randpkt.html 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  6. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  7. <meta name="generator" content="Asciidoctor 2.0.17">
  8. <title>randpkt(1)</title>
  9. <link rel="stylesheet" href="./ws.css">
  10. </head>
  11. <body class="manpage">
  12. <div id="header">
  13. <h1>randpkt(1) Manual Page</h1>
  14. <h2 id="_name">NAME</h2>
  15. <div class="sectionbody">
  16. <p>randpkt - Random packet generator</p>
  17. </div>
  18. </div>
  19. <div id="content">
  20. <div class="sect1">
  21. <h2 id="_synopsis">SYNOPSIS</h2>
  22. <div class="sectionbody">
  23. <div class="paragraph">
  24. <p><span class="nowrap"><strong>randpkt</strong></span>
  25. <span class="nowrap">[ <strong>-b</strong> &lt;maxbytes&gt; ]</span>
  26. <span class="nowrap">[ <strong>-c</strong> &lt;count&gt; ]</span>
  27. <span class="nowrap">[ <strong>-t</strong> &lt;type&gt; ]</span>
  28. <span class="nowrap">&lt;filename&gt;</span></p>
  29. </div>
  30. </div>
  31. </div>
  32. <div class="sect1">
  33. <h2 id="_description">DESCRIPTION</h2>
  34. <div class="sectionbody">
  35. <div class="paragraph">
  36. <p><strong>randpkt</strong> is a small utility that creates a <strong>pcap</strong> trace file
  37. full of random packets.</p>
  38. </div>
  39. <div class="paragraph">
  40. <p>By creating many randomized packets of a certain type, you can
  41. test packet sniffers to see how well they handle malformed packets.
  42. The sniffer can never trust the data that it sees in the packet because
  43. you can always sniff a very bad packet that conforms to no standard.
  44. <strong>randpkt</strong> produces <em>very bad</em> packets.</p>
  45. </div>
  46. <div class="paragraph">
  47. <p>When creating packets of a certain type, <strong>randpkt</strong> uses a sample
  48. packet that is stored internally to <strong>randpkt</strong>. It uses this as the
  49. starting point for your random packets, and then adds extra random
  50. bytes to the end of this sample packet.</p>
  51. </div>
  52. <div class="paragraph">
  53. <p>For example, if you choose to create random ARP packets, <strong>randpkt</strong>
  54. will create a packet which contains a predetermined Ethernet II header,
  55. with the Type field set to ARP. After the Ethernet II header, it will
  56. put a random number of bytes with random values.</p>
  57. </div>
  58. </div>
  59. </div>
  60. <div class="sect1">
  61. <h2 id="_options">OPTIONS</h2>
  62. <div class="sectionbody">
  63. <div class="dlist">
  64. <dl>
  65. <dt class="hdlist1">-b &lt;maxbytes&gt;</dt>
  66. <dd>
  67. <div class="openblock">
  68. <div class="content">
  69. <div class="paragraph">
  70. <p>Default 5000.</p>
  71. </div>
  72. <div class="paragraph">
  73. <p>Defines the maximum number of bytes added to the sample packet.
  74. If you choose a <strong>maxbytes</strong> value that is less than the size of the
  75. sample packet, then your packets would contain only the sample
  76. packet&#8230;&#8203; not much variance there! <strong>randpkt</strong> exits on that condition.</p>
  77. </div>
  78. </div>
  79. </div>
  80. </dd>
  81. <dt class="hdlist1">-c &lt;count&gt;</dt>
  82. <dd>
  83. <div class="openblock">
  84. <div class="content">
  85. <div class="paragraph">
  86. <p>Default 1000.</p>
  87. </div>
  88. <div class="paragraph">
  89. <p>Defines the number of packets to generate.</p>
  90. </div>
  91. </div>
  92. </div>
  93. </dd>
  94. <dt class="hdlist1">-t &lt;type&gt;</dt>
  95. <dd>
  96. <div class="openblock">
  97. <div class="content">
  98. <div class="paragraph">
  99. <p>Default Ethernet II frame.</p>
  100. </div>
  101. <div class="paragraph">
  102. <p>Defines the type of packet to generate:</p>
  103. </div>
  104. <div class="literalblock">
  105. <div class="content">
  106. <pre>arp Address Resolution Protocol
  107. bgp Border Gateway Protocol
  108. bvlc BACnet Virtual Link Control
  109. dns Domain Name Service
  110. eth Ethernet
  111. fddi Fiber Distributed Data Interface
  112. giop General Inter-ORB Protocol
  113. icmp Internet Control Message Protocol
  114. ip Internet Protocol
  115. ipv6 Internet Protocol Version 6
  116. llc Logical Link Control
  117. m2m WiMAX M2M Encapsulation Protocol
  118. megaco MEGACO
  119. nbns NetBIOS-over-TCP Name Service
  120. ncp2222 NetWare Core Protocol
  121. sctp Stream Control Transmission Protocol
  122. syslog Syslog message
  123. tds TDS NetLib
  124. tcp Transmission Control Protocol
  125. tr Token-Ring
  126. udp User Datagram Protocol
  127. usb Universal Serial Bus
  128. usb-linux Universal Serial Bus with Linux specific header</pre>
  129. </div>
  130. </div>
  131. </div>
  132. </div>
  133. </dd>
  134. </dl>
  135. </div>
  136. </div>
  137. </div>
  138. <div class="sect1">
  139. <h2 id="_diagnostic_options">DIAGNOSTIC OPTIONS</h2>
  140. <div class="sectionbody">
  141. <div class="dlist">
  142. <dl>
  143. <dt class="hdlist1">--log-level &lt;level&gt;</dt>
  144. <dd>
  145. <p>Set the active log level.
  146. Supported levels in lowest to highest order are "noisy", "debug", "info", "message", "warning", "critical", and "error".
  147. Messages at each level and higher will be printed, for example "warning" prints "warning", "critical", and "error" messages and "noisy" prints all messages.
  148. Levels are case insensitive.</p>
  149. </dd>
  150. <dt class="hdlist1">--log-fatal &lt;level&gt;</dt>
  151. <dd>
  152. <p>Abort the program if any messages are logged at the specified level or higher.
  153. For example, "warning" aborts on any "warning", "critical", or "error" messages.</p>
  154. </dd>
  155. </dl>
  156. </div>
  157. <div class="dlist">
  158. <dl>
  159. <dt class="hdlist1">--log-domains &lt;list&gt;</dt>
  160. <dd>
  161. <p>Only print messages for the specified log domains, e.g. "GUI,Epan,sshdump".
  162. List of domains must be comma-separated.</p>
  163. </dd>
  164. <dt class="hdlist1">--log-debug &lt;list&gt;</dt>
  165. <dd>
  166. <p>Force the specified domains to log at the "debug" level.
  167. List of domains must be comma-separated.</p>
  168. </dd>
  169. <dt class="hdlist1">--log-noisy &lt;list&gt;</dt>
  170. <dd>
  171. <p>Force the specified domains to log at the "noisy" level.
  172. List of domains must be comma-separated.</p>
  173. </dd>
  174. <dt class="hdlist1">--log-file &lt;path&gt;</dt>
  175. <dd>
  176. <p>Write log messages and stderr output to the specified file.</p>
  177. </dd>
  178. </dl>
  179. </div>
  180. </div>
  181. </div>
  182. <div class="sect1">
  183. <h2 id="_examples">EXAMPLES</h2>
  184. <div class="sectionbody">
  185. <div class="paragraph">
  186. <p>To see a description of the randpkt options use:</p>
  187. </div>
  188. <div class="literalblock">
  189. <div class="content">
  190. <pre>randpkt</pre>
  191. </div>
  192. </div>
  193. <div class="paragraph">
  194. <p>To generate a capture file with 1000 DNS packets use:</p>
  195. </div>
  196. <div class="literalblock">
  197. <div class="content">
  198. <pre>randpkt -b 500 -t dns rand_dns.pcap</pre>
  199. </div>
  200. </div>
  201. <div class="paragraph">
  202. <p>To generate a small capture file with just a single LLC frame use:</p>
  203. </div>
  204. <div class="literalblock">
  205. <div class="content">
  206. <pre>randpkt -b 100 -c 1 -t llc single_llc.pcap</pre>
  207. </div>
  208. </div>
  209. </div>
  210. </div>
  211. <div class="sect1">
  212. <h2 id="_see_also">SEE ALSO</h2>
  213. <div class="sectionbody">
  214. <div class="paragraph">
  215. <p><a href="https://www.tcpdump.org/manpages/pcap.3pcap.html">pcap</a>(3), <a href="editcap.html">editcap</a>(1)</p>
  216. </div>
  217. </div>
  218. </div>
  219. </div>
  220. </body>
  221. </html>