Skip to content

Commit

Permalink
Added TOOL_PATH variable so users can change the location of the tool…
Browse files Browse the repository at this point in the history
…s list.
  • Loading branch information
bellma101 committed Mar 11, 2019
1 parent 8f30ebe commit 7441765
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 25 deletions.
72 changes: 47 additions & 25 deletions chomp-scan.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ SKIP_MASSCAN=0;
NOTICA="";
CONFIG_FILE="";
TOOL_PATH="$HOME/bounty/tools";
TOOL_PATH_SET=0;

# Config file variables
ENABLE_DNSCAN=0;
Expand All @@ -62,31 +63,38 @@ ENABLE_MASSCAN=0;
ENABLE_NMAP=0;
ENABLE_SCREENSHOTS=0;

# Tool paths
SUBFINDER=$(command -v subfinder);
SUBJACK=$(command -v subjack);
FFUF=$(command -v ffuf);
WHATWEB=$(command -v whatweb);
WAFW00F=$(command -v wafw00f);
GOBUSTER=$(command -v gobuster);
CHROMIUM=$(command -v chromium);
NMAP=$(command -v nmap);
MASSCAN=$(command -v masscan);
NIKTO=$(command -v nikto);
INCEPTION=$(command -v inception);
WAYBACKURLS=$(command -v waybackurls);
GOALTDNS=$(command -v goaltdns);
SUBLIST3R=$TOOL_PATH/Sublist3r/sublist3r.py;
DNSCAN=$TOOL_PATH/dnscan/dnscan.py;
MASSDNS_BIN=$TOOL_PATH/massdns/bin/massdns;
MASSDNS_RESOLVERS=resolvers.txt;
AQUATONE=$TOOL_PATH/aquatone/aquatone;
BFAC=$TOOL_PATH/bfac/bfac;
DIRSEARCH=$TOOL_PATH/dirsearch/dirsearch.py;
SNALLY=$TOOL_PATH/snallygaster/snallygaster;
CORSTEST=$TOOL_PATH/CORStest/corstest.py;
S3SCANNER=$TOOL_PATH/S3Scanner/s3scanner.py;
AMASS=$TOOL_PATH/amass/amass;
function set_tool_paths() {
# If tool paths have not been set, set them
if [[ "$TOOL_PATH_SET" -eq 0 ]]; then
TOOL_PATH_SET=1;
SUBFINDER=$(command -v subfinder);
SUBJACK=$(command -v subjack);
FFUF=$(command -v ffuf);
WHATWEB=$(command -v whatweb);
WAFW00F=$(command -v wafw00f);
GOBUSTER=$(command -v gobuster);
CHROMIUM=$(command -v chromium);
NMAP=$(command -v nmap);
MASSCAN=$(command -v masscan);
NIKTO=$(command -v nikto);
INCEPTION=$(command -v inception);
WAYBACKURLS=$(command -v waybackurls);
GOALTDNS=$(command -v goaltdns);
SUBLIST3R=$TOOL_PATH/Sublist3r/sublist3r.py;
DNSCAN=$TOOL_PATH/dnscan/dnscan.py;
MASSDNS_BIN=$TOOL_PATH/massdns/bin/massdns;
MASSDNS_RESOLVERS=resolvers.txt;
AQUATONE=$TOOL_PATH/aquatone/aquatone;
BFAC=$TOOL_PATH/bfac/bfac;
DIRSEARCH=$TOOL_PATH/dirsearch/dirsearch.py;
SNALLY=$TOOL_PATH/snallygaster/snallygaster;
CORSTEST=$TOOL_PATH/CORStest/corstest.py;
S3SCANNER=$TOOL_PATH/S3Scanner/s3scanner.py;
AMASS=$TOOL_PATH/amass/amass;
else
return;
fi
}

# Other variables
ALL_IP=all_discovered_ips.txt;
Expand Down Expand Up @@ -241,6 +249,17 @@ function parse_config() {
fi
fi

CONFIG_TOOL_PATH=$(grep '^TOOL_PATH' "$CONFIG_FILE" | cut -d '=' -f 2);
if [[ "$CONFIG_TOOL_PATH" != "" ]]; then
if [[ -w "$CONFIG_TOOL_PATH" ]]; then
TOOL_PATH="$CONFIG_TOOL_PATH";
set_tool_paths;
else
echo -e "$RED""[!] Custom tool path $CONFIG_TOOL_PATH does not exist or is not writable. Please check the configuration file.""$NC";
exit 1;
fi
fi

# Parse [subdomain enumeration]

if [[ $(grep '^ENABLE_DNSCAN' "$CONFIG_FILE" | cut -d '=' -f 2) == "YES" ]]; then
Expand Down Expand Up @@ -572,6 +591,9 @@ done
shift $((OPTIND -1));

function check_paths() {
# Check if paths haven't been set and set them
set_tool_paths;

# Check for Debian/Ubuntu and set proper paths
grep 'Ubuntu' /etc/issue 1>/dev/null;
UBUNTU="$?";
Expand Down
2 changes: 2 additions & 0 deletions config
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ NOTICA=
BLACKLIST=
# Set custom interesting word list, values are a path to a file or blank
INTERESTING=
# Set custom path to tools. This should be a fully qualified path to the directory that contains the downloaded tools from Github
TOOL_PATH=


[subdomain enumeration]
Expand Down

0 comments on commit 7441765

Please sign in to comment.