Home > Honeypot, InfoSec, Kippo, Python > Starting with Kippo (SSH Honeypot)

Starting with Kippo (SSH Honeypot)

2010/07/06

As I started life as a Linux server admin I’m only too aware that many attackers see remote access functionality as a way into a system, and as SSH is the de facto standard for Linux access it is a prime target for attack. The stats collected by DShield give an indication to the extent of the problem.

As a result I’ve had the Kippo honeypot is something that I’ve had on my radar for a while. For a number of reasons I hadn’t found time to implement the system in a live environment, but a recent post on the Diatel blog suggested that installation may be quick and pain free.

Kippo is described by it’s author (Desaster) as:

Kippo is a medium interaction SSH honeypot designed to log brute force attacks and, most importantly, the entire shell interaction performed by the attacker.

Kippo is inspired, but not based on Kojoney.

Installation for me was painless, running a Debian system I downloaded the latest archive to disk, unpacked and installed the pyton-twisted package (I hadn’t read Mig5’s comment until after install so now need to go back and live on the bleeding edge…). I did hit a couple of problems when trying to start up the system, which is as simple as invoking ./start.sh

  1. First, I was logged in as root when I first tried to start the system (not clever I know, was testing…). Kippo encounters an error when started by a root user. As Desaster rightly states, it’s not wise to run Kippo as a root user anyway and running as a regular user resolves the issue.
  2. Second, when running as a normal user I got a ‘meaningful’ error of “Failed to load application: ‘NoneType’ object has no attribute ‘get’.” A quick piece of Google-fu lead me to this ticket, which explained Kippo was missing the file kippo.cfg, as explained copying kippo.cfg.dist to kippo.cfg correct the issue and produced a fully functional system.

There are a couple of key files that can be edited to change the feel of the system that is provided to malicious users:

  • kippo.cfg contains runtime information including log location, fake hostname etc.
  • kippo.tac contains an array ‘users’, which lists the username/password combination which the emulated SSH login will accept as ‘valid’.
  • The honeyfs/ directory goes so far as to allow you to create a ‘real’ filesystem for the malicious user to interact with, potentially copying a live server’s filesystem to the directory to help camouflage the emulated system (after sensitive data is removed/sanitised obviously….). I haven’t tried this myself yet but is definitely on my to-do list.

From initial testing I’ve got high hopes for Kippo becoming a mainstay in my honeypot toolbox; the interaction session provided to a malicious user is reasonably convincing at first glance, and I particularly like the trick to keep users logged in after they think they’ve sent an ‘exit’ command to close the session, it could get some interesting results.

For post compromise analysis Kippo also provides some an interesting utility, utils/playlog.py. This allows you to replay a malicious terminal session in real-time, typos and all, to truely provide a feel for the malicious users interaction with the session. To help whet your apetite whilst I wait for someone to target my kippo installation, Kippo has a few demo’s of the playlog capabilities from compromise attempts. Get your demos here.

–Andrew Waite

Advertisements
Categories: Honeypot, InfoSec, Kippo, Python
  1. 2010/07/07 at 02:54

    Andrew, just sharing, for the people who’re living behind NAT, map port 2222 with port 22, say from the router or from the host.

    If from the host;
    iptables -t nat -A PREROUTING -i eth0 -p tcp –dport 22 -j REDIRECT –to-port 2222

    will redirect port 22 attempt to port 2222 . however if your machine is actively using port 22 for remote access and need reconnect that will be a problem. If the session is ongoing, no problemo amigo

    • 2010/07/07 at 18:53

      Thanks Najmi,

      I had intended to mention my install is behind a NAT (oops), completely slipped my mind. Thanks for filling in the gaps 😀

  2. doncicuto
    2010/07/07 at 16:40

    Great post Andrew! Just be patient and you’ll start to log “interesting” ssh sessions 😀

  3. Andrew
    2010/07/08 at 10:58

    A link to kippo would be nice 🙂

    • 2010/07/08 at 11:12

      Oops, was convinced I had linked to the home page. My mistake, now rectified.

      Cheers

  4. Ion
    2011/12/09 at 13:58

    Hello guys, I wrote two simple posts outlining the installation and configuration of Kippo, let me know what you think:

    http://ikoniari.webpages.auth.gr/installing-kippo-ssh-honeypot-on-ubuntu.html
    http://ikoniari.webpages.auth.gr/logging-kippo-events-using-mysql-db.html

    • 2011/12/09 at 14:17

      Nice work, Ion. Thanks for sharing 🙂

  1. 2010/07/08 at 11:31
  2. 2010/12/31 at 14:03
  3. 2011/05/23 at 09:30
  4. 2011/06/20 at 18:34
Comments are closed.
%d bloggers like this: