Skip to content

Latest commit

 

History

History
51 lines (37 loc) · 2.14 KB

File metadata and controls

51 lines (37 loc) · 2.14 KB

firmware-analysis-toolkit_docker

构建镜像

docker build -t simulation:1.0 .

挂载固件运行

docker run -it --rm --privileged -p 8066:80 -v /dev:/dev -v /home/firmware_run/input:/root/input simulation:1.0 ./fat.py /root/input/"WNAP320 Firmware Version 2.0.3.zip"

🚩 固件仿真运行报错 🚩

postgres

service postgresql start
psql -U firmadyne -h127.0.0.1 -p5432 -dfirmware

外网访问

1、einetd端口转发工具

在docker容器内添加端口映射
```shell
root@30f4fcce93c7:~/firmware-analysis-toolkit# apt install rinetd

root@30f4fcce93c7:~/firmware-analysis-toolkit# vi /etc/rinetd.conf
0.0.0.0 80 192.168.0.100 80

root@30f4fcce93c7:~/firmware-analysis-toolkit# pkill rinetd   		       # 关闭进程
root@30f4fcce93c7:~/firmware-analysis-toolkit# rinetd -c /etc/rinetd.conf  # 启动转发

web访问地址:http://宿主机hostip:8066    # admin/password
```

2、iptables端口映射

在docker容器内(IP:172.17.0.2)添加端口映射
```shell
root@30f4fcce93c7:~/firmware-analysis-toolkit# iptables -t nat -A POSTROUTING -j MASQUERADE
root@30f4fcce93c7:~/firmware-analysis-toolkit# iptables -t nat -A PREROUTING -d 172.17.0.2 -p tcp --dport 80 -j DNAT --to-destination 192.168.0.100:80
root@30f4fcce93c7:~/firmware-analysis-toolkit# iptables -t nat -A POSTROUTING -d 192.168.0.100 -p tcp --dport 80 -j SNAT --to 172.17.0.2

web访问地址:http://宿主机hostip:8066    # admin/password
```

模拟运行结果

image