Created
September 23, 2013 13:18
-
-
Save nboubakr/6670282 to your computer and use it in GitHub Desktop.
Three Way Handshaking using Scapy
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
#!/usr/bin/env python | |
#! -*- coding: utf-8 -*- | |
# Three Way Handshaking using Scapy | |
from scapy.all import * | |
ip = IP(src="192.168.0.2", dst="172.16.24.1") | |
SYN = TCP(sport=1500, dport=80, flags='S', seq=100) | |
SYNACK = sr1(ip/SYN) | |
my_ack = SYNACK.seq + 1 | |
ACK = TCP(sport=1050, dport=80, flags='A', seq=101, ack=my_ack) | |
send(ip/ACK) | |
payload = "stuff" | |
PUSH = TCP(sport=1050, dport=80, flags='PA', seq=11, ack=my_ack) | |
send(ip/PUSH/payload) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
issue