tcpprep.1 13 KB

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