Giter Site home page Giter Site logo

vulntotal-team / iot-vulhub Goto Github PK

View Code? Open in Web Editor NEW
1.1K 26.0 165.0 430.78 MB

IoT固件漏洞复现环境

Home Page: https://vulntotal-team.github.io/IoT-vulhub/

License: GNU General Public License v3.0

Dockerfile 2.97% Shell 17.82% Python 64.51% Makefile 0.21% C 14.47% Batchfile 0.02%
iot vulnerability exploit docker qemu

iot-vulhub's Introduction

IoT-vulhub

Vulhub 项目的启发,希望做一个 IoT 版的固件漏洞复现环境。

安装

在 Ubuntu 20.04 下安装 docker 和 docker-compose:

# 安装 pip
$ curl -s https://bootstrap.pypa.io/get-pip.py | python3

# 安装最新版 docker
$ curl -s https://get.docker.com/ | sh

# 启动 docker 服务
$ systemctl start docker

# 安装 docker-compose
$ python3 -m pip install docker-compose

使用说明

# 下载本项目
$ wget https://github.com/VulnTotal-Team/IoT-vulhub/archive/master.zip -O iot-vulhub-master.zip
$ unzip iot-vulhub-master.zip && cd iot-vulhub-master

# 构建 ubuntu1604 基础镜像
$ cd baseImage/ubuntu1604 && docker build -t firmianay/ubuntu1604 .

# 构建 binwalk 容器,方便使用
$ cd baseImage/binwalk && docker build -t firmianay/binwalk .

# 进入一个漏洞环境目录
$ cd D-Link/CVE-2019-17621

# 解包固件
$ docker run --rm -v $PWD/firmware:/root/firmware firmianay/binwalk -Mer "/root/firmware/firmware.bin"

# 初始化环境(arm/mips/mipsel)
$ ./init_env.sh xxxx

# 自动化编译环境(目前通常有四种模拟方式)
$ docker-compose -f docker-compose-user.yml build         # QEMU 用户模式模拟
$ docker-compose -f docker-compose-system.yml build       # QEMU 系统模式模拟
$ docker-compose -f docker-compose-firmadyne.yml build    # firmadyne 模拟
$ docker-compose -f docker-compose-firmae.yml build       # firmae 模拟(方便调试)

# 启动整个环境
$ docker-compose -f docker-compose-xxxx.yml up

# 每个环境目录下都有相应的说明文件,请阅读该文件,进行漏洞测试

# 测试完成后,删除整个环境
$ docker-compose -f docker-compose-xxxx.yml down -v

注意事项:

  • 在构建 qemu-system 前务必下载对应的 qemu 镜像!
  • 退出 qemu 用 Ctrl+A,再输入 X
  • 容器中使用 systemctl 可能会有问题,使用 /etc/init.d/xxxx start 代替
  • 如果要从实体机直接访问 Qemu,例如打开固件的 web 界面(实体机 -> Docker -> Qemu):
    • 首先在启动 docker 时需要将 ssh 端口映射出来,如 -p 1234:22
    • 然后在本地开启端口转发,如 ssh -D 2345 [email protected] -p 1234
    • 最后对浏览器设置 socks5 代理 127.0.0.1:2345。Burpsuite/Python脚本同理。

漏洞环境列表

请查看漏洞环境列表

贡献指南

在研究漏洞的同时,也请给我们提交一份复现环境吧!贡献指南

关注我们

VulnTotal安全致力于分享高质量原创文章和开源工具,包括物联网/汽车安全、移动安全、网络攻防等。

GNU General Public License v3.0

Stargazers over time

iot-vulhub's People

Contributors

firmianay avatar fouzhe avatar llx418 avatar pic4xiu avatar sco4x0 avatar ucgjhe avatar winfog avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

iot-vulhub's Issues

cisco-CVE-2020-3331容器无法运行

注意事项:
在构建 qemu-system 前务必下载对应的 qemu 镜像!

请问师傅上面这个注意事项是什么意思?
image
这个错误的原因是我没有下载对应镜像吗?
(ps:我已经安装说明安装了baseimage)

firmianay/qemu-system:mipsel 请问师父这个是不是没了,

=> ERROR [internal] load metadata for docker.io/firmianay/qemu-system:mipsel 0.1s

[internal] load metadata for docker.io/firmianay/qemu-system:mipsel:


Dockerfile:1

1 | >>> FROM firmianay/qemu-system:mipsel
2 | LABEL Author="[email protected]"
3 |

ERROR: failed to solve: firmianay/qemu-system:mipsel: pull access denied, repository does not exist or may require authorization: server message: insufficient_scope: authorization failed
ERROR: Service 'system-emu' failed to build : Build failed

firmianay/qemu-system:mipsel
请问师父这个是不是没了,

ssh: connect to host 127.0.0.1 port 1234: Connection refused

环境:

D-Link/CVE-2019-17621

我构建好了所有的镜像,然后按照教程启动容器时候,发现报错exited with code 0

:~/IoT-vulhub/D-Link/CVE-2019-17621$ docker-compose -f docker-compose-firmae.yml up
Creating dlink-firmae ... done
Attaching to dlink-firmae
dlink-firmae  | 
dlink-firmae  | Scan Time:     2021-08-03 10:52:55
dlink-firmae  | Target File:   /bin/sh
dlink-firmae  | MD5 Checksum:  e02ea3c3450d44126c46d658fa9e654c
dlink-firmae  | Signatures:    411
dlink-firmae  | 
dlink-firmae  | DECIMAL       HEXADECIMAL     DESCRIPTION
dlink-firmae  | --------------------------------------------------------------------------------
dlink-firmae  | 0             0x0             ELF, 64-bit LSB shared object, AMD x86-64, version 1 (SYSV)
dlink-firmae  | 121509        0x1DAA5         Unix path: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
dlink-firmae  | 
dlink-firmae  | 
dlink-firmae  | Scan Time:     2021-08-03 10:52:55
dlink-firmae  | Target File:   /root/run.sh
dlink-firmae  | MD5 Checksum:  9a755098ab0058be71245bf6063fc25d
dlink-firmae  | Signatures:    411
dlink-firmae  | 
dlink-firmae  | DECIMAL       HEXADECIMAL     DESCRIPTION
dlink-firmae  | --------------------------------------------------------------------------------
dlink-firmae  | 0             0x0             Executable script, shebang: "/bin/bash"
dlink-firmae  | 33            0x21            Unix path: /etc/init.d/ssh start
dlink-firmae  | 
dlink-firmae exited with code 0

123

基础镜像升级计划

将Ubuntu从16.04升级到18.04(保持python2的兼容性)或者一步到位20.04(仅支持python3,需重写部分exp),可能需要做大量测试工作,特开此帖白嫖PR :)

baby problem

is the firmianay existing in dockerhub?Ididn't find it...

华为镜像部署问题

师傅您好,很感谢你写的这个利器。我在部署华为的环境时有如下报错。感到很奇怪,不知道如何解决。
image

在这里我看到您使用的镜像从我们开始build的unbuntu 变为了mips。我因为docker下载不到mips,就将其改为了原来的unbuntu。
在之后我遇到了如下报错,求解答!!
image

关于CVE-2020-8962的一些问题解决合集

昨晚复现这个脚本的时候,发现诸多问题,在咨询原作者后,主要针对复现中可能遇到的几个问题做下解释:

1、首先需要创建一个session文件,否则运行中会报错:
image

2、脚本中的断点位置不对,需要断在漏洞函数里,而不是漏洞函数返回后的地址,也就是0x41db40 改为 0x41d3f0

3、如果是最新的qiling 1.3 dev0的话,原作者告诉我原PoC需要修改为以下代码:

    ql.mem.write(sysinfo_info, b"AAAA") # uptime
    regreturn = 0
    ql.log.info("sysinfo(0x%x)=%d"%(sysinfo_info,regreturn))
    return regreturn

以上问题原作者也会更新博客,我只是个搬运工。。

dlink-qiling exited with code 0

在Dlink文件下的sudo docker-compose -f docker-compose-qiling.yml up
出现了“dlink-qiling exited with code 0”的问题
请问qiling这个模拟环境是否需要添加其他的额外依赖呢?

docker build binwalk报错

image
我是在arm架构上测试的,修改了ubuntu 16的Dockerfile中镜像源后,ubuntu16的build没有问题;
但docker build binwalk时使用无法正常进行,这里的matplotlib安装包从3.0.3版本一直找到现在的2.2.0版本,就是找不到,看红色提示,应该是库不支持,一直在降低版本试图找到合适的版本。
image

firmianay/firmadyne不存在

项目中的"firmianay/firmadyne好像在dockerhub中拉取不到了,是删掉了吗?

Building firmadyne-emu
Sending build context to Docker daemon   26.1MB
Step 1/6 : FROM firmware/firmadyne
pull access denied for firmware/firmadyne, repository does not exist or may require 'docker login': denied: requested access to the resource is denied
ERROR: Service 'firmadyne-emu' failed to build : Build failed

Cisco RV110W 报错问题

image
已经 build 完成,运行 docker-compose -f docker-compose-system.yml up 时无法正常启动 如何解决此问题o_O

安装问题

初始化环境(arm/mips/mipsel)
$ ./init_env.sh xxxx
请教大佬 这步要怎么执行啊 我在文件夹里没有找到这个脚本啊

申请重新上传以下这些镜像。

这些镜像都没有了,申请重新上传一下吧。
"firmianay/ubuntu1604"
"firmianay/gdbserver"
"firmianay/qiling"
"firmianay/binwalk"
"firmianay/binwalk:noentry" # 作为 firmadyne 和 firmae 的基础镜像
"firmianay/firmadyne"
"firmianay/firmae"

"firmianay/qemu-user-static"
"firmianay/qemu-system:arm"
"firmianay/qemu-system:mips"
"firmianay/qemu-system:mipsel"

Problems when trying to start

我试图从D-Link/CVE-2019- 开始
我沿着依赖关系
firmianay/ubuntu1604 -> firmianay/binwalk:noentry(noentry这个版本是?) -> firmianay/firmadyne
逐步修改了他们的Dockerfile中开头行的“From xxx”为本地docker image的值,并且一直没有报错,直到
我试图启动
issue

请问该如何启动?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.