내가 Scapy를 사용하여 포트에 UDP 세그먼트/패킷을 보낼 때
을 테스트했습니다. 잘못된 패킷 (알 수없는 작업)을 말하고 목적지가 적절한 ICMP로 응답합니다 포트 도달 불가능 메시지. 누구든지이 부분을 밝힐 수 있습니까, 아니면 바보 같은 실수를 저지르고 있습니까? 내 스크립트입니다.ICMP 목적지에 도달 할 수 없음 오류 scapy
# Generate packet
pkts3 = IP(dst="10.0.0.2")/UDP()/Raw(RandString(size=120))
#print pkts
pkts3[UDP].flags = "S"
pktList3 = []
for pktNum3 in range(0,5):
pktList3.extend(pkts3)
pktList3[pktNum3][UDP].dport = 520 # Pkt has Ran PortNo.
print pktList3[pktNum3].summary()
#print len(pktList[pktNum])
#wrpcap('tcp-packets.pcap',pktList[pktNum])
# Send the list of packets send(pktList)
start_time3=time.time()
send(pktList3)
totalTime = time.time()-start_time3
totalBytes=(5*120)/totalTime
#print pktList3[0].show()
print pktList3[0].show2()
print totalBytes,"Seconds"
출력 당신은 무엇을 인쇄한다? – RyPeck
패킷을 생성하지만 제대로 보내지 않습니다. 내가 얻는 결과는 다음과 같습니다. [link] https://www.dropbox.com/s/z6y790vfpx9yv8z/udpPacket.jpg –
코드에 print 문이 있습니다. Wireshark가 아니라 그 출력을보고 싶었습니다. – RyPeck