tcpprep.1 11 KB

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