{"id":587,"date":"2013-05-17T10:18:36","date_gmt":"2013-05-17T10:18:36","guid":{"rendered":"http:\/\/blog.bachi.net\/?p=587"},"modified":"2015-10-15T08:33:55","modified_gmt":"2015-10-15T08:33:55","slug":"inject-packets-from-pcap-format","status":"publish","type":"post","link":"https:\/\/blog.bachi.net\/?p=587","title":{"rendered":"Inject packets from PCAP-format"},"content":{"rendered":"<h3>tcpreplay \/ tcprewrite<\/h3>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\n$ sudo apt-get install tcpreplay\r\n$ tcpreplay -t -L &lt;limit&gt; -i &lt;interface&gt; &lt;file.cap&gt;\r\n\r\nOptions:\r\n-i string, --intf1=string      Server\/primary traffic output interface.\r\n-I string, --intf2=string      Client\/secondary traffic output interface.\r\n-L number, --limit=number      Limit the number of packets to send.\r\n\r\n-M float , --mbps=float        Replay packets at a given Mbps. Specify a floating point value.\r\n-t,        --topspeed          Replay packets as fast as possible. \r\n-p number, --pps=number        Replay packets at a given packets\/sec.\r\nwithout -t or -p               Send out packets as in the timestamp of each packet of the PCAP file.\r\n<\/pre>\n<p><a href=\"http:\/\/tcpreplay.synfin.net\/wiki\/tcpreplay\">tcpreplay.synfin.net Wiki: tcpreplay<\/a><br \/>\n<a href=\"http:\/\/tcpreplay.synfin.net\/wiki\/tcprewrite\">tcpreplay.synfin.net Wiki: tcprewrite<\/a><br \/>\n<a href=\"http:\/\/xmodulo.com\/2013\/05\/how-to-capture-and-replay-network-traffic-on-linux.html\">How to capture and replay network traffic on Linux<\/a><\/p>\n<h3>ostinato<\/h3>\n<h3>packeth<\/h3>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\n$ sudo apt-get install packeth\r\n$ sudo packeth\r\nLoad -&gt; PCAP\r\n<\/pre>\n<h3>netdude<\/h3>\n<p>Netdude 0.5.1 and libnetdude 0.12 released<br \/>\nEdit PCAP files in a GUI.<br \/>\n<a href=\"http:\/\/netdude.sourceforge.net\/\">Netdude Homepage<\/a><br \/>\n<a href=\"http:\/\/sourceforge.net\/projects\/netdude\/\">Netdude Source<\/a><\/p>\n<h3>mergecap<\/h3>\n<p>Merges two or more capture files into one<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\nmergecap &#x5B; -a ] &#x5B; -v ] -w &lt;outfile&gt; &lt;infile&gt; &#x5B;&lt;infile&gt; ...]\r\n-a             Causes the frame timestamps to be ignored. \r\n               When -a is not specified, the contents of the input files are merged\r\n               in chronological order based on each frame's timestamp.\r\n-v             Causes mergecap to print a number of messages while it's working.\r\n-w  &lt;outfile&gt;  Sets the output filename.\r\n\r\n<\/pre>\n<h3>capinfos<\/h3>\n<p>Prints information about capture files<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\n-a    Displays the start time of the capture.\r\n-e    Displays the end time of the capture.\r\n-c    Displays the number of packets in the capture file.\r\n-u    Displays the capture duration, in seconds.\r\n-S    Display the start and end times as seconds (unixtime)\r\n<\/pre>\n<h3>editcap<\/h3>\n<p>Edit and\/or translate the format of capture files<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\n-A  &lt;start time&gt;               Saves only the packets whose timestamp is on or after start time. \r\n-B  &lt;stop time&gt;                Saves only the packets whose timestamp is before stop time.\r\n-t  &lt;time adjustment&gt;          Sets the time adjustment to use on selected packets.\r\n                               The adjustment is specified as &#x5B;-]seconds&#x5B;.fractional seconds].\r\n-S  &lt;strict time adjustment&gt;   Time adjust selected packets to insure strict chronological order.\r\n                               The value represents relative seconds specified as &#x5B;-]seconds&#x5B;.fractional seconds].\r\n                               If the value is 0 or greater then only packets with a timestamp less than the previous packet will be adjusted.\r\n                               If the value is specified as a negative value, then the timestamp values of all packets will be adjusted\r\n                               to be equal to the timestamp value of the previous packet plus the absolute value of the value\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>tcpreplay \/ tcprewrite $ sudo apt-get install tcpreplay $ tcpreplay -t -L &lt;limit&gt; -i &lt;interface&gt; &lt;file.cap&gt; Options: -i string, &#8211;intf1=string Server\/primary traffic output interface. -I string, &#8211;intf2=string Client\/secondary traffic output interface. -L number, &#8211;limit=number Limit the number of packets to send. -M float , &#8211;mbps=float Replay packets at a given Mbps. Specify a floating point [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[26],"tags":[],"class_list":["post-587","post","type-post","status-publish","format-standard","hentry","category-debian"],"_links":{"self":[{"href":"https:\/\/blog.bachi.net\/index.php?rest_route=\/wp\/v2\/posts\/587","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.bachi.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.bachi.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.bachi.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.bachi.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=587"}],"version-history":[{"count":19,"href":"https:\/\/blog.bachi.net\/index.php?rest_route=\/wp\/v2\/posts\/587\/revisions"}],"predecessor-version":[{"id":4180,"href":"https:\/\/blog.bachi.net\/index.php?rest_route=\/wp\/v2\/posts\/587\/revisions\/4180"}],"wp:attachment":[{"href":"https:\/\/blog.bachi.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=587"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.bachi.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=587"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.bachi.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=587"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}