23/09/26 nmap and tcpdump¶
I wanted to see what was running on my laptop from another computers perspective, so I SSH'd into my pi and began practicing service enumeration on myself using nmap and tcpdump.
nmap -Pn -p 5355 IP— scan TCP port 5355 and skip host discovery.openmeans the target accepted a TCP connection on that port.- Nmap displaying
llmnrdoes not by itself prove the service is LLMNR. - Nmap can associate known port numbers with service names from its service database.
nmap -Pn -sV -p 5355 IP— perform service/version detection.tcpdumpshows the packets actually crossing a network interface.sudo tcpdump -ni eth0 -nn -vv 'tcp port 5355 and host 192.168.10.100'-i eth0— capture oneth0.-nn— do not resolve IP addresses or port numbers into names.-vv— display more packet detail.- Observed TCP exchange:
SYN— Pi requests a TCP connection.SYN-ACK— Fedora accepts the connection.ACK— Pi completes the TCP handshake.RST— Pi terminates the connection.
- TCP flag shorthand:
[S]— SYN.[S.]— SYN-ACK.[.]— ACK.[R]— RST.
length 0— no application payload was exchanged.- The capture confirmed that something was listening on TCP/5355.
- The capture did not identify the process or application behind the port.
-Xin tcpdump displays packet payloads as hexadecimal and ASCII.sudo tcpdump -ni eth0 -nn -vv -X 'tcp port 5355 and host IP'-Pn— assume the target is online and scan it without requiring successful host-discovery probes.