Skip to content
KitploitKITPLOIT
工具博客
提交
工具博客
提交

黑客、渗透测试和网络安全工具,武装您的安全武器库!

Kitploit 是一个黑客、网络安全和渗透测试工具的目录。发现最新的项目更新,查找漏洞、分析系统、自动化测试并加强你的安全。

··订阅源·联系·隐私·© 2026 Kitploit

工具目录

分类

查看所有分类
Loading categories
工具/GitHubGitHub/detuxsandbox/detux
动态分析 (沙盒)网络取证取证分析恶意软件分析
GitHubdetuxsandbox/detux

detux

跨平台 Linux 沙箱

查看仓库
266598年前Kitploit 审核通过

最受欢迎

查看全部 →

发现我们社区最常用的工具。

探索所有工具

浏览我们的工具集合

查看所有工具 →
分享

Detux:多平台Linux沙箱

简介:

Detux是一个沙箱,用于对Linux恶意软件进行流量分析,并从中捕获IOC。它使用QEMU虚拟机管理程序来模拟不同CPU架构的Linux(Debian)。

目前支持以下CPU:

  • x86
  • x86-64
  • ARM
  • MIPS
  • MIPSEL

立即使用在线版本:http://detux.org

此版本包含什么?

此版本的Detux包含用于在指定CPU架构下执行Linux二进制文件/脚本的脚本。如果你不知道平台类型也不必担心,脚本内已集成Magic包,可自动识别CPU架构。x86是默认的CPU版本,可在配置文件中调整为其他架构。

此版本以DICT格式输出分析报告,可轻松定制以插入到NoSQL数据库中。

提供了一个示例脚本,演示了沙箱库的使用方法。

报告中包含什么?

root@kitploit:~
- 静态分析
    -- 从二进制文件中提取的基本字符串
    -- 由readelf命令生成的ELF信息
    -- 可修改report.py以添加更多第三方命令来分析二进制文件并将结果加入DICT

- 动态分析
    -- 使用DPKT解析捕获的pcap文件,从中提取IOC及可读信息

依赖要求

  • 系统包

    • python 2.7
    • qemu
    • pcaputils
    • sudo
    • libcap2-bin
    • bridge-utils
  • Python库(建议使用虚拟环境)

    • pexpect
    • paramiko
    • python-magic

请确保在运行Detux之前满足以上依赖。某些依赖可能因操作系统而异。

架构

  • 宿主机(主机本身可以是虚拟机或裸机)
    • QEMU
    • dumpcap
    • DETUX脚本

网络架构

root@kitploit:~
- NIC1:用于访问宿主的接口
- NIC2:与QEMU沙箱虚拟机桥接的接口。可将该接口的流量重定向至WHONIX、REMNUX或自定义网关,以过滤/允许沙箱虚拟机的互联网访问

虚拟机设置:

下载Linux虚拟机镜像

特别感谢aurel,他已预先构建好所有可能CPU架构的QEMU Debian虚拟机镜像。 镜像位于:https://people.debian.org/~aurel32/qemu/,同一链接包含启动虚拟机镜像的命令示例。

你可以使用以下脚本自动下载虚拟机镜像到Detux的"qemu"文件夹。

root@kitploit:~
#x86
wget https://people.debian.org/~aurel32/qemu/i386/debian_wheezy_i386_standard.qcow2 -P qemu/x86/1/


#x86-64
wget https://people.debian.org/~aurel32/qemu/amd64/debian_wheezy_amd64_standard.qcow2 -P qemu/x86-64/1/

#arm
wget https://people.debian.org/~aurel32/qemu/armel/debian_wheezy_armel_standard.qcow2 -P qemu/arm/1/
wget https://people.debian.org/~aurel32/qemu/armel/initrd.img-3.2.0-4-versatile -P qemu/arm/1/
wget https://people.debian.org/~aurel32/qemu/armel/vmlinuz-3.2.0-4-versatile -P qemu/arm/1/

#mips
wget https://people.debian.org/~aurel32/qemu/mips/vmlinux-3.2.0-4-4kc-malta -P qemu/mips/1/
wget https://people.debian.org/~aurel32/qemu/mips/debian_wheezy_mips_standard.qcow2 -P qemu/mips/1/

#mipsel
wget https://people.debian.org/~aurel32/qemu/mipsel/vmlinux-3.2.0-4-4kc-malta -P qemu/mipsel/1/
wget https://people.debian.org/~aurel32/qemu/mipsel/debian_wheezy_mipsel_standard.qcow2 -P qemu/mipsel/1/
设置sudoers以执行qemu

Detux通过SSH与虚拟机通信,因此虚拟机需要具备网络能力。假设所列二进制文件位于同一路径,你可以将以下行添加到/etc/sudoers(仅限非root用户时):

root@kitploit:~
Cmnd_Alias  QEMU_CMD    =   /usr/bin/qemu-*, /sbin/ip, /sbin/ifconfig, /sbin/brctl
<your detux username here> ALL = (ALL) NOPASSWD: QEMU_CMD

如果二进制路径不同,请自行修改。

网络设置

将以下配置添加到/etc/qemu-ifup(如有原文件请备份):

root@kitploit:~
#! /bin/sh
# Script to bring a network (tap) device for qemu up.
# The idea is to add the tap device to the same bridge
# as we have default routing to.

# in order to be able to find brctl
PATH=$PATH:/sbin:/usr/sbin
ip=$(which ip)
ifconfig=$(which ifconfig)

echo "Starting"  $1
if [ -n "$ip" ]; then
   ip link set "$1" up
else
   brctl=$(which brctl)
   if [ ! "$ip" -o ! "$brctl" ]; then
     echo "W: $0: not doing any bridge processing: neither ip nor brctl utility not found" >&2
     exit 0
   fi
   ifconfig "$1" 0.0.0.0 up
fi

switch=$(ip route ls | \
    awk '/^default / {
          for(i=0;i<NF;i++) { if ($i == "dev") { print $(i+1); next; } }
         }'
        )
    if [ -d /sys/class/net/br0/bridge/. ]; then
        if [ -n "$ip" ]; then
          ip link set "$1" master br0
        else
          brctl addif br0 "$1"
        fi
        exit    # exit with status of the previous command
    fi

echo "W: $0: no bridge for guest interface found" >&2

假设eth0是你要与虚拟机桥接的接口,你可以移除eth0的配置,并在/etc/network/interfaces中使用以下配置:

root@kitploit:~
auto br0
iface br0 inet dhcp
  bridge_ports eth0
  bridge_maxwait 0

你也可以指定你之前用于eth0的静态地址。

设置你的虚拟机

进入每个QEMU镜像所在的文件夹,例如ARM位于:

root@kitploit:~
<your detux folder>/qemu/arm/1/

对于每个镜像,按照"https://people.debian.org/~aurel32/"给出的虚拟机启动指令启动虚拟机。但如果你是非root用户,需要使用sudo。

启动虚拟机的命令(将替换为你想要的MAC地址):

root@kitploit:~
#x86
sudo qemu-system-i386 -hda qemu/x86/1/debian_wheezy_i386_standard.qcow2 -vnc 127.0.0.1:5901 -net nic,macaddr=<MACADDR> -net tap -monitor stdio


#x86-64
sudo qemu-system-x86_64 -hda qemu/x86-64/1/debian_wheezy_amd64_standard.qcow2 -vnc 127.0.0.1:5901 -net nic,macaddr=<MACADDR> -net tap -monitor stdio

#arm
sudo qemu-system-arm -M versatilepb -kernel qemu/arm/1/vmlinuz-3.2.0-4-versatile -initrd qemu/arm/1/initrd.img-3.2.0-4-versatile -hda qemu/arm/1/debian_wheezy_armel_standard.qcow2 -append "root=/dev/sda1" -vnc 127.0.0.1:5901 -net nic,macaddr=<MACADDR> -net tap -monitor stdio

#mips
sudo qemu-system-mips -M malta -kernel qemu/mips/1/vmlinux-3.2.0-4-4kc-malta -hda qemu/mips/1/debian_wheezy_mips_standard.qcow2 -append "root=/dev/sda1 console=tty0" -vnc 127.0.0.1:5901 -net nic,macaddr=<MACADDR> -net tap -monitor stdio

#mipsel
sudo qemu-system-mipsel -M malta -kernel qemu/mipsel/1/vmlinux-3.2.0-4-4kc-malta -hda qemu/mipsel/1/debian_wheezy_mipsel_standard.qcow2 -append "root=/dev/sda1 console=tty0" -vnc 127.0.0.1:5901 -net nic,macaddr=<MACADDR> -net tap -monitor stdio

Detux需要一个预先配置好IP地址和SSH设置的虚拟机快照。

配置快照的步骤:
  • 选择一个未配置的虚拟机镜像,并在终端中使用上述命令启动。
  • 连接虚拟机显示器。将VNC客户端连接到127.0.0.1:5901,等待虚拟机完全启动。
  • 使用默认root凭据(root/root)登录。
  • 配置虚拟机的网络接口,使其可被宿主机访问。
  • 在虚拟机上设置SSH服务器,并根据需要执行其他配置。
  • 配置完成后,启动到接受网络连接的状态。
  • 切换回启动qemu控制台的终端,界面应类似:
root@kitploit:~
(qemu)
  • 在qemu控制台中输入以下命令保存虚拟机状态:
root@kitploit:~
(qemu) savevm init
  • 退出QEMU控制台:
root@kitploit:~
(qemu) q

-- 对所有虚拟机重复步骤1

设置抓包权限

为了使非root用户能够抓包,Dumpcap需要捕获权限。(https://wiki.wireshark.org/CaptureSetup/CapturePrivileges)。

以下命令可能为你提供相应权限:

root@kitploit:~
sudo groupadd -g wireshark
sudo usermod -a -G wireshark <your user name>
sudo chmod 750 /usr/bin/dumpcap
sudo setcap cap_net_raw,cap_net_admin=eip /usr/bin/dumpcap

请注意,你可能需要注销并重新登录或重启宿主机才能应用这些权限。如果你无法抓包或遇到与dumpcap相关的错误,请检查用户权限设置是否正确以及dumpcap路径是否正确。

Detux配置

需要配置主目录中的detux.cfg文件。每个虚拟机部分必须配置正确的网络参数和SSH凭据。你可以根据需要选择root或非root用户。

运行Detux

"core"目录中的Detux库可用于满足你的分析需求。 该仓库包含"detux.py",用于分析给定的二进制文件,将pcap保存到pcap文件夹,并将JSON输出写入指定文件路径。

用法

root@kitploit:~
usage: detux.py [-h] --sample SAMPLE [--cpu {x86,x86-64,arm,mips,mipsel}]
                [--int {python,perl,sh,bash}] --report REPORT

optional arguments:
  -h, --help            show this help message and exit
  --sample SAMPLE       Sample path (default: None)
  --cpu {x86,x86-64,arm,mips,mipsel}
                        CPU type (default: auto)
  --int {python,perl,sh,bash}
                        Architecture type (default: None)
  --report REPORT       JSON report output path (default: None)

示例:

root@kitploit:~
python detux.py --sample test_script/example_binary1 --report reports/example_report1.json

贡献者:

  • Vikas Iyengar - 核心设计 ( dudeintheshell , email: [email protected] )
  • Muslim Koser - 技术思想贡献 ([email protected])
  • Rahul Binjve - pcap解析帮助 (@c0dist, twitter)
  • Amey Gat - pcap解析帮助 (ameygat, [email protected] )

致谢

感谢Aurélien Jarno (@aurel32) (https://www.aurel32.net/) 提供的预构建虚拟机镜像。

下载工具