diff --git a/README.md b/README.md index 2cf1a42..394f931 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,10 @@ This repository is for public my work on MS17-010. I have no plan to do any supp * **mysmb.py** Extended Impacket SMB class for easier to exploit MS17-010 bugs * **npp_control.py** PoC for controlling nonpaged pool allocation with session setup command * **zzz_exploit.py** Exploit for Windows 2000 and later (requires access to named pipe) + * **chkip** Check ip list for vulnerable ips . (it will create a file with the vulnerable ips) +** Usage : +* chkip myiplist.txt ## Anonymous user diff --git a/chkip b/chkip new file mode 100755 index 0000000..e25ef07 --- /dev/null +++ b/chkip @@ -0,0 +1,68 @@ +#!/bin/bash +green='\033[92m' +red='\e[1;31m' +yellow='\e[0;33m' +path=$(pwd) +lt=$1 +chkip() { +python checker.py $var > $lg 2>&1 + +# ip file to be created in current path with vulnerable ips +ipl=$path/iplist.txt + +# Check from output if connection to ip had a timeout +gtdata=$(cat $lg | grep "timeout") +if [[ ! -z $gtdata ]] +then +echo -e $yellow "Connection to $var Time Out" +else + +# timeout was not recieved , so check if ip is vulnerable +if [ -f $ipl ] +then +gtdata=$(cat $lg | grep "Ok") +if [[ -z $gtdata ]] +then +echo -e $red "IP $var not vulnerable" +else +echo -e $green "IP $var Vulnerable" +cp=$(cat $lg) +echo "" >> $ipl +echo $var >> $ipl +echo $cp >> $ipl +fi +else +gtdata=$(cat $lg | grep "Ok") +if [[ -z $gtdata ]] +then +echo -e $red "IP $var not vulnerable" +else +echo -e $green "IP $var Vulnerable" +cp=$(cat $lg) +echo "Vulnerable IPS to Eternal Blue & vulnerable services" > $ipl +echo "" >> $ipl +echo $var >> $ipl +echo $cp >> $ipl +fi +fi +fi +} +if [ -z $lt ] +then +echo "you must input an ip list to check" +echo "" +echo "Example: chkip /myiplist.txt" +exit 1 +else +ips=$(cat "$lt" | wc -l) +echo "" +echo "Going to check $ips ips " +for i in $(seq "$ips") +do +lg=$path/log.txt +rm $lg >/dev/null 2>&1 +var=$(cat "$lt" | awk -v nb=$i 'NR==nb') +echo -e $green "checking ip $var" +chkip +done +fi \ No newline at end of file diff --git a/mysmb.pyc b/mysmb.pyc new file mode 100644 index 0000000..7b97d89 Binary files /dev/null and b/mysmb.pyc differ diff --git a/requirements b/requirements new file mode 100644 index 0000000..ce29b73 --- /dev/null +++ b/requirements @@ -0,0 +1,4 @@ +* Required libraries : +python-impacket +python-crypto +python-pyasn1-modules