Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/expect -f
- set timeout -1
- spawn $env(SHELL)
- match_max 100000
- expect -exact "use@home:~$ "
- send -- "telnet xxx.xxx.xxx.xxx"
- expect -exact "telnet xxx.xxx.xxx.xxx"
- send -- "r"
- expect -exact "r
- Trying xxx.xxx.xxx.xxx...r
- Connected to xxx.xxx.xxx.xxx.r
- Escape character is '^]'.r
- r
- r
- User Access Verificationr
- r
- Username: "
- send -- "exampleuser"
- expect -exact "exampleuser"
- send -- "r"
- expect -exact "r
- Password: "
- send -- "examplepasswordr"
- expect -exact "r
- ROUTERCISCO>"
- send -- "enabler"
- expect -exact "enabler
- Password: "
- send -- "examplepasswordr"
- expect -exact "r
- ROUTERCISCO#"
- send -- "terminal length 0"
- expect -exact "terminal length 0"
- send -- "r"
- expect -exact "r
- ROUTERCISCO#"
- send -- "show running-config"
- expect -exact "show running-config"
- send -- "r"
- expect -exact "r
- !r
- !r
- !r
- !r
- endr
- r
- ROUTERCISCO#"
- send -- "exitr"
- expect -exact "exitr
- Connection closed by foreign host.r
- use@home:~$ "
- send -- ""
- expect eof
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement