Ticket #70 (new defect)

Opened 10 months ago

Last modified 10 months ago

SNMP replay does not work

Reported by: sven.wisotzky@alcatel-lucent.de Assigned to: pbi
Priority: major Milestone:
Component: Scapy Version: 1.1.1
Keywords: Cc:

Description

I have tried to capture some SNMP packets using wireshark. It is possible to read the captured files to scapy and to resend the frames much faster. Doing so, we sometimes meet the situation of wrong encapsulated ASN.1 (due to BER encoding). Scapy is able to read ASN.1 using wrong length encoding and corrects the failure itself when resending the packets. Unfortunately in this case the checksum and length is not recalculated - therefore it will be dropped before it reaches the SNMP agent to be stressed.

Here one example:

a) BER within the capture file

30 82 00 ea # SEQUENCE/SEQUENCE OF

b) BER after sending the same packet with scapy

30 81 ea # SEQUENCE/SEQUENCE OF

For sure it is possible to overwrite the checksum/length field with scapy. But this is not very helpfull to have a real record/replay test environment. In addition this kind of manipulation must be done per hand. From my perspective it would be brilliant to add the encapsulation already when reading the capture file to the buffer:

rdpcap( filename, Ether)

In addition we found out, that sending SNMP packets using scapy is quite slow. Changing the encoding to Ether is much faster (about 1500frames/s on my PC). Therefore it would be great to have an additional option for sendp for rapid packet generation. Rapid packet generation should compile the frames before sending it. This can be quite helpful for stress tests:

sendp( 1000*cbuf, iface="eth1", inter=0, rapid=1)

Attachments

Change History

12/12/07 20:34:32 changed by pbi

For the rapid packet generation: there is already sendpfast() which creates a pcap file and calls tcpreplay on it.

For the problem of not reencoding as it was, yes it's a problem with scapy and any protocol having many ways to encode the same thing (DNS, ASN1 stuff, ISAKMP, etc.). Yes I plan to correct it. For the moment, a workaround is to avoid dissection of those protocols:

split_layers(UDP, SNMP)

If dissection is needed, it can be done out of the packet, or after it has been sent.


Add/Change #70 (SNMP replay does not work)




Change Properties
Action