
Auto Installer Script for Cuckoo Sandbox
Cuckoo Sandbox <http://www.cuckoosandbox.org/>_ 自动安装脚本
Cuckoo Sandbox 是一个恶意软件分析系统。
这意味着你可以将任何可疑文件丢进去,然后获得一份报告,详细说明该文件在隔离环境中的行为。
我们最初在 Buguroo Offensive Security <http://www.buguroo.com>_ 创建这个脚本,目的是让痛苦的 Cuckoo 安装过程变得更快、更简单、更无痛。
本脚本大部分不依赖发行版(当然你必须在 GNU/Linux 上运行它),但在软件包安装方面,目前仅支持 Debian 衍生版。
另外,由于我们使用专有的 VirtualBox 版本(大多数情况下 OSE 版本不能满足我们的需求),本脚本要求你的发行版在 Virtualbox Downloads <http://downloads.virtualbox.org>_ 中有一个 Debian 源。若在配置文件中强制指定发行版,应能让它在不支持的发行版上工作。
David Reguera García - Dreg <http://github.com/David-Reguera-Garcia-Dreg>_ - [email protected] <mailto:[email protected]>_ - @fr33project <https://twitter.com/fr33project>_
David Francos Cuartero - XayOn <http://github.com/Xayon>_ - [email protected] <mailto:[email protected]>_ - @davidfrancos <https://twitter.com/davidfrancos>_
.. image:: /../screenshots/cuckooautoinstall.png?raw=true
如果你信任我们、信任你的网络设置以及其他许多变量(这完全不被推荐),并且你懒得不能再懒,那么你可以作为普通用户执行(前提是你已配置 sudo):
::
wget -O - https://raw.githubusercontent.com/buguroo/cuckooautoinstall/master/cuckooautoinstall.bash | bash
该脚本接受一个配置文件,格式为简单的 bash 脚本,包含如下选项:
::
SUDO="sudo"
TMPDIR=$(mktemp -d)
RELEASE=$(lsb_release -cs)
CUCKOO_USER="cuckoo"
CUSTOM_PKGS=""
ORIG_DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
VOLATILITY_URL="http://downloads.volatilityfoundation.org/releases/2.4/volatility-2.4.tar.gz"
VIRTUALBOX_REP="deb http://download.virtualbox.org/virtualbox/debian $RELEASE contrib"
CUCKOO_REPO='https://github.com/cuckoobox/cuckoo'
YARA_REPO="https://github.com/plusvic/yara"
JANSSON_REPO="https://github.com/akheron/jansson"
LOG=$(mktemp)
UPGRADE=false
你可以在配置文件中覆盖这些变量中的任何一个。
它接受参数
::
┌─────────────────────────────────────────────────────────┐
│ CuckooAutoInstall 0.2 │
│ David Reguera García - Dreg <[email protected]> │
│ David Francos Cuartero - XayOn <[email protected]> │
│ Buguroo Offensive Security - 2015 │
└─────────────────────────────────────────────────────────┘
Usage: cuckooautoinstall.bash [--verbose|-v] [--help|-h] [--upgrade|-u]
--verbose Print output to stdout instead of temp logfile
--help This help menu
--upgrade Use newer volatility, yara and jansson versions (install from source)
对于大多数设置,始终建议使用 --upgrade。
::
passwd cuckoo
http://docs.cuckoosandbox.org/en/latest/installation/guest/
或导入虚拟机::
VBoxManage import virtual_machine.ova
::
vboxmanage modifyvm “virtual_machine" --hostonlyadapter1 vboxnet0
配置 cuckoo(http://docs.cuckoosandbox.org/en/latest/installation/host/configuration/)
执行 cuckoo
::
cd ~cuckoo/cuckoo python cuckoo.py
.. image:: /../screenshots/github%20cuckoo%20working.png?raw=true
::
cd ~cuckoo/cuckoo/web python manage.py runserver 0.0.0.0:6969
.. image:: /../screenshots/github%20django.png?raw=true
::
sudo iptables -A FORWARD -o eth0 -i vboxnet0 -s 192.168.56.0/24 -m conntrack --ctstate NEW -j ACCEPT
sudo iptables -A FORWARD -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT
sudo iptables -A POSTROUTING -t nat -j MASQUERADE
sudo sysctl -w net.ipv4.ip_forward=1
允许非 root 用户运行 tcpdump
::
sudo apt-get -y install libcap2-bin
sudo setcap cap_net_raw,cap_net_admin=eip /usr/sbin/tcpdump
修复运行 python manage.py 时 DJANGO 版本 >= 1.6 出现的 "TEMPLATE_DIRS setting must be a tuple" 错误。将 web/web/settings.py 中的
::
TEMPLATE_DIRS = (
"templates"
)
改为
::
TEMPLATE_DIRS = (
("templates"),
)
为此,我们推荐使用 supervisor。
安装 supervisor
::
sudo apt-get install supervisor
编辑 /etc/supervisor/conf.d/cuckoo.conf,类似如下:
::
[program:cuckoo]
command=python cuckoo.py
directory=/home/cuckoo
User=cuckoo
[program:cuckoo-api]
command=python api.py
directory=/home/cuckoo/utils
user=cuckoo
重新加载 supervisor
::
sudo supervisorctl reload
你可能已经注意到,iptables 规则在重启后不会保留。如果你想使其持久化,我们推荐使用 iptables-save 和 iptables-restore。
::
iptables-save > your_custom_iptables_rules
iptables-restore < your_custom_iptables_rules
你可能想阅读:
远程 <./doc/Remote.rst>_ - 启用对虚拟机和 VBox 的远程管理OVA <./doc/OVA.rst>_ - 处理 OVA 镜像反虚拟机 <./doc/Antivm.rst>_ - 如何应对采用虚拟机检测技术的恶意软件VMcloak <./doc/Vmcloak.rst>_ - VMCloak - Cuckoo Windows 虚拟机管理本项目采用 GPL3+ 许可证,详见"LICENSE"文件。 欢迎所有拉取请求,但需注意:
我们通常会在 7-14 天内回复 PR,请耐心等待。