Skip to content

Instantly share code, notes, and snippets.

@mattyjones
Last active September 30, 2020 14:17
Show Gist options
  • Save mattyjones/31e45b95324266269e435af9a4f97d4f to your computer and use it in GitHub Desktop.
Save mattyjones/31e45b95324266269e435af9a4f97d4f to your computer and use it in GitHub Desktop.
This is a bare # bones script that will take either a cve or exploit id and open up a browser tab directly to # the exploit given or search results given a cve.
#! /bin/env bash
# Description:
# Going to a browser and playing cut and paste games can be time consuming and break the flow
# of a penetration. Searchsploit is a great tool that acts as a cli interface with exploit-db.
# You can search for exploits in much the same way as you can on the site. This is a bare
# bones script that will take either a cve or exploit id and open up a browser tab directly to
# the exploit given or search results given a cve.
#
# License: MIT
#
# Usage:
# fetch-exploit.sh 71141
# fetch-exploit.sh 2017-3456
#
# Install:
# Download the script and make it exectuable with `chmod +x`
#
# You can get the exploit-id via searchsploit or the cve from any number of sources.
BROWSER_CMD="/usr/bin/firefox"
OPTIONS="--new-window"
if [[ "$1" =~ [0-9] ]]; then
exploit_id="$1"
SITE_URL="https://www.exploit-db.com/exploits"
cmd="$BROWSER_CMD $OPTIONS $SITE_URL/$exploit_id"
fi
if [[ "$1" =~ [0-9]{4}-[0-9]+ ]]; then
cve="$1"
SEARCH_URL="https://www.exploit-db.com/search?cve="
cmd="$BROWSER_CMD $OPTIONS $SEARCH_URL$cve"
fi
$cmd &
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment