Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/expect -f
- spawn telnet 10.15.160.69 #using a test IP, later it will read IP's from a list.
- expect {
- "Login: " {
- send "ABCr"
- exp_continue
- }
- "Password: " {
- send "ABCr"
- exp_continue
- }
- "> " {
- send "passwdr"
- expect "Username: "
- send "ABCr"
- expect "Password: "
- send "ABCr"
- expect "New Password: "
- send "n3wp@ssr"
- expect "Confirm New Password: "
- send "n3wp@ssr"
- expect "> "
- send "saver"
- }
- }
- Trying 10.15.160.69...
- Connected to 10.15.160.69.
- Escape character is '^]'.
- BCM96816 Broadband Router
- Login:
- Password:
- Login incorrect. Try again.
- Login:
- Password:
- Login incorrect. Try again.
- Login:
- Password:
- Authorization failed after trying 3 times!!!.
- Login: Password:
- Login incorrect. Try again.
- Login:
- Password:
- Login incorrect. Try again.
- Login:
- Password:
- Authorization failed after trying 3 times!!!.
- Login:
- Password:
- Login incorrect. Try again.
- #!/bin/bash
- for host in $(cat ipnmap.txt);do
- echo "${host}";
- /usr/bin/expect passchange1.sh $host
- done
- #!/usr/bin/expect
- proc abort { } { send_user "Timeout!" ; exit 2 }
- set address [lindex $argv 0]
- spawn telnet $address
- expect timeout abort "Login: "
- set timeout 5
- send "ABCr"
- expect timeout abort "Password: "
- send "ABCr"
- expect timeout abort "Login incorrect" exit "> "
- send "passwdr"
- expect timeout abort "Username: "
- send "ABCr"
- expect timeout abort "Password: "
- send "ABCr"
- expect timeout abort "New Password: "
- send "n3wp@ssr"
- expect timeout abort "Confirm New Password: "
- send "n3wp@ssr"
- expect timeout abort "> "
- send "saver"
- expect timeout abort "> "
- send "quitr"
- expect timeout abort eof
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement