OSCP Cheatsheet
General Enumeration - Nmap
Replace $ip with target IP
Initial scan
If no ports are found, scan in parts
Scan all ports
Targeted scanning
UDP Scanning
Automated nmap scanning (my preference is nmapAutomator, never missed a port)
Banner Grabbing
Port 21 - FTP
Nmap script scanning - will reveal anonymous access
Checking anonymous access manually
Easy view of FTP content - Browse to:
Uploading a binary or webshell
Port 22 - SSH
Additional banner grabbing
Port 53 - DNS
Port 79 - Finger
Run this script with following wordlist
Port 80/443 - HTTP(S)
Get web server, version, potential OS
Use Wappalyzer to identify technologies, web server, OS, database server deployed
View-Source
of pages to find interesting comments, directories, technologies, web application being used, etc.
Finding hidden content Scanning each sub-domain and interesting directory is a good idea
Files to browse manually
Run web server scanning
Web application specific scanning WordPress, use API
Drupal, found here
Port 110 - POP3
Port 139/445 - SMB
General enumeration
Enumerate hostname
Get version - script available here
List shares
Note: smbmap
will state access type available, smbclient will NOT. To check access type using smbclient, it’s best to access each share, read a file, and write a file.
Connecting to a share
Port 161 - SNMP
MIB Values | Windows Parameters |
---|---|
1.3.6.1.2.1.25.1.6.0 | System Processes |
1.3.6.1.2.1.25.4.2.1.2 | Running Programs |
1.3.6.1.2.1.25.4.2.1.4 | Processes Path |
1.3.6.1.2.1.25.2.3.1.4 | Storage Units |
1.3.6.1.2.1.25.6.3.1.2 | Software Name |
1.3.6.1.4.1.77.1.2.25 | User Accounts |
1.3.6.1.2.1.6.13.1.3 | TCP Local Ports |
Port 2049 - NFS
Shells / Payloads
Universal Listeners
Linux
One-liners
Credit to Pentest Monkey
Reverse shell scripts
PHP reverse shell available here or locally
/usr/share/webshells/php/php-reverse-shell
Python PTY shells available here
Windows
PowerShell reverse shell available here PHP reverse shell available here Netcat for Windows available here
PHP Webshells
Metasploit
System Binaries
Web
Shellcode
Select appropriate architecture
Upgrading your shell - Linux
Upon initial access, it is crucial to achieve the highest functional shell possible for privesc purposes!
Escaping jailed Shells
Go here
File Transfers
Server
Linux - HTTP
Windows
- HTTP
- TFTP (UDP)
- SMB
- FTP
Port Forwarding
Linux
- Local port forwarding
- Remote port forwarding
- Dynamic port forwarding
Windows
Chisel is a port forwarding tool for Linux as well as Windows, works over HTTP and can be found here.
Privilege Escalation
Windows
Local enumeration + privilege escalation available here
Linux
Local enumeration + privilege escalation available here