最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

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

programmeradmin1浏览0评论

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

发布评论

评论列表(0)

  1. 暂无评论