diff --git a/CHANGELOG.md b/CHANGELOG.md index a4005f9..81709d0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,7 @@ ## CHANGELOG: +* v8.6 - Added new Sn1per configuration flow that allows persistent user configurations and API key transfer +* v8.6 - Updated port lists to remove duplicate ports error and slim down list +* v8.6 - Updated PHP to 7.4 * v8.6 - Added CVE-2020-12720 - vBulletin Unauthenticaed SQLi * v8.6 - Added CVE-2020-9757 - SEOmatic < 3.3.0 Server-Side Template Injection * v8.6 - Added CVE-2020-1147 - Remote Code Execution in Microsoft SharePoint Server diff --git a/install.sh b/install.sh index 54bd437..2aebebd 100755 --- a/install.sh +++ b/install.sh @@ -84,8 +84,8 @@ apt-get install -y whois apt-get install -y dnsrecon apt-get install -y curl apt-get install -y nmap -apt-get install -y php -apt-get install -y php-curl +apt-get install -y php7.4 +apt-get install -y php7.4-curl apt-get install -y hydra apt-get install -y sqlmap apt-get install -y nbtscan @@ -106,8 +106,8 @@ apt-get install -y net-tools apt-get install -y p7zip-full apt-get install -y jsbeautifier apt-get install -y phantomjs 2> /dev/null -apt-get install openvas -apt-get install greenbone-security-assistant +apt-get install -y openvas +apt-get install -y greenbone-security-assistant echo -e "$OKBLUE[*]$RESET Installing Metasploit...$RESET" curl https://raw.githubusercontent.com/rapid7/metasploit-omnibus/master/config/templates/metasploit-framework-wrappers/msfupdate.erb > /tmp/msfinstall @@ -278,12 +278,5 @@ mkdir -p /usr/share/sniper/loot/workspaces/ 2> /dev/null ln -fs /usr/share/sniper/loot/workspaces/ /home/kali/Desktop/workspaces 2> /dev/null ln -fs /usr/share/sniper/loot/workspaces/ /root/Desktop/workspaces 2> /dev/null -echo -e "$OKBLUE[*]$RESET Copying the old Sn1per configuration file to /root/.sniper.conf.old $RESET" -mv ~/.sniper.conf ~/.sniper.conf.old 2> /dev/null - -echo -e "$OKBLUE[*]$RESET Copying updated Sn1per configuration file to /root/.sniper.conf $RESET" -cp $INSTALL_DIR/sniper.conf ~/.sniper.conf 2> /dev/null - -echo -e "$OKBLUE[i]$RESET NOTE: You may need to copy your old API keys and config to the new sniper.conf file at /root/.sniper.conf $RESET" echo -e "$OKRED[>]$RESET Done! $RESET" echo -e "$OKRED[>]$RESET To run, type 'sniper'! $RESET" diff --git a/sniper b/sniper index b6155ad..012be69 100755 --- a/sniper +++ b/sniper @@ -16,14 +16,26 @@ SNIPER_PRO=$INSTALL_DIR/pro.sh # INIT POSTGRESQL service postgresql start 2> /dev/null -# LOAD SNIPER CONFIGURATION FILE -if [[ -f ~/.sniper.conf ]]; then - source ~/.sniper.conf - echo -e "$OKBLUE[*]$RESET Loaded configuration file from ~/.sniper.conf $OKBLUE[$RESET${OKGREEN}OK${RESET}$OKBLUE]$RESET" +# LOAD DEFAULT SNIPER CONFIGURATION FILE +source $INSTALL_DIR/sniper.conf +echo -e "$OKBLUE[*]$RESET Loaded configuration file from $INSTALL_DIR/sniper.conf $OKBLUE[$RESET${OKGREEN}OK${RESET}$OKBLUE]$RESET" + +if [[ -f /root/.sniper.conf ]]; then + # LOAD USER SN1PER CONFIGURATION FILE + source /root/.sniper.conf + echo -e "$OKBLUE[*]$RESET Loaded configuration file from /root/.sniper.conf $OKBLUE[$RESET${OKGREEN}OK${RESET}$OKBLUE]$RESET" + + if [[ -f /root/.sniper_api_keys.conf ]]; then + # LOAD USER API KEYS (PERSISTENT CONFIG) + source /root/.sniper_api_keys.conf + echo -e "$OKBLUE[*]$RESET Loaded API keys from /root/.sniper_api_keys.conf $OKBLUE[$RESET${OKGREEN}OK${RESET}$OKBLUE]$RESET" + fi + else - cp $INSTALL_DIR/sniper.conf ~/.sniper.conf 2> /dev/null - source ~/.sniper.conf - echo -e "$OKBLUE[*]$RESET Loaded configuration file from ~/.sniper.conf $OKBLUE[$RESET${OKGREEN}OK${RESET}$OKBLUE]$RESET" + # IF NO USER CONFIG PRESENT, CREATE IT FROM THE DEFAULT TEMPLATE + cp $INSTALL_DIR/sniper.conf /root/.sniper.conf 2> /dev/null + source /root/.sniper.conf + echo -e "$OKBLUE[*]$RESET Loaded configuration file from /root/.sniper.conf $OKBLUE[$RESET${OKGREEN}OK${RESET}$OKBLUE]$RESET" fi DISTRO=$(cat /etc/*-release | grep DISTRIB_ID= | cut -d'=' -f2) @@ -97,6 +109,9 @@ function help { echo -e "$OKBLUE[*]$RESET DELETE HOST FROM WORKSPACE" echo ' sniper -w -t -dh' echo "" + echo -e "$OKBLUE[*]$RESET DELETE TASKS FROM WORKSPACE" + echo ' sniper -w -t -dt' + echo "" echo -e "$OKBLUE[*]$RESET GET SNIPER SCAN STATUS" echo ' sniper --status' echo "" @@ -216,8 +231,10 @@ case $key in CONFIG="$2" echo -e "$OKBLUE[*]$RESET Creating backup of existing config to /root/.sniper.conf.bak...$OKBLUE[$RESET${OKGREEN}OK${RESET}$OKBLUE]$RESET" cp -f /root/.sniper.conf /root/.sniper.conf.bak - echo -e "$OKBLUE[*]$RESET Copying $CONFIG to ~/.sniper.conf...$OKBLUE[$RESET${OKGREEN}OK${RESET}$OKBLUE]$RESET" + echo -e "$OKBLUE[*]$RESET Copying $CONFIG to /root/.sniper.conf...$OKBLUE[$RESET${OKGREEN}OK${RESET}$OKBLUE]$RESET" cp -f $CONFIG /root/.sniper.conf + source /root/.sniper.conf + sleep 1 shift shift ;; @@ -325,6 +342,13 @@ case $key in exit shift # past argument ;; + -dt|--delete-task) + echo "Removing all running $TARGET tasks from $WORKSPACE" + rm -vf $WORKSPACE_DIR/scans/running_$TARGET_*.txt + ls -lh $LOOT_DIR/scans/running_*.txt 2> /dev/null | wc -l 2> /dev/null > $WORKSPACE_DIR/scans/tasks-running.txt 2> /dev/null + exit + shift # past argument + ;; --list) logo ls -l $INSTALL_DIR/loot/workspace/ @@ -438,128 +462,131 @@ function init { } function loot { - echo -e "$OKRED ____ $RESET" - echo -e "$OKRED _________ / _/___ ___ _____$RESET" - echo -e "$OKRED / ___/ __ \ / // __ \/ _ \/ ___/$RESET" - echo -e "$OKRED (__ ) / / // // /_/ / __/ / $RESET" - echo -e "$OKRED /____/_/ /_/___/ .___/\___/_/ $RESET" - echo -e "$OKRED /_/ $RESET" - echo "" - if [[ ! -z $WORKSPACE_DIR ]]; then - LOOT_DIR=$WORKSPACE_DIR - fi + if [[ ! $LOOT == "0" ]]; then + echo -e "$OKRED ____ $RESET" + echo -e "$OKRED _________ / _/___ ___ _____$RESET" + echo -e "$OKRED / ___/ __ \ / // __ \/ _ \/ ___/$RESET" + echo -e "$OKRED (__ ) / / // // /_/ / __/ / $RESET" + echo -e "$OKRED /____/_/ /_/___/ .___/\___/_/ $RESET" + echo -e "$OKRED /_/ $RESET" + echo "" + if [[ ! -z $WORKSPACE_DIR ]]; then + LOOT_DIR=$WORKSPACE_DIR + fi - rm -f $INSTALL_DIR/stash.sqlite 2> /dev/null - rm -f $INSTALL_DIR/hydra.restore 2> /dev/null + rm -f $INSTALL_DIR/stash.sqlite 2> /dev/null + rm -f $INSTALL_DIR/hydra.restore 2> /dev/null + ls -lh $LOOT_DIR/scans/running_*.txt 2> /dev/null | wc -l 2> /dev/null > $LOOT_DIR/scans/tasks-running.txt 2> /dev/null - echo -e "$OKBLUE[*]$RESET Opening loot directory $LOOT_DIR $OKBLUE[$RESET${OKGREEN}OK${RESET}$OKBLUE]$RESET" + echo -e "$OKBLUE[*]$RESET Opening loot directory $LOOT_DIR $OKBLUE[$RESET${OKGREEN}OK${RESET}$OKBLUE]$RESET" - cd $LOOT_DIR + cd $LOOT_DIR - if [[ "$METASPLOIT_IMPORT" == "1" ]]; then - echo -e "$OKORANGE + -- --=[ Starting Metasploit service...$RESET" - /etc/init.d/metasploit start 2> /dev/null > /dev/null - msfdb start - echo -e "$OKORANGE + -- --=[ Importing NMap XML files into Metasploit...$RESET" - msfconsole -x "workspace -a $WORKSPACE; workspace $WORKSPACE; db_import $LOOT_DIR/nmap/nmap*.xml; hosts; services; exit;" | tee $LOOT_DIR/notes/msf-$WORKSPACE.txt - fi + if [[ "$METASPLOIT_IMPORT" == "1" ]]; then + echo -e "$OKORANGE + -- --=[ Starting Metasploit service...$RESET" + /etc/init.d/metasploit start 2> /dev/null > /dev/null + msfdb start + echo -e "$OKORANGE + -- --=[ Importing NMap XML files into Metasploit...$RESET" + msfconsole -x "workspace -a $WORKSPACE; workspace $WORKSPACE; db_import $LOOT_DIR/nmap/nmap*.xml; hosts; services; exit;" | tee $LOOT_DIR/notes/msf-$WORKSPACE.txt + fi - echo -e "$OKORANGE + -- --=[ Generating reports...$RESET" - cd $LOOT_DIR/output 2> /dev/null - echo -en "$OKGREEN[$OKBLUE" - for a in `ls sniper-*.txt 2>/dev/null`; - #for a in `sort -u $LOOT_DIR/scans/updated.txt`; - do - # TXT OUTPUT - #cat "$a" 2> /dev/null | sed -r "s/\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[mGK]//g" 2> /dev/null > $LOOT_DIR/reports/$a.txt 2> /dev/null - # HTML OUTPUT - echo "$a" 2> /dev/null | aha 2> /dev/null > $LOOT_DIR/reports/$a.html 2> /dev/null - cat "$a" 2> /dev/null | aha 2> /dev/null >> $LOOT_DIR/reports/$a.html 2> /dev/null - # PDF OUTPUT - #$INSTALL_DIR/bin/pyText2pdf.py -o $LOOT_DIR/reports/$a.pdf $LOOT_DIR/reports/$a.txt 2> /dev/null > /dev/null - echo -n '|' - done - echo -en "$OKGREEN]$RESET" - echo "" + echo -e "$OKORANGE + -- --=[ Generating reports...$RESET" + cd $LOOT_DIR/output 2> /dev/null + echo -en "$OKGREEN[$OKBLUE" + for a in `ls sniper-*.txt 2>/dev/null`; + #for a in `sort -u $LOOT_DIR/scans/updated.txt`; + do + # TXT OUTPUT + #cat "$a" 2> /dev/null | sed -r "s/\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[mGK]//g" 2> /dev/null > $LOOT_DIR/reports/$a.txt 2> /dev/null + # HTML OUTPUT + echo "$a" 2> /dev/null | aha 2> /dev/null > $LOOT_DIR/reports/$a.html 2> /dev/null + cat "$a" 2> /dev/null | aha 2> /dev/null >> $LOOT_DIR/reports/$a.html 2> /dev/null + # PDF OUTPUT + #$INSTALL_DIR/bin/pyText2pdf.py -o $LOOT_DIR/reports/$a.pdf $LOOT_DIR/reports/$a.txt 2> /dev/null > /dev/null + echo -n '|' + done + echo -en "$OKGREEN]$RESET" + echo "" - # DISABLED FOR CONTINUITY / ENABLE FOR SPEED - #rm -f sniper-*.txt 2>/dev/null + # DISABLED FOR CONTINUITY / ENABLE FOR SPEED + #rm -f sniper-*.txt 2>/dev/null - cd .. - chmod 777 -Rf $LOOT_DIR - #echo -e "$OKORANGE + -- --=[ Parsing NMap Ports... $RESET" - #echo -en "$OKGREEN[$OKBLUE" - #for TARGET in `cat $WORKSPACE_DIR/scans/updated.txt`; do - #echo -n "|" - #HOST_UP=$(cat $LOOT_DIR/nmap/nmap-$TARGET.txt $LOOT_DIR/nmap/nmap-$TARGET-*.txt 2> /dev/null | grep "host up" 2> /dev/null) - #if [[ ${#HOST_UP} -ge 2 ]]; then - # echo "$TARGET" >> $LOOT_DIR/nmap/livehosts-unsorted.txt 2> /dev/null - #fi - #rm -f $LOOT_DIR/nmap/ports-$TARGET.txt 2> /dev/null - #for PORT in `cat $LOOT_DIR/nmap/nmap-$TARGET.xml $LOOT_DIR/nmap/nmap-$TARGET-*.xml 2>/dev/null | egrep 'state="open"' | cut -d' ' -f3 | cut -d\" -f2 | sort -u | grep '[[:digit:]]'`; do - # echo "$PORT " >> $LOOT_DIR/nmap/ports-$TARGET.txt 2> /dev/null - # if [[ ${#PORT} -ge 2 ]]; then - # echo "$TARGET" >> $LOOT_DIR/nmap/openports-unsorted.txt 2> /dev/null - # fi + cd .. + chmod 777 -Rf $LOOT_DIR + #echo -e "$OKORANGE + -- --=[ Parsing NMap Ports... $RESET" + #echo -en "$OKGREEN[$OKBLUE" + #for TARGET in `cat $WORKSPACE_DIR/scans/updated.txt`; do + #echo -n "|" + #HOST_UP=$(cat $LOOT_DIR/nmap/nmap-$TARGET.txt $LOOT_DIR/nmap/nmap-$TARGET-*.txt 2> /dev/null | grep "host up" 2> /dev/null) + #if [[ ${#HOST_UP} -ge 2 ]]; then + # echo "$TARGET" >> $LOOT_DIR/nmap/livehosts-unsorted.txt 2> /dev/null + #fi + #rm -f $LOOT_DIR/nmap/ports-$TARGET.txt 2> /dev/null + #for PORT in `cat $LOOT_DIR/nmap/nmap-$TARGET.xml $LOOT_DIR/nmap/nmap-$TARGET-*.xml 2>/dev/null | egrep 'state="open"' | cut -d' ' -f3 | cut -d\" -f2 | sort -u | grep '[[:digit:]]'`; do + # echo "$PORT " >> $LOOT_DIR/nmap/ports-$TARGET.txt 2> /dev/null + # if [[ ${#PORT} -ge 2 ]]; then + # echo "$TARGET" >> $LOOT_DIR/nmap/openports-unsorted.txt 2> /dev/null + # fi + #done #done - #done - #echo -e "$OKGREEN]$RESET" - echo -e "$OKORANGE + -- --=[ Sorting all files...$RESET" - sort -u $LOOT_DIR/domains/*-full.txt 2> /dev/null > $LOOT_DIR/domains/domains-all-presorted.txt 2> /dev/null - sed -E "s/^\.//g" $LOOT_DIR/domains/domains-all-presorted.txt 2> /dev/null | sed -E "s/^\*\.//g" | tr '[:upper:]' '[:lower:]' | sort -u > $LOOT_DIR/domains/domains-all-presorted2.txt 2> /dev/null - sort -u $LOOT_DIR/domains/targets.txt 2> /dev/null > $LOOT_DIR/domains/targets-all-presorted.txt 2> /dev/null - sed -E "s/^\.//g" $LOOT_DIR/domains/targets-all-presorted.txt 2> /dev/null | sed -E "s/^\*\.//g" | tr '[:upper:]' '[:lower:]' | sort -u > $LOOT_DIR/domains/targets-all-sorted.txt 2> /dev/null - sort -u $LOOT_DIR/ips/ips-all-unsorted.txt 2> /dev/null > $LOOT_DIR/ips/ips-all-sorted.txt 2> /dev/null - sed -i -E 's/address//g' $LOOT_DIR/ips/ips-all-sorted.txt 2> /dev/null - sort -u $LOOT_DIR/domains/domains-all-presorted2.txt $LOOT_DIR/domains/targets-all-sorted.txt 2> /dev/null > $LOOT_DIR/domains/domains-all-sorted.txt 2> /dev/null - diff $LOOT_DIR/domains/targets-all-sorted.txt $LOOT_DIR/domains/domains-all-sorted.txt 2> /dev/null | grep \> | awk '{print $2}' > $LOOT_DIR/domains/targets-all-unscanned.txt - rm -f $LOOT_DIR/domains/targets-all-presorted.txt $LOOT_DIR/domains/targets-all-presorted2.txt 2> /dev/null - rm -f $LOOT_DIR/domains/domains-all-presorted.txt $LOOT_DIR/domains/domains-all-presorted2.txt 2> /dev/null - sort -u $LOOT_DIR/nmap/openports-unsorted.txt 2> /dev/null > $LOOT_DIR/nmap/openports-sorted.txt 2> /dev/null - sort -u $LOOT_DIR/nmap/livehosts-unsorted.txt 2> /dev/null > $LOOT_DIR/nmap/livehosts-sorted.txt 2> /dev/null - find $LOOT_DIR/web/ -type f -size -1c -exec rm -f {} \; - cd $LOOT_DIR/web/ && rm -f webhosts-all-sorted-* 2> /dev/null - cd $LOOT_DIR/domains/ && rm -f domains-all-sorted-* 2> /dev/null - cd $LOOT_DIR/nmap/ && rm -f openports-all-sorted-* 2> /dev/null - cd $LOOT_DIR/nmap/ && rm -f livehosts-all-sorted-* 2> /dev/null - cd $LOOT_DIR/web/ 2> /dev/null - egrep -Hi 'HTTP/1.' headers-* 2> /dev/null | cut -d':' -f1 | sed "s/headers\-http\(\|s\)\-//g" | sed "s/\.txt//g" | sed "s/^\-.*$//" | sort -u > $LOOT_DIR/web/webhosts-sorted.txt 2> /dev/null - split -d -l $MAX_HOSTS -e $LOOT_DIR/web/webhosts-sorted.txt webhosts-all-sorted- 2> /dev/null - cd $LOOT_DIR/domains/ 2> /dev/null - split -d -l $MAX_HOSTS -e $LOOT_DIR/domains/domains-all-sorted.txt domains-all-sorted- 2> /dev/null - cd $LOOT_DIR/nmap/ 2> /dev/null - split -d -l $MAX_HOSTS -e $LOOT_DIR/nmap/openports-sorted.txt openports-all-sorted- 2> /dev/null - split -d -l $MAX_HOSTS -e $LOOT_DIR/nmap/livehosts-sorted.txt livehosts-all-sorted- 2> /dev/null - echo -e "$OKORANGE + -- --=[ Removing blank screenshots and files...$RESET" - chmod 777 -Rf $LOOT_DIR 2> /dev/null - cd $LOOT_DIR/screenshots/ - find $LOOT_DIR/screenshots/ -type f -size -9000c -exec rm -f {} \; - find $LOOT_DIR/nmap/ -type f -size -1c -exec rm -f {} \; - cd $LOOT_DIR - if [[ -f $SNIPER_PRO ]]; then - if [[ -f "$LOOT_DIR/notes/notepad.html" ]]; then - echo -n "" 2>/dev/null - else - cp "$INSTALL_DIR/pro/notepad.html" "$LOOT_DIR/notes/notepad.html" 2>/dev/null - PRE_NAME=$(echo $WORKSPACE | sed "s/\./-/g") - sed -i "s/notepad/notepad-$PRE_NAME/g" "$LOOT_DIR/notes/notepad.html" 2> /dev/null - fi - if [[ "$SN1PER_AUTOLOAD" = "1" ]] && [[ ! -f "$INSTALL_DIR/pro/settings.php" ]]; then - echo -e "$OKORANGE + -- --=[ Loading Sn1per Professional...$RESET" + #echo -e "$OKGREEN]$RESET" + echo -e "$OKORANGE + -- --=[ Sorting all files...$RESET" + sort -u $LOOT_DIR/domains/*-full.txt 2> /dev/null > $LOOT_DIR/domains/domains-all-presorted.txt 2> /dev/null + sed -E "s/^\.//g" $LOOT_DIR/domains/domains-all-presorted.txt 2> /dev/null | sed -E "s/^\*\.//g" | tr '[:upper:]' '[:lower:]' | sort -u > $LOOT_DIR/domains/domains-all-presorted2.txt 2> /dev/null + sort -u $LOOT_DIR/domains/targets.txt 2> /dev/null > $LOOT_DIR/domains/targets-all-presorted.txt 2> /dev/null + sed -E "s/^\.//g" $LOOT_DIR/domains/targets-all-presorted.txt 2> /dev/null | sed -E "s/^\*\.//g" | tr '[:upper:]' '[:lower:]' | sort -u > $LOOT_DIR/domains/targets-all-sorted.txt 2> /dev/null + sort -u $LOOT_DIR/ips/ips-all-unsorted.txt 2> /dev/null > $LOOT_DIR/ips/ips-all-sorted.txt 2> /dev/null + sed -i -E 's/address//g' $LOOT_DIR/ips/ips-all-sorted.txt 2> /dev/null + sort -u $LOOT_DIR/domains/domains-all-presorted2.txt $LOOT_DIR/domains/targets-all-sorted.txt 2> /dev/null > $LOOT_DIR/domains/domains-all-sorted.txt 2> /dev/null + diff $LOOT_DIR/domains/targets-all-sorted.txt $LOOT_DIR/domains/domains-all-sorted.txt 2> /dev/null | grep \> | awk '{print $2}' > $LOOT_DIR/domains/targets-all-unscanned.txt + rm -f $LOOT_DIR/domains/targets-all-presorted.txt $LOOT_DIR/domains/targets-all-presorted2.txt 2> /dev/null + rm -f $LOOT_DIR/domains/domains-all-presorted.txt $LOOT_DIR/domains/domains-all-presorted2.txt 2> /dev/null + sort -u $LOOT_DIR/nmap/openports-unsorted.txt 2> /dev/null > $LOOT_DIR/nmap/openports-sorted.txt 2> /dev/null + sort -u $LOOT_DIR/nmap/livehosts-unsorted.txt 2> /dev/null > $LOOT_DIR/nmap/livehosts-sorted.txt 2> /dev/null + find $LOOT_DIR/web/ -type f -size -1c -exec rm -f {} \; + cd $LOOT_DIR/web/ && rm -f webhosts-all-sorted-* 2> /dev/null + cd $LOOT_DIR/domains/ && rm -f domains-all-sorted-* 2> /dev/null + cd $LOOT_DIR/nmap/ && rm -f openports-all-sorted-* 2> /dev/null + cd $LOOT_DIR/nmap/ && rm -f livehosts-all-sorted-* 2> /dev/null + cd $LOOT_DIR/web/ 2> /dev/null + egrep -Hi 'HTTP/1.' headers-* 2> /dev/null | cut -d':' -f1 | sed "s/headers\-http\(\|s\)\-//g" | sed "s/\.txt//g" | sed "s/^\-.*$//" | sort -u > $LOOT_DIR/web/webhosts-sorted.txt 2> /dev/null + split -d -l $MAX_HOSTS -e $LOOT_DIR/web/webhosts-sorted.txt webhosts-all-sorted- 2> /dev/null + cd $LOOT_DIR/domains/ 2> /dev/null + split -d -l $MAX_HOSTS -e $LOOT_DIR/domains/domains-all-sorted.txt domains-all-sorted- 2> /dev/null + cd $LOOT_DIR/nmap/ 2> /dev/null + split -d -l $MAX_HOSTS -e $LOOT_DIR/nmap/openports-sorted.txt openports-all-sorted- 2> /dev/null + split -d -l $MAX_HOSTS -e $LOOT_DIR/nmap/livehosts-sorted.txt livehosts-all-sorted- 2> /dev/null + echo -e "$OKORANGE + -- --=[ Removing blank screenshots and files...$RESET" + chmod 777 -Rf $LOOT_DIR 2> /dev/null + cd $LOOT_DIR/screenshots/ + find $LOOT_DIR/screenshots/ -type f -size -9000c -exec rm -f {} \; + find $LOOT_DIR/nmap/ -type f -size -1c -exec rm -f {} \; + cd $LOOT_DIR + if [[ -f $SNIPER_PRO ]]; then + if [[ -f "$LOOT_DIR/notes/notepad.html" ]]; then + echo -n "" 2>/dev/null + else + cp "$INSTALL_DIR/pro/notepad.html" "$LOOT_DIR/notes/notepad.html" 2>/dev/null + PRE_NAME=$(echo $WORKSPACE | sed "s/\./-/g") + sed -i "s/notepad/notepad-$PRE_NAME/g" "$LOOT_DIR/notes/notepad.html" 2> /dev/null + fi + if [[ "$SN1PER_AUTOLOAD" = "1" ]] && [[ ! -f "$INSTALL_DIR/pro/settings.php" ]]; then + echo -e "$OKORANGE + -- --=[ Loading Sn1per Professional...$RESET" + source $INSTALL_DIR/pro.sh + $BROWSER $LOOT_DIR/sniper-report.html 2> /dev/null > /dev/null & + else + echo -e "$OKORANGE + -- --=[ Generating Sn1per Professional reports...$RESET" source $INSTALL_DIR/pro.sh - $BROWSER $LOOT_DIR/sniper-report.html 2> /dev/null > /dev/null & + fi else - echo -e "$OKORANGE + -- --=[ Generating Sn1per Professional reports...$RESET" - source $INSTALL_DIR/pro.sh + echo -e "$OKRED + -- --=[ Sn1per Professional is not installed. To download Sn1per Professional, go to https://xerosecurity.com. $RESET" + $BROWSER https://xerosecurity.com 2> /dev/null > /dev/null & fi - else - echo -e "$OKRED + -- --=[ Sn1per Professional is not installed. To download Sn1per Professional, go to https://xerosecurity.com. $RESET" - $BROWSER https://xerosecurity.com 2> /dev/null > /dev/null & + rm -f $UPDATED_TARGETS 2> /dev/null + touch $UPDATED_TARGETS 2> /dev/null + echo -e "$OKORANGE + -- --=[ Done!$RESET" fi - rm -f $UPDATED_TARGETS 2> /dev/null - touch $UPDATED_TARGETS 2> /dev/null - echo -e "$OKORANGE + -- --=[ Done!$RESET" } if [[ "$REIMPORT" = "1" ]]; then diff --git a/sniper.conf b/sniper.conf index 12a5226..d94b9f8 100644 --- a/sniper.conf +++ b/sniper.conf @@ -22,7 +22,7 @@ LOOT="1" # SN1PER PROFESSIONAL SETTINGS SNIPER_PRO_CONSOLE_OUTPUT="0" -SN1PER_AUTOLOAD="1" +SN1PER_AUTOLOAD="0" MAX_HOSTS="2000" # DEFAULT BROWSER @@ -39,6 +39,13 @@ OPENVAS_PORT="9390" OPENVAS_USERNAME="admin" OPENVAS_PASSWORD="" +# NESSUS CONFIG +NESSUS="0" +NESSUS_HOST="127.0.0.1:8834" +NESSUS_USERNAME="admin" +NESSUS_PASSWORD="" +NESSUS_POLICY_ID="c3cbcd46-329f-a9ed-1077-554f8c2af33d0d44f09d736969bf" + # METASPLOIT SCANNER CONFIG METASPLOIT_IMPORT="0" MSF_LHOST="127.0.0.1" @@ -109,11 +116,8 @@ FLYOVER_DELAY="10" NMAP_OPTIONS="--script-args http.useragent='' --open" # NMAP PORT CONFIGURATIONS -QUICK_PORTS="21,22,23,25,53,80,110,137,138,139,161,162,443,445,512,513,514,1099,1433,3306,4444,5000,5001,5104,5555,5432,5555,5800,5900,5901,6093,6095,6443,6667,7000,7001,7002,8009,8080,8081,8082,8089,8220,8888,8000,9080,10000,10250,49180" -DEFAULT_PORTS="1,10008,10050-10051,10080,10098-10099,10162,10202-10203,1024,10250,1030,1035,10443,105,10616,10628,1090,109-111,1098-1103,11000-11001,11099,11211,11234,1128-1129,113,11333,11460,1158,1199,12000,1211,12174,1220,12203,12221,123,1234,12345,12397,12401,1241,13,1300,13013,1311,13364,135,13500,1352,137-139,13838,14000,143,14330,1433-1435,1440,1471,1494,15000-15001,15200,1521,1530,1533,1581-1582,16000,1604,161,16102,162,16992,17185,1720,17200,1723,1755,179,1811,18881,18980,19,1900,19300,19810,20000,2000-2001,20010,2002,20031,20034,20101,20111,20171,20222,2049,2067,2100,2103,2121,21-23,2181,2199,2207,222,2222,22222,2323,23423,23472,2362,23791,2380-2381,23943,25,25000,25025,2525,2533,2598,26000,26122,26256,2638,264,27000,27015,27017,2780,27888,27960,2809,28222,28784,2947,2967,3000,30000,3037,3050,3057,30718,31001,31099,3128,3200,32022,3217,3268,3269,3273,32764,32913,3299,33000,3306,3310,3333,3389,34205,34443,3460,3465,3500,3628,3632,3690,37,37718,37777,3780,3790,38080,3817,38292,384,389,3900,4000,40007,4002,402,407,41025,41080,41523-41524,42,4322,4433,44334,443-446,4444-4445,44818,45230,465,4659,4672,4679,46823-46824,47001-47002,4800,48080,4848,48899,49,49152,49180,500,5000,50000-50004,5001,50013,50050,5009,502,5038,5040,50500-50504,5051,5060-5061,5093,5104,512-515,5168,5227,52302,523-524,5247,5250,52869,53,53413,5351,5353,5355,540,5400,5405,5432-5433,5466,548,5498,5520-5521,554,5554-5555,55553,5560,5580,5631-5632,5666,57772,5800,5814,587,5900-5910,5920,5984-5986,5999-6000,6002,6050,6060,6070,6080,6082,6093,6095,6101,6106,6112,6161,617,62078,623,62514,6262,631,6379,6405,6443,6502-6504,6542,655,65535,6660-6661,6667,67,6789,68,689,69,6905,6988,6996,7,7000-7001,7002,7021,705,7071,7080,7144,7181,7210,7272,7414,7426,7443,7510,7547,7579-7580,7700,771,7770,7777-7778,7787,7800-7801,783,7878-7879,7890,7902,79-81,8000-8001,8008,8009,8014,8020,8023,8028,8030,8050-8051,8080-8082,8085-8088,8089,8090-8091,8095,8101,8161,8180,8205,8220,8222,8300,8303,831,8333,8400,8443-8445,85,8503,8642,8686,8701,873,8787,88,8800,8812,8834,888,8880,8888-8890,8899,8901-8903,8980,8983,8999-9005,9,9002,9010,902,9050,9080-9081,9084,9090,9099-9100,910,9111,912,9152,9200,921,9256,9300,9390-9391,9495,9500,9711,9788,9809-9815,9855,9875,9876,9910,993,995,998-1000,9991,9999-10001,U:137,U:138,U:139,U:161,U:162,U:2049,U:389,U:500,U:520,U:53,U:67,U:68,U:69,U:88" -DEFAULT_TCP_PORTS="10008,10050-10051,10080,10098-10099,10162,10202-10203,1024,10250,1030,1035,10443,105,10616,10628,1090,109-111,1098-1103,11000-11001,11099,11211,11234,1128-1129,113,11333,11460,1158,1199,12000,1211,12174,1220,12203,12221,123,1234,12345,12397,12401,1241,13,1300,13013,1311,13364,135,13500,1352,137-139,13838,14000,143,14330,1433-1435,1440,1471,1494,15000-15001,15200,1521,1530,1533,1581-1582,16000,1604,161,16102,162,16992,17185,1720,17200,1723,1755,179,1811,18881,18980,19,1900,19300,19810,20000,2000-2001,20010,2002,20031,20034,20101,20111,20171,20222,2049,2067,2100,2103,2121,21-23,2181,2199,2207,222,2222,22222,2323,23423,23472,2362,23791,2380-2381,23943,25,25000,25025,2525,2533,2598,26000,26122,26256,2638,264,27000,27015,27017,2780,27888,27960,2809,28222,28784,2947,2967,3000,30000,3037,3050,3057,30718,31001,31099,3128,3200,32022,3217,3268,3269,3273,32764,32913,3299,33000,3306,3310,3333,3389,34205,34443,3460,3465,3500,3628,3632,3690,37,37718,37777,3780,3790,38080,3817,38292,384,389,3900,4000,40007,4002,402,407,41025,41080,41523-41524,42,4322,4433,44334,443-446,4444-4445,44818,45230,465,4659,4672,4679,46823-46824,47001-47002,4800,48080,4848,48899,49,49152,49180,500,5000,50000-50004,5001,50013,50050,5009,502,5038,5040,50500-50504,5051,5060-5061,5093,5104,512-515,5168,5227,52302,523-524,5247,5250,52869,53,53413,5351,5353,5355,540,5400,5405,5432-5433,5466,548,5498,5520-5521,554,5554-5555,55553,5560,5580,5631-5632,5666,57772,5800,5814,587,5900-5910,5920,5984-5986,5999-6000,6002,6050,6060,6070,6080,6082,6093,6095,6101,6106,6112,6161,617,62078,623,62514,6262,631,6379,6405,6443,6502-6504,6542,655,65535,6660-6661,6667,67,6789,68,689,69,6905,6988,6996,7,7000-7001,7002,7021,705,7071,7080,7144,7181,7210,7272,7414,7426,7443,7510,7547,7579-7580,7700,771,7770,7777-7778,7787,7800-7801,783,7878-7879,7890,7902,79-81,8000-8001,8008,8009,8014,8020,8023,8028,8030,8050-8051,8080-8082,8085-8088,8089,8090-8091,8095,8101,8161,8180,8205,8220,8222,8300,8303,831,8333,8400,8443-8445,85,8503,8642,8686,8701,873,8787,88,8800,8812,8834,888,8880,8888-8890,8899,8901-8903,8980,8983,8999-9005,9,9002,9010,902,9050,9080-9081,9084,9090,9099-9100,910,9111,912,9152,9200,921,9256,9300,9390-9391,9495,9500,9711,9788,9809-9815,9855,9875,9876,9910,993,995,998-1000,9991,9999-10001" -TOP_1000_PORTS="1,100,1000,10000,10001,10002,10003,10004,10009,1001,10010,10012,1002,10024,10025,1007,10082,1009,1010,1011,10180,1021,10215,1022,1023,1024,10243,1025,1026,1027,1028,1029,1030,1031,1032,1033,1034,1035,1036,1037,1038,1039,1040,1041,1042,1043,1044,1045,1046,1047,1048,1049,1050,1051,1052,1053,1054,1055,1056,10566,1057,1058,1059,106,1060,1061,10616,10617,1062,10621,10626,10628,10629,1063,1064,1065,1066,1067,1068,1069,1070,1071,1072,1073,1074,1075,1076,1077,10778,1078,1079,1080,1081,1082,1083,1084,1085,1086,1087,1088,1089,109,1090,1091,1092,1093,1094,1095,1096,1097,1098,1099,110,1100,1102,1104,1105,1106,1107,1108,111,1110,1111,11110,11111,1112,1113,1114,1117,1119,1121,1122,1123,1124,1126,113,1130,1131,1132,1137,1138,1141,1145,1147,1148,1149,1151,1152,1154,1163,1164,1165,1166,1169,1174,1175,1183,1185,1186,1187,119,1192,11967,1198,1199,12000,1201,1213,1216,1217,12174,1218,12265,1233,1234,12345,1236,1244,1247,1248,125,1259,1271,1272,1277,1287,1296,13,1300,1301,1309,1310,1311,1322,1328,1334,13456,135,1352,13722,13782,13783,139,14000,1417,14238,143,1433,1434,144,1443,14441,14442,1455,146,1461,1494,1500,15000,15002,15003,15004,1501,1503,1521,1524,1533,1556,15660,15742,1580,1583,1594,1600,16000,16001,16012,16016,16018,16080,161,16113,163,1641,1658,1666,1687,1688,16992,16993,17,1700,1717,1718,1719,1720,1721,1723,1755,1761,1782,1783,17877,179,17988,1801,18040,1805,18101,1812,1839,1840,1862,1863,1864,1875,18988,19,1900,19101,1914,19283,19315,1935,19350,1947,1971,1972,1974,19780,19801,1984,19842,199,1998,1999,20,2000,20000,20005,2001,2002,2003,20031,2004,2005,2006,2007,2008,2009,2010,2013,2020,2021,2022,20221,20222,2030,2033,2034,2035,2038,2040,2041,2042,2043,2045,2046,2047,2048,2049,2065,2068,20828,2099,21,2100,2103,2105,2106,2107,211,2111,2119,212,2121,2126,2135,2144,21571,2160,2161,2170,2179,2190,2191,2196,22,2200,222,2222,2251,2260,2288,22939,23,2301,2323,23502,2366,2381,2382,2383,2393,2394,2399,24,2401,24444,24800,2492,25,2500,2522,2525,254,255,2557,256,25734,25735,259,26,2601,2602,2604,2605,2607,2608,26214,2638,264,27000,2701,27017,2702,2710,2717,2718,2725,27352,27353,27355,27356,27715,280,2800,2809,2811,28201,2869,2875,2909,2910,2920,2967,2968,2998,3,30,3000,30000,3001,3003,3005,3006,3007,301,3011,3013,3017,3030,3031,3052,306,3071,30718,3077,30951,31038,311,3128,31337,3168,32,3211,3221,3260,3261,3268,3269,32768,32769,32770,32771,32772,32773,32774,32775,32776,32777,32778,32779,32780,32781,32782,32783,32784,32785,3283,33,3300,3301,3306,3322,3323,3324,3325,3333,33354,3351,3367,3369,3370,3371,3372,3389,33899,3390,340,3404,34571,34572,34573,3476,3493,3517,3527,3546,35500,3551,3580,3659,366,3689,3690,37,3703,3737,3766,3784,3800,3801,3809,3814,3826,3827,3828,38292,3851,3869,3871,3878,3880,3889,389,3905,3914,3918,3920,3945,3971,3986,3995,3998,4,4000,4001,4002,4003,4004,4005,4006,40193,4045,406,407,40911,4111,4125,4126,4129,41511,416,417,42,4224,4242,425,42510,427,4279,43,4321,4343,44176,443,444,4443,4444,44442,44443,4445,4446,4449,445,44501,45100,4550,4567,458,464,465,4662,48080,481,4848,4899,49,4900,49152,49153,49154,49155,49156,49157,49158,49159,49160,49161,49163,49165,49167,49175,49176,49400,497,4998,49999,500,5000,50000,50001,50002,50003,50006,5001,5002,5003,5004,5009,5030,50300,5033,50389,5050,50500,5051,5054,5060,5061,50636,5080,50800,5087,5100,5101,5102,51103,512,5120,513,514,51493,515,5190,5200,5214,5221,5222,5225,5226,524,52673,5269,5280,52822,52848,52869,5298,53,5357,54045,5405,541,5414,543,5431,5432,54328,544,5440,545,548,5500,55055,55056,5510,554,5544,555,5550,5555,55555,5560,55600,5566,563,5631,5633,5666,56737,56738,5678,5679,5718,57294,5730,57797,5800,5801,5802,58080,5810,5811,5815,5822,5825,5850,5859,5862,587,5877,5900,5901,5902,5903,5904,5906,5907,5910,5911,5915,5922,5925,593,5950,5952,5959,5960,5961,5962,5963,5987,5988,5989,5998,5999,6,6000,6001,6002,60020,6003,6004,6005,6006,6007,6009,6025,60443,6059,6100,6101,6106,6112,6123,6129,61532,6156,616,617,61900,62078,625,631,63331,6346,636,6389,646,64623,64680,648,65000,6502,6510,65129,65389,6543,6547,6565,6566,6567,6580,6646,666,6666,6667,6668,6669,667,668,6689,6692,6699,6779,6788,6789,6792,683,6839,687,6881,6901,691,6969,7,70,700,7000,7001,7002,7004,7007,7019,7025,705,7070,7100,7103,7106,711,714,720,7200,7201,722,726,7402,7435,7443,749,7496,7512,7625,7627,765,7676,7741,777,7777,7778,7800,783,787,79,7911,7920,7921,7937,7938,7999,80,800,8000,8001,8002,8007,8008,8009,801,8010,8011,8021,8022,8031,8042,8045,808,8080,8081,8082,8083,8084,8085,8086,8087,8088,8089,8090,8093,8099,81,8100,8180,8181,8192,8193,8194,82,8200,8222,8254,8290,8291,8292,83,8300,8333,8383,84,8400,8402,843,8443,85,8500,8600,8649,8651,8652,8654,8701,873,88,880,8800,8873,888,8888,8899,89,898,8994,9,90,900,9000,9001,9002,9003,9009,901,9010,9011,902,903,9040,9050,9071,9080,9081,9090,9091,9099,9100,9101,9102,9103,911,9110,9111,912,9200,9207,9220,9290,9415,9418,9485,9500,9502,9503,9535,9575,9593,9594,9595,9618,9666,981,987,9876,9877,9878,9898,99,990,9900,9917,992,9929,993,9943,9944,995,9968,999,9998,9999" -NMAP_TOP_1000="1,3-4,6-7,9,13,17,19-26,30,32-33,37,42-43,49,53,70,79-85,88-90,99-100,106,109-111,113,119,125,135,139,143-144,146,161,163,179,199,211-212,222,254-256,259,264,280,301,306,311,340,366,389,406-407,416-417,425,427,443-445,458,464-465,481,497,500,512-515,524,541,543-545,548,554-555,563,587,593,616-617,625,631,636,646,648,666-668,683,687,691,700,705,711,714,720,722,726,749,765,777,783,787,800-801,808,843,873,880,888,898,900-903,911-912,981,987,990,992-993,995,999-1002,1007,1009-1011,1021-1100,1102,1104-1108,1110-1114,1117,1119,1121-1124,1126,1130-1132,1137-1138,1141,1145,1147-1149,1151-1152,1154,1163-1166,1169,1174-1175,1183,1185-1187,1192,1198-1199,1201,1213,1216-1218,1233-1234,1236,1244,1247-1248,1259,1271-1272,1277,1287,1296,1300-1301,1309-1311,1322,1328,1334,1352,1417,1433-1434,1443,1455,1461,1494,1500-1501,1503,1521,1524,1533,1556,1580,1583,1594,1600,1641,1658,1666,1687-1688,1700,1717-1721,1723,1755,1761,1782-1783,1801,1805,1812,1839-1840,1862-1864,1875,1900,1914,1935,1947,1971-1972,1974,1984,1998-2010,2013,2020-2022,2030,2033-2035,2038,2040-2043,2045-2049,2065,2068,2099-2100,2103,2105-2107,2111,2119,2121,2126,2135,2144,2160-2161,2170,2179,2190-2191,2196,2200,2222,2251,2260,2288,2301,2323,2366,2381-2383,2393-2394,2399,2401,2492,2500,2522,2525,2557,2601-2602,2604-2605,2607-2608,2638,2701-2702,2710,2717-2718,2725,2800,2809,2811,2869,2875,2909-2910,2920,2967-2968,2998,3000-3001,3003,3005-3007,3011,3013,3017,3030-3031,3052,3071,3077,3128,3168,3211,3221,3260-3261,3268-3269,3283,3300-3301,3306,3322-3325,3333,3351,3367,3369-3372,3389-3390,3404,3476,3493,3517,3527,3546,3551,3580,3659,3689-3690,3703,3737,3766,3784,3800-3801,3809,3814,3826-3828,3851,3869,3871,3878,3880,3889,3905,3914,3918,3920,3945,3971,3986,3995,3998,4000-4006,4045,4111,4125-4126,4129,4224,4242,4279,4321,4343,4443-4446,4449,4550,4567,4662,4848,4899-4900,4998,5000-5004,5009,5030,5033,5050-5051,5054,5060-5061,5080,5087,5100-5102,5120,5190,5200,5214,5221-5222,5225-5226,5269,5280,5298,5357,5405,5414,5431-5432,5440,5500,5510,5544,5550,5555,5560,5566,5631,5633,5666,5678-5679,5718,5730,5800-5802,5810-5811,5815,5822,5825,5850,5859,5862,5877,5900-5904,5906-5907,5910-5911,5915,5922,5925,5950,5952,5959-5963,5987-5989,5998-6007,6009,6025,6059,6100-6101,6106,6112,6123,6129,6156,6346,6389,6502,6510,6543,6547,6565-6567,6580,6646,6666-6669,6689,6692,6699,6779,6788-6789,6792,6839,6881,6901,6969,7000-7002,7004,7007,7019,7025,7070,7100,7103,7106,7200-7201,7402,7435,7443,7496,7512,7625,7627,7676,7741,7777-7778,7800,7911,7920-7921,7937-7938,7999-8002,8007-8011,8021-8022,8031,8042,8045,8080-8090,8093,8099-8100,8180-8181,8192-8194,8200,8222,8254,8290-8292,8300,8333,8383,8400,8402,8443,8500,8600,8649,8651-8652,8654,8701,8800,8873,8888,8899,8994,9000-9003,9009-9011,9040,9050,9071,9080-9081,9090-9091,9099-9103,9110-9111,9200,9207,9220,9290,9415,9418,9485,9500,9502-9503,9535,9575,9593-9595,9618,9666,9876-9878,9898,9900,9917,9929,9943-9944,9968,9998-10004,10009-10010,10012,10024-10025,10082,10180,10215,10243,10566,10616-10617,10621,10626,10628-10629,10778,11110-11111,11967,12000,12174,12265,12345,13456,13722,13782-13783,14000,14238,14441-14442,15000,15002-15004,15660,15742,16000-16001,16012,16016,16018,16080,16113,16992-16993,17877,17988,18040,18101,18988,19101,19283,19315,19350,19780,19801,19842,20000,20005,20031,20221-20222,20828,21571,22939,23502,24444,24800,25734-25735,26214,27000,27352-27353,27355-27356,27715,28201,30000,30718,30951,31038,31337,32768-32785,33354,33899,34571-34573,35500,38292,40193,40911,41511,42510,44176,44442-44443,44501,45100,48080,49152-49161,49163,49165,49167,49175-49176,49400,49999-50003,50006,50300,50389,50500,50636,50800,51103,51493,52673,52822,52848,52869,54045,54328,55055-55056,55555,55600,56737-56738,57294,57797,58080,60020,60443,61532,61900,62078,63331,64623,64680,65000,65129,65389,280,4567,7001,8008,9080" +QUICK_PORTS="21,22,80,443,8000,8080,8443" +DEFAULT_PORTS="10000,1099,110,111,123,135,137,139,1433,1524,161,162,16992,2049,21,2121,2181,22,23,25,264,27017,27018,27019,28017,3128,3306,3310,3389,3632,389,443,4443,445,49152,49180,500,512,513,514,53,5432,5555,5800,5900,5984,623,624,6667,67,68,69,7001,79,80,8000,8001,8080,8180,8443,8888,9200,9495" DEFAULT_UDP_PORTS="53,67,68,69,88,123,161,162,137,138,139,389,500,520,2049" FULL_PORTSCAN_PORTS="T:1-65535,U:53,U:67,U:68,U:69,U:88,U:161,U:162,U:137,U:138,U:139,U:389,U:500,U:520,U:2049" THREADS="100" @@ -191,7 +195,7 @@ WEBSCREENSHOT="1" SPOOF_CHECK="1" # RECON PLUGINS -SUBHIJACK_CHECK="1" +SUBHIJACK_CHECK="0" SLURP="1" SUBLIST3R="1" AMASS="1" @@ -202,7 +206,7 @@ SUBOVER="1" PROJECT_SONAR="1" CENSYS_SUBDOMAINS="0" SUBNET_RETRIEVAL="1" -SUBJACK="1" +SUBJACK="0" ALT_DNS="0" MASS_DNS="0" DNSGEN="0"