<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Capture on Amit Agarwal Linux Blog</title>
    <link>/tags/capture/</link>
    <description>Recent content in Capture on Amit Agarwal Linux Blog</description>
    <generator>Hugo -- gohugo.io</generator>
    <language>en</language>
    <lastBuildDate>Mon, 03 Jun 2019 01:00:38 +0000</lastBuildDate>
    
	<atom:link href="/tags/capture/index.xml" rel="self" type="application/rss+xml" />
    
    
    <item>
      <title>Split pcap to multiple files based on number of packets</title>
      <link>/2019/06/03/split-pcap-to-multiple-files-based-on-number-of-packets/</link>
      <pubDate>Mon, 03 Jun 2019 01:00:38 +0000</pubDate>
      
      <guid>/2019/06/03/split-pcap-to-multiple-files-based-on-number-of-packets/</guid>
      <description>&lt;p&gt;Here is a script that can use tshark to split a large pcap to multiple small pcaps&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;pre class=&#34;brush:shell&#34;&gt;inpcap=&#34;test.pcap&#34;

max=$(tshark  -r $inpcap -n -T fields -e frame.number|tail -1)

# This is the number of packets in each split pcap
c=1

# Save all new pcaps to out, if it does not exist, create it.
[[ ! -d out ]] &amp;&amp; mkdir out

for i in $(seq 1 $max $c)
do
        tshark  -r $inpcap  -n -c $c &#34;frame.number==$i&#34; -w out/$i.pcap
        #Do other stuff, if required
        read -p &#34;Send the next packet? &#34;
done
&lt;/pre&gt;
&lt;p&gt;A very simple 3-4 line script that has saved my day so may times.&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>scapy packet dump to packet</title>
      <link>/2017/04/10/scapy-packet-dump-packet/</link>
      <pubDate>Mon, 10 Apr 2017 01:05:34 +0000</pubDate>
      
      <guid>/2017/04/10/scapy-packet-dump-packet/</guid>
      <description>&lt;p&gt;First you need to have scapy installed. And if you don’t know about scapy, then&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Scapy is a powerful interactive packet manipulation program. It is able to forge or decode packets of a wide number of protocols, send them on the wire, capture them, match requests and replies, and much more. It can easily handle most classical tasks like scanning, tracerouting, probing, unit tests, attacks or network discovery (it can replace hping, 85% of nmap, arpspoof, arp-sk, arping, tcpdump, tethereal, p0f, etc.). It also performs very well at a lot of other specific tasks that most other tools can’t handle, like sending invalid frames, injecting your own 802.11 frames, combining technics (VLAN hopping+ARP cache poisoning, VOIP decoding on WEP encrypted channel, …), etc&lt;/p&gt;</description>
    </item>
    
  </channel>
</rss>
