# Table of Contents - [OSCP Methodology | Mike's OSCP Guide](#oscp-methodology-mike-s-oscp-guide) - [Mike's OSCP Guide](#mike-s-oscp-guide) - [OSCP Last Minute Tips | Mike's OSCP Guide](#oscp-last-minute-tips-mike-s-oscp-guide) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [OSCP Methodology | Mike's OSCP Guide](#oscp-methodology-mike-s-oscp-guide) --- # OSCP Methodology | Mike's OSCP Guide For the complete documentation index, see [llms.txt](https://hackwithmike.gitbook.io/oscp/llms.txt) . This page is also available as [Markdown](https://hackwithmike.gitbook.io/oscp/methodology/oscp-methodology.md) . **Important Notice**[](https://hackwithmike.gitbook.io/oscp/methodology/oscp-methodology#important-notice) ----------------------------------------------------------------------------------------------------------- ⚠️ **I have migrated all my notes to the new website:** [**https://hackwithmike.com**](https://hackwithmike.com/) **. All future updates will only be pushed on the new site** [**https://hackwithmike.com/oscp**](https://hackwithmike.com/oscp) **/.** Introduction[](https://hackwithmike.gitbook.io/oscp/methodology/oscp-methodology#introduction) ----------------------------------------------------------------------------------------------- * * * The OSCP is an practical hacking exam with a strict 24-hour time constraint. Therefore, time management is the most important aspect of the exam. The ability to identify potentially vulnerable attack vectors within the time constraint is key —you can always research and learn the exploitation process on the fly. Note that this guide expects you to have basic understanding on hacking and the OSCP exam itself. To begin with, let's filter out what we **should not spend time on**. Here is what you will likely not expect in the OSCP exam: * **OSINT** (E.g., Google Dorking & DNS enumeration). * **Network Poisoning and Spoofing** (LLMNR / NBT-NS Attacks) * **Client-side Attacks** (E.g., Phishing, XSS, CSRF, etc - highly unlikely) * Some practice boxes on PGs and HTBs do simulate client interactions. * In the case that this is the intended path, there should also be hints (e.g., "An admin will review your comment") With these constraints _(plus the fact that OSCP is an entry-to-intermediate level certification)_, we can expect a limited number of possible attack vectors, which can mostly be grouped into the following 3 categories: 1 **Vulnerable Versions** & Public Exploits 2 Secure Versions but **Misconfigurations** 3 Hunting **Sensitive Information** Noted that the 3 categories can be mixed & matched in a full attack path. For example: * Vulnerable Apache Web Server _(Vulnerable Version)_ -> Path Traversal into reading SSH Private Key _(Misconfiguration & Sensitive Information)_. * Anonymous SMB Share _(Misconfiguration)_ -> Discovered user credentials _(Sensitive Information)_. * Username used as Password _(Misconfiguration)_ _\->_ Run an authenticated RCE exploit _(Vulnerable Version)_. These three attack vectors apply not only to initial footholds but also to privilege escalation and Active Directory attacks. It is a cyclic process: 1 Enumerate the three vectors. 2 Escalate privileges (Could be lateral - another user account). 3 Re-enumerate the three vectors with new privileges. 4 Escalate to higher privileges. 5 Repeat until root / administrator. As the old saying goes — OSCP is an **enumeration exam**. If you find yourself crafting complex exploits, or fixing kernel driver dependencies, you are likely 90% on the wrong path. Try to take a step back and redo your enumeration, such as look for another available public exploit, a previous missed open port, some hidden credentials, etc. Vulnerable Versions[](https://hackwithmike.gitbook.io/oscp/methodology/oscp-methodology#vulnerable-versions) ------------------------------------------------------------------------------------------------------------- * * * Vulnerable versions of services and applications are usually quick wins when there are **Proof-of-Concepts (PoCs)** and **Public Exploits** available out there. ### Key strategies[](https://hackwithmike.gitbook.io/oscp/methodology/oscp-methodology#key-strategies) 1 **Enumerating versions** Use automated scanning tools like `nmap`, `netcat`, `wpscan`, etc., to perform banner grabbing or service scanning. Manually walk through each running services and look for service & version information. 2 **Look for public exploits** Utilize `searchsploit`, GitHub repos, [Exploit-DB](https://www.exploit-db.com/) , etc., for existing public exploits. 3 **Fixing and using exploits** Make sure the exploit is applicable to the service version. Some exploits have a range of vulnerable versions, and older versions may not be vulnerable. Also some public exploits require fixing and modifying before using. If you find a vulnerable version with public exploit available, prioritizing trying out all the available exploits online. Don't spending too much time on making your own exploits or bypassing filters. OSCP is all about finding and using the right exploit, with a slight touch on "**fixing the exploit**" (which is usually just changing the target IPs, fixing typos, removing unnecessary spaces, etc.) **Beware of Rabbit Holes** It is always possible that the vulnerable versions have already been **patched**, and they are only here as rabbit holes. So if you find the public exploits not working despite all the conditions are met, take a step back and re-enumerate other possible attack paths. ### Enumerating Versions[](https://hackwithmike.gitbook.io/oscp/methodology/oscp-methodology#enumerating-versions) Web Pages Services on Open Port Internal Services (Priv Esc) This is the most common attacker vector of outdated version attacks. It could be in the form of an outdated CMS, a web portal for vulnerable systems, a page running on outdated web servers, etc. * Wappalzyer Plugin ([Firefox](https://addons.mozilla.org/en-CA/firefox/addon/wappalyzer/) , or [Chrome](https://chromewebstore.google.com/detail/wappalyzer-technology-pro/gppongmhjkpfnbhagpmjfkannfbllamg?pli=1) for Burp). * Check the HTML source codes. * Look for URLs, folder names, developer comments, etc. * Check HTTP Response Headers. * Look for headers like: `Server`, `X-Powered-By`, etc. * For CMS, use WPScan / Droopescan / JoomlaScan / etc. As for other running services, we can either detect their versions automatically with existing scanning tools, or interacting with them manually. * Service Detection with Nmap. (With the `-sV` flag.) * Banner Grabbing with Netcat & Telnet. * Interact with the service directly (E.g., SMB, FTP, SSH, etc.) If you have **CLI access** to the machine (E.g., Reverse Shell, SSH, etc.): * Run the service binary with `--help` ,`-h` , `--version` ,`-v` , etc. * Check if there is a installation file of the service. If you have **GUI access** to the machine (E.g., RDP): * Open the application and manually look for the version in the `About` section. * Check if there is a installation file of the service. * Sometimes the version number is also in the installation path / folder. If the service is running on an internally opened port, try to port-forward the service externally for Nmap Scanning. ### Finding Exploits[](https://hackwithmike.gitbook.io/oscp/methodology/oscp-methodology#finding-exploits) Exploit Databases GitHub Metasploit Most of the time, you will be able to find the exploit PoC on these databases * [Searchsploit](https://www.exploit-db.com/searchsploit) on Kali command line. * [Exploit-DB](https://www.exploit-db.com/) , [Packet Storm](https://packetstorm.news/) , * CVE databases (like [MITRE](https://cve.mitre.org/) ) are usually not too helpful as they do not provide PoCs. * Although some may link to the blogs & articles that may contain PoCs. If an exploit has a publicly available exploit, you can most likely find a PoC on GitHub written by some great security researchers. (It could be me or you someday!) * Google "_CVE-XXX-XXX GitHub PoC_" or "_ exploit_" * There are also some famous exploit repos like SecWiki's [Windows Kernel Exploits](https://github.com/SecWiki/windows-kernel-exploits) . * Always CHECK the codes before running exploits from GitHub - they could be malicious. Personally I never find the need to use Metasploit in the exam, since there will always be alternative PoCs available if that particular exploit is the intended path. * Regardless, it can sometimes be the easier way to exploit a vulnerability. For example, using Metasploit is probably the easiest way to exploit EternalBlue (apart from AutoBlue) * Alternatively, you can always review the [Metasploit module source code](https://github.com/rapid7/metasploit-framework/tree/master/modules) to understand how they exploit a vulnerability and do it manually. This is of course not recommended to be performed during the actual exam. ### Using Exploits[](https://hackwithmike.gitbook.io/oscp/methodology/oscp-methodology#using-exploits) Fixing Exploits Compiling Exploits Matching Versions While the exploits are publicly available, not all of them are ready-to-use without some **cleaning and fixing**. * The most common way of "fixing" an exploit is simply to change the source & target IP addresses, modify the exploit URI paths, provide the correct user credentials, etc. * Older Python exploits are written in Python2 and should be run with `python2.7` instead of `python3`. * Always remember to with add run permission with `chmod +x