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

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

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

订阅源联系隐私© 2026 Kitploit

工具目录

分类

查看所有分类
Loading categories
AutoGadgetFS — USB测试变得简单 | Kitploit
工具/GitHubGitHub/ehabhussein/autogadgetfs
模糊测试硬件黑客渗透测试
GitHubehabhussein/autogadgetfs

AutoGadgetFS

USB测试变得简单

查看仓库网站
12323225年前Kitploit 审核通过

最受欢迎

查看全部 →

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

探索所有工具

浏览我们的工具集合

查看所有工具 →
分享

以太坊捐赠:0xA919e40ddB0563918dDc174320D91992e0048477

目录

  1. 什么是AutoGadgetFS?

  2. 需求

  3. 设置

    a. 仅设备测试

    b. 最小agfs中间人配置

    c. 带调试支持的完整agfs中间人配置

  4. USB设备类支持

  5. 功能

  6. 路线图

  7. 安装

    a. Linux

    b. 带WiFi的树莓派Zero

  8. AutoGadgetFS教程

  9. 截图

  10. YouTube播放列表

  11. Slack

  12. 支持方

  13. 请我喝杯咖啡 ☕️

  14. 联系我

  15. 想贡献?


什么是AutoGadgetFS?

AutoGadgetFS是一个开源框架,允许用户无需深入了解USB协议即可评估USB设备及其相关主机/驱动/软件。该工具使用Python3编写,并利用RabbitMQ和WiFi接入,使研究人员能够从全球任何地方进行远程USB安全评估。通过利用ConfigFS,AutoGadgetFS允许用户快速克隆和仿真设备,无需深入研究每个实现的细节。该框架还允许用户在其基础上创建自己的模糊测试器。


需求:

  • 💻 运行Linux(Debian/Ubuntu/Kali)的主机
  • 🥧 支持WiFi的树莓派Zero
  • 🎯 目标机器选项:
    • 虚拟机
    • 独立机器
  • 🔌 2根USB Micro线缆
  • 🔱 目标USB设备
  • 🐞 硬件调试器(可选)

设置:

```bash Device testing only:

<div style="text-align:center"><img src="https://raw.githubusercontent.com/ehabhussein/AutoGadgetFS/master/screenshots/devtest.jpeg" width="450" height="187" /></div>

<a name="MMITM"/>```bash
Minimal agfs in the middle setup:

```bash Complete agfs in the middle setup with debugging support:

<div style="text-align:center"><img src="https://raw.githubusercontent.com/ehabhussein/AutoGadgetFS/master/screenshots/scenario2.jpeg"/></div>

---

<a name="Usbdev"/>

### USB 设备类支持:

[✔️] USB HID 设备完全支持(中间人攻击)

[⚠️] 仅设备测试 .. 所有 USB 设备(无中间人攻击)

[⏳] 未来版本... 所有 USB 设备(中间人攻击)

---

<a name="Caps"/>

### 功能:

1. 轻松查找、选择并附加到 USB 设备。
1. 模拟任意 USB HID 设备。
1. 对 HID 设备执行 AGFS 中间人嗅探(将通信保存到磁盘)。
1. 设备嗅探(任意设备)。
1. 多种模糊测试器,可对设备或主机进行模糊测试。
1. 随机模糊测试器(固定或随机长度的数据包)。
1. 从之前 USB 通信中学习的智能模糊测试器。
1. 描述模糊测试器,指示模糊测试器对哪些字节进行模糊测试,其余数据包保持不变。
1. Gadget 模糊测试器。
1. 顺序模糊测试器。
1. 控制传输枚举器。
1. 从文件重放数据包。
1. 从保存的 USBLyzer 捕获中重放数据包。
1. 可视化方式呈现数据包,便于逆向分析通信。
1. 设备处于 DFU 模式或设备泄露信息时的警报。
1. USB 设备和主机可以位于互联网上的任何位置。
1. 监控接口的突然变化。

---

<a name="Road"/>

### 路线图:

1. 嗅探设备的控制传输请求并回复它们。
1. MITM 并模拟所有类型的设备。
1. 基于控制台/QT 的界面。
1. 在 RPI zero W 上支持更多接口/端点。
1. 支持更多开发板,如 GreatFET。
1. 迁移到自定义开发板。
1. 努力使树莓派完全支持所有接口的 USB 设备模拟。
1. 通过序列号关联发送和接收的数据包。

---

<a name="Installation"/>

### 安装:

<a name="Linux"/>

### Linux 机器:

* 注意:由于 USB 穿透问题,不支持 WSL/WSL2。

* 安装 Python3、ipython3、git、pip 和 rabbitMQ 服务器

    ```bash
    sudo apt install python3 ipython3 git python3-pip rabbitmq-server dfu-util
    sudo service rabbitmq-server start
    ```

* 克隆仓库

    ```bash
    git clone https://github.com/ehabhussein/AutoGadgetFS
    cd AutoGadgetFS
    ```

* 安装依赖项

    ```bash
    sudo -H pip3 install -r requirements.txt
    ```

* 降级 prompt toolkit 以获得更好的 ipython 体验:

    ```bash
    sudo python3 -m pip install prompt-toolkit~=2.0
    ```

* 启用 rabbitMQ 的 Web 界面

    ```bash
    sudo rabbitmq-plugins enable rabbitmq_management
    http://localhost:15672/ 访问 Web 界面
    ```

* 使用凭据 *guest:guest* 登录 Web 界面
  * 注意:如果你不是在 `localhost` 上安装 rabbitMQ,请添加以下用户并以此登录:
    ```bash
    sudo rabbitmqctl add_user autogfs usb4ever
    sudo rabbitmqctl set_user_tags autogfs administrator
    ```
  * 上传 rabbitMQ 配置文件
    * 在概览标签页中滚动到底部以导入定义
    * 上传位于 *rabbitMQbrokerconfig/rabbitmq-Config.json* 的文件

    ```bash
    sudo service rabbitmq-server restart
    ```

* 测试安装

    ```python
    sudo ipython3
    
    Python 3.7.7 (default, Apr  1 2020, 13:48:52)
    Type 'copyright', 'credits' or 'license' for more information
    IPython 7.9.0 -- An enhanced Interactive Python. Type '?' for help.

    In [1]: import libagfs

    In [2]: x = libagfs.agfs()

    ***************************************
    AutoGadgetFS: USB testing made easy
    ***************************************
    Enter IP address of the rabbitmq server: 127.0.0.1
  
    In [3]: exit

    sudo `python3` agfsconsole.py
    
    ***************************************
    AutoGadgetFS: USB testing made easy
    ***************************************
    Enter IP address of the rabbitmq server: 127.0.0.1
    Give your project a name?!:
```   ```

* Patch Pyusb langID ( Not needed unless you get pyusb errors for langID ):
  * Edit the file `/usr/local/lib/python3/dist-packages/usb/util.py`
    * make changes to the `def get_string` method to look like below:

        ```python
        if 0 == len(langids):
            return "Error Reading langID"
            #raise ValueError("The device has no langid")
        if langid is None:
            langid = langids[0]
        elif langid not in langids:
            return "Error Reading langID"
            #raise ValueError("The device does not support the specified langid")
        ```

    * If you prefer to use `patch` apply the following patch to the file: `AutoGadgetFS/pyusb_patches/pyusb_langid.patch`

---

<a name="Rasp"/>

### Raspberry Pi Zero W:

* Obtain a copy of [Raspian Lite Edition](https://downloads.raspberrypi.org/raspios_lite_armhf_latest)
  * Burn the Image to the SD card using [BalenaEtcher](https://www.balena.io/etcher/)

* Mount the SD card on your machine and make the following changes:
  * In the `/path/to/sdcard/boot/config.txt` file add to the very end of the file:

    ```bash
    enable_uart=1
    dtoverlay=dwc2
    ```

  * In the `/path/to/sdcard/boot/cmdline.txt` add right after `rootwait`

    ```bash
    modules-load=dwc2
    ```

  * it should look like this make sure its on the same line:

    ```bash
    console=serial0,115200 console=tty1 root=PARTUUID=6c586e13-02 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait modules-load=dwc2
    ```

* Enable ssh:
  * in the `/path/to/sdcard/boot` directory create an empty file name ssh:

    ```bash
    sudo touch /path/to/sdcard/boot/ssh
    ```

* Enable Wifi:
  * in the `/path/to/sdcard/boot` directory create an file named `wpa_supplicant.conf`:

    ```bash
    sudo vim /path/to/sdcard/boot/wpa_supplicant.conf
    ```

  * Add the following contents:

    ```bash
    ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
    update_config=1
    country=US
    network={
                ssid="<your wifi SSID>"
                psk="<your wifi password>"
                key_mgmt=WPA-PSK
             }
    ```

* Unmount the SD card and place it back into the Raspberry Pi Zero and power it on.
* Copy the content of `AutogadgetFS/Pizero/` to the Pi zero: `username: pi` & `password: raspberry`

    ```bash
    cd AutogadgetFS/Pizero/
    scp gadgetfuzzer.py removegadget.sh requirements.txt router.py pi@<pi-ipaddress>:/home/pi
    ```

* SSH into the PI Zero and setup requirements for AutoGadgetFS:

    ```bash
    ssh pi@<pi-ip-address>
    chmod +x removegadget.sh
    sudo apt update
    sudo apt install python3 python3-pip
    sudo -H pip3 install -r requirements.txt
    ```
* Upgrading the latest kernel and adding modules (* This step is optional for the current release):
    ( This will take a very long time compiling on the Pi Zero, unless you choose to cross compile the kernel see [Compiling options](https://www.raspberrypi.org/documentation/linux/kernel/building.md))
下载工具