Skip to content

Instantly share code, notes, and snippets.

@samduy
Created December 31, 2017 13:22
Show Gist options
  • Select an option

  • Save samduy/4567ac7bbe90efa129f5fdc51fef7eda to your computer and use it in GitHub Desktop.

Select an option

Save samduy/4567ac7bbe90efa129f5fdc51fef7eda to your computer and use it in GitHub Desktop.

Revisions

  1. samduy created this gist Dec 31, 2017.
    11 changes: 11 additions & 0 deletions send_http_msg.py
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,11 @@
    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()