What
honeynet是一个致力于研究蜜罐系统的非盈利组织,以了解黑客使用的工具,策略和行为.在honeynet的带领下,牛人门提出了多种不同的蜜罐系统,简单可以分为低交互和高交互两种,某些项目的入口可以在这里找到.其中,phoneyc是一种低交互的蜜罐系统,它提供了一个javascript引擎,用来执行网页中的js代码,依据其行为特征判断该网页是否含有恶意js代码.这里是某位跟着phoneyc的作者jose大牛混的北大学生对phoneyc的介绍,源码可以在google code下载.
顺便提一下,正如google code上phoneyc上的介绍一样,jose常在 irc.freenode.net/8001 的#phoneyc频道上混,按jose的话来说,他还有一个"helping communicate": Angelo_Honeynet,两位都是相当相当热忱认真的大牛,//applause.
How
phoneyc虽然强大,但是安装起来却是极度繁琐的,下面记下我的安装过程 :
- sudo apt-get install libnspr4-0d libnspr4-dev #安装phoneyc依赖的nspr
- wget http://curl.haxx.se/download/curl-7.20.0.tar.gz && tar zvxf curl-7.20.0.tar.gz #以下3步安装phoneyc依赖的curl
- cd curl-7.20.0
- sudo ./install-sh
- cd ..
- wget https://godorz.info/wp-content/uploads/2010/04/pycurl-7.19.0.tar.gz && tar zvxf pycurl-7.19.0.tar.gz #以下4步安装 \ phoneyc同样依赖的pycurl <- curl的python版
- cd pycurl-7.19.0
- python setup.py build
- sudo setup.py install
- cd ..
- wget https://godorz.info/wp-content/uploads/2010/04/libemu-trunk.tar.bz2 && tar jvxf libemu-trunk.tar.bz2 #下载 \ phoneyc的依赖包并且解压缩 (请一定要在这里下载modified版,libemu官网那个版本是旧的,有些文件没有包含,我花了一天 \ 多在这里被搞得半死,Angelo提醒后才知道的.)
- cd libemu-trunk #以下4步安装libemu
- autoreconf -v -i
- /configure --prefix=/opt/libemu
- sudo make install
- cd ..
- sudo echo "/opt/libemu/lib/libemu" > /etc/ld.so.conf.d/libemu.conf #以下两步配置ld
- sudo ldconfig
- svn checkout https://phoneyc.googlecode.com/svn/phoneyc/trunk/ phoneyc #下载phoneyc
- cd phoneyc/modules/libemu #根据jose的说法,以下3步将hook up the installed libemu to phoneyc
- python setup.py build
- sudo setup.py install
- cd .. #以下3步安装modules,包含hcalert,honeyjs,jscript,libemu等组件.
- sudo make
- sudo make install
- cd ..
- python phoneyc.py -v file://test/ssreader_0day.html #测试,如果返回结果与 \ phoneyc/result//home/arthur/phoneyc/result/ssreader_0day.txt一致,就说明phoneyc已经成功安装了.
Architecture
下面是phoneyc的结构图,要看源码的话还是对着这图看不容易头晕..XD.
End
PS:
- 本文在ubuntu 9.10下测试,其他平台无法保证可以依照这里的方法成功安装phoneyc. 如果无法安装,或许你可以参考这里jose和Angelo对我孜孜不倦的回答.
- 赶紧把信安比赛酱油打完,要开始碰UNP(volume 1)了.
看到N多的命令就头疼的飘过~~
为了方便后人不如弄个deb包出来吧呵呵
额..问题是我不会打包deb啊..
请问下,我在hook up the installed libemu to phoneyc的时候,出现了如下错误,为什么呢?
root@zhukeding-desktop:~/phoneyc/modules/libemu# python setup.py build
running build
running build_ext
building ‘libemu’ extension
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/opt/libemu/include -I/usr/include/python2.6 -c libemu_module.c -o build/temp.linux-i686-2.6/libemu_module.o
libemu_module.c: In function ‘user_hook_URLDownloadToFile’:
libemu_module.c:79: warning: unused variable ‘szFileName’
libemu_module.c:78: warning: unused variable ‘szURL’
libemu_module.c: At top level:
libemu_module.c:594: warning: function declaration isn’t a prototype
gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions build/temp.linux-i686-2.6/libemu_module.o -L/opt/libemu/lib -lemu -o build/lib.linux-i686-2.6/libemu.so
/usr/bin/ld: cannot find -lemu
collect2: ld returned 1 exit status
error: command ‘gcc’ failed with e/+rq
搜索所有含-Werror的文件(grep * -Werror),将其去掉..-Werror选项表示编译器认为警告也是一种错误,以致于无法成功编译.
貌似你的ld链接器也没有配置好,麻烦参考第17,18步.
在进行17、18步的时候没有出现异常,应该是配置没有问题吧?去掉-Wall的文件,不知道怎么操作,您给的那个命令好像不对。可否留一下其他的联系方式?想请教一下。
导航栏 -> 关于博主..
i have the same problem, how do you solve it finally?
rtfm.
知道问题在哪里了,gcc指明的库目录是/opt/libemu/lib/,然而实际上库文件在/opt/libemu/lib/libemu中,我将/opt/libemu/lib/libemu/文件夹下的文件cp到/opt/libemu/lib/,OK :)
我在ubuntu 8.10 上又装了一遍,基本上按照博主的步骤就没错,但是我在第15步make的时候,出现了如下错误:
make all-recursive
make[1]: Entering directory `/home/zhanghuilin/libemu-trunk’
Making all in src
make[2]: Entering directory `/home/zhanghuilin/libemu-trunk/src’
Making all in functions
make[3]: Entering directory `/home/zhanghuilin/libemu-trunk/src/functions’
make[3]: 没有什么可以做的为 `all’。
make[3]: Leaving directory `/home/zhanghuilin/libemu-trunk/src/functions’
make[3]: Entering directory `/home/zhanghuilin/libemu-trunk/src’
/bin/bash ../libtool –tag=CC –mode=compile gcc -DHAVE_CONFIG_H -I. -I.. -D _GNU_SOURCE -I/usr/local/include -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGE_FILES -pipe -D _GNU_SOURCE -I../include -Werror -Wall -g -g -O2 -Wstrict-prototypes -MT emu.lo -MD -MP -MF .deps/emu.Tpo -c -o emu.lo emu.c
libtool: Version mismatch error. This is libtool 2.2, but the
libtool: definition of this LT_INIT comes from libtool 2.2.4.
libtool: You should recreate aclocal.m4 with macros from libtool 2.2
libtool: and run autoconf again.
make[3]: *** [emu.lo] 错误 63
make[3]: Leaving directory `/home/zhanghuilin/libemu-trunk/src’
make[2]: *** [all-recursive] 错误 1
make[2]: Leaving directory `/home/zhanghuilin/libemu-trunk/src’
make[1]: *** [all-recursive] 错误 1
make[1]: Leaving directory `/home/zhanghuilin/libemu-trunk’
make: *** [all] 错误 2
我查了好久,终于在http://bugs.gentoo.org/show_bug.cgi?id=238441上找到一个靠谱的解释:
OK i found out that i have libtool files not only in /usr/share/libtool but in
/usr/local/share/libtool also.Those files in local does not get over written
during emerge of the new libtool and that were the source of my problems.
I emerged libtool-2.2.6a, renamed /usr/local/share/libtool (just in case) and
did copy over /usr/share/libtool in to /usr/local/share/. For now everything
seems to be ok, but everything will start over again after new libtool release,
because /usr/local/share/libtool does not get updated during libtool merge!!
于是执行 sudo cp -r -L /usr/share/libtool /usr/local/share/ ,之后再从13步重新开始,就一切ok了
相当感谢你的补充..