Expect: Difference between revisions
m
m (Protected "Expect" ([Edit=Allow only logged in users] (indefinite) [Move=Allow only logged in users] (indefinite) [Delete=Allow only logged in users] (indefinite))) |
(m) |
||
Line 3:
<br />
= Basics =
Installing Expect
=Expect script to ARP Ping=▼
{{UC}}
= Scripts =
<pre>
#!/usr/bin/expect
set timeout 20
spawn telnet 192.200.200.201
Line 18 ⟶ 28:
send "0\r"
exit
</pre>
Cron Entry
<pre>
#!/usr/bin/expect
spawn ssh nsroot@10.107.88.78
expect "Password:"
Line 38 ⟶ 48:
send "^C\r"
exit
</pre>
▲=TCP three-way handshake by hand using expect=
<pre>
#
set SYN 0x02
set RST 0x04
Line 52 ⟶ 66:
set window 4096
#
set myip 10.10.10.123
set mymac [random mac]
Line 113 ⟶ 127:
}
#
#
# $tcp(ack) and the server's is $tcp(seq) + 1.
#
|