# 2.1.1 VirtualBox

* [虚拟化环境](#虚拟化环境)
* [硬件虚拟化环境](#硬件虚拟化环境)
  * [物理机 Manjaro 17.02](#物理机-manjaro-1702)
  * [Windows 虚拟机](#windows-虚拟机)
  * [Linux 虚拟机](#linux-虚拟机)
  * [工具安装脚本](#工具安装脚本)

## 虚拟化环境

虚拟化是资源的抽象化，是单一物理资源的多个逻辑表示，具有兼容性、隔离的优良特性。

在恶意代码和漏洞分析过程中常常需要使用虚拟化技术来进行辅助，这不仅可以保护真实的物理设备环境不被恶意代码攻击，还能够固化保存分析环境以提高工作效率，同时还能够在不影响程序执行流的情况下动态捕获程序内存、CPU 等关键数据。

虚拟化技术根据实现技术的不同可以分为：

* 软件虚拟化：用纯软件的方法在现有平台上实现对物理资源访问的截获和模拟。如 QEMU。
* 硬件虚拟化：由硬件平台对特殊指令进行截获和重定向，交由虚拟机监控器（VMM）进行处理，这需要 CPU、主板、BIOS 和软件的支持。如 VMWare、VirtualBox。

虚拟化技术根据是否改动操作系统又可以分为：

* 半虚拟化：通过修改开源操作系统，将虚拟机特殊指令的被动截获请求转化成客户机操作系统的主动通知以提高性能。如 Xen。
* 全虚拟化：不需要对操作系统进行改动，提供了完整的包括处理器、内存和外设的虚拟化平台。如 VMWare、VirtualBox、

## 硬件虚拟化环境

用硬件虚拟机的话比较简单，可以自己下载安装。下面是我个人的一些环境配置。

* VirtualBox(<https://www.virtualbox.org/)>
* VMware Workstation/Player(<https://www.vmware.com/)>

### 物理机 Manjaro 17.02

Manjaro 17.02 x86-64(<https://manjaro.org/)> with BlackArch tools.

```
$ uname -a
Linux firmy-pc 4.9.43-1-MANJARO #1 SMP PREEMPT Sun Aug 13 20:28:47 UTC 2017 x86_64 GNU/Linux
```

```
yaourt -Rscn:

skanlite cantata kdenlive konversation libreoffice-still thunderbird-kde k3b cups

yaourt -S:

virtualbox tree git ipython ipython2 gdb google-chrome tcpdump vim wireshark-qt edb ssdeep wps-office strace ltrace metasploit python2-pwntools peda oh-my-zsh-git radare2 binwalk burpsuite checksec netcat wxhexeditor

pip3/pip2 install:

r2pipe
```

### Windows 虚拟机

* 32-bit
  * Windows XP
  * Windows 7
* 64-bit
  * Windows 7

    ```
    7-Zip/WinRAR
    IDA_Pro_v6.8
    吾爱破解工具包2.0
    ```
  * Windows 10

下载地址：<http://www.itellyou.cn/>

### Linux 虚拟机

* 32-bit/64-bit Ubuntu LTS - <https://www.ubuntu.com/download>
  * 14.04
  * 16.04

    ```
    $ uname -a
    Linux firmyy-VirtualBox 4.10.0-28-generic #32~16.04.2-Ubuntu SMP Thu Jul 20 10:19:13 UTC 2017 i686 i686 i686 GNU/Linux
    ```

    ```
    apt-get purge:

    libreoffice-common unity-webapps-common thunderbird totem rhythmbox simple-scan gnome-mahjongg aisleriot gnome-mines cheese transmission-common gnome-orca webbrowser-app gnome-sudoku onboard deja-dup usb-creator-common

    apt-get install:

    git vim tree ipython ipython3 python-pip python3-pip foremost ssdeep zsh

    pip2 install:

    termcolor
    zio

    other install:

    oh my zsh
    peda
    ```

    ```
    dpkg --add-architecture i386
    sudo apt update
    sudo apt install libc6-i386
    sudo apt install libc6-dev-i386
    sudo apt install libc6-dbg:i386
    ```
* Kali Linux - <https://www.kali.org/>
* BlackArch - <https://blackarch.org/>
* REMnux - <https://remnux.org>

### 工具安装脚本

* ctf-tools - <https://github.com/zardus/ctf-tools>
* [pwn\_env](https://github.com/firmianay/CTF-All-In-One/blob/master/src/others/2.1.1_vm/pwn_env.sh)
