title: How to create sample pcap file in python with dummy data, without using tcpdump?
body: <p>I do not have permission to perform <code>tcpdump</code> on my test server, without <code>sudo</code>.</p>
  <p>As of now I just want to create a dummy pcap file like original ones with some sample data and use it for some testing.</p>
  <p>To replicate original, cat should look like:</p>
  <pre><code>&lt;&lt;▒
  </code></pre>
  <p>Below command to read it in a human way should give o/p like below.</p>
  <pre><code>tcpdump -qns 0 -X -r test_abc.pcap
  reading from file abc.pcap, link-type EN10MB (Ethernet)
  22:06:04.309992 IP xxx.xxx.x.xx.xxxxx &gt; xx.xxx.xxx.xxx.xx: tcp 0
          0x0000:  4500 0028 57ef 4000 7b06 0199 c0a8 015b  E..(W.@.{......[
          0x0010:  2b94 b8b0 ae38 0016 48d1 ea1b b5f0 3568  +....8..H.....5h
          0x0020:  5010 00fe 3bfa 0000 0000 0000 0000       P...;.........
  </code></pre>
  <p>If I try to write a <code>pcap</code> file with 0s and 1s or copy pasting above readable text, the file is not like real <code>pcap</code> file, because the data is readable with cat, which is not the case for real <code>pcap</code> files.</p>