<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/">
  <channel>
    <title>Scapy on To Linux and beyond !</title>
    <link>https://home.regit.org/tags/scapy/</link>
    <description>Recent content in Scapy on To Linux and beyond !</description>
    <generator>Hugo</generator>
    <language>fr</language>
    <lastBuildDate>Thu, 17 Apr 2014 14:11:58 +0000</lastBuildDate>
    <atom:link href="https://home.regit.org/feed/tags/scapy/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Speeding up scapy packets sending</title>
      <link>https://home.regit.org/2014/04/speeding-up-scapy-packets-sending/</link>
      <pubDate>Thu, 17 Apr 2014 14:11:58 +0000</pubDate>
      <guid>https://home.regit.org/2014/04/speeding-up-scapy-packets-sending/</guid>
      <description>&lt;h4 id=&#34;sending-packets-with-scapy&#34;&gt;Sending packets with scapy&lt;/h4&gt;
&lt;p&gt;I’m currently doing some code based on &lt;a href=&#34;http://www.secdev.org/projects/scapy/&#34;&gt;scapy&lt;/a&gt;. This code reads data from a possibly huge file and send a packet for each line in the file using the contained information.&lt;br&gt;
So the code contains a simple loop and uses sendp because the frame must be sent at layer 2.&lt;/p&gt;
&lt;pre&gt;def run(self):
         filedesc = open(self.filename, &#39;r&#39;)
         # loop on read line
         for line in filedesc:
             # Build and send packet
             sendp(pkt, iface = self.iface, verbose = verbose)
             # Inter packet treatment
&lt;/pre&gt;
&lt;p&gt;Doing that the performance are a bit deceptive. For 18 packets, we’ve got:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Using Scapy lfilter</title>
      <link>https://home.regit.org/2012/06/using-scapy-lfilter/</link>
      <pubDate>Thu, 07 Jun 2012 13:13:45 +0000</pubDate>
      <guid>https://home.regit.org/2012/06/using-scapy-lfilter/</guid>
      <description>&lt;p&gt;Scapy BPF filtering is not working when some exotic interface are used. This includes Virtualbox interface such as vboxnet.&lt;/p&gt;
&lt;p&gt;For example, the following code will not work if the interface is a virtualbox interface:&lt;/p&gt;
&lt;pre&gt;build_filter = &#34;src host %s and src port 21&#34;
sniff(iface=iface, prn=callback, filter=build_filter)
&lt;/pre&gt;
&lt;p&gt;To fix this, you can use the &lt;em&gt;lfilter&lt;/em&gt; option. The filtering is now done inside Scapy. This is powerful but less efficient.&lt;/p&gt;
&lt;p&gt;The code can be modified like this:&lt;/p&gt;</description>
    </item>
  </channel>
</rss>
