Development

Docker

The docker-compose can be used to setup a development envirnment for dionaea.

$ git clone https://github.com/DinoTools/dionaea.git
$ cd dionaea/dev/docker
$ docker-compose up

To debug dionaea it can be started with gdbserver and gdbgui.

$ git clone https://github.com/DinoTools/dionaea.git
$ cd dionaea/dev/docker
$ docker-compose -f docker-compose.yml -f extra_conf/gdbserver.yml up

The gdbgui frontend is available on the host system http://localhost:5000/. To connect to the gdbserver just select ‘Connect to gdbserver’ and enter dionaea:9999 on the frontend.

All source files are monitored with inotifywait and if a source file changes dionaea is automatically rebuild and restarted.

Ubuntu 14.04

Todo

This section is deprecated and should be updated.

Instead of using Vagrant you can use a Ubuntu 14.04 system to setup your development environment. In this section we will use the scripts used to setup the Vagrant environment to bootstrap a fresh Ubuntu system. If you like you can follow the Installation ‘From Source’ guide to setup everything by hand.

Install

First install Ubuntu.

If everything has been setup correctly clone the git repository and run the bootstrap script.

$ git clone https://github.com/DinoTools/dionaea.git
$ vagrant
$ ./bootstrap.sh

All files will be installed in the /opt/dionaea directory.

Rebuild and test

Rebuild, install and start dionaea from the root of the git repository.

$ make
$ sudo make install
$ sudo /opt/dionaea/bin/dionaea -c /opt/dionaea/etc/dionaea/dionaea.cfg -l all,-debug -L '*'

This can also be done in one line.

$ make && sudo make install && sudo dionaea -c /opt/dionaea/etc/dionaea/dionaea.cfg -l all,-debug -L '*'

Find memory leaks

To enable AddressSanitizer you have to add the following parameters to the configure script and rebuild dionaea.

--disable-shared CFLAGS="-fsanitize=address -ggdb" CXXFLAGS="-fsanitize=address -ggdb"

When running dionaea it will print information about overfow errors. If you would like to stop execution you have to export an additional environment variable.

export ASAN_OPTIONS='abort_on_error=1'

To get a stacktrace you can use gdb and add an additional breakpoint break __asan_report_error.

It is also possible to use asan_symbolize.py python2 script to extract additional information.

/opt/dionaea/bin/dionaea -c /opt/dionaea/etc/dionaea/dionaea.cfg  2>&1 | python asan_symbolize.py