How To OSCP
How To OSCP
How to OSCP
Nathan Subra
Intro Opinions are my own and not the views of my
employer, government, spouse etc.
Sysadmin ~10 Years
Information Security ~5 Years
Industries:
Financial
Government
Defense
Current:
Overly Opinionated Pen Tester
natesubra.com
@natesubra
SecDSM
Free food/drinks/beer
No registration required
secdsm.org
@SecDSM
Offsec Disclaimer
Offensive Security has a strict academic policy:
No Spoilers about the lab (we’ll talk about this more later)
https://support.offensive-security.com/#!academic-policy.md
What is the OSCP?
Offensive Security Certified Professional <- Certification
Materials are ALL INCLUSIVE and will teach you EVERYTHING YOU NEED TO
KNOW
Lab
~44 Hands-On Exercises in PDF
~4 Networks
>50 systems in the lab
Penetration Testing with Kali + 30 days Lab access This course may qualify you for 40 (ISC)² CPE
+ Certification USD 800.00 Credits after you submit your documentation at the
end of the course or pass the certification
Penetration Testing with Kali + 60 days Lab access challenge.
+ Certification USD 1000.00
10 “extra” points: Submit your lab exercises and 10 documented LAB machines - OPTIONAL (but do it)
Recommended Experience
Nothing required! The more you know in each area, less
time you’ll spend researching in the lab
BUT, helpful to have knowledge of:
Networking (OSI)
Scripting (bash, python, perl, powershell)
CLI (Windows and Linux)
Assembly (x86)/Debuggers
C
Javascript
SQL (syntax, mssql/mysql)
Metasploit (mostly meterpreter/msfvenom)
Server side languages (php,asp)
Who should take it?
Everyone!
All the different ways you can mess up the above things
Things you probably WON’T LEARN from the OSCP
● Offensive “Tradecraft” is only covered briefly
○ Minimal Stealth
○ Minimal Anti-Forensics
○ Minimal Firewall/IDS evasion
● Post-Ex coverage is weak (we’ll talk about this later)
○ root/system ---> ????
● Many lab technologies are “older” (still valuable, but different)
● Persistence/C2
Tools - Using them
Dig into every tool, understand how they work.
<command> -h
<command> --help
man <command>
Tools - Know your tools (and try different ones)
What other tools offer that same capability? Are you fully utilizing your tools?
Nmap can:
Scan Networks
Scan for vulnerabilities
Exploit vulnerabilities
Brute force passwords
Craft packets like scapy
Tools - Write your own
Scripting - if you have to do something more than once -- it’s probably worth the
time to script it
Tools - Mistakes I made
The internet is not a substitute for reading man pages/documentation
TAKE MORE SCREENSHOTS (wasted a lot of time going back and doing this)
If you make a checklist, put a version on it, you’ll change it and will need to know
which machine has run which version (example later)
Save your tool output via copy/paste and Screenshot so you can search later
Narratives are good - you won’t remember 2 weeks later. Also when you are doing
something dumb it tends to pop out at you when you write it down.
Enumeration
e·nu·mer·a·tion
əˌn(y)o͞oməˈrāSH(ə)n/
noun
Don’t assume. Evaluate the entire attack surface, rack and stack, then exploit.
Enumeration - Example (not all inclusive)
1. Staged nmap scan Capture screenshots/notes as you go!
a. Common ports (21,22,80,443 etc)
b. Less common ports (8080,10443, etc)
c. All ports (UDP ugh)
2. Enumerate each port (banners can lie)
3. poke/prod each port (nc, browser, etc)
4. Default passwords
5. Enumerate Services (nikto, web apps, etc)
“Exploitation”
Misconfigurations are as common as (or common than) exploits
Practice your screenshot techniques (you’ll need them for the exam)
Practice your screenshot techniques (you’ll need them for the exam)
Did you?
● Grab/Crack hashes
○ Make wordlist/userlist
○ Spray network
● Search for interesting files (passwords, php config, asp, interesting scripts apps)?
● Enumerate the application?
● Enumerate SQL? (I missed this way too many times)
● See what connects to the box?
○ Pivot
○ Exploitation point?
● Backups?
● Grab config files
My Methodology (finalized)
1. Make an enumeration checklist, stick with it
2. Make a separate list: every time you use a new technique
(enumeration/exploit/postex) -- add it to that list
3. When you get stuck, look at that list
4. If you get stuck for a long time, move on and come back
5. Don’t slack on documentation
6. Keep track of all the rabbit holes you went down, don’t do those things
My Methodology - Mistakes
Building a checklist or formal process to start
Hunches will work sometimes, other times you’ll waste 8 hours on your hunch
Wrong: “this very specific exploit that I randomly downloaded and ran without even
looking at is not working on this specific lab machine, why not????!!!!111”
The goal is to teach you to figure out the answer, not give you the answer
Some of the best help I had was someone asking what I tried
Resources
Get a study buddy (helping to teach others can help you, someone to talk to when
you’re frustrated)
Just remember, offsec is always watching, if it’s a spoiler-- don’t post it. If you’re
unsure -- ask the staff -- https://www.offensive-security.com/contact-us/
https://gist.github.com/natesubra/5117959c660296e12d3ac5df491da395
Last thoughts
1. Make a checklist
2. The main Goal of the lab is to learn. Not just root boxes. Use every method
you can, multiple times
3. Using Metasploit is OK, just go back and repeat using the manual method
4. Recap: How could I have done it better. Where did I get stuck and why?
5. Failure == Successfully identifying a method that does not work