2017年3月24日 星期五

How to Install Cuckoo Sandbox? [Step1]

Install All Packages dependencies and libraries

Step1: update

$ sudo apt-get update 


Step2: Install the dependencies and libraries

$ sudo apt-get install -y python python-pip python-dev python-sqlalchemy python-dpkt python-jinja2 python-magic python-pymongo python-libvirt subversion git build-essential git libpcre3 libpcre3-dev libpcre++-dev python-bottle libffi-dev libssl-dev libxml2-dev libxslt-dev libxslt1-dev libjpeg-dev libfuzzy-dev ssdeep  autoconf automake libtool make gcc 


Step3: Upgrade pip-9.0.1-py2.py3-none-any.whlc

$ sudo pip install --upgrade pip
$ sudo pip install -U pip setuptools


Step4: Install Pefile Python Modulec

$ wget https://github.com/erocarrera/pefile/files/192316/pefile-2016.3.28.tar.gz
$ tar zxvf pefile-2016.3.28.tar.gz
$ cd pefile-2016.3.28/
$ sudo python setup.py build
$ sudo python setup.py install
$ cd ..


Step5: Install pydeept Python Module

$ git clone https://github.com/kbandla/pydeep.git pydeep
$ cd pydeep
$ sudo python setup.py build
$ sudo python setup.py install
$ cd ..


Step6: Install jasson-2.10

$ wget http://www.digip.org/jansson/releases/jansson-2.10.tar.gz
$ tar zxvf jansson-2.10.tar.gz
$ cd jansson-2.10/
$ ./configure
$ make
$ sudo make install
$ cd ..


Step7: Install swing-3.0.12

$ wget http://downloads.sourceforge.net/swig/swig-3.0.12.tar.gz
$ tar zxvf swig-3.0.12.tar.gz
$ cd swig-3.0.12/
$ ./configure
$ make
$ sudo make install
$ cd ..



Step8: Install M2Crypto==0.24.0

$ wget https://pypi.python.org/packages/58/75/362faac80a1bc2742b4b696dc350518312043d568bfd2687a9270f18da88/M2Crypto-0.24.0.tar.gz#md5=8e87235942c76d1ba9f999ee33764fdb
$ tar zxvf M2Crypto-0.24.0.tar.gz
$ cd M2Crypto-0.24.0/
$ sudo python setup.py build
$ sudo python setup.py install
$ cd ..



Step9: \Install YARA 3.5

$ sudo apt-get install -y flex bison
$ wget https://github.com/VirusTotal/yara/archive/v3.5.0.tar.gz
$ tar xvfz v3.5.0.tar.gz
$ cd yara-3.5.0/
$ ./bootstrap.sh
$ ./configure --enable-cuckoo --enable-magic
$ make
$ sudo make install



Step10: Install Tcpdump

$ sudo apt-get -y install tcpdump libpcap-dev
$ sudo setcap cap_net_raw,cap_net_admin=eip /usr/sbin/tcpdump
$ getcap /usr/sbin/tcpdump


Step11:  "Create ip_tables.sh"

$ echo '#!/bin/bash' >update_ip_tables.sh
$ echo 'iptables -A FORWARD -o eth0 -i vboxnet0 -s 192.168.56.0/24 -m conntrack --ctstate NEW -j ACCEPT' >> update_ip_tables.sh
$ echo 'iptables -A FORWARD -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT' >> update_ip_tables.sh
$ echo 'iptables -A POSTROUTING -t nat -j MASQUERADE' >> update_ip_tables.sh
$ echo 'sysctl -w net.ipv4.ip_forward=1' >> update_ip_tables.sh
$ chmod +x ./update_ip_tables.sh
$ sudo ./update_ip_tables.sh


Step12:  "Install Dnsmasq"
$ sudo apt-get install -y dnsmasq
$ sudo service dnsmasq start


Step13: "Install volatility、MongoDB、tesseract-oct"
$ sudo apt-get install -y volatility mongodb tesseract-ocr



Step 14: "Install Cuckoo Sandbox"
$ git clone https://github.com/cuckoosandbox/cuckoo


Step 15:  "Install Cuckoo Sandbox requirement modules"
$ cd cuckoo/
$ sudo -H pip install -r requirements.txt


Step16: "Install Cuckoo Sandbox utilitys"
$ cd utils/
$ ./community.py -a -f -w



Step17:  "Install Install Oracle VM VirtualBox"
$ sudo sh -c 'echo "deb http://download.virtualbox.org/virtualbox/debian xenial contrib" >> /etc/apt/sources.list.d/virtualbox.list'
$ wget -q https://www.virtualbox.org/download/oracle_vbox_2016.asc -O- | sudo apt-key add -
$ wget -q https://www.virtualbox.org/download/oracle_vbox.asc -O- | sudo apt-key add -
$ sudo apt update && sudo apt-get -y install virtualbox-5.1


Step18: "Install Install Oracle VM VirtualBox Extension Pack"
$ wget http://download.virtualbox.org/virtualbox/5.1.18/Oracle_VM_VirtualBox_Extension_Pack-5.1.18-114002.vbox-extpack
$ VBoxManage extpack install Oracle_VM_VirtualBox_Extension_Pack-5.1.18-114002.vbox-extpack



Step19 : "Add cuckoo to Vboxusers Grops"
$ sudo usermod -aG vboxusers cuckoo


========================================================================
install.sh
#!/bin/bash

mkdir install_tmp
cd install_tmp/

echo "====================================="
echo "Ubuntu Packages Update"
echo "====================================="
read -rsp $'Press [Enter] key to continue....\n'
sudo apt-get update 

echo "====================================="
echo "Install the dependencies and libraries"
echo "====================================="
read -rsp $'Press [Enter] key to continue....\n'
sudo apt-get install -y python python-pip python-dev python-sqlalchemy python-dpkt python-jinja2 python-magic python-pymongo python-libvirt subversion git build-essential git libpcre3 libpcre3-dev libpcre++-dev python-bottle libffi-dev libssl-dev libxml2-dev libxslt-dev libxslt1-dev libjpeg-dev libfuzzy-dev ssdeep  autoconf automake libtool make gcc 

echo ""
echo ""
echo "====================================="
echo "Upgrade pip-9.0.1-py2.py3-none-any.whlc"
echo "====================================="
read -rsp $'Press [Enter] key to continue....\n'
sudo pip install --upgrade pip
sudo pip install -U pip setuptools

echo ""
echo ""
echo "====================================="
echo "Install Pefile Python Module"
echo "====================================="
read -rsp $'Press [Enter] key to continue....\n'
wget https://github.com/erocarrera/pefile/files/192316/pefile-2016.3.28.tar.gz
tar zxvf pefile-2016.3.28.tar.gz
cd pefile-2016.3.28/
sudo python setup.py build
sudo python setup.py install
cd ..

echo ""
echo ""
echo "====================================="
echo "Install pydeept Python Module"
echo "====================================="
read -rsp $'Press [Enter] key to continue....\n'
git clone https://github.com/kbandla/pydeep.git pydeep
cd pydeep
sudo python setup.py build
sudo python setup.py install
cd ..

echo ""
echo ""
echo "====================================="
echo "Install jasson-2.10"
echo "====================================="
read -rsp $'Press [Enter] key to continue....\n'
wget http://www.digip.org/jansson/releases/jansson-2.10.tar.gz
tar zxvf jansson-2.10.tar.gz
cd jansson-2.10/
./configure
make
sudo make install
cd ..

echo ""
echo ""
echo "====================================="
echo "Install swing-3.0.12"
echo "====================================="
read -rsp $'Press [Enter] key to continue....\n'
wget http://downloads.sourceforge.net/swig/swig-3.0.12.tar.gz
tar zxvf swig-3.0.12.tar.gz
cd swig-3.0.12/
./configure
make
sudo make install
cd ..

echo ""
echo ""
echo "====================================="
echo "Install M2Crypto==0.24.0"
echo "====================================="
read -rsp $'Press [Enter] key to continue....\n'
wget https://pypi.python.org/packages/58/75/362faac80a1bc2742b4b696dc350518312043d568bfd2687a9270f18da88/M2Crypto-0.24.0.tar.gz#md5=8e87235942c76d1ba9f999ee33764fdb
tar zxvf M2Crypto-0.24.0.tar.gz
cd M2Crypto-0.24.0/
sudo python setup.py build
sudo python setup.py install
cd ..

echo ""
echo ""
echo "====================================="
echo "Install YARA 3.5"
echo "====================================="
read -rsp $'Press [Enter] key to continue....\n'
sudo apt-get install -y flex bison
wget https://github.com/VirusTotal/yara/archive/v3.5.0.tar.gz
tar xvfz v3.5.0.tar.gz
cd yara-3.5.0/
./bootstrap.sh
./configure --enable-cuckoo --enable-magic
make
sudo make install

cd ~

echo ""
echo ""
echo "====================================="
echo "Install Tcpdump"
echo "====================================="
read -rsp $'Press [Enter] key to continue....\n'
sudo apt-get -y install tcpdump libpcap-dev
sudo setcap cap_net_raw,cap_net_admin=eip /usr/sbin/tcpdump
getcap /usr/sbin/tcpdump

echo ""
echo ""
echo "====================================="
echo "Create ip_tables.sh"
echo "====================================="
read -rsp $'Press [Enter] key to continue....\n'
echo '#!/bin/bash' >update_ip_tables.sh
echo 'iptables -A FORWARD -o eth0 -i vboxnet0 -s 192.168.56.0/24 -m conntrack --ctstate NEW -j ACCEPT' >> update_ip_tables.sh
echo 'iptables -A FORWARD -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT' >> update_ip_tables.sh
echo 'iptables -A POSTROUTING -t nat -j MASQUERADE' >> update_ip_tables.sh
echo 'sysctl -w net.ipv4.ip_forward=1' >> update_ip_tables.sh
chmod +x ./update_ip_tables.sh
sudo ./update_ip_tables.sh

echo ""
echo ""
echo "====================================="
echo "Install Dnsmasq"
echo "====================================="
read -rsp $'Press [Enter] key to continue....\n'
sudo apt-get install -y dnsmasq
sudo service dnsmasq start

echo ""
echo ""
echo "====================================="
echo "Install volatility,MongoDB,tesseract-oct"
echo "====================================="
read -rsp $'Press [Enter] key to continue....\n'
sudo apt-get install -y volatility mongodb tesseract-ocr


echo ""
echo ""
echo "====================================="
echo "Install Cuckoo Sandbox"
echo "====================================="
read -rsp $'Press [Enter] key to continue....\n'
git clone https://github.com/cuckoosandbox/cuckoo

echo ""
echo ""
echo "====================================="
echo "Install Cuckoo Sandbox requirement modules"
echo "====================================="
read -rsp $'Press [Enter] key to continue....\n'
cd cuckoo/
sudo -H pip install -r requirements.txt

echo ""
echo ""
echo "====================================="
echo "Install Cuckoo Sandbox utilitys"
echo "====================================="
read -rsp $'Press [Enter] key to continue....\n'
cd utils/
./community.py -a -f -w
echo ""
echo ""
echo "Cuckoo Sandbox Installed!"
cd ~

cd install_tmp/
echo ""
echo ""
echo "====================================="
echo "Install Install Oracle VM VirtualBox"
echo "====================================="
read -rsp $'Press [Enter] key to continue....\n'
sudo sh -c 'echo "deb http://download.virtualbox.org/virtualbox/debian xenial contrib" >> /etc/apt/sources.list.d/virtualbox.list'
wget -q https://www.virtualbox.org/download/oracle_vbox_2016.asc -O- | sudo apt-key add -
wget -q https://www.virtualbox.org/download/oracle_vbox.asc -O- | sudo apt-key add -
sudo apt update && sudo apt-get -y install virtualbox-5.1

echo ""
echo ""
echo "====================================="
echo "Install Install Oracle VM VirtualBox Extension Pack"
echo "====================================="
read -rsp $'Press [Enter] key to continue....\n'
wget http://download.virtualbox.org/virtualbox/5.1.18/Oracle_VM_VirtualBox_Extension_Pack-5.1.18-114002.vbox-extpack
VBoxManage extpack install Oracle_VM_VirtualBox_Extension_Pack-5.1.18-114002.vbox-extpack

cd ~
echo ""
echo ""
echo "====================================="
echo "Add cuckoo to Vboxusers Grops"
echo "====================================="
read -rsp $'Press [Enter] key to continue....\n'
sudo usermod -aG vboxusers cuckoo
echo ""
echo ""
echo "==========================================="
echo "                Finished!!                 "
echo "==========================================="
sudo rm -fr install_tmp/



28 則留言:

  1. 前幾天CUCKOO更新,GIT上沒有包含 requirements.txt

    回覆刪除
  2. Great post!I am actually getting ready to across this information,i am very happy to this commands.Also great blog here with all of the valuable information you have.Well done,its a great knowledge.
    Python Training in Chennai

    回覆刪除
  3. set14.15 可以改成這樣(以下載點為目前穩定版本2.0)
    $sudo wget https://github.com/cuckoosandbox/cuckoo/archive/legacy.zip
    $sudo unzip legacy.zip
    $cd legacy
    $sudo -H pip install -r requirements.txt

    回覆刪除
  4. The knowledge of technology you have been sharing thorough this post is very much helpful to develop new idea. here by i also want to share this.
    full stack developer training in annanagar

    full stack developer training in tambaram

    full stack developer training in velachery

    回覆刪除
  5. Thanks for splitting your comprehension with us. It’s really useful to me & I hope it helps the people who in need of this vital information. 
    python training institute in chennai
    python training in Bangalore
    python training institute in chennai

    回覆刪除
  6. Your good knowledge and kindness in playing with all the pieces were very useful. I don’t know what I would have done if I had not encountered such a step like this.
    Blueprism training in Pune

    Blueprism online training

    Blue Prism Training in Pune

    回覆刪除
  7. Fantastic work! This is the type of information that should follow collective approximately the web. Embarrassment captivating position Google for not positioning this transmit higher! Enlarge taking place greater than and visit my web situate
    Data science training in tambaram
    Data Science training in anna nagar
    Data Science training in chennai
    Data science training in Bangalore
    Data Science training in marathahalli
    Data Science training in btm

    回覆刪除
  8. Nice post. By reading your blog, i get inspired and this provides some useful information. Thank you for posting this exclusive post for our vision. 

    angularjs Training in chennai
    angularjs-Training in pune

    angularjs-Training in chennai

    angularjs Training in chennai

    angularjs-Training in tambaram

    回覆刪除
  9. Thanks for the informative article. This is one of the best resources I have found in quite some time. Nicely written and great info. I really cannot thank you enough for sharing.
    Microsoft Azure online training
    Selenium online training
    Java online training
    Java Script online training
    Share Point online training

    回覆刪除
  10. This is a nice article here with some useful tips for those who are not used-to comment that frequently. Thanks for this helpful information I agree with all points you have given to us. I will follow all of them.

    devops online training

    aws online training

    data science with python online training

    data science online training

    rpa online training

    回覆刪除
  11. Good Post! Thank you so much for sharing this pretty post, it was so good to read and useful to improve my knowledge as updated one, keep blogging.
    Java course in chennai

    python course in chennai

    web designing and development course in chennai

    selenium course in chennai

    digital-marketing seo course in chennai



    回覆刪除
  12. This post is so interactive and informative.keep update more information...
    Salesforce Training in Tambaram
    Salesforce Training in Chennai

    回覆刪除

用APNIC找出台灣所有的IP位址