Development

Vagrant

Vagrant can be used to setup a development environment for dionaea within minutes.

Install

First install Vagrant and VirtualBox.

If everything has been setup correctly clone the git repository and use vagrant to bootstrap and start the environment.

$ git clone https://github.com/DinoTools/dionaea.git
$ cd dionaea/vagrant
$ vagrant up

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

Run

Access the development environment, edit the config files and start dionaea with the following command.

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

Rebuild and test

To rebuild and install dionaea run the flowing commands.

$ cd /vagrant
$ make
$ sudo make install

See Run for more information on how to start dionaea.

Ubuntu 14.04

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