#1
Code:
#!usr/bin/expect -f
That statement is missing the leading slash for an absolute path. It should be:
#2
I suggest you (a) put the executable to spawn in double quotes and (b) as shown in most of the examples, give an explicit path to scapy. For instance:
Code:
spawn "/usr/local/bin/scapy"
#3
Expect scripts do not need semicolons at the end of each line
#4
Code:
send "a=IP(dst="192.168.0.111")/TCP(dport=(1,1024),flags="S")\r";
You have a problem here. You are trying to use double quotes within the quotes used for the send command. You need to escape the internal double quotes. If you do not, expect may get confused as to what text should sent. For instance:
Code:
send "a=IP(dst=\"192.168.0.111\")/TCP(dport=(1,1024),flags=\"S\")\r"
EDIT:
#5
Your expect script will also need an 'interact' command or another 'expect "<something here>"' command after your send command. Without one of those, the expect script will terminate immediately after sending the string--which will probably cause the command you sent to have no effect.