sudo nmap -Pn -sU -A -oN udp-extra.nmap -p PORTS IP
ICMP Sweep
fping -a -g 10.10.10.0/24 2>/dev/null
ARP Scan (Local Network)
arp-scan -l
Enumeration
FTP - Port 21
# Check for FTP version vulns
# Check for Anonymous login
# Check for Read access
# Check for Web root or root directories of any other accessible service
# Check for write access
SSH - Port 22
# Check for SSH version vulns
# Check for User enumeration if necessary
# Check if host key was seen somewhere else
# Check if it prompts for a password - means password login is allowed for some users
nmap -sV --script=ssh-hostkey -p22 IP
# Bruteforce if necessary with CeWL, Hydra, Patator, Crowbar, MSF (if port gets filtered, there's defense mechanisms - fail2ban)
Telnet - Port 23
# Connect and check for service running
SMTP - Port 25
# Check for SMTP vulns
# Check version with HELO / HELLO <domain>
POP - PORT 110
# Connect using telnet
user <username>
pass <pass>
LIST - to list emails
RETR <email numbr> - To retrieve emails
DNS - Port 53
# Might indicate a domain controller on Windows
# Check for zone transfer
nmblookup -A IP
nbtscan IP
# On older hosts, this port serves SMB / SAMBA, scan by adding 'client min protocol = LANMAN1' to GLOBAL setting in /etc/samba/smb.conf or by using --option='client min protocol'=LANMAN1 with smbclient
snmpwalk -v2c -c public IP
snmp-check IP
onesixtyone -c community.txt IP
sudo nmap -sU -sV -p 161 --script snmp* IP
snmpenum -t IP -c public
Oracle - Port 1521
tnscmd10g version -h IP
nmap -sV --script=oracle-tns-version -p1521 IP
odat tnscmd -s IP --ping
odat all -s IP -p 1521
odat sidguesser -s IP
MySQL - Port 3306
mysql -h IP -u root -p
nmap -sV --script=mysql* -p3306 IP
hydra -L users.txt -P passwords.txt mysql://IP
mysql -h IP -u root
WEB - PORT 80 / 443
NMAP Web
sudo nmap -Pn -sC -p80,443
Checks
# Browse the webapp
# Check for usernames, keywords
# Check Web server vulns
# Check for Cgi's shellshock
# Check Certificates for hostname
# Check robots.txt
# Check sitemap.xml
# Check for known software - View source
# Check for default credentials
# Check for input validation - SQLi
# Check for OS Command execution
# Check for LFI / RFI
Dirb
dirb IP
dirb with -X extensions based on web technology, .php,.asp,.txt,.jsp
dirb IP -a 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.135 Safari/537.36 Edge/12.246'
Gobuster
gobuster dir --url IP --wordlist /usr/share/seclists/Discovery/Web-Content/big.txt
gobuster dir --url IP --wordlist /usr/share/seclists/Discovery/Web-Content/big.txt -k -a 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.135 Safari/537.36 Edge/12.246'
showmount -e IP
mount -t nfs -o vers=3 10.1.1.1:/home/ ~/home
mount -t nfs4 -o proto=tcp,port=2049 127.0.0.1:/srv/Share mountpoint
TFTPD - UDP 69
tftp client to connect
atftp is a better client
Can be used to read system files, MSSQL password mdf file
Automation Tools
AutoRecon
autorecon IP
NmapAutomator
./NmapAutomator.sh IP All
Finding exploits
# Search on EDB and searchsploit
# Check each service on CVE details for RCE / LFI / RFI / SQLI issues
# Google search the with the service banner
searchsploit apache 2.4.49
searchsploit -x path/to/exploit