Advertisement
Guest User

Untitled

a guest
Dec 3rd, 2016
247
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.62 KB | None | 0 0
  1. #!/usr/bin/expect -f
  2.  
  3. spawn telnet 10.15.160.69 #using a test IP, later it will read IP's from a list.
  4.  
  5. expect {
  6.  
  7. "Login: " {
  8. send "ABCr"
  9. exp_continue
  10. }
  11. "Password: " {
  12.  
  13. send "ABCr"
  14. exp_continue
  15. }
  16.  
  17. "> " {
  18.  
  19. send "passwdr"
  20. expect "Username: "
  21. send "ABCr"
  22. expect "Password: "
  23. send "ABCr"
  24. expect "New Password: "
  25. send "n3wp@ssr"
  26. expect "Confirm New Password: "
  27. send "n3wp@ssr"
  28. expect "> "
  29. send "saver"
  30.  
  31. }
  32. }
  33.  
  34. Trying 10.15.160.69...
  35. Connected to 10.15.160.69.
  36. Escape character is '^]'.
  37. BCM96816 Broadband Router
  38. Login:
  39. Password:
  40. Login incorrect. Try again.
  41. Login:
  42. Password:
  43. Login incorrect. Try again.
  44. Login:
  45. Password:
  46. Authorization failed after trying 3 times!!!.
  47.  
  48. Login: Password:
  49. Login incorrect. Try again.
  50. Login:
  51. Password:
  52. Login incorrect. Try again.
  53. Login:
  54. Password:
  55. Authorization failed after trying 3 times!!!.
  56. Login:
  57. Password:
  58. Login incorrect. Try again.
  59.  
  60. #!/bin/bash
  61.  
  62. for host in $(cat ipnmap.txt);do
  63. echo "${host}";
  64.  
  65. /usr/bin/expect passchange1.sh $host
  66. done
  67.  
  68. #!/usr/bin/expect
  69. proc abort { } { send_user "Timeout!" ; exit 2 }
  70. set address [lindex $argv 0]
  71. spawn telnet $address
  72. expect timeout abort "Login: "
  73. set timeout 5
  74. send "ABCr"
  75. expect timeout abort "Password: "
  76. send "ABCr"
  77. expect timeout abort "Login incorrect" exit "> "
  78. send "passwdr"
  79. expect timeout abort "Username: "
  80. send "ABCr"
  81. expect timeout abort "Password: "
  82. send "ABCr"
  83. expect timeout abort "New Password: "
  84. send "n3wp@ssr"
  85. expect timeout abort "Confirm New Password: "
  86. send "n3wp@ssr"
  87. expect timeout abort "> "
  88. send "saver"
  89. expect timeout abort "> "
  90. send "quitr"
  91. expect timeout abort eof
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement