Created
October 7, 2015 03:45
-
-
Save averagesecurityguy/2c9384c30689ae344424 to your computer and use it in GitHub Desktop.
Scapy Issue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from scapy.all import * | |
http = IP(dst="10.0.2.15)/TCP(dport=80)/"GET /index.html HTTP/1.0\r\n\r\n" | |
send(http) | |
sendp(http, iface="eth0") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo tcpdump -i eth0 | |
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode | |
listening on eth0, link-type EN10MB (Ethernet), capture size 262144 bytes | |
23:33:25.286185 00:00:40:06:62:96 (oui Unknown) > 45:00:00:44:00:01 (oui Unknown), ethertype Unknown (0x0a00), length 68: | |
0x0000: 020f 0a00 020f 0014 0050 0000 0000 0000 .........P...... | |
0x0010: 0000 5002 2000 b589 0000 4745 5420 2f69 ..P.......GET./i | |
0x0020: 6e64 6578 2e68 746d 6c20 4854 5450 2f31 ndex.html.HTTP/1 | |
0x0030: 2e30 0d0a 0d0a .0.... | |
I had the quotes correct in my script. Not sure what happened when creating the gist. Scapy tells me both packets are sent but I only see one in tcpdump when listening on eth0. If I listen on the loopback interface I see the packet from send but not the packet from sendp. If I listen on eth0 I see the packet from sendp but not send. I guess send defaults to loopback?
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi Stephen,
Looks like you forgot to quote the dst correctly. I tested the code on my system and the send works correctly.