################################ # Pentester Night School 2016 # # By Joe McCray # ################################ ########## # VMWare # ########## - For this workshop you'll need the latest version of VMWare Workstation (Windows), Fusion (Mac), or Player. - Although you can get the VM to run in VirtualBox, I will not be supporting this configuration for this class. ########################## # Download the attack VM # ########################## VM for these labs ----------------- https://s3.amazonaws.com/StrategicSec-VMs/StrategicsecUbuntu-v3.zip user: strategicsec pass: strategicsec --------------------------------------------------------------------------------------------------------------------------------- ################################ # Tactical Pentest Methodology # ################################ The purpose of this section of the Pastebin document is to provide you with a tactical pentest plan. -=-=-=-=-=- Phase 1 -=-=-=-=-=- ########################################## # Step 1: External Target Identification # ########################################## Find all of the IP ranges owned by your target company via the following websites: - https://www.robtex.com/ - http://toolbar.netcraft.com/site_report Look for weak SSL implementations - https://www.ssllabs.com/ssltest/ ############################# # Step 2: Google Quick Hits # ############################# Be thorough, and really look for vulnerabilities and data leakages that are relevant to what you learned while doing your OSINT work. https://www.exploit-db.com/google-hacking-database/ Really good google dorks to use: site:yourtarget.com filetype:pcf site:yourtarget.com filetype:ica 1. Footholds: ------------- https://www.exploit-db.com/google-hacking-database/?action=search&ghdb_search_cat_id=1&ghdb_search_text= Be sure to use 'site:yourtarget.com' [ google dork for the site above ] 2. Passwords: ------------- https://www.exploit-db.com/google-hacking-database/?action=search&ghdb_search_cat_id=9&ghdb_search_text= Be sure to use 'site:yourtarget.com' [ google dork for the site above ] 3. Sensitive Directories: ------------------------- https://www.exploit-db.com/google-hacking-database/?action=search&ghdb_search_cat_id=3&ghdb_search_text= Be sure to use 'site:yourtarget.com' [ google dork for the site above ] Make sure that you do at least 50-100 different Google dorks. Do no less than 10 dorks per category. ########################### # Step 3: Compromise Data # ########################### Look to see if they have already been breached Search for the target company (and their major competitors) in the Data Breach Database http://www.privacyrights.org/data-breach Place targetgcompany.com in the search box of the link below to look known breaches http://zone-h.com/search Replace targetgcompany.com with your target domain name to look for known XSS vulnerabilities in the site. http://xssed.com/search?key=targetcompany.com ############################## # Step 4: Build OSINT Report # ############################## Passive Recon ------------- Install this add-on and enumerate as much info as possible - https://addons.mozilla.org/en-US/firefox/addon/passiverecon/ Next we build at an OSINT report with the data gleaned from the previous steps: https://s3.amazonaws.com/StrategicSec-Files/OSINT_Innophos_11242010.doc We looked through this to get an idea of what is not only involved in doing passive recon, but what the actual output of the work should look like. --------------------------------------------------------------------------------------------------------------------------------- -=-=-=-=-=- Phase 2 -=-=-=-=-=- ########################## # Download the attack VM # ########################## VM for these labs ----------------- https://s3.amazonaws.com/StrategicSec-VMs/StrategicsecUbuntu-v3.zip user: strategicsec pass: strategicsec ############################################ # Identifying External Security Mechanisms # ############################################ sudo /sbin/iptables -F strategicsec cd /home/strategicsec/toolz ########################### # Target IP Determination # ########################### cd /home/strategicsec/toolz perl blindcrawl.pl -d targetgcompany.com -- Take each IP address and look ip up here: http://www.networksolutions.com/whois/index.jsp cd ~/toolz/fierce2 fierce -dns targetgcompany.com cd .. cd ~/toolz/ ./ipcrawl 148.87.1.1 148.87.1.254 (DNS forward lookup against an IP range) sudo nmap -sL 148.87.1.0-255 strategicsec sudo nmap -sL 148.87.1.0-255 | grep oracle strategicsec sudo nmap -p 443,444,8443,8080,8088 --script=ssl-cert --open 148.87.1.0-255 strategicsec Reference: http://blog.depthsecurity.com/2012/01/obtaining-hostdomain-names-through-ssl.html ########################### # Load Balancer Detection # ########################### Here are some command-line options to use for identifying load balancers: dig google.com cd ~/toolz ./lbd-0.1.sh targetgcompany.com halberd targetgcompany.com ###################################### # Web Application Firewall Detection # ###################################### cd ~/toolz/wafw00f python wafw00f.py http://www.targetgcompany.com cd ~/toolz/ sudo nmap -p 80 --script http-waf-detect.nse targetgcompany.com strategicsec sudo nmap -p 80 --script http-waf-detect.nse targetgcompany.com strategicsec --------------------------------------------------------------------------------------------------------------------------------- -=-=-=-=-=- Phase 3 -=-=-=-=-=- Let's have you connect to the VPN. I wanted to make sure that I did some of the stuff on my local virtual machines because I want you to do the hunting for vulnerable hosts to attack. If I attack the live targets in the lab then I'll end up giving away a lot of the little secrets that I want you to discover. So, let's start with some lab fun (just a little bit)...lol. Here are the instructions for connecting to the VPN: https://s3.amazonaws.com/StrategicSec-Files/Strategic-Security-2016-VPN-Info.pdf sudo nmap -sP 10.0.0.0/24 sudo nmap -sL 10.0.0.0/24 cd ~/toolz wget --no-check-certificate https://raw.githubusercontent.com/BenDrysdale/ipcrawl/master/ipcrawl.c gcc ipcrawl.c -o ipcrawl chmod 777 ipcrawl ./ipcrawl 10.0.0.1 10.0.0.254 wget --no-check-certificate https://dl.packetstormsecurity.net/UNIX/scanners/propecia.c gcc propecia.c propecia sudo cp propecia /bin propecia 10.0.0 22 propecia 10.0.0 3389 nmap -Pn -sV -T 5 -oG - -p 21,22,80,443,1433,3389 10.0.0.* | grep open nmap -Pn -sV -T 5 -oG - -p 21,22,80,443,1433,3389 10.0.0.* | awk '/open/{print $2 " " $3}' nmap -Pn -sV -T 5 -oG - -p 21,22,80,443,1433,3389 10.0.0.* | awk '/open/{print $2}' | wc -l nmap -Pn -sV -T 5 -oG - -p 21,22,80,443,1433,3389 10.0.0.* | awk '/open/{print $2}' nmap -Pn -sV -T 5 -oG - -p 21,22,80,443,1433,3389 10.0.0.* | awk '/open/{print $2}' > ~/labnet-ip-list.txt cd ~/toolz wget http://wkhtmltopdf.googlecode.com/files/wkhtmltoimage-0.11.0_rc1-static-i386.tar.bz2 tar -jxvf wkhtmltoimage-0.11.0_rc1-static-i386.tar.bz2 sudo cp wkhtmltoimage-i386 /usr/local/bin/ git clone git://github.com/SpiderLabs/Nmap-Tools.git cd Nmap-Tools/NSE/ sudo cp http-screenshot.nse /usr/share/nmap/scripts/ sudo nmap --script-updatedb cd ~/toolz/ mkdir labscreenshots cd labscreenshots/ sudo nmap -Pn -T 5 -p 80 -A --script=http-screenshot 10.0.0.0/24 -iL /home/strategicsec/labnet-ip-list.txt vi screenshots.sh #!/bin/bash printf "