目标:不会一点linux,想在windows安装docker版的mqtt-pwn
工具下载:https://github.com/akamai-threat-research/mqtt-pwn
官方文档:https://mqtt-pwn.readthedocs.io/en/latest/intro.html#docker-usage
步骤1.安装docker:
windows选amd64版本的docker desktop
步骤2.
打开docker发现不能运行
家庭版安装Hyper-V参考:
https://blog.csdn.net/thorns666/article/details/138215902
安装wsl2参考:
https://www.zhihu.com/question/654276902/answer/3534009412
docker desktop终于能正常运行
步骤3.安装docker-compose
https://blog.csdn.net/u013737132/article/details/134521228
步骤4.修报错
docker-compose up --build --detach
报错,因为python jessie版本不再维护
参考:https://github.com/akamai-threat-research/mqtt-pwn/issues/23的解决方案
(1)修改mqtt-pwn文件中的Dockerfile:第一行改为slim-buster,另外第三行加--force-yes
FROM python:3.8-slim-buster
RUN apt-get update
RUN apt-get install software-properties-common less vim -y --force-yes
ENV INSTALL_PATH /mqtt_pwn
RUN mkdir -p $INSTALL_PATH
WORKDIR $INSTALL_PATH
COPY requirements.txt requirements.txt
RUN pip install -r requirements.txt
COPY . .
(2)后续针对run.py报错,改requirement.txt文件,其中:idna-ssl==1.0.1 改为1.1.0;MarkupSafe;psycopg2-binary;Pygments,这几个需要修改
aiohttp==3.2.1
alabaster==0.7.10
async-timeout==3.0.0
attrs==18.1.0
Babel==2.5.3
blessings==1.6.1
certifi==2018.4.16
chardet==3.0.4
Click==7.0
click-plugins==1.0.4
cmd2==0.9.3
colorama==0.4.0
docutils==0.14
future==0.16.0
idna==2.6
idna-ssl==1.1.0
imagesize==1.0.0
Jinja2==2.10
MarkupSafe
multidict==4.3.1
packaging==17.1
paho-mqtt==1.3.1
peewee==3.3.2
prettytable==0.7.2
psycopg2-binary
Pygments
PyMySQL==0.8.1
pyparsing==2.2.0
pyperclip==1.6.0
pytz==2018.4
requests==2.20.0
shodan==1.10.4
six==1.11.0
snowballstemmer==1.2.1
Sphinx==1.7.4
sphinxcontrib-websupport==1.0.1
urllib3==1.24.2
wcwidth==0.1.7
XlsxWriter==1.1.2
yarl==1.2.4
docker-compose ps
docker-compose run cli