0

I would like to code a Python program that listens on a range of ports for incoming sin requests (possibly ack and fin as well). I then want this program to log the time, ip, and port of these sent packets.

Only thing is I really don't know where to start. I don't want anyone to hold my hand here, but I do need someone to point me in the right direction

4

2 回答 2

3

您可能正在寻找原始套接字,请参阅http://docs.python.org/library/socket.html

如果您只想在端口范围内捕获接收到的数据包并记录它,您可能应该省去麻烦并使用 Wireshark http://www.wireshark.org/

于 2012-08-12T02:44:32.487 回答
1

如果是为了教育目的;你可以使用scapy作为网络嗅探器。否则,只需将防火墙配置为记录适当的事件就足够了。

于 2012-08-12T03:53:13.753 回答