« HoneyDrive 3 VMware guide

Adding ElasticSearch support to Kippo SSH honeypot »

Aug 07 2014

Getting started with honeyd

This is a quick guide to honeyd (which is included in HoneyDrive of course) inspired by Jonathan whom I had the pleasure to meet at BSides where we discussed about honeypots and some problems related to honeyd’s operation.

I will be explaining the following common scenario: we have a home router with a port forwarding/DMZ feature and we utilize the latter to send traffic to a honeypot emulating an old Linux server to catch some attacks. Details:

  • Public IP address (WAN): <something, e.g. dynamic>
  • IP address of the honeyd VM (LAN): 192.168.1.77
  • IP address of the virtual honeypot (LAN): 192.168.1.50

The first thing to notice is that there are actually two honeypot related machines above. We have the honeyd VM and a “virtual honeypot”. This is because honeyd doesn’t actually run the (fake) services we define by itself so to speak, but it creates “virtual honeypots” for machines we want to emulate. You can think of a virtual honeypot as a separate tiny virtual machine created and controlled by honeyd.

Honeyd can create many virtual honeypots like that and even whole network topologies consisting of many. Each of these virtual honeypots are normally bound to a private IP (let’s say in the 192.168.1.0/24 range). The problem with this scenario is that the router we have on our network doesn’t know where exactly to deliver packets that are destined to one of the virtual honeypots. For this reason we must use a tool called farpd, which affects the operation of the ARP protocol. Using farpd we essentially tell to the router to send every package destined to our virtual honeypot (192.168.1.50) to the honeypot VM (192.168.1.77) instead, where honeyd will get it and “deliver” it properly to the virtual honeypot.

Installing honeyd and farpd is easy via apt:

# apt-get install honeyd farpd

After the installation, a new file should have been created at /etc/default/honeyd which is responsible for the initialization of honeyd. In that file we need to edit the INTERFACE and NETWORK variables where we need to enter appropriate values depending on the network topology we are trying to achieve. In our case these should be “eth0” (normally) and “192.168.1.50” accordingly. And if we want to use the init script we need to set RUN to “yes” as well.

Honeyd also creates its primary configuration file at /etc/honeypot/honeyd.conf. This is where we should enter all the virtual honeypots and all their fake services. Here is an example of a honeyd configuration file:

# FTP Linux server template
create linuxftp
set linuxftp personality "Linux 2.4.7 (X86)"
set linuxftp default tcp action reset
set linuxftp default udp action block
set linuxftp default icmp action open
add linuxftp tcp port 21 "sh /usr/share/honeyd/scripts/unix/linux/suse8.0/proftpd.sh $ipsrc $sport $ipdst $dport"
bind 192.168.1.50 linuxftp

After creating our honeyd configuration file, we need to start farpd as mentioned above. This is easily done as:

# farpd 192.168.1.77 -i eth0

And only then we are ready to start honeyd:

# /etc/init.d/honeyd start

The last command actually starts honeyd with its default settings. The full command to achieve the same would have been:

# /usr/bin/honeyd -f /etc/honeypot/honeyd.conf -l /var/log/honeypot/honeyd.log -p /etc/honeypot/nmap.prints -a /etc/honeypot/nmap.assoc -0 /etc/honeypot/pf.os -x /etc/honeypot/xprobe2.conf -u 1000 -g 1000 -i eth0 192.168.1.50

From now on, FTP connections to 192.168.1.50 will arrive to 192.168.1.77 and honeyd will deliver them to the virtual honeypot where they will be handled by the script we specified in the config file.

Honeyd writes to the honeyd.log file which you can transfer to a MySQL database using Honeyd2MySQL and then visualize the data with Honeyd-Viz.

  • Pingback: Security-Vision » Getting started with honeyd()

  • mikkosuomu

    I believe on above example it should be “farpd -i eth0 192.168.1.50” if this is the IP claimed by honeyd, right?

    • http://bruteforce.gr/ Ion

      No I think it should be .77 (the IP of the honeyd VM). honeyd will then “route” the packets to 192.168.1.50 (the IP of the virtual honeypot created by honeyd).

  • soni

    are the honeyd vm and honeypot vm ip addresses random? if not how do we find them?

    after running the above, what is to be done after ftp open *ip_adress*, what result is to be expected?

    • http://bruteforce.gr/ Ion

      They are not random, but their exact address doesn’t really matter as long as they are unique and unused in your network. The .77 was a static one I picked for the VM, and the .50 one is defined in the configuration file (last line).

      After honeyd is running all FTP connections will be handled by the /usr/share/honeyd/scripts/unix/linux/suse8.0/proftpd.sh script as defined in the config file. Of course you can write your own scripts with more features etc.

More in Honeypots
HoneyDrive 3 VMware guide
HoneyDrive 3 Royal Jelly edition
Vagrant configuration for Thug honeyclient
Kippo-Graph 1.2 released!
Honeypots workshop at BSidesLV 2014!
Close