data visualisation - afterglow

We will create images showing the correlation of attacker-host, vulnerability, malware.
Basically, image will look like this:
small version of an afterglow picture
I had to cheat to get the image to a valid size … But, you may have much more data, so images may look like this:
scaled version of the image
this is a rescaled version of the real image, here is a link to the large one.

sqlite

First, extract the data we need from the sqlite database, the query takes all downloads during the last 14 days into account.

query

SELECT
	root.remote_host,
	root.connection_protocol || '::' || dcerpcservice_name  || '::' ||dcerpcserviceop_name ,
	downloads.download_md5_hash
FROM 
	downloads
	NATURAL JOIN connections
	JOIN connections AS root ON (connections.connection_root = root.connection)
	JOIN dcerpcbinds AS binds ON (root.connection = binds.connection)
	JOIN dcerpcrequests ON(root.connection = dcerpcrequests.connection AND binds.dcerpcbind_uuid = dcerpcrequest_uuid)
	JOIN dcerpcservices ON (dcerpcservice_uuid = binds.dcerpcbind_uuid)
	JOIN dcerpcserviceops ON (dcerpcserviceops.dcerpcservice = dcerpcservices.dcerpcservice AND dcerpcserviceop_opnum = dcerpcrequests.dcerpcrequest_opnum)
WHERE
	root.connection_timestamp > strftime('%s','now') - 14*24*3600
;

afterglow-malware-hosts.sql

cheating

As afterglows thresholds did not do any good for me, I bruteforced all, I decided to limit the images size in a way I expected to work - limiting the input data size.

        JOIN (
                SELECT
                        COUNT(*) AS download_count,
                        download_md5_hash
                FROM
                        downloads
                        NATURAL JOIN connections AS iconnections
                        JOIN connections AS iroot ON (iconnections.connection_root = iroot.connection)
                WHERE
                        iroot.connection_timestamp > strftime('%s','now') - 21*24*3600
                GROUP BY
                        download_md5_hash
                ) AS download_counts ON (download_counts.download_md5_hash = downloads.download_md5_hash)

add this join

WHERE
        root.connection_timestamp > strftime('%s','now') - 21*24*3600
        AND download_count > 27

add the download_count filter clause

export data

sqlite> .separator ","
sqlite> .output /tmp/afterglow-malware-hosts.csv
sqlite> .read afterglow-malware-hosts.sql

sanatize data

Replace all host addresses with 10/8 addresses. ipstrip did not really survive the git migration, here is a copy.

cat /tmp/afterglow-malware-hosts.csv | ipstrip.py -l -s mysecret > /tmp/afterglow-malware-hosts-sanatized.csv

afterglow

Afterglow will get the sanatized csv file, and create a dot file for us.

color.source="yellow"
color.event="green"
color.target="red"

afterglow-malware-hosts.conf

src/perl/graph/afterglow.pl -d -p 2 -i /tmp/afterglow-malware-hosts-sanatized.csv  -w /tmp/afterglow-malware-hosts.dot -c /tmp/afterglow-malware-hosts.conf

cheating

To reduce image size, I changed the node shape to box, and set the edge len to 1.5 in the resulting dot file.

...
node [shape=box, style=filled, fontsize=10, width=0.2, height=0.2, fontcolor=black ];
edge [len=1.5];
...

head of /tmp/afterglow-malware-hosts.dot

neato

The dot file created by afterflow is fed into neato, neato creates the image.

neato -Tpng -o /tmp/afterglow-malware-hosts.png /tmp/afterglow-malware-hosts.dot

finally

The large version can be found here.

Comments

1

Hello Markus,

My name is Ivan and I'm working with dionaea in my master degree.

I had install it and everything is going alright. But now I need to extract informations from it.

Unfortunately I'm not so good with databases and I don't manage execute what you show in http://carnivore.it/2010/06/11/data_visualisation_-_afterglow ; http://carnivore.it/2010/06/06/data_visualisation and http://carnivore.it/2010/09/19/gnuplotsql

Can you help me, please!!!

If you want, you can send me an email.

Regards,

Ivan

Ivan
2013/02/06 17:21


2010/06/11/data_visualisation_-_afterglow.txt · Last modified: 2010/06/15 01:00 by common
chimeric.de = chi`s home Creative Commons License Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0