tcpprep.html 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366
  1. <!--#exec cmd="header tcpprep" -->
  2. <ul>
  3. </ul><H2>NAME </H2><ul>
  4. tcpprep - Create a tcpreplay cache cache file from a pcap file.
  5. </ul><H2>SYNOPSIS </H2><ul>
  6. <b>tcpprep</b>
  7. [<b>-<i>flag</i></b> [<i>value</i>]]... [<b>--<i>opt-name</i></b> [[=| ]<i>value</i>]]...
  8. <p>
  9. All arguments must be options.
  10. <p>
  11. tcpprep is a <i>pcap(3)</i> file pre-processor which creates a cache
  12. file which provides "rules" for <i>tcprewrite(1)</i> and <i>tcpreplay(1)</i>
  13. on how to process and send packets.
  14. </ul><H2>DESCRIPTION </H2><ul>
  15. This manual page documents, briefly, the <b>tcpprep</b> command.
  16. The basic operation of tcpreplay is to resend all packets from the
  17. input file(s) out a single file. Tcpprep processes a pcap file and
  18. applies a set of user-specified rules to create a cache file which
  19. tells tcpreplay wether or not to send each packet and which interface the
  20. packet should be sent out of.
  21. </ul><H2>OPTIONS </H2><ul>
  22. <p><dl compact><dt><b>-d</b> <i>number</i>, <b>--dbug</b>=<b><i>number</i></b>
  23. <dd>Enable debugging output.
  24. This option may appear up to 1 times.
  25. This option takes an integer number as its argument.
  26. The value of <i>number</i> is constrained to being:
  27. <pre>
  28. in the range 0 through 5
  29. <br></pre>
  30. The default <i>number</i> for this option is:
  31. </dl><br>
  32. 0
  33. <p>
  34. If configured with --enable-debug, then you can specify a verbosity
  35. level for debugging output. Higher numbers increase verbosity.
  36. <p><dl compact><dt><b>-a</b> <i>string</i>, <b>--auto</b>=<b><i>string</i></b>
  37. <dd>Auto-split mode.
  38. This option may appear up to 1 times.
  39. This option must not appear in combination with any of the following options:
  40. cidr, port, regex, mac.
  41. </dl>
  42. <p>
  43. Tcpprep will try to automatically determine the primary function of hosts
  44. based on the traffic captured and classify each host as client or server.
  45. In order to do so, you must provide a hint to tcpprep as to how to search
  46. for clients and servers. Valid hints are:
  47. <p>
  48. <p>
  49. <b>bridge</b>
  50. Bridge mode processes each packet to try to determine if the sender is a
  51. client or server. Once all the packets are processed, the results are weighed
  52. according to the server/client ratio (<b>--ratio</b>) and systems are assigned an
  53. interface. If tcpprep is unable to determine what role a system plays, tcpprep
  54. will abort.
  55. <p>
  56. <b>router</b>
  57. Router mode works just like bridge mode, except that after weighing is done,
  58. systems which are undetermined are considered a server if they fall inside a
  59. network known to contain other servers. Router has a greater chance of
  60. successfully splitting clients and servers but is not 100% foolproof.
  61. <p>
  62. <b>client</b>
  63. Client mode works just like bridge mode, except that unclassified systems are
  64. treated as clients. Client mode should always complete successfully.
  65. <p>
  66. <b>server</b>
  67. Server mode works just like bridge mode, except that unclassified systems are
  68. treated as servers. Server mode should always complete successfully.
  69. <br>
  70. <p><dl compact><dt><b>-c</b> <i>string</i>, <b>--cidr</b>=<b><i>string</i></b>
  71. <dd>CIDR-split mode.
  72. This option may appear up to 1 times.
  73. This option must not appear in combination with any of the following options:
  74. auto, port, regex, mac.
  75. </dl>
  76. <p>
  77. Specify a comma delimited list of CIDR netblocks to match against
  78. the source IP of each packet. Packets matching any of the CIDR's
  79. are classified as servers.
  80. <p><dl compact><dt><b>-r</b> <i>string</i>, <b>--regex</b>=<b><i>string</i></b>
  81. <dd>Regex-split mode.
  82. This option may appear up to 1 times.
  83. This option must not appear in combination with any of the following options:
  84. auto, port, cidr, mac.
  85. </dl>
  86. <p>
  87. Specify a regular expression to match against the source IP of each
  88. packet. Packets matching the regex are classified as servers.
  89. <p><dl compact><dt><b>-p</b>, <b>--port</b>
  90. <dd>Port-split mode.
  91. This option may appear up to 1 times.
  92. This option must not appear in combination with any of the following options:
  93. auto, regex, cidr, mac.
  94. </dl>
  95. <p>
  96. Specifies that TCP and UDP traffic should be classified as client
  97. or server based upon the destination port of the header.
  98. <p><dl compact><dt><b>-e</b> <i>string</i>, <b>--mac</b>=<b><i>string</i></b>
  99. <dd>Source MAC split mode.
  100. This option may appear up to 1 times.
  101. This option must not appear in combination with any of the following options:
  102. auto, regex, cidr, port.
  103. </dl>
  104. <p>
  105. Specify a list of MAC addresses to match against the source MAC
  106. of each packet. Packets matching one of the values are classified
  107. as servers.
  108. <p><dl compact><dt><b>-C</b> <i>string</i>, <b>--comment</b>=<b><i>string</i></b>
  109. <dd>Embeded cache file comment.
  110. This option may appear up to 1 times.
  111. </dl>
  112. <p>
  113. Specify a comment to be imbedded within the output cache file and later
  114. viewed.
  115. <p><dl compact><dt><b>--no-arg-comment</b>
  116. <dd>Do not embed any cache file comment.
  117. This option may appear up to 1 times.
  118. </dl>
  119. <p>
  120. By default, tcpprep includes the arguments passed on the command line
  121. in the cache file comment (in addition to any user specified --comment).
  122. If for some reason you do not wish to include this, specify this option.
  123. <p><dl compact><dt><b>-x</b> <i>string</i>, <b>--include</b>=<b><i>string</i></b>
  124. <dd>Include only packets matching rule.
  125. This option may appear up to 1 times.
  126. This option must not appear in combination with any of the following options:
  127. exclude.
  128. </dl>
  129. <p>
  130. Override default of sending all packets stored in the capture file and only
  131. send packets which match the provided rule. Rules can be one of:
  132. <p>
  133. <p>
  134. <i>S:&lt;CIDR1&gt;,... </i>
  135. - Source IP must match specified CIDR(s)
  136. <p>
  137. <i>D:&lt;CIDR1&gt;,... </i>
  138. - Destination IP must match specified CIDR(s)
  139. <p>
  140. <i>B:&lt;CIDR1&gt;,... </i>
  141. - Both source and destination IP must match specified CIDR(s)
  142. <p>
  143. <i>E:&lt;CIDR1&gt;,... </i>
  144. - Either IP must match specified CIDR(s)
  145. <p>
  146. <i>P:&lt;LIST&gt; </i>
  147. - Must be one of the listed packets where the list
  148. corresponds to the packet number in the capture file.
  149. <pre>
  150. -x P:1-5,9,15,72-
  151. <br></pre>
  152. would send packets 1 thru 5, the 9th and 15th packet, and packets 72 until the
  153. end of the file
  154. <p>
  155. <i>F:'&lt;bpf&gt;'</i>
  156. - BPF filter. See the <i>tcpdump(8)</i> man page for syntax.
  157. <br>
  158. <p><dl compact><dt><b>-X</b> <i>string</i>, <b>--exclude</b>=<b><i>string</i></b>
  159. <dd>Exclude any packet matching this rule.
  160. This option may appear up to 1 times.
  161. This option must not appear in combination with any of the following options:
  162. include.
  163. </dl>
  164. <p>
  165. Override default of sending all packets stored in the capture file and only
  166. send packets which do not match the provided rule. Rules can be one of:
  167. <p>
  168. <p>
  169. <i>S:&lt;CIDR1&gt;,... </i>
  170. - Source IP must not match specified CIDR(s)
  171. <p>
  172. <i>D:&lt;CIDR1&gt;,... </i>
  173. - Destination IP must not match specified CIDR(s)
  174. <p>
  175. <i>B:&lt;CIDR1&gt;,... </i>
  176. - Both source and destination IP must not match specified CIDR(s)
  177. <p>
  178. <i>E:&lt;CIDR1&gt;,... </i>
  179. - Either IP must not match specified CIDR(s)
  180. <p>
  181. <i>P:&lt;LIST&gt; </i>
  182. - Must not be one of the listed packets where the list
  183. corresponds to the packet number in the capture file.
  184. <pre>
  185. -x P:1-5,9,15,72-
  186. <br></pre>
  187. would drop packets 1 thru 5, the 9th and 15th packet, and packets 72 until the
  188. end of the file
  189. <br>
  190. <p><dl compact><dt><b>-o</b> <i>string</i>, <b>--cachefile</b>=<b><i>string</i></b>
  191. <dd>Output cache file.
  192. This option may appear up to 1 times.
  193. </dl>
  194. <p>
  195. <p><p><dl compact><dt><b>-i</b> <i>string</i>, <b>--pcap</b>=<b><i>string</i></b>
  196. <dd>Input pcap file to process.
  197. This option may appear up to 1 times.
  198. </dl>
  199. <p>
  200. <p><p><dl compact><dt><b>-P</b> <i>string</i>, <b>--print-comment</b>=<b><i>string</i></b>
  201. <dd>Print embedded comment in the specified cache file.
  202. </dl>
  203. <p>
  204. <p><p><dl compact><dt><b>-I</b> <i>string</i>, <b>--print-info</b>=<b><i>string</i></b>
  205. <dd>Print basic info from the specified cache file.
  206. </dl>
  207. <p>
  208. <p><p><dl compact><dt><b>-S</b> <i>string</i>, <b>--print-stats</b>=<b><i>string</i></b>
  209. <dd>Print statistical information about the specified cache file.
  210. </dl>
  211. <p>
  212. <p><p><dl compact><dt><b>-s</b> <i>string</i>, <b>--services</b>=<b><i>string</i></b>
  213. <dd>Load services file for server ports.
  214. </dl>
  215. <p>
  216. This option has not been fully documented.
  217. <p><dl compact><dt><b>-N</b>, <b>--nonip</b>
  218. <dd>Send non-IP traffic out server interface.
  219. </dl>
  220. <p>
  221. By default, non-IP traffic which can not be classified as client
  222. or server is classified as "client". Specifiying <b>--nonip</b>
  223. will reclassify non-IP traffic as "server".
  224. <p><dl compact><dt><b>-R</b> <i>string</i>, <b>--ratio</b>=<b><i>string</i></b>
  225. <dd>Ratio of client to server packets.
  226. This option may appear up to 1 times.
  227. This option must appear in combination with the following options:
  228. auto.
  229. </dl>
  230. <p>
  231. Since a given host may have both client and server traffic being sent
  232. to/from it, tcpprep uses a ratio to weigh these packets. If you would
  233. like to override the default of 2:1 server to client packets required for
  234. a host to be classified as a server, specify it as a floating point value.
  235. <p><dl compact><dt><b>-m</b> <i>number</i>, <b>--minmask</b>=<b><i>number</i></b>
  236. <dd>Minimum network mask length in auto mode.
  237. This option may appear up to 1 times.
  238. This option must appear in combination with the following options:
  239. auto.
  240. This option takes an integer number as its argument.
  241. The value of <i>number</i> is constrained to being:
  242. <pre>
  243. in the range 0 through 32
  244. <br></pre>
  245. </dl>
  246. <p>
  247. By default, auto modes use a minimum network mask length of 30 bits
  248. to build networks containing clients and servers. This allows you
  249. to override this value. Larger values will increase performance but
  250. may provide inaccurate results.
  251. <p><dl compact><dt><b>-M</b> <i>number</i>, <b>--maxmask</b>=<b><i>number</i></b>
  252. <dd>Maximum network mask length in auto mode.
  253. This option may appear up to 1 times.
  254. This option must appear in combination with the following options:
  255. auto.
  256. This option takes an integer number as its argument.
  257. The value of <i>number</i> is constrained to being:
  258. <pre>
  259. in the range 0 through 32
  260. <br></pre>
  261. </dl>
  262. <p>
  263. By default, auto modes use a maximum network mask length of 8 bits
  264. to build networks containing clients and servers. This allows you
  265. to override this value. Larger values will decrease performance
  266. and accuracy but will provide greater chance of success.
  267. <p><dl compact><dt><b>-v</b>, <b>--verbose</b>
  268. <dd>Print decoded packets via tcpdump to STDOUT.
  269. This option may appear up to 1 times.
  270. </dl>
  271. <p>
  272. <p><p><dl compact><dt><b>-A</b> <i>string</i>, <b>--decode</b>=<b><i>string</i></b>
  273. <dd>Arguments passed to tcpdump decoder.
  274. This option may appear up to 1 times.
  275. This option must appear in combination with the following options:
  276. verbose.
  277. </dl>
  278. <p>
  279. When enabling verbose mode (<b>-v</b>) you may also specify one or
  280. more additional arguments to pass to <b>tcpdump</b> to modify
  281. the way packets are decoded. By default, -n and -l are used.
  282. Be sure to quote the arguments so that they are not interpreted
  283. by tcprewrite. The following arguments are valid:
  284. [ -aAeNqRStuvxX ]
  285. [ -E spi@ipaddr algo:secret,... ]
  286. [ -s snaplen ]
  287. <p><dl compact><dt><b>-V</b>, <b>--version</b>
  288. <dd>Print version information.
  289. </dl>
  290. <p>
  291. <p><p><dl compact><dt><b>-h</b>, <b>--less-help</b>
  292. <dd>Display less usage information and exit.
  293. </dl>
  294. <p>
  295. This option has not been fully documented.
  296. <p><dl compact><dt><b>-H</b>,<b> --help</b>
  297. <dd>Display usage information and exit.
  298. <dt><b>-!</b>,<b> --more-help</b>
  299. <dd>Extended usage information passed thru pager.
  300. <dt><b>-</b> [<i>rcfile</i>],<b> --save-opts</b>[=<i>rcfile</i>]
  301. <dd>Save the option state to <i>rcfile</i>. The default is the <i>last</i>
  302. configuration file listed in the <b>OPTION PRESETS</b> section, below.
  303. <dt><b>-</b> <i>rcfile</i>,<b> --load-opts</b>=<i>rcfile</i>,<b> --no-load-opts</b>
  304. <dd>Load options from <i>rcfile</i>.
  305. The <i>no-load-opts</i> form will disable the loading
  306. of earlier RC/INI files. <i>--no-load-opts</i> is handled early,
  307. out of order.
  308. </dl>
  309. </ul><H2>OPTION PRESETS </H2><ul>
  310. Any option that is not marked as <i>not presettable</i> may be preset
  311. by loading values from configuration ("RC" or ".INI") file(s).
  312. The <i>homerc</i> file is "<i>$$/</i>", unless that is a directory.
  313. In that case, the file "<i>.tcppreprc</i>"
  314. is searched for within that directory.
  315. </ul><H2>SEE ALSO </H2><ul>
  316. tcpdump(1), tcprewrite(1), tcpreplay(1)
  317. </ul><H2>AUTHOR </H2><ul>
  318. Copyright 2000-2005 Aaron Turner
  319. <p>For support please use the tcpreplay-users@lists.sourceforge.net mailing list.
  320. <p>
  321. Released under the Free BSD License.
  322. <p>
  323. This manual page was <i>AutoGen</i>-erated from the <b>tcpprep</b>
  324. option definitions.
  325. </ul>
  326. <!--#exec cmd="trailer" -->