The Search utility allows an analyst to reach back in time and view network events even if they didn't meet the criteria (filters) to be included in an hourly report. Depending on the search plugin and output format selected, the analyst can display the results of ad-hoc queries textually or graphically, or retrieve the packets that match the query as a composite libpcap dumpfile for further, local, examination.
The Search interface is plugin-customized to provide access to important capabilities of the associated utility. For instance, the ngrep search interface provides text boxes in which you can specify regular expressions to match against packet payload, while the tethereal search interface accepts tethereal-specific filters. The plugin-specific interfaces that are included with this distribution will be discussed in "Search plugins", below.
Not all of the following are available to all plugins, but are general enough to be called "standard":
gnuplot(1) must be installed on the analyzer.
mergecap(1) or tcpslice(1), if available, aggregates them into a new
binary dumpfile which can be downloaded to the analyst's local system for
further analysis. One of the primary benefits gained through binary downloads
is the now obviated need for analysts' shell accounts, and possibly even
sshd, on the IDABench analysis system. An example of use might be to query
for an interesting tcp communication, such as an IRC bot's communication with
its server, by specifying source and destination addresses, as well as binary
output format, in the tcpdump search tab, then locally using tcptrace,
ethereal or tcpflow to extract the conversation(s). Another possibility is to
query for all traffic to a suspected compromised system, then open the binary
dumpfile with etherape to graphically display the communication relationships
as they unfold. Ooh, pretty.
With both graphical and binary output, the image files and merged packet logs
returned from your query are spooled locally on the webserver for a period of
time specified as CLEAN_TIME in site.ph. The names of the resultant
.png, .ps or .bin files look like gibberrish, but are actually a md5sum(1)
of the submitted search parameters. Every time a search form is submitted, the
md5sum is calculated and IDABench checks to see if someone has already
performed this same search. If so, the results are returned directly from the
cached file, instead of re-running the search.
One thing to look out for, as a result of this: If the search parameters haven't changed, but the dataset has, IDABench will NOT run the search over again. This is a bug and will be addressed shortly. Until this is fixed, you will need to either change something in the query (add another hour, or a redundant bpf element), or delete the offending cached files from the spool directory before resubmitting the form.
The search plugins included with IDABench are by no means the only ones that are possible. As such, these notes may be rather insufficient to describe the settings and options available to you. The three that are provided are:
tcpdump(1) deal with output
formatting.
tcpdump is trying to print
details of a particular transport or application protocol, merely because of a
certain port number. For instance, an attacker is communicating with his remote
administration backdoor on port 12345, using a source port of 53. This would
be misinterpreted as DNS traffic and printed with erroneous details.
tcpdump's summary line, or not printed at all. It
may also make available patterns of binary content for correlation. "With
ASCII" prints line numbers, hex, and ASCII representation of that binary
content, side-by-side. Pretty. This option will not work with early versions of
tcpdump(1).
.* or a pipe
symbol |, depending on the pull-down selections "followed by" and "or",
respectively. To better understand the syntax and processing, try several
combinations and review the resultant command line that is displayed at the top
of the returned "Results" web page.
From the Tethereal manual page:
When printing a decoded form of packets, Tethereal prints,
by default, a summary line containing the fields specified
by the preferences file (which are also the fields dis
played in the packet list pane in Ethereal), although if
it's printing packets as it captures them, rather than
printing packets from a saved capture file, it won't print
the "frame number" field. If the -V flag is specified, it
prints instead a protocol tree, showing all the fields of
all protocols in the packet.
See man 1 tethereal for a full description of the read filter syntax. A
few examples:
ip.addr eq 10.2.3.4 - either ip address equals 10.2.3.4
ip.src ne 192.168.46.2 - source ip address is not equal to 192.168.46.2
tcp.port ne 22 - EITHER tcp source port or destination port isn't equal
to 22
! tcp.port eq 22 - NEITHER tcp source port not destination port is equal
to 22
aim.channel eq 2 and ip.addr eq dhcp69 - AOL Instant Messenger
channel 2 and ip host dhcp.69
aim[17:9] == 61.6c.70.69.6e.69.73.74.61 - AOL IM Screen name is
"alpinista"
The tethereal search plugin is a very simple one that can be used as an example of plugin design; hopefully there will be a friendlier IDABench interface to tethereal soon.
If a query is submitted that is identical to a prior query, and the image or composite binary dumpfile is still in the web spool directory, the query will NOT be reprocessed. Instead, the cached results will be returned to the browser immediately. This allows one to bookmark or email the URL of a "results" webpage containing an image or postscript or binary results link. These spooled files will be flushed once the IDABENCH_TEMP_FILE_LIFESPAN (in idabench.conf) has been surpassed.