Thug on REMnux (Walkthrough)
This blog posts describes how to install Thug (see http://www.honeynet.org/node/827, https://github.com/buffer/thug) on a fresh copy of REMnux 3.0 (VMware version). You should be familiar with VMware and Debian-like OS and have your favourite drugs (read: coffee) within reach …
- basic installation map: https://github.com/buffer/thug
- download & open REMnux in VMware Workstation; set RAM to 1 GB, set network to NAT; boot
- if needed: set keyboard (e.g. setxkbmap de)
- install VMware tools (vmware-install.pl -d); reboot
- update the system (apt-get update and apt-get -u dist-upgrade); take a cup of coffee; reboot
- we will work in ~remnux/install
- mkdir ~remnux/install
- cd ~remnux/install
- Req.: Python 2.7 -> installed
- Req.. Google V8 -> installed, but source needed anyway
- Req.: pyv8:
- get boost: http://sourceforge.net/projects/boost/files/boost/1.49.0/
- build and install:
gunzip -c < /home/remnux/install/boost_1_49_0.tar.gz | tar xvf –
cd boost_1_49_0
./bootstrap.sh –prefix=/home/remnux/install
./b2 install
sudo ./b2 install –prefix=/usr/local - get source of v8:
cd ~remnux/install
svn checkout http://v8.googlecode.com/svn/trunk v8 - build v8 (http://code.google.com/p/v8/wiki/BuildingWithGYP does not work!):
cd v8
modify SConstruct: remove all ‘-fno-rtti’, ‘-fno-exceptions’ from CXXFLAGS
make dependencies
make ia32.release - get pyv8 packages:
cd /home/remnux/install
svn checkout http://pyv8.googlecode.com/svn/trunk/ pyv8 - make PyV8:
cd pyv8
chmod a+x ./setup.py
V8_HOME=/home/remnux/install/v8; export V8_HOME
BOOST_HOME=/home/remnux/install/boost_1_49_0; export BOOST_HOME
INCLUDE=/home/remnux/install/include; export INCLUDE
LIB=/home/remnux/install/lib; export LIB
./setup.py build
sudo su –
V8_HOME=/home/remnux/install/v8; export V8_HOME
BOOST_HOME=/home/remnux/install/boost_1_49_0; export BOOST_HOME
INCLUDE=/home/remnux/install/include; export INCLUDE
LIB=/home/remnux/install/lib; export LIB
cd /home/remnux/install/pyv8
./setup.py install
- get python setup tools:
sudo apt-get install python-setuptools - install beautiful soup:
sudo easy_install beautifulsoup4 - get sources of libemu: http://sourceforge.net/projects/nepenthes/files/libemu%20development/0.2.0/libemu-0.2.0.tar.gz/download
- build libemu:
gunzip -c < libemu-0.2.0.tar.gz | tar xvf –
cd libemu-0.2.0/
modify line 4587 of configure: remove -R/usr/local/lib
./configure –prefix=/home/remnux/install
modify testsuite/Makefile: in line 213 remove -Wall
modify tools/sctest/Makefile: in line 193 remive -Wall
make install # will fail with a permission error
sudo make install - get pylibemu:
wget https://github.com/buffer/pylibemu/tarball/master -O pylibemu.tar.gz
gunzip -c < pylibemu.tar.gz | tar xvf – - build pylibemu:
cd buffer-pylibemu-a18cadf
modify setup.py: change include_dirs from /opt/libemu/include to /home/remnux/install/include and library_dirs
from /opt/libemu/lib to /home/remnux/install/lib/libemu
python setup.py build
sudo python setup.py install - get pefile:
wget “http://pefile.googlecode.com/files/pefile-1.2.10-114.tar.gz” -O pefile-1.2.10-114.tar.gz
gunzip -c < pefile-1.2.10-114.tar.gz | tar xvf – - installing pefile:
python setup.py build
sudo python setup.py install - python-chardet already installed
- install httplib2: sudo apt-get install python-httplib2
- download thug:
wget https://github.com/buffer/thug/tarball/master -O thug.tar.gz
gunzip -c < thug.tar.gz | tar xvf – - set enviromnet:
LD_LIBRARY_PATH=/home/remnux/install/lib:/home/remnux/install/lib/libemu:${LD_LIBRARY_PATH}; export LD_LIBRARY_PATH - run:
cd buffer-thug-*/src
python thug.py -h
Note: I haven’t had the time to verify if thug runs fine, but it displays the help…