UPDATE JULY 2014: This guide is considered “old” now. You probably want to try the new Thug-Vagrant project: http://bruteforce.gr/vagrant-configuration-thug-honeyclient.html
So, after a brief discussion with Twitter fellows @KDPryor and @Tazdrumm3r about Thug, the Python low-interaction honeyclient, I decided to write a proper installation guide for it since the official one is not quite complete.
I have already forked the project on GitHub and promise to update the official guide as well, submitting a pull request for buffer (the developer of Thug).
By the way, if you don’t want to bother installing Thug by yourself, you can find it inside HoneyDrive (0.2 Nectar edition), ready and waiting!
In the mean time, let me guide you step by step while I successfully (fortunately) install Thug on a new VPS running Ubuntu Server 12.04 LTS. Following the procedure below, Thug will be installed at “/opt/thug/”.
- Install Python 2.7 packages:
aptitude install python2.7 python2.7-dev
- Get Thug itself:
aptitude install git cd /opt/ git clone git://github.com/buffer/thug.git
- Get Google’s V8 JavaScript engine and PyV8 Python wrapper:
aptitude install subversion svn checkout http://v8.googlecode.com/svn/trunk/ v8
Patch it:
cp thug/patches/V8-patch* . patch -p0 < V8-patch1.diff
Get PyV8:
svn checkout http://pyv8.googlecode.com/svn/trunk/ pyv8
Install PyV8:
aptitude install build-essential libboost-python-dev export V8_HOME=/opt/v8 cd pyv8 python setup.py build sudo python setup.py install
- Install Beautiful Soup 4:
aptitude install python-setuptools easy_install beautifulsoup4
- Install html5lib:
easy_install html5lib
- Install Libemu:
aptitude install autoconf libtool cd /tmp/ git clone git://git.carnivore.it/libemu.git cd libemu autoreconf -v -i ./configure --prefix=/opt/libemu sudo make install
- Install Pylibemu:
cd /opt/ git clone git://github.com/buffer/pylibemu.git cd pylibemu python setup.py build sudo python setup.py install
- Install Pefile:
easy_install pefile
- Install chardet:
easy_install chardet
- Install httplib2:
easy_install httplib2
- Install cssutils:
easy_install cssutils
- Install Zope Interface:
easy_install zope.interface
- Install MongoDB:
aptitude install mongodb
14: Install PyMongo:
easy_install pymongo
15: Execute Thug:
python /opt/thug/src/thug.py -h
to test if it’s working. In case you get the “ImportError: libemu.so.2: cannot open shared object file: No such file or directory” error, follow the solution as written below:
touch /etc/ld.so.conf.d/libemu.conf echo "/opt/libemu/lib/" > /etc/ld.so.conf.d/libemu.conf ldconfig
You are ready! Thug is installed and ready to hunt for client-side attacks!
Pingback: Thug – A Client Honeypot()