Skip to content

Как да разберем кой сървис е отворил порт на нашия сървър

Има лесен начин да намерим кой сървис е отворил порт на нашата машина.
Стъпките са следните:

0. Ако нямате nmap инсталиран:

nedko@marvin: sudo aptitude install nmap

nedko@marvin:/home/nedko# nmap localhost

Starting Nmap 7.01 ( https://nmap.org ) at 2017-08-16 23:41 EEST
Nmap scan report for localhost (127.0.0.1)
Host is up (0.0000060s latency).
Other addresses for localhost (not scanned): ::1
Not shown: 995 closed ports
PORT STATE SERVICE
80/tcp open http
443/tcp open https
1022/tcp open exp2
3306/tcp open mysql

Nmap done: 1 IP address (1 host up) scanned in 1.60 seconds

  1. lsof -i :3306

nedko@marvin:/etc/mysql/conf.d# lsof -i :3306
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
mysqld 30190 mysql 25u IPv4 9345387 0t0 TCP localhost:mysql (LISTEN)

2. ps -fp 4486

nedko@marvin:/etc/mysql/conf.d# ps -fp 30190
UID PID PPID C STIME TTY TIME CMD
mysql 30190 1 0 00:26 ? 00:00:01 /usr/sbin/mysqld

 

As simple as that.

Published inБлогинкиНедко разказваСтатии

Be First to Comment

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.