when i made a 3 handshake with ubuntu in VMware return package R
<pre><code>#!/usr/bin/python
from scapy.all import *

def findWeb():
    a = sr1(IP(dst="8.8.8.8")/UDP()/DNS(qd=DNSQR(qname="www.google.com")),verbose=0)
    return a[DNSRR].rdata

def sendPacket(dst,src):
    ip = IP(dst = dst)
    SYN = TCP(sport=1500, dport=80, flags='S')
    SYNACK = sr1(ip/SYN)

    my_ack = SYNACK.seq + 1
    ACK = TCP(sport=1050, dport=80, flags='A', 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)


    http = sr1(ip/TCP()/'GET /index.html HTTP/1.0 \n\n',verbose=0)
    print http.show()

src = '10.0.0.24'
dst = findWeb()
sendPacket(dst,src)
</code></pre>

<p>I'm trying to do HTTP packets with SCAPY
I am using UBUNTU on VMwaer</p>

<p>The problem is that every time I send messages I have RESET
How do we fix it?</p>

<p>Thanks</p>

<p><a href="http://i.stack.imgur.com/0eJdj.png" rel="nofollow">sniff package image</a></p>

<p>Few things I notice wrong. 
1. You have your sequence number set statically (seq=11) which is wrong. Sequence numbers are always randomly generated and they must be used as per RFC793. So the sequence should be = SYNACK[TCP].ack</p>

<ol start="2">
<li><p>You set your source port as 1500 during SYN packet, but then you use it as 1050 (typo?)</p></li>
<li><p>You don't need extra payload/PUSH. </p></li>
</ol>

<p>Also, have a look at these threads: </p>

<p><a href="http://stackoverflow.com/questions/37683026/how-to-create-http-get-request-scapy">How to create HTTP GET request Scapy?</a></p>

<p><a href="http://stackoverflow.com/questions/4750793/python-scapy-or-the-like-how-can-i-create-an-http-get-request-at-the-packet-leve">Python-Scapy or the like-How can I create an HTTP GET request at the packet level</a></p>

python http package virtual-machine scapy