Verifica apertura porte tra due macchine linux

Qualche volta può essere necessario verificare se vi siano tutte le aperture necessarie verso una macchina linux, PRIMA di configurare/installare alcunchè…

UDP

Su macchina metto in listen il netcat:
nc -u -l -k 0.0.0.0 1234

sull’altra verificao con nmap se la porta (1234 nell’esempio) è aperta:
nmap -p 1234 -sU 192.168.1.1

TCP

Analogamente:
nc -l -k 0.0.0.0 1234
nmap -p 1234 192.168.1.1

L’output è di questo tipo in caso di porte aperte:

Starting Nmap 4.11 ( http://www.insecure.org/nmap/ ) at 2011-04-15 17:52 CEST
Interesting ports on test.diegobelotti.com (192.168.1.1):
PORT STATE SERVICE
1234/tcp open hotline

Nmap finished: 1 IP address (1 host up) scanned in 0.191 seconds

————————————–

Starting Nmap 4.11 ( http://www.insecure.org/nmap/ ) at 2011-04-15 17:51 CEST
Interesting ports on test.diegobelotti.com (192.168.1.1):
PORT STATE SERVICE
1234/udp open|filtered unknown

Nmap finished: 1 IP address (1 host up) scanned in 0.352 seconds

Ovviamente in caso di porte firewallate, il responso sarà closed.

Leave a Reply

Your email address will not be published.