我正在使用Scapy的srp1()将pcap重放到一个设备上,如下所示:
for p in rdpcap(pcapfile):
...
rcv = srp1(p, 'eth0')
print rcv[IP].len
print rcv[TCP].seq
...当设备发送一个包时,我可以得到它的IP.len和TCP.seq,但是当它发送两个包时,我只能得到第一个包的信息,而我需要第二个数据包的信息。
我哪里出错了?
发布于 2016-03-13 23:17:57
's user manual和's API documentation都声明srp1()是srp()的一个变体,它只返回构成发送的数据包/s的答案的第一个数据包。
因此,尝试使用srp()而不是srp1(),如下所示:
for p in rdpcap(pcapfile):
...
answers, unanswered = srp(p, 'eth0')
last_request, last_answer = answers[-1]
print last_answer[IP].len
print last_answer[TCP].seq
...https://stackoverflow.com/questions/35957196
复制相似问题