python - Why sr1 return None when TCP flags are FPU - Stack Overflow

from scapy.all import IP, ICMP, TCP, sr1import sysdef probe_scan(ip):probe_packet = IP(dst=ip)ICMP()


from scapy.all import IP, ICMP, TCP, sr1
import sys

def probe_scan(ip):
    probe_packet = IP(dst=ip) / ICMP()
    return sr1(probe_packet, timeout=10) != None

def tryXMas(ip, port):
    xMas_packet = IP(dst=ip) / TCP(dport=int(port), flags="FPU")
    Xmas_resp = sr1(xMas_packet, timeout=5)
    return Xmas_resp


if __name__ == "__main__":
    ip = "127.0.0.1" # sys.argv[1]
    port = 21 # sys.argv[2]
    if probe_scan(ip):
        xMas_packet = tryXMas(ip, port)
       """This line calls error due to sr1 return None type!! """
        xMas_packet.summary()
    else:
        print("Prove Scan Failed")`

Hi, I wanna create XMas scanning using Scapy. When I set flags="SA" all is fine(I get TCP result), but when I change flags I get None type from sr1 in tryXMas() method

It doesn't make difference what ip or port I'll choose. However, in my example I use metasploitable machine on my VirtualBox

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745669271a4639307.html

相关推荐

  • python - Why sr1 return None when TCP flags are FPU - Stack Overflow

    from scapy.all import IP, ICMP, TCP, sr1import sysdef probe_scan(ip):probe_packet = IP(dst=ip)ICMP()

    21天前
    30

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信