Hello guest, if you read this it means you are not registered. Click here to register in a few simple steps, you will enjoy all features of our Forum.
Bottom Page

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
FIN scan with scapy
#1
I'm trying to make a FIN scan with python3.5 using scapy, I send a FIN packet and in case the port is closed I should get a RST packet back, in case it is opened the server should ignore my request. The problem is I'm not getting anything at all, nothing in resp part of the sending function. The same thing happens when I try to do a xmas scan (FPU). I've already tried with several hosts but none seems to work. What am I doing wrong ? Here's the code :

...
def TCP_Fin():
    ip_p = IP(dst=host_ip)
    tcp_p = TCP(dport=(1,100),flags='F')
    packets = ip_p/tcp_p
    resp, non_resp = sr(packets,timeout=0.5)
    for item in non_resp :
        print('[-]Port:',item.sport,'closed)
    for sent,recv in resp: # I DO NOt get any recv packets
        if recv[1].flags == 4 : # 4 == RST packet
            print('[+]Port:',sent[1].dport,'closed, but !port service on!')
        if recv[1].flags != 4 :
            print('[+]Port:',sent[1].dport,'opened')
            print(recv[1].flags) 


Quote

Top Page

Possibly Related Threads...
Thread Author Replies Views Last Post
  Failed to recieve scapy udp packet SkyAmryBoi 1 80 Sep-29-2017, 01:26 PM
Last Post: camp0
  Trying to Scan multiple IPs with python-nmap DarkSuniuM 5 716 Apr-09-2017, 06:34 AM
Last Post: wavic
  Scapy route6 configuration peterkl 0 264 Mar-06-2017, 03:58 PM
Last Post: peterkl
  Scapy Beacon Frames peterkl 1 428 Feb-28-2017, 09:00 PM
Last Post: peterkl
  scapy ssh connection my network sniffing from my router Boss 1 830 Feb-13-2017, 07:04 PM
Last Post: nilamo
  Scapy question azazel79 1 1,151 Nov-09-2016, 11:01 PM
Last Post: nilamo

Forum Jump:


Users browsing this thread: 1 Guest(s)