假设您有一个名为
sock…的套接字,请使用
socket.bind()
import socketsock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)DESTINATION_ADDR = '1.1.1.1'SOURCE_PORT, DESTINATION_PORT = 31415, 80sock.bind(('0.0.0.0', SOURCE_PORT))sock.connect((DESTINATION_ADDR, DESTINATION_PORT))
现在,我运行
tshark(text
wireshark)以查看该界面上的流量…
[mpenning@Bucksnort ~]$ sudo tshark -i eth0 tcp and port 31415Capturing on eth0 0.000000 24.19.161.6 -> 1.1.1.1 TCP 31415 > http [SYN] Seq=0 Win=5840 Len=0 MSS=1460 TSV=4228124209 TSER=0 WS=6 12.000009 24.19.161.6 -> 1.1.1.1 TCP 31415 > http [SYN] Seq=0 Win=5840 Len=0 MSS=1460 TSV=4228127209 TSER=0 WS=6 36.000010 24.19.161.6 -> 1.1.1.1 TCP 31415 > http [SYN] Seq=0 Win=5840 Len=0 MSS=1460 TSV=4228133209 TSER=0 WS=6
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)