Thug adalah salah satu tools honeypot yang masuk dalam kategori low interaction honeyclient. Sebelum membahas mengenai Thug, kita akan membahas sedikit mengenai honeyclient. Apakah honeyclient itu? Lalu mengapa Thug dikategorikan sebagai Low Interaction honeypot? Honeyclient adalah salah satu jenis honeypot, dimana honeypot jenis ini meniru, baik itu secara manual, ataupun otomatis aktivitas dari browser yang sedang mengunjungi halaman web. Secara sederhana honeyclient adalah tools meniru cara kerja dari sebuah web browser. Malicious web content yang membahayakan user, dapat di identifikasi oleh honeyclient ini dengan berpura-pura seolah-olah honeyclient ini adalah sebagai browser dari user yang sedang mengunjungi website yang mengandung malicious content. Honeyclient ini dapat mendeteksi dan mengidentifikasi malware atau malicious content yang terdapat pada halaman web tertentu.
Mengapa Thug disebut sebagai low interaction honeyclient? Low interaction adalah jenis yang tidak menggunakan keseluruhan real system, namun hanya sebatas komponen-komponen kecil saja. Thug dikategorikan sebagai low interaction karena hanya sebatas meniru kemampuan web browser dan web crawler. Response dari server langsung diperiksa apakah terdapat malicious content atau tidak. Low interaction honeypot juga mudah untuk di deploy dibandingkan dengan high interaction honeypot.
Lalu mari kita bahas secara spesifik mengenai Thug ini. Berikut sekilas fitur yang dimiliki oleh Thug :
- DOM (almost) compliant with W3C DOM Core and HTML specifications (Level 1, 2 and partially 3) and partially compliant with W3C DOM Events and Style specifications
DOM (Document Object Module) adalah rekomendasi dari W3C untuk melakukan proses terhadap dokumen terstruktur seperti XML dan HTML. DOM didefinisikan sebagai sebuah spesifikasi Application Programming Interface (API) yang bebas bahasa dan platform. DOM mendefinisikan struktur lojik dokumen serta cara untuk melakukan manipulasi dan akses terhadap dokumen tersebut. Saat ini W3C telah mengeluarkan tiga buah rekomendasi untuk DOM yaitu DOM Level 1, DOM Level 2 dan DOM Level 3. DOM dibagi dalam 3 Level :
- Core DOM, Model Standar untuk Dokumen terstruktur.
- HTML DOM, Model Standar untuk Dokumen HTML.
- XML DOM, Model Standar untuk Doukumen XML.
Source : http://yaniwid.wordpress.com/2009/04/01/document-object-model-dom/ https://kaptenagil.wordpress.com/2009/10/31/apa-itu-html-dom-xml-dom/
- Google V8 Javascript engine wrapped through PyV8
- Vulnerability modules (ActiveX controls, core browser functionalities, browser plugins)
- Currently 14 browser personalities supported
- Hybrid static (Abstratc syntax tree) / dynamic analysis (V8 debugger protocol, libemu integration)
- MITRE MAEC native logging format (Format logging mengikuti standard MITRE)
- HPFeeds and MongoDB logging (Sebagai media yang menyimpan event dan juga report dari Thug)
Brikut ini browserpersonalities yang di support Thug :
Available User-Agents:
winxpie60 Internet Explorer 6.0 (Windows XP)
winxpie61 Internet Explorer 6.1 (Windows XP)
winxpie70 Internet Explorer 7.0 (Windows XP)
winxpie80 Internet Explorer 8.0 (Windows XP)
winxpchrome20 Chrome 20.0.1132.47 (Windows XP)
winxpsafari5 Safari 5.1.7 (Windows XP)
win2kie60 Internet Explorer 6.0 (Windows 2000)
win2kie80 Internet Explorer 8.0 (Windows 2000)
win7xpie80 Internet Explorer 8.0 (Windows 7)
win7xpie90 Internet Explorer 9.0 (Windows 7)
win7chrome20 Chrome 20.0.1132.47 (Windows 7)
win7safari5 Safari 5.1.7 (Windows 7)
osx10safari5 Safari 5.1.1 (MacOS X 10.7.2)
osx10chrome19 Chrome 19.0.1084.54 (MacOS X 10.7.4)
Mungkin itu saja sekilas mengenai Thug. Berikut ini saya paparkan bagaimana cara instalasi Thug.
NB : Environment OS yang saya gunakan adalah Ubuntu 12.04. Beberapa Library tidak di support di Ubuntu 10.04 (kecuali compile sendiri)
Requirements
Python 2.7 http://www.python.org/
Google V8 http://code.google.com/p/v8/
Beautiful Soup 4 http://www.crummy.com/software/BeautifulSoup/
Html5lib http://code.google.com/p/html5lib/
Libemu http://libemu.carnivore.it/
Pylibemu https://github.com/buffer/pylibemu
httplib2 0.7.4 or later http://code.google.com/p/httplib2/
Zope interface http://pypi.python.org/pypi/zope.interface
MongoDB (optional) http://www.mongodb.org/
PyMongo (optional) http://www.mongodb.org/display/DOCS/Python+Language+Center
Instalasi
Instal dependensi terlebih dahulu :
digit@digit-laptop:~$ sudo apt-get install python-setuptools subversion python-html5lib libboost-python-dev python-pefile python-httplib2 scons python-chardetInstall beautifulsoup4 via easy_install:
digit@digit-laptop:~$ sudo easy_install beautifulsoup4Instal libemu dan pylibemu
Step-step silakan di ikuti dari halaman ini : http://digitoktavianto.web.id/install-libemu-dan-pylibemu-untuk-mendeteksi-shellcode.html
Ambil Thug dari git :
digit@digit-laptop:~$ cd ~ digit@digit-laptop:~$ git clone https://github.com/buffer/thug.git digit@digit-laptop:~$ cd thug/Checkout V8 Source code dari SVN :
digit@digit-laptop:~$ svn checkout https://v8.googlecode.com/svn/trunk v8Patch v8 surce code dari folder patch :
digit@digit-laptop:~$ cp patches/V8-patch* . digit@digit-laptop:~$ patch -p0 < V8-patch1.diff digit@digit-laptop:~$ patch -p0 < V8-patch2.diff digit@digit-laptop:~$ rm V8-patch*Checkout PyV8 Source Code dari SVN :
digit@digit-laptop:~$ cd /tmp/ digit@digit-laptop:~$ svn checkout http://pyv8.googlecode.com/svn/trunk/ pyv8 digit@digit-laptop:~$ export V8_HOME=$HOME/thug/v8Install PyV8 :
digit@digit-laptop:~$ cd pyv8/ && python setup.py build digit@digit-laptop:~$ sudo python setup.py installTes apakah PyV8 berjalan dengan baik :
digit@digit-laptop:~$ python PyV8.pyMasuk ke home directory Thug dan jalankan Thug :
digit@digit-laptop:~$ cd /home/digit/thug/src digit@digit-laptop:~$ python thug.py digit@digit-laptop:~$ python thug.py -h Synopsis: Thug: Pure Python honeyclient implementation Usage: python thug.py [ options ] url Options: -h, --help Display this help information -o, --output= Log to a specified file -r, --referer= Specify a referer -p, --proxy= Specify a proxy (see below for format and supported schemes) -l, --local -v, --verbose Enable verbose mode -d, --debug Enable debug mode -a, --ast-debug Enable AST debug mode (requires debug mode) -u, --useragent= Select a user agent (see below for values, default: winxpie61) -A, --adobepdf= Specify the Adobe Acrobat Reader version (default: 7.1.0) -S, --shockwave= Specify the Shockwave Flash version (default: 10.0.64.0) Proxy Format: scheme://[username:password@]host:port (supported schemes: http, socks4, socks5)
Selesai. Demikianlah step by step Instalasi Thug dan juga sedikit penjelasan mengenai Thug dan Honeyclient.
Happy Hacking :D
Source :
http://blog.xanda.org/2012/05/21/installation-of-thug-a-python-low-interaction-honeyclient-on-ubuntudebian/ https://github.com/buffer/thug http://www.honeynet.org/files/HPAW2012-Thug.pdf