1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98
|
<html lang="en">
<head>
<title>EXAMPLES</title>
<meta http-equiv="Content-Type" content="text/html">
<meta name="description" content="EXAMPLES">
<meta name="generator" content="makeinfo 4.7">
<link title="Top" rel="top" href="#Top">
<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
<meta http-equiv="Content-Style-Type" content="text/css">
<style type="text/css"><!--
pre.display { font-family:inherit }
pre.format { font-family:inherit }
pre.smalldisplay { font-family:inherit; font-size:smaller }
pre.smallformat { font-family:inherit; font-size:smaller }
pre.smallexample { font-size:smaller }
pre.smalllisp { font-size:smaller }
span.sc { font-variant:small-caps }
span.roman { font-family: serif; font-weight: normal; }
--></style>
</head>
<body>
<h1 class="settitle">EXAMPLES</h1>
<h2 class="chapter"><a name="TOC0"></a>1 Examples of tcpick usage</h2>
<h3 class="section"><a name="TOC1"></a>1.1 connection status</h3>
<p>Tcpick is a sniffer able to understand wich status has the connection
(SYN-SENT, SYN-RECEIVED and so on). To see the connection tracker in
action on eth0 simply type:
<pre class="example"> # tcpick -i eth0 -C
</pre>
<p>`-C' means “enable colors”, and the output is very pretty.
<p>You will see something like this:
<pre class="example"> 23:07:42.672171 1 SYN-SENT 12.34.56.78:41599 > 123.123.123.123:http
23:07:42.822239 2 SYN-SENT 12.34.56.78:41600 > 32.13.21.32:5973
23:07:42.826634 3 SYN-SENT 12.34.56.78:41601 > 123.45.67.89:5555
23:07:42.854681 4 SYN-SENT 12.34.56.78:41602 > 1.2.3.4:56789
23:07:43.084242 1 SYN-RECEIVED 12.34.56.78:41599 > 123.123.123.123:http
23:07:43.087045 1 ESTABLISHED 12.34.56.78:41599 > 123.123.123.123:http
23:07:44.061311 5 SYN-SENT 12.34.56.78:41603 > 10.20.30.40:8888
</pre>
<h3 class="section"><a name="TOC2"></a>1.2 display the payload and packet headers</h3>
<p>It is very easy:
<pre class="example"> # tcpick -i eth0 -C -yP -h -a
</pre>
<p>`-yP' means “payload printable”, `-h' means
“header” and `-a' means names resolution.
Unprintable carachters are displayed as dots.
<h3 class="section"><a name="TOC3"></a>1.3 display client data only of the first smtp connection</h3>
<pre class="example"> # tcpick -i eth0 -C -bCU -T1 "port 25"
</pre>
<p>`-bCU' means: display the rebuilded stream (`-b') only the client side
(`C') and unprintable carachters will be displayed as hexcode (`U').
<p>`T1' means: display only the first (1) connection.
<p>“port 25” is the filter.
<h3 class="section"><a name="TOC4"></a>1.4 download a file passively</h3>
<p>Yeah! It is very a simple job:
<p>#tcpick -i eth0 -wR “port ftp-data”
<p>When the file has been completely transmitted (connection displayed as
“CLOSED”) check in the working directory: you will find some files
named like this:
<pre class="example"> # ls *.tcpick
client_123.45.67.89_98.76.54.32_34567.tcpick
server_123.45.67.89_98.76.54.32_34567.tcpick
</pre>
<p>Bingo! If you do `$ file *.tcpick' you will find that one of the two is a
a gzip archive or whatever you sniffed.
<h3 class="section"><a name="TOC5"></a>1.5 redirect the first connection to a software</h3>
<p>You must choose between client or server side, because you don't want
both stream mixed in the standard output. It is a really simple job,
just type:
<pre class="example"> # tcpick -i eth0 --pipe client "port 80" | gzip > http_response.gz
</pre>
<p>or
<pre class="example"> # tcpick -i eth0 --pipe server "port 25" | nc foobar.net 25
</pre>
<p>Now, use your imagination and let me know what crazy experiments have
you done with tcpick ;^)
</body></html>
|