본문 바로가기
Information Security/OpenSource

Phoneyc

by hakawati 2012. 12. 18.

Python으로 구현된 "honeyclient"입니다. 여기서 honeyclient는 공격을 포함하는 악성 웹 사이트의 페이지를 분석하여 제공하도록 설계한 것을 말합니다. http://code.google.com/p/phoneyc/

기능

1. 원격 링크에 유용한 HTML 태그를 이해

  • hrefs, imgs 등...
  • 또한 iframe, frame 등

2. 스크립팅 언어를 이해

  • 자바 스크립트 (spidermonkey를 이용)
  • Visual Basic 스크립트 (vb2py를 이용)
  • deobfuscation, 원격 스크립트 소스를 지원

3. ActiveX 취약점의 공격 탐지를 위한 모듈 지원

4. 페이지에 대한 또다른 검색 방법을 지원

  • ClamAV를 통한 AV 검출
  • 취약점 모듈

설치

환경 : Ubuntu 12.04 LTS amd64

설치방법 : Shell script


#!/bin/bash

# Phoneyc installation on the Ubuntu 12.04 LTS amd64.
## Phoneyc is a honeyclient.

sudo apt-get install -y git-core libtool autoconf python-dev pkg-config libnspr4-dev python-setuptools

HOME_PWD=`pwd`

sudo sh -c "echo /opt/libemu/lib > /etc/ld.so.conf.d/libemu.conf"
sudo sh -c "echo /opt/libemu/lib/libemu >> /etc/ld.so.conf.d/libemu.conf"

cd /tmp
git clone git://git.carnivore.it/libemu.git
cd /tmp/libemu
sudo sh -c "echo /opt/libemu/lib > /etc/ld.so.conf.d/libemu.conf"
sudo sh -c "echo /opt/libemu/lib/libemu >> /etc/ld.so.conf.d/libemu.conf"
autoreconf -v -i
./configure --prefix=/opt/libemu/
sudo make install
cd ..

sudo wget http://launchpadlibrarian.net/66061326/libhunspell-1.2-0_1.2.14-4_amd64.deb
sudo wget https://launchpad.net/ubuntu/+archive/primary/+files/xulrunner-1.9.2_1.9.2.28%2Bbuild1%2Bnobinonly-0ubuntu0.11.04.1_amd64.deb
sudo dpkg -i libhunspell-1.2-0_1.2.14-4_amd64.deb
sudo dpkg -i xulrunner-1.9.2_1.9.2.28+build1+nobinonly-0ubuntu0.11.04.1_amd64.deb
cd $HOME_PWD

svn checkout https://phoneyc.googlecode.com/svn/phoneyc/trunk/ phoneyc
cd phoneyc/modules
make && make install
cd ..

사용


python phoneyc.py
Synopsis:
PHoneyC: Pure python honeyclient implementation.

Usage:
python phoneyc.py [ options ] url

Options:
-h , --help Display this help information.
-l  , --logfile= Output file name for logs.
-v , --verbose Explain what is being done (DEBUG mode).
-d  , --debug= Debug Level, 1-10.
-r , --retrieval-all Retrieval all inline linking data.
-c , --cache-response Cache the responses from the remote sites.
-u  , --user-agent= Select a user agent (see below for values, default: 2)
-n , --replace-nonascii Replace all non-ASCII characters with spaces(0x20) in all HTML or JS contents
-m , --universal-activex Enable Universal ActiveX object


User Agents:
[ 1] Internet Explorer 6.0 (Windows XP)
[ 2] Internet Explorer 6.1 (Windows XP)
[ 3] Internet Explorer 7.0 (Windows XP)
[ 4] Internet Explorer 8.0 (Windows XP)
[ 5] Internet Explorer 6.0 (Windows 2000)
[ 6] Internet Explorer 8.0 (Windows 2000)

그림1. 악성코드 유포하는 웹사이트 검사

위와 같이 악성코드 유포지를 검사해본 결과 Heapspray기법을 탐지하였음을 보여줍니다.

'Information Security > OpenSource' 카테고리의 다른 글

Pygoogle.py  (1) 2013.01.10
GeoIP + Matploitlib  (1) 2013.01.03
thug  (1) 2013.01.02
YARA-Project  (1) 2012.11.15
JSDetox  (1) 2012.11.08

댓글1