1

Im trying to send get request to a certain website and save the source code that the server replay to me but after im doing the tree way handshake the connection is restarted

this is my code thanks for everyone...:

def Make_GET(URL):
 Dns_File.seek(16)
 ans = Find_IP(URL)
 if(ans == 1):
  print "You entered something different then Domain"
 elif ans == -1:
  print "Not found"
 else:  
  print "The ip of the wanted domain is: "+ ans 
  ip_send=ans
  SYN = IP(dst=ip_send) / TCP(dport=80,sport=1025, flags='S',seq=1000)
  SYN_ACK = sr1(SYN)
  SYN_ACK.show()
  print "check 1"
  print SYN_ACK[TCP].ack+1, SYN_ACK[TCP].seq + 1
  get_packet=sr1(IP(dst=ip_send)/TCP(dport=80, sport=1025,
             seq=SYN_ACK[TCP].ack+1, ack=SYN_ACK[TCP].seq + 1, flags='A'))
  get_packet.show()
  print "check 2"

this is what i see when im sniffing the packets in wire shark:click here

alon
  • 13
  • 5
  • Why are you working in such a low level, instead of working with libraries such as `requests` that turn this code to around 3 lines? – DeepSpace Jun 13 '16 at 14:31
  • i cant.... my task is to do it in a sniffer way is forbidden to use requests library i know this library... @DeepSpace – alon Jun 13 '16 at 14:38
  • You are sending a RST segment ending the connection. Take a look at this post. [link](http://stackoverflow.com/q/37683026/5314053) – Noob123 Jun 13 '16 at 15:42

0 Answers0