Skip to content

Instantly share code, notes, and snippets.

@samduy
Created December 31, 2017 13:22
Show Gist options
  • Save samduy/4567ac7bbe90efa129f5fdc51fef7eda to your computer and use it in GitHub Desktop.
Save samduy/4567ac7bbe90efa129f5fdc51fef7eda to your computer and use it in GitHub Desktop.
Send HTTP Message
from scapy.all import *
# Add iptables rule to block attack box from sending RSTs
# Create web.txt with entire GET/POST packet data
fileweb = open("web.txt",'r')
data = fileweb.read()
ip = IP(dst="<ip>")
SYN=ip/TCP(rport=RandNum(6000,7000),dport=80,flags="S",seq=4)
SYNACK = sr1(SYN)
ACK=ip/TCP(sport=SYNACK.dport,dport=80,flags="A",seq=SYNACK.ack,ack=SYNACK.seq+1)/data
reply,error = sr(ACK)
print reply.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment