07 - Scanning
07 - Scanning
Offensive Security
Scanning
• We have an idea of where to look now
IP Address(s)
Domains
Offensive Security
2
Scanning
• LEGAL
Offensive Security
3
Ping
• Before spending time on a scan
Check to see which hosts are up
Offensive Security
Host based
Network based
4
ARP
• ARP Scan
• Only works on local LAN
• Sends ARP packets to other hosts on the network
Checks for responses
Offensive Security
5
Port scanning
• So we know where the hosts are now
• What is a port?
Offensive Security
6
Why are they important?
• Find what services are offered on the host
• Might help us identify the OS
• Identify Vulnerabilities
• Doorway into the system
Launch an exploit
Offensive Security
7
Nmap
• Most common scanning tool
• Flexible/Extendable
Nmap Scripting Engine
• Flags
Nmap cheat sheet
Offensive Security
8
Nmap Flags
• T4
Speed
• –Pn
No ping
• -n
No DNS resolution
• --open
Only show open ports
• -sT
Offensive Security
TCP Scan
• -sV
Gather service information
9
Nmap Scripting Engine (NSE)
• Scripts to check for more details
• Vulnerabilities
• Service Details
• Discovery
• Auth
Offensive Security
• Bruteforcing
• Etc...
10
Masscan/Zmap
• Large scale scanners
• Zmap.io
Offensive Security
11
Common Ports & Services
• 80 - HTTP • 110 – POP3
• 21 – FTP • 123 – NTP
• 22 – SSH • 443 – HTTP over TLS/SSL (HTTPS)
• 23 – Telnet • 445 - SMB
• 25 – SMTP • 514 – Syslog
• 53 – DNS • 3389 – RDP (Microsoft Terminal Server)
• 135 – RPC • 5500 - VNC
Offensive Security
12
Common Ports & Services
• Do they always have to be on those ports?
• Dynamic services
Offensive Security
Etc…
13
What should you scan?
• Considerations
Time Available
Amount of hosts
Goal?
• Ports 1-1024?
What about 5900?
• Scanner options
Nmap top ports
Offensive Security
Port list file
14
Scanning IPv6 Hosts
• Not every host is running IPv4
Offensive Security
• nmap –T4 -Pn -n -sT -sV -6 fc00:660:0:1::46
15
Documentation is key
• Remember when I said reporting is a constant process?
Offensive Security
Source of scan
Hosts/Ports Scanned
16