.\" Text automatically generated by txt2man .TH chaosreader 1 "18 Nov 2016" "chaosreader-0.96" "trace network sessions and export it to html format" .SH NAME \fBchaosreader \fP- trace network sessions and export it to html format \fB .SH SYNOPSIS .nf .fam C \fBchaosreader\fP \fBchaosreader\fP [\fB-adehiknqrvxAHIRTUXY\fP] [\fB-D\fP \fIdir\fP] [\fB-b\fP port[,\.\.\.]] [\fB-B\fP port[,\.\.\.]] [\fB-j\fP IPaddr[,\.\.\.]] [\fB-J\fP IPaddr[,\.\.\.]] [\fB-l\fP port[,\.\.\.]] [\fB-L\fP port[,\.\.\.]] [\fB-m\fP bytes[k]] [\fB-M\fP bytes[k]] [\fB-o\fP "time"|"size"|"type"|"ip"] [\fB-p\fP port[,\.\.\.]] [\fB-P\fP port[,\.\.\.]] \fBinfile\fP [\fIinfile2\fP \.\.\.] \fBchaosreader\fP \fB-s\fP [\fImins\fP] | \fB-S\fP [\fImins\fP[,count]] [\fB-z\fP] [\fB-f\fP 'filter'] .fam T .fi .fam T .fi .SH DESCRIPTION Chaosreader traces TCP/UDP/others sessions and fetches application data from snoop or tcpdump logs. This is a type of "any-snarf" program, as it will fetch telnet sessions, FTP files, HTTP transfers (HTML, GIF, JPEG etc) and SMTP emails from the captured data inside network traffic logs. A html index file is created to that links to all the session details, including realtime replay programs for telnet, rlogin, IRC, X11 and VNC sessions. Chaosreader reports such as image reports and HTTP GET/POST content reports. .PP It also creates replay programs for telnet sessions, so that you can play them back in realtime (or even different speeds). .PP Chaosreader can also run in standalone mode, where it invokes tcpdump or snoop (a similar to tcpdump program for Solaris) to create the log files and then processes them. .SH OPTIONS .TP .B \fB-a\fP, \fB--application\fP Create application session files (default). .TP .B \fB-d\fP, \fB--preferdns\fP Show DNS names instead of IP addresses. .TP .B \fB-e\fP, \fB--everything\fP Create HTML 2-way & hex files for everything. .TP .B \fB-h\fP Print a brief help. .TP .B \fB--help\fP Print verbose help (this) and version. .TP .B \fB--help2\fP Print massive help. .TP .B \fB-i\fP, \fB--info\fP Create info file. .TP .B \fB-q\fP, \fB--quiet\fP Quiet, no output to screen. .TP .B \fB-r\fP, \fB--raw\fP Create raw files. .TP .B \fB-v\fP, \fB--verbose\fP Verbose. .TP .B \fB-x\fP, \fB--index\fP Create index files (default). .TP .B \fB-A\fP, \fB--noapplication\fP Exclude application session files. .TP .B \fB-H\fP, \fB--hex\fP Include hex dumps (slow). .TP .B \fB-I\fP, \fB--noinfo\fP Exclude info files. .TP .B \fB-R\fP, \fB--noraw\fP Exclude raw files. .TP .B \fB-T\fP, \fB--notcp\fP Exclude TCP traffic. .TP .B \fB-U\fP, \fB--noudp\fP Exclude UDP traffic. .TP .B \fB-Y\fP, \fB--noicmp\fP Exclude ICMP traffic. .TP .B \fB-X\fP, \fB--noindex\fP Exclude index files. .TP .B \fB-k\fP, \fB--keydata\fP Create extra files for keystroke analysis. .TP .B \fB-n\fP, \fB--names\fP Include hostnames in hyperlinked HTTPlog (HTML) .TP .B \fB-D\fP \fIdir\fP, --\fIdir\fP \fIdir\fP Output all files to this directory. .TP .B \fB-b\fP 25,79, \fB--playtcp\fP 25,79 Replay these TCP ports as well (playback). .TP .B \fB-B\fP 36,42, \fB--playudp\fP 36,42 Replay these UDP ports as well (playback). .TP .B \fB-l\fP 7,79, \fB--htmltcp\fP 7,79 Create HTML for these TCP ports as well. .TP .B \fB-L\fP 7,123, \fB--htmludp\fP 7,123 Create HTML for these UDP ports as well. .TP .B \fB-m\fP 1k, \fB--min\fP 1k Min size of connection to save ("k" for Kb). .TP .B \fB-M\fP 1024k, \fB--max\fP 1k Max size of connection to save ("k" for Kb) .TP .B \fB-o\fP size, \fB--sort\fP size Sort Order: time/size/type/ip (Default time). .TP .B \fB-p\fP 21,23, \fB--port\fP 21,23 Only examine these ports (TCP & UDP). .TP .B \fB-P\fP 80,81, \fB--noport\fP 80,81 Exclude these ports (TCP & UDP). .TP .B \fB-s\fP 5, \fB--runonce\fP 5 Standalone. Run tcpdump/snoop for 5 \fImins\fP. .TP .B \fB-S\fP 5,10, \fB--runmany\fP 5,10 Standalone, many. 10 samples of 5 \fImins\fP each. .TP .B \fB-S\fP 5, \fB--runmany\fP 5 Standalone, endless. 5 min samples forever. .TP .B \fB-z\fP, \fB--runredo\fP Standalone, redo. Rereads last run's logs. .TP .B \fB-j\fP 10.1.2.1, \fB--ipaddr\fP 10.1.2.1 Only examine these IPs. .TP .B \fB-J\fP 10.1.2.1, \fB--noipaddr\fP 10.1.2.1 Exclude these IPs. .TP .B \fB-f\fP 'port 7', \fB--filter\fP 'port 7' With standalone, use this dump filter. .SH OUTPUT FILES Many files will be created, run this in a clean directory. Short example: .TP .B index.html Html index (full details). .TP .B index.text Text index. .TP .B index.file File index for standalone redo mode. .TP .B image.html HTML report of images. .TP .B getpost.html HTML report of HTTP GET/POST requests. .TP .B session_0001.info Info file describing TCP session #1. .TP .B session_0001.telnet.html HTML colored 2-way capture (time sorted). .TP .B session_0001.telnet.raw Raw data 2-way capture (time sorted). .TP .B session_0001.telnet.raw1 Raw 1-way capture (assembled) server->client. .TP .B session_0001.telnet.raw2 Raw 1-way capture (assembled) client->server. .TP .B session_0002.web.html HTML colored 2-way. .TP .B session_0002.part_01.html HTTP portion of the above, a HTML file. .TP .B session_0003.web.html HTML colored 2-way. .TP .B session_0003.part_01.jpeg HTTP portion of the above, a JPEG file. .TP .B session_0004.web.html HTML colored 2-way. .TP .B session_0004.part_01.gif HTTP portion of the above, a GIF file. .TP .B session_0005.part_01.ftp-data.gz An FTP transfer, a gz file. .SH CONVENTIONS .TP .B session_* TCP Sessions. .TP .B stream_* UDP Streams. .TP .B icmp_* ICMP packets. .TP .B index.html HTML Index. .TP .B index.text Text Index. .TP .B index.file File Index for standalone redo mode only. .TP .B image.html HTML report of images. .TP .B getpost.html HTML report of HTTP GET/POST requests. .TP .B *.info Info file describing the Session/Stream. .TP .B *.raw Raw data 2-way capture (time sorted). .TP .B *.raw1 Raw 1-way capture (assembled) server->client. .TP .B *.raw2 Raw 1-way capture (assembled) client->server. .TP .B *.replay Session replay program (perl). .TP .B *.partial.* Partial capture (tcpdump/snoop were aware of drops). .TP .B *.hex.html 2-way Hex dump, rendered in colored HTML. .TP .B *.hex.text 2-way Hex dump in plain text. .TP .B *.X11.replay X11 replay script (talks X11). .TP .B *.textX11.replay X11 communicated text replay script (text only). .TP .B *.textX11.html 2-way text report, rendered in red/blue HTML. .TP .B *.keydata Keystroke delay data file. Used for SSH analysis. .SH MODES .TP .B Normal eg "\fBchaosreader\fP \fBinfile\fP", this is where a tcpdump/snoop file was created previously and \fBchaosreader\fP reads and processes it. .TP .B Standalone once eg "\fBchaosreader\fP \fB-s\fP 10" this is where \fBchaosreader\fP runs tcpdump/snoop and generates the log file, in this case for 10 minutes, and then processes the result. Some OS's may not have tcpdump or snoop available so this will not work (instead you may be able to get Ethereal, run it, save to a file, then use normal mode). There is a master index.html and the report index.html in a sub \fIdir\fP, which is of the format out_YYYYMMDD-hhmm, eg "out_20031003-2221". .TP .B Standalone, many eg "\fBchaosreader\fP \fB-S\fP 5,12", this is where \fBchaosreader\fP runs tcpdump/snoop and generates many log files, in this case it samples 12 times for 5 minutes each. While this is running, the master index.html can be viewed to watch progress, which links to minor index.html reports in each sub directory. .TP .B Standalone, redo eg "\fBchaosreader\fP \fB-ve\fP \fB-z\fP", (the \fB-z\fP), this is where a standalone capture was previously performed - and now you would like to reprocess the logs - perhaps with different options (in this case, "\fB-ve\fP"). It reads index.file to determine which capture logs to read. .TP .B Standalone, endless eg "\fBchaosreader\fP \fB-S\fP 5", like standalone many - but runs forever (if you ever had the need?). Watch your disk space! .PP Note: this is a work in progress, some of the code is a little unpolished. .SH NOTES .IP \(bu 3 Run \fBchaosreader\fP in an empty directory. .IP \(bu 3 Create small packet dumps. Chaosreader uses around 5x the dump size in memory. A 100Mb file could need 500Mb of RAM to process. .IP \(bu 3 Your tcpdump may allow "\fB-s0\fP" (entire packet) instead of "\fB-s9000\fP". .IP \(bu 3 Beware of using too much disk space, especially standalone mode. .IP \(bu 3 If you capture too many small connections giving a huge index.html, try using the \fB-m\fP option to ignore small connections. eg "\fB-m\fP 1k". .IP \(bu 3 snoop logs may actually work better. Snoop logs are based on RFC1761, however there are many variants of tcpdump/libpcap and this program cannot read them all. If you have Ethereal you can create snoop logs during the "save as" option. On Solaris use "snoop \fB-o\fP logfile". .IP \(bu 3 tcpdump logs may not be portable between OSs that use different sized timestamps or endian. .IP \(bu 3 Logs are best created in a memory filesystem for speed, usually /tmp. .IP \(bu 3 For X11 or VNC playbacks, first practise by replaying a recent captured session of your own. The biggest problem is color depth, your screen must match the capture. For X11 check authentication (xhost +), for VNC check the viewers options (\fB-8bit\fP, "Hextile", \.\.\.) .IP \(bu 3 SSH analysis can be performed with the "sshkeydata" program as demonstrated on http://www.brendangregg.com/sshanalysis.html . \fBchaosreader\fP provides the input files (*.keydata) that sshkeydata analyses. .SH BUGS The following assumptions may cause problems (check for new vers): .IP \(bu 3 A lower port number = the service type. Eg with ports 31247 and 23, the actual type of session is telnet (23). This may not work for some things (eg, VNC). .IP \(bu 3 Time based order is more important for 2-way sessions (eg telnet), SEQ order is more import for 1-way transfers (eg ftp-data). .IP \(bu 3 One particular TCP session isn't active for long enough that the SEQ number loops (or even wraps). .SH EXAMPLES .IP \(bu 3 Example 1: .PP .nf .fam C tcpdump -s9000 -w output1 # create tcpdump capture file chaosreader output1 # extract recognised sessions, or, chaosreader -ve output1 # gimme everything, or, chaosreader -p 20,21,23 output1 # only ftp and telnet\.\.\. .fam T .fi .IP \(bu 3 Example 2: .PP .nf .fam C snoop -o output1 # create snoop capture file instead chaosreader output1 # extract recognised sessions\.\.\. .fam T .fi .IP \(bu 3 Example 3: .PP .nf .fam C chaosreader -S 2,5 # Standalone, sniff network 5 times for 2 mins each. View index.html for progress (or .text) .fam T .fi .SH SEE ALSO \fBtcpdump\fP(8), \fBsnoop\fP(1M), \fBchaosreader\fP help page. .SH AUTHORS \fBchaosreader\fP was written by Brendan Gregg. .PP This manual page was written by Joao Eriberto Mota Filho for the Debian project (but may be used by others).