cha...ader(1)

chaosreader(1) πŸ’–

okay bestie, sit DOWN, because we're about to talk about chaosreader β€” the little icon that traces network sessions and exports the whole thing to html format. she's giving forensics, she's giving main character, she's giving "I read your tcpdump so you don't have to". ✨


NAME πŸŽ€

chaosreader β€” trace network sessions and export it to html format πŸ’…


SYNOPSIS πŸ¦‹

chaosreader

chaosreader [-adehiknqrvxAHIRTUXY] [-D dir]
            [-b port[,...]] [-B port[,...]]
            [-j IPaddr[,...]] [-J IPaddr[,...]]
            [-l port[,...]] [-L port[,...]] [-m bytes[k]]
            [-M bytes[k]] [-o "time"|"size"|"type"|"ip"]
            [-p port[,...]] [-P port[,...]]
            infile [infile2 ...]

chaosreader -s [mins] | -S [mins[,count]]
            [-z] [-f 'filter']

DESCRIPTION 🌸

So chaosreader traces TCP/UDP/others sessions and scoops up application data from snoop or tcpdump logs. it's a "any-snarf" type of program, meaning it will literally grab telnet sessions, FTP files, HTTP transfers (HTML, GIF, JPEG etc) and SMTP emails right out of the captured data inside network traffic logs. not me being nosy but also being extremely good at it 😌

she makes a html index file that links to all the session details, including realtime replay programs for telnet, rlogin, IRC, X11 and VNC sessions. plus chaosreader reports like image reports and HTTP GET/POST content reports. obsessed.

she also creates replay programs for telnet sessions so you can play them back in realtime (or even at different speeds). yes, different speeds. she's versatile like that 🫢

and get this β€” chaosreader can also run in standalone mode, where she invokes tcpdump or snoop (a similar to tcpdump program for Solaris) to create the log files and then processes them. self-sufficient queen πŸ‘‘


OPTIONS πŸ’…

  • -a, --application β€” Create application session files (this is the default, no cap).
  • -d, --preferdns β€” Show DNS names instead of IP addresses (so much cuter to read, honestly).
  • -e, --everything β€” Create HTML 2-way & hex files for everything. everything. all of it. periodt.
  • -h β€” Print a brief help. short and sweet.
  • --help β€” Print verbose help (this) and version.
  • --help2 β€” Print massive help. she said "you want MORE?"
  • -i, --info β€” Create info file.
  • -q, --quiet β€” Quiet, no output to screen.
  • -r, --raw β€” Create raw files.
  • -v, --verbose β€” Verbose.
  • -x, --index β€” Create index files (default).
  • -A, --noapplication β€” Exclude application session files.
  • -H, --hex β€” Include hex dumps (slow 🐌).
  • -I, --noinfo β€” Exclude info files.
  • -R, --noraw β€” Exclude raw files.
  • -T, --notcp β€” Exclude TCP traffic.
  • -U, --noudp β€” Exclude UDP traffic.
  • -Y, --noicmp β€” Exclude ICMP traffic.
  • -X, --noindex β€” Exclude index files.
  • -k, --keydata β€” Create extra files for keystroke analysis.
  • -n, --names β€” Include hostnames in hyperlinked HTTPlog (HTML).
  • -D dir, --dir dir β€” Output all files to this directory.
  • -b 25,79, --playtcp 25,79 β€” Replay these TCP ports as well (playback).
  • -B 36,42, --playudp 36,42 β€” Replay these UDP ports as well (playback).
  • -l 7,79, --htmltcp 7,79 β€” Create HTML for these TCP ports as well.
  • -L 7,123, --htmludp 7,123 β€” Create HTML for these UDP ports as well.
  • -m 1k, --min 1k β€” Min size of connection to save ("k" for Kb).
  • -M 1024k, --max 1k β€” Max size of connection to save ("k" for Kb).
  • -o size, --sort size β€” Sort Order: time/size/type/ip (Default time).
  • -p 21,23, --port 21,23 β€” Only examine these ports (TCP & UDP).
  • -P 80,81, --noport 80,81 β€” Exclude these ports (TCP & UDP).
  • -s 5, --runonce 5 β€” Standalone. Run tcpdump/snoop for 5 mins.
  • -S 5,10, --runmany 5,10 β€” Standalone, many. 10 samples of 5 mins each.
  • -S 5, --runmany 5 β€” Standalone, endless. 5 min samples forever.
  • -z, --runredo β€” Standalone, redo. Rereads last run's logs.
  • -j 10.1.2.1, --ipaddr 10.1.2.1 β€” Only examine these IPs.
  • -J 10.1.2.1, --noipaddr 10.1.2.1 β€” Exclude these IPs.
  • -f 'port 7', --filter 'port 7' β€” With standalone, use this dump filter.

OUTPUT FILES 🌈

bestie, she is going to make SO many files. run this in a clean directory, I'm begging you πŸ™ˆ short example:

  • index.html β€” Html index (full details).
  • index.text β€” Text index.
  • index.file β€” File index for standalone redo mode.
  • image.html β€” HTML report of images.
  • getpost.html β€” HTML report of HTTP GET/POST requests.
  • session_0001.info β€” Info file describing TCP session #1.
  • session_0001.telnet.html β€” HTML colored 2-way capture (time sorted).
  • session_0001.telnet.raw β€” Raw data 2-way capture (time sorted).
  • session_0001.telnet.raw1 β€” Raw 1-way capture (assembled) server->client.
  • session_0001.telnet.raw2 β€” Raw 1-way capture (assembled) client->server.
  • session_0002.web.html β€” HTML colored 2-way.
  • session_0002.part_01.html β€” HTTP portion of the above, a HTML file.
  • session_0003.web.html β€” HTML colored 2-way.
  • session_0003.part_01.jpeg β€” HTTP portion of the above, a JPEG file.
  • session_0004.web.html β€” HTML colored 2-way.
  • session_0004.part_01.gif β€” HTTP portion of the above, a GIF file.
  • session_0005.part_01.ftp-data.gz β€” An FTP transfer, a gz file.

CONVENTIONS 🧚

  • session_* β€” TCP Sessions.
  • stream_* β€” UDP Streams.
  • icmp_* β€” ICMP packets.
  • index.html β€” HTML Index.
  • index.text β€” Text Index.
  • index.file β€” File Index for standalone redo mode only.
  • image.html β€” HTML report of images.
  • getpost.html β€” HTML report of HTTP GET/POST requests.
  • *.info β€” Info file describing the Session/Stream.
  • *.raw β€” Raw data 2-way capture (time sorted).
  • *.raw1 β€” Raw 1-way capture (assembled) server->client.
  • *.raw2 β€” Raw 1-way capture (assembled) client->server.
  • *.replay β€” Session replay program (perl).
  • *.partial.* β€” Partial capture (tcpdump/snoop were aware of drops).
  • *.hex.html β€” 2-way Hex dump, rendered in colored HTML.
  • *.hex.text β€” 2-way Hex dump in plain text.
  • *.X11.replay β€” X11 replay script (talks X11).
  • *.textX11.replay β€” X11 communicated text replay script (text only).
  • *.textX11.html β€” 2-way text report, rendered in red/blue HTML.
  • *.keydata β€” Keystroke delay data file. Used for SSH analysis.

MODES ⭐

Normal eg "chaosreader infile", this is where a tcpdump/snoop file was created previously and chaosreader reads and processes it.

Standalone once eg "chaosreader -s 10" this is where chaosreader 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 dir, which is of the format out_YYYYMMDD-hhmm, eg "out_20031003-2221".

Standalone, many eg "chaosreader -S 5,12", this is where chaosreader 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.

Standalone, redo eg "chaosreader -ve -z", (the -z), 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, "-ve"). It reads index.file to determine which capture logs to read.

Standalone, endless eg "chaosreader -S 5", like standalone many β€” but runs forever (if you ever had the need?). Watch your disk space! πŸ’€

Note: this is a work in progress, some of the code is a little unpolished.

NOTES ✨

  • Run chaosreader in an empty directory.
  • Create small packet dumps. Chaosreader uses around 5x the dump size in memory. A 100Mb file could need 500Mb of RAM to process.
  • Your tcpdump may allow "-s0" (entire packet) instead of "-s9000".
  • Beware of using too much disk space, especially standalone mode.
  • If you capture too many small connections giving a huge index.html, try using the -m option to ignore small connections. eg "-m 1k".
  • 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 -o logfile".
  • tcpdump logs may not be portable between OSs that use different sized timestamps or endian.
  • Logs are best created in a memory filesystem for speed, usually /tmp.
  • 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 (-8bit, "Hextile", ...)
  • SSH analysis can be performed with the "sshkeydata" program as demonstrated on http://www.brendangregg.com/sshanalysis.html . chaosreader provides the input files (*.keydata) that sshkeydata analyses.

BUGS 😭

The following assumptions may cause problems (check for new vers):

  • 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).
  • Time based order is more important for 2-way sessions (eg telnet), SEQ order is more import for 1-way transfers (eg ftp-data).
  • One particular TCP session isn't active for long enough that the SEQ number loops (or even wraps).

EXAMPLES πŸ”₯

  • Example 1:
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...
  • Example 2:
snoop -o output1                 # create snoop capture file instead

chaosreader output1              # extract recognised sessions...
  • Example 3:
chaosreader -S 2,5      # Standalone, sniff network 5 times for 2 mins
                        # each. View index.html for progress (or .text)

SEE ALSO πŸ¦‹

tcpdump(8), snoop(1M), chaosreader help page.


AUTHORS πŸ‘‘

chaosreader was written by Brendan Gregg.

This manual page was written by Joao Eriberto Mota Filho <eriberto@debian.org> for the Debian project (but may be used by others).


and that's the whole vibe, bestie 🫢 this was chaosreader-0.96, dated 18 Nov 2016 β€” go read your packet dumps, you absolute icon πŸ’–βœ¨