PT CH 3 Active Reconnaissance Ready
PT CH 3 Active Reconnaissance Ready
PT CH 3 Active Reconnaissance Ready
3.0 Active
Reconnaissance
-S <spoofed source nmap -e eth0 -S Spoof the source address; will not return useful
address> www.google.com 192.168.1.50 reports to you, but can be used to confuse an IDS
or the target administrator
--spoof-mac [vendor type • nmap -sT -PN --spoof-mac Use a bogus source hardware address; you can
| MAC address] apple 192.168.1.50 specify a random MAC based on vendor, or
• nmap -sT -PN --spoof-mac explicitly specify the MAC address
B7:B1:F9:BC:D4:56
192.168.1.50
--source-port <port nmap --source-port 53 Use a specific source port number (spoof source
number> 192.168.1.36 port) to dupe packet filters configured to trust
that port; same as -g <port number> option
--randomize-hosts nmap --randomize-hosts Randomize the order of the hosts being scanned.
192.168.1.1-100
--proxies <proxy:port, nmap --proxies Relay TCP connections through a chain of HTTP or
proxy:port…> http://192.168.1.30:8080, SOCKS4 proxies; especially useful on the Internet.
http://192.168.1.90:8008
Activity: Stealth
Scans
• Full Scans are a type of scan
that elicits the maximum
amount of information from
and about a target
• AKA TCP Connect scan
Full Scans • Scan all ports
• Interrogate services for version
information
• Footprint Operating System
• Other actions
• Produces most results, but
more likely to be detected
• Evasion tactics include
• nmap -sT <target> randomization of IP
• nmap -p- 192.168.1.0/24 addresses and ports, and
slowing the scan itself
• nmap -p1-65535 www.example.tld
• nmap -sU -p1-65535 192.168.1.50
Activity: Full Scans
• Packet Crafting is the practice
of altering a normal IP packet
prior to transmitting it on a
network to test firewall rules,
evade intrusion detection, or
Packet Crafting cause a denial of service
• Use as few packets as
possible to reach objective
• Four stage process:
1. Packet assembly
2. Packet editing
3. Packet play
4. Packet decoding
• A variety of tools can be used
• Command line, GUI, and
scripts
Packet Crafting Example
Packet Count Source Port
Mapping •
•
Ports and services
OSs
• Device types
• VMs
• Host names
• Protocols
• Identify subnets and device
interconnection
• Methods:
• SolarWinds • PRTG • nmap
• Intermapper • Spiceworks • ARP cache interrogation
• WhatsUp Gold • nmap • Routing and MAC tables
• CDP neighbor tables
Activity: Network
Mapping
• Metasploit is a multi-purpose
computer security and
penetration testing framework
• Modularity lets you mix and
match to create an optimal
toolset
Metasploit • De facto exploit framework
• Editions: Framework,
Community, Express, and Pro
• GUI spinoffs from Rapid7:
Armitage and Cobalt Strike
• Module types:
• Exploits
• Payloads
• Post
• Auxiliary
• Encoders
• Nops
Metasploit Example
Activity: Scanning
with Metasploit
• Enumeration
• Common Enumeration Targets
• Banner Grabbing
• Windows Host Enumeration
3.2 • Linux Host Enumeration
Enumeration • Service and Application Enumeration
• Network Shares
• Null Sessions
• Website Enumeration
• Enumerating Targets
Enumeration is the process of querying a device
or service for information about its
configuration and resources
Enumeration
Can be done remotely
• OS details
• User and group names
• Email addresses and contact information
Enumeration • Host names, domain information,
Discovery and IP addresses
• Volumes and shares
• Services
• Policies and audit settings
• Configuration settings
• Common information revealed during
enumeration:
Common Routers
Enumeration
Targets Switches
Network services
• Banner Grabbing is an enumeration method that
involves trying to open a session with a service and
getting the service to identify itself
• Many tools can grab banners from various services
• FTP, SSH, HTTP, SMTP, POP3, IMAP4, DNS, Telnet,
Microsoft-DS, Microsoft netbios-ssn, etc.
• Can help you focus your attacks on specific
services
Banner • Sample commands:
• rpcclient
Windows Host • rpcclient <target IP> -U <username>
srvinfo
Examples • Metasploit
• use /auxiliary/scanner/smb/smb_lookupsid
set SMBUser moo
set SMBPass Pa22w0rd
set MinRID 1000
set MaxRID 1100
set RHOSTS 192.168.74.50
Activity: Windows
Host Enumeration
• Popular enumeration tools for Linux:
• Metasploit modules
• nmap scans and rpcclient:
nmap -O 192.168.1.20
nmap -sV 192.168.1.20
Linux Host nmap --script=smb-os-discovery
192.168.1.20
Enumeration
• Can use rpcclient if target is running a SAMBA
server
• This example connects using a null session:
rpcclient -U "" 192.168.1.20
Rpcclient example
• Built-in bash commands
• uname -a
• hostname
• route
• arp
• ifconfig
• netstat -antp/-anup
Linux Host • iptables -L
• mount
Enumeration • dpkg -l
Bash • apache2 -v
• mysql -version
Commands • df -a
• cat /etc/*-release
• cat /proc/cpuinfo
• cat /etc/resolv.conf
• cat /etc/network/interfaces
• Built-in bash commands
• uname -a
• hostname
• route
• arp
• ifconfig
• netstat -antp/-anup
• iptables -L
Linux Host • mount
Enumeration • dpkg -l
• apache2 -v
Bash Commands • mysql -version
(cont’d) • df -a
• cat /etc/*-release
• cat /proc/cpuinfo
• cat /etc/resolv.conf
• cat /etc/network/interfaces
• cat /etc/passwd
• cat /etc/group
• cat /etc/shadow
• users
• w
Linux Host • lastlog
• whoami
Enumeration • id
Bash Commands • sudo -l
(cont’d) • find | head
• find / -iname *.txt
• find / -type f -exec grep -l "password" {} \;
• find . -type f -name ".*"
Activity: Linux Host
Enumeration
Service and Application Enumeration
Services required by default processes and by installed software
Service and Application Enumeration (cont’d)
Services required by default processes and by installed software
Service and Application Enumeration (cont’d)
Services required by default processes and by installed software
Service and Application Enumeration (cont’d)
Services required by default processes and by installed software
Activity: Service
Enumeration
map -p 2049 192.168.1.0/24
Vulnerability •
•
Credentialed and Non-Credentialed Scans
Network Service Vulnerability Scans
Scanning • Server Service Vulnerability Scans
• Web Server and Database Vulnerability Scans
• Application Vulnerability Scans
• Network Device Vulnerability Scans
• Packet Crafting for Vulnerability Scans
3.3 • Firewall Vulnerability Scans
Vulnerability • Packet Inspection
Scanning • WAP Vulnerability Scans
• Container Security Issues
(cont’d) • Scanning for Vulnerabilities
• A Vulnerability is a weakness that might or
might not be exploitable
• Vulnerability scan is a reconnaissance tactic
that sends specially crafted packets or
commands to a service to see how it responds
• Use Common Vulnerabilities and Exposure
(CVE) numbers for known vulnerabilities
NIKTO
Example Webserver
Brute Force
Vulnerability
Open Source
Vulnerability
Database
PHP Vulnerability
SQL Injection
Vulnerability
Activity: Web App
Vulnerability Scanning
Routers, switches, network access points
have their own operating Systems,
services, and features
Scans
stacks
should look for: Administrative access