Penetration Testing Cheat Sheet (In Progress)

1. Reconnaissance

Network Scan

# -- Nmap Scans --
# If you are not getting results then use the -Pn flag (treat hosts as live).
sudo nmap -sn <IP>/<CIDR> # Scan for hosts in the network without port scan.
sudo nmap -sC -sV -O -oA <Name>.tcp <Target-IP-Address> -v # Scans the top tcp ports
sudo nmap -sU -oA <Name>.udp <Target-IP-Address> # Scans the top UDP ports
# After these are done run again but for all ports using the flag (-p-)
 
python3 autorecon.py <IP-Address> <Output-File> # Run auto recon to automate various enumeration steps

2. Web Attacks

Web General Tips

  • View source-code and identify any hidden content.

  • Check for robots.txt

  • Add hosts to /etc/hosts

  • Start fuzzing

  • Conduct vulnerability scanning using nikto

  • Check the SSL certificate for subdomains or usernames

  • If there is any login page then try default credentials or/and bruteforce it

  • If there is any file upload functionality then check where it's reflected

  • Check any input fields to injection attacks

  • If you found cgi-bin then fuzz further and try shellshock.

Sometimes you might be able to exploit a file upload vulnerability but then you don't have the permission to create a directory, in such cases, try using an existing directory.

Wordpress

  • Check /wp-content/uploads

  • Check the config file (wp-config.php)

  • Check if there are users to bruteforce

  • Run wp-scan

Joomla

  • Check if there are users to bruteforce

  • Run joomscan/droopescan/joomlavs

Drupal

  • Enumerate usersnames by testing on /user/register or /user/<Number>

  • Fuzz /node/<Number> to detect pages that might have not been noticed

  • If the version is less than 8 then you can inject PHP code

Tomcat

  • Try to access /manager/html from there you can upload war files (shell) However, the path is protected by basic http auth.

  • Try default credentials

  • Run a bruteforce attack

3. Network Protocls/Attacks (In Progress)

FTP - 21

  • Check for anonymous access

  • Download or upload files (config files, ssh keys, etc/passwd, etc.)

  • Bruteforce users

SSH - 22

  • Bruteforce users

  • Upload a key as a backdoor

SMTP - 25

  • Check for users

DNS - 53

  • Try zone transfer

  • Enumerate the subdomains for more targets

POP3 - 110

  • Enumerate users

  • Bruteforce users

  • Read emails

RPC - 135

SNMP - 161

LDAP - 389

SMB - 445

MSSQL - 1433

MYSQL - 3306

Last updated