Discover : Custom Bash Scripts Used To Automate Various Penetration Testing Tasks

Discover custom bash scripts used to automate various penetration testing tasks including recon, scanning, parsing, and creating malicious payloads and listeners with Metasploit. For use with Kali Linux and the Penetration Testers Framework (PTF).

Download, setup, and usage

git clone https://github.com/leebaird/discover /opt/discover/
All scripts must be ran from this location.
cd /opt/discover/
./update.sh

  • RECON
    • Domain
    • Person
    • Parse salesforce
  • SCANNING
    • Generate target list
    • CIDR
    • List
    • IP, range, or domain
    • Rerun Nmap scripts and MSF aux
  • WEB
    • Insecure direct object reference
    • Open multiple tabs in Firefox
    • Nikto
    • SSL
  • MISC
    • Parse XML
    • Generate a malicious payload
    • Start a Metasploit listener
    • Update
    • Exit

Also Read – RITA : Real Intelligence Threat Analytics

RECON

Domain

  • RECON
    • Passive
    • Active
    • Import names into an existing recon-ng workspace
    • Previous menu

Passive uses ARIN, dnsrecon, goofile, goog-mail, goohost, theHarvester, Metasploit, URLCrazy, Whois, multiple websites, and recon-ng.

Active uses dnsrecon, WAF00W, traceroute, Whatweb, and recon-ng.

[*] Acquire API keys for Bing, Builtwith, Fullcontact, GitHub, Google, Hashes, Hunter, SecurityTrails, and Shodan for maximum results with recon-ng and theHarvester.

API key locations:
recon-ng
show keys
keys add bing_api
theHarvester
/opt/theHarvester/api-keys.yaml

  • Person
    • RECON
      • First name:
      • Last name:
  • Combines info from multiple websites.

Parse salesforce

  • Create a free account at salesforce (https://connect.data.com/login).
  • Perform a search on your target company > select the company name > see all.
  • Copy the results into a new file.

Enter the location of your list:

  • Gather names and positions into a clean list.

SCANNING

Generate target list

  • SCANNING
    • Local area network
    • NetBIOS
    • netdiscover
    • Ping sweep
    • Previous menu
  • Use different tools to create a target list including Angry IP Scanner, arp-scan, netdiscover and nmap pingsweep.

CIDR, List, IP, Range, or URL

  • Type of scan:
    • External
    • Internal
    • Previous menu
  • External scan will set the nmap source port to 53 and the max-rrt-timeout to 1500ms.
  • Internal scan will set the nmap source port to 88 and the max-rrt-timeout to 500ms.
  • Nmap is used to perform host discovery, port scanning, service enumeration and OS identification.
  • Matching nmap scripts are used for additional enumeration.
  • Addition tools: enum4linux, smbclient, and ike-scan.
  • Matching Metasploit auxiliary modules are also leveraged.

WEB

Insecure direct object reference

Using Burp, authenticate to a site, map & Spider, then log out. Target > Site map > select the URL > right click > Copy URLs in this host. Paste the results into a new file.

Enter the location of your file:

Open multiple tabs in Firefox

  • Open multiple tabs in Firefox with:
    • List
    • Directories from robots.txt.
    • Previous menu
  • Use a list containing IPs and/or URLs.
  • Use wget to pull a domain’s robot.txt file, then open all of the directories.

Nikto

  • Run multiple instances of Nikto in parallel.
    • List of IPs.
    • List of IP:port.
    • Previous menu

SSL

Check for SSL certificate issues.
Enter the location of your list:

  • Use sslscan and sslyze to check for SSL/TLS certificate issues.

MISC

Parse XML

  • Parse XML to CSV.
    • Burp (Base64)
    • Nessus (.nessus)
    • Nexpose (XML 2.0)
    • Nmap
    • Qualys
    • Previous menu

Generate a malicious payload

  • Malicious Payloads
    • android/meterpreter/reverse_tcp
    • cmd/windows/reverse_powershell
    • java/jsp_shell_reverse_tcp (Linux)
    • java/jsp_shell_reverse_tcp (Windows)
    • linux/x64/meterpreter_reverse_https
    • linux/x64/meterpreter_reverse_tcp
    • linux/x64/shell/reverse_tcp
    • osx/x64/meterpreter_reverse_https
    • osx/x64/meterpreter_reverse_tcp
    • php/meterpreter/reverse_tcp
    • python/meterpreter_reverse_https
    • python/meterpreter_reverse_tcp
    • windows/x64/meterpreter_reverse_https
    • windows/x64/meterpreter_reverse_tcp
    • Previous menu

Start a Metasploit listener

  • Metasploit Listeners
    • android/meterpreter/reverse_tcp
    • cmd/windows/reverse_powershell
    • java/jsp_shell_reverse_tcp
    • linux/x64/meterpreter_reverse_https
    • linux/x64/meterpreter_reverse_tcp
    • linux/x64/shell/reverse_tcp
    • osx/x64/meterpreter_reverse_https
    • osx/x64/meterpreter_reverse_tcp
    • php/meterpreter/reverse_tcp
    • python/meterpreter_reverse_https
    • python/meterpreter_reverse_tcp
    • windows/x64/meterpreter_reverse_https
    • windows/x64/meterpreter_reverse_tcp
    • Previous menu

Update

  • Use to update Kali Linux , Discover scripts, various tools, and the locate database.
R K

Recent Posts

Vermilion : Mastering Linux Post-Exploitation For Red Team Success

Vermilion is a simple and lightweight CLI tool designed for rapid collection, and optional exfiltration…

1 day ago

AD-CS-Forest-Exploiter : Mastering Security Through PowerShell For AD CS Misconfiguration

ADCFFS is a PowerShell script that can be used to exploit the AD CS container…

1 day ago

Usage Of Tartufo – A Comprehensive Guide To Securing Your Git Repositories

Tartufo will, by default, scan the entire history of a git repository for any text…

1 day ago

Loco : A Rails-Inspired Framework For Rust Developers

Loco is strongly inspired by Rails. If you know Rails and Rust, you'll feel at…

2 days ago

Monolith : The Ultimate Tool For Storing Entire Web Pages As Single HTML Files

A data hoarder’s dream come true: bundle any web page into a single HTML file.…

2 days ago