Strategy
Pre engagement
General methodology
Google-Fu
Every error message
Every URL path
Every paramenter to find versions/apps/bugs
searchsploit every serivce
Google
Every version exploit db
Every version vulnerability
If app has auth
User enumeration
Password bruteforce
Default credentials (Google them)
revert the machine
DEFCON 1 try:
Check if the hostname/target's name is meaningful for the assessment (E.g.: google its name for product, technology, etc)
Grab the damn banner!
nc -v $IP <PORT>
telnet $IP <PORT>
Network & Port scanning
If you don't know the alive hosts, you can scan the full subnet to find them, so you can do a deeper scan on them later.
Go big
List scan with nmap
Ping scan (run it with privileges)
Look for hosts's info (name, logged-in user, MAC) with NetBIOS queries
Use ARP to do hosts discovery
smbtree
Go small (Individual host scanning)
Run a fast TCP port scan:
Run a simple TCP port scan to uncover open ports
Run a simple UDP port scan to uncover open ports
If lazy do an Aggressive scan on open ports (A = O+sC+sV)
Do a version detection on TCP ports
Do a version detection on UDP ports
Vulnerable to heartbleed?
Version/OS detection using other DNS servers
Try identify unknown services
Full vulnerability scanning with vulnscan.nse
Service enumeration
FTP (TCP 21) | TFTP (UDP 21)
Banner grabbing
Connect and check for anonymous access
Any known vulnerability?
Check https://www.exploit-db.com/
Check https://www.cvedetails.com/
Check https://nvd.nist.gov/
Check on google
Check with nmap
Default credentials check
Download recursively all the files
SSH (TCP 22)
Banner grabbing
User enumeration
Bruteforce root
Bruteforce list of user
Use requested Key Exchange List
Use requested cipher
Use requested MAC
SMTP (TCP 25)
Enumeration with nmap
Any known vulnerability?
Check https://www.exploit-db.com/
Check https://www.cvedetails.com/
Check https://nvd.nist.gov/
Check on google
Check with nmap
nc -nvv $IP
manual testing with telnet and VRFY / EXPN
Finger (TCP 79)
Download script and run it with a wordlist: http://pentestmonkey.net/tools/user-enumeration/finger-user-enum
Web App (TCP 80/443)
Phase Alpha - enumeration
Investigate SSL/TLS cert details for further information
Investigate robots.txt
Investigate crossdomain.xml
Investigate clientaccesspolicy.xml
Identify all parameters. Document which parameters are used for GET and POST
View source code
Nikto
Directory Traversal Fuzzer
Gobuster (Doesn't work recursively!!!)
File and directory fuzzing
Vhost bruteforcing
use -x to look for specific extensions (.txt, .php, .bak, .cfg, .json, .md, .git)
nothing? Ensure that you scan the correct protocol (HTTP/HTTPS) and directory
gobuster -w /usr/share/seclists/Discovery/Web-Content/common.txt -s '200,204,301,302,307,403,500' -t 50 -e -u $IP
gobuster -w /usr/share/seclists/Discovery/Web-Content/CGIs.txt -s '200,204,403,500' -e -t 50 -u $IP/cgi-bin
Re-run for each directory found
wfuzz
dotdotpwn
WhatWeb & weppalyzer to map the whole infrastructure:
Middleware
Programming languages
Backends
Services
Plugins
Which CMS is running?
wpscan
joomscan
drupwn
use nmap to enumerates installed Drupal themes/modules
WebDAV:
davtest
cadevar
Use nmap to detect WebDAV installations & listings:
Any known vulnerability?
Check https://www.exploit-db.com/
Check https://www.cvedetails.com/
Check https://nvd.nist.gov/
Check on google
Check comments in source of all pages
RTFM! Read the manual for the application you are testing
Does it have a dev mode?
DEBUG=TRUE flag to see more?
Other interesting stuff?
Look for where you can put data
API
Paywall or sign up
Unauthenticated
Logical reasoning
Look at the application from a bad guy perspective, what does it do? what is the most valuable part? Some applications will value things more than others, for example a premium website might be more concerned about users being able to bypass the pay wall than they are of say cross-site scripting
Look at the application logic too, how is business conducted?
Phase Bravo - go deeper
Follow webapp testing methodology [[webapp_testing_methodology🌐]]
LFI / RFI test
cgi-bin found? try shellshock https://www.exploit-db.com/exploits/34900
Check every input field for SQLi
Check for code injection: Owasp code injection
DNS (UDP/TCP 53)
Find domain names for host
Find IP and authoritative servers
Resolve DNS
Find name servers
Find mail servers
Is DNS zone transfer possible?
Request zone transfer
dnsrecon -d $IP -D /usr/share/wordlists/dnsmap.txt -t std --xml ouput.xml
Any known vulnerability?
Check https://www.exploit-db.com/
Check https://www.cvedetails.com/
Check https://nvd.nist.gov/
Check on google
POP (TCP 110)
Is username enumeration possible?
Nmap enumeration (Default scripts runned with -sC flag):
telnet $IP 110
Bruteforce with nmap
Any known vulnerability?
Check https://www.exploit-db.com/
Check https://www.cvedetails.com/
Check https://nvd.nist.gov/
Check on google
RPCBind (TCP/UDP 111)
rpcinfo -p $IP
RPC (TCP 135)
rpcinfo -p $IP
SMB (TCP 139/445)
Enumeration
nbtscan
enum4linux
Manual browsing (Prefer it whenever possible):
Any known vulnerability?
Check https://www.exploit-db.com/
Check https://www.cvedetails.com/
Check https://nvd.nist.gov/
Check on google
Check with nmap
Download recursively all the files
SNMP (UDP 161)
Enumeration
Bruteforce community names
Any known vulnerability?
Check https://www.exploit-db.com/
Check https://www.cvedetails.com/
Check https://nvd.nist.gov/
Check on google
MSSQL (TCP 1433)
Enumerate MSSQL Servers
Password bruteforcing
Gain shell using gathered credentials
Log in to a MSSQL Server
Any known vulnerability?
Check https://www.exploit-db.com/
Check https://www.cvedetails.com/
Check https://nvd.nist.gov/
Check on google
Check with nmap
Oracle (TCP 1521)
Default credentials
tnscmd10g version -h $IP
tnscmd10g status -h $IP
oracle-version - MSF module which scans Oracle DB to find the version
oracle-sid - MSF module to enumerate the Oracle DB SID
Any known vulnerability?
Check https://www.exploit-db.com/
Check https://www.cvedetails.com/
Check https://nvd.nist.gov/
Check on google
MySQL (TCP 3306)
Default credentials?
Any known vulnerability?
Check https://www.exploit-db.com/
Check https://www.cvedetails.com/
Check https://nvd.nist.gov/
Check on google
Check with nmap
PostgreSQL (TCP 5432)
Try default credentials:
Pentest wiki will save you time
Any known vulnerability?
Check https://www.exploit-db.com/
Check https://www.cvedetails.com/
Check https://nvd.nist.gov/
Check on google
Redis (TCP 6379)
https://redis.io/documentation
Interesting article by Antirez on Redis security
HackTricks' guide
ProgrammerSought's guide
Google-Fu
Any known vulnerability?
Check https://www.exploit-db.com/
Check https://www.cvedetails.com/
Check https://nvd.nist.gov/
Check on google
RDP (TCP/UDP 3389)
Use rpd-sec-check to enumerate security settings:
Use ncrack to brute force RDP:
Use hydra to bruteforce RDP:
Check for BlueKeep
Check login with default guest account and blank password
Check with gathered users:passwds
VNC (TCP 5900)
Enum with nmap
Check for easy VNC passwords
Bruteforce:
Any known vulnerability?
Check https://www.exploit-db.com/
Check https://www.cvedetails.com/
Check https://nvd.nist.gov/
Check on google
Check with nmap
LDAP (TCP/UDP 389) | LDAPS (TCP/UDP 636)
LDAPSearch can be utilized to locate and retrieve directory entries
Kerberos (88/464)
Passive network sniffing
User enumeration
Test MS14-068
Rsync (TCP 873)
Manual enumeration
Automate the enum
Gather the modules
Image File Investigation
Always use wget for downloading files to keep original timestamps and file information
Use binwalk and strings to check image files for hidden content
steghide
NFS Share
Show NFS shares
Packet inspection
Wireshark
tcpdump
Anything else
nmap scripts (locate nse | grep servicename)
hydra
MSF auxiliary modules
Download the software and investigate it locally
Try enumeration scripts for specific
Last updated