4. Scan (EN)
4. Scan (EN)
4. Scan (EN)
Port Scanning
Role of port scanning
Identification of active systems, open communication ports
and services running on computer networks
Port scanning techniques:
– ARP Ping
– ICMP Ping
– TCP connect() Scan
– TCP SYN Scan
– TCP FIN, Xmas Tree, Null Scan
– UDP Scan
2
ARP Ping
3
ICMP Ping
4
TCP Connect() Scan
5
TCP SYN Scan
7
TCP FIN Scan
Closed Port
Opened Port
8
TCP Xmas Tree Scan
Closed Port
Opened Port
Sends a TCP packet with the FIN, URG, and PUSH flags set
then waits for a response
Tools:
– nmap –sX
– hping3 --fin --urg --push
9
TCP Null Scan
Closed Port
Opened Port
Sends a TCP packet with no flags set then waits for a response
Tools:
– nmap –sN
– hping3
10
UDP Scan
11
OS Fingerprinting
RFCs do not contain complete specifications
There are differences in TCP/IP stack implementation
– TTL (time-to-live)
– Initial sequence numbers
– Window size
– DF (Don't fragment bit)
…
Passive fingerprinting
– sniffing to examine packets for certain characteristics
– low precision
Active fingerprinting
– send packets to the target in order to analyze it's behavior
– high precision
12
Passive OS fingerprinting
p0f (http://lcamtuf.coredump.cx/p0f.shtml)
p0f can identify the operating system of:
– machines that connect to you (SYN mode)
– machines you connect to (SYN+ACK mode)
– machines you cannot connect to (RST mode)
– machines whose communications you can observe
p0f output
<Wed Feb 27 18:26:58 2008> 213.215.x.x:45291 - Linux 2.6
(newer, 2) (up: 1421 hrs) -> 208.83.x.x:2703 (distance 0,
link: ethernet/modem)
13
Active OS fingerprinting
nmap –O <target>
7 TCP probes, 1 ICMP, 1 UDP. TCP probes are sent exactly 110 milliseconds
apart
14
Other scanning tools
nmap (http://www.insecure.org/nmap/)
hping3 (http://www.hping.org)
IPEye (http://ntsecurity.nu/toolbox/)
NetScan Tools Pro (http://www.netscantools.com/)
SuperScan (http://www.foundstone.com )
Cheops-ng (http://cheops-ng.sourceforge.net/)
15
16