when i made a 3 handshake with ubuntu in VMware return package R
Question: 
    #!/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)
    

I'm trying to do HTTP packets with SCAPY I am using UBUNTU on VMwaer

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

Thanks

[sniff package image](http://i.stack.imgur.com/0eJdj.png)


Answer: 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

  2. You set your source port as 1500 during SYN packet, but then you use it as 1050 (typo?)

  3. You don't need extra payload/PUSH. 

Also, have a look at these threads:

[How to create HTTP GET request
Scapy?](http://stackoverflow.com/questions/37683026/how-to-create-http-get-
request-scapy)

[Python-Scapy or the like-How can I create an HTTP GET request at the packet
level](http://stackoverflow.com/questions/4750793/python-scapy-or-the-like-
how-can-i-create-an-http-get-request-at-the-packet-leve)

