Skip to content

Commit

Permalink
Docker working
Browse files Browse the repository at this point in the history
  • Loading branch information
William Moody committed Mar 21, 2021
1 parent 536ed90 commit a53f33c
Show file tree
Hide file tree
Showing 5 changed files with 60 additions and 1 deletion.
8 changes: 8 additions & 0 deletions .docker/entrypoint.sh
@@ -0,0 +1,8 @@
# start mongodb
mongod --fork -f /etc/mongod.conf

# seed mongodb
mongo /app/.docker/init.js

# start the node app
npm start
File renamed without changes.
11 changes: 11 additions & 0 deletions .exploit/dumpPasspord.py
@@ -0,0 +1,11 @@
#!/usr/bin/python3
import requests
import sys

if len(sys.argv) != 3:
print("usage: %s TARGET USER" % sys.argv[0])
sys.exit(-1)

target = sys.argv[1]
user = sys.argv[2]

24 changes: 23 additions & 1 deletion Dockerfile
@@ -1 +1,23 @@
FROM alpine:latest
FROM debian:latest

# copy files to /app
WORKDIR /app
COPY . /app

# install necessary packages
RUN apt-get update
RUN apt-get install -y nodejs npm wget gnupg
RUN wget -qO - https://www.mongodb.org/static/pgp/server-4.4.asc | apt-key add -
RUN echo "deb http://repo.mongodb.org/apt/debian buster/mongodb-org/4.4 main" | tee /etc/apt/sources.list.d/mongodb-org-4.4.list
RUN apt-get update
RUN apt-get install -y mongodb-org

# update npm
RUN npm install -g npm@latest

# install node modules
RUN npm install

# start the app
EXPOSE 3000
CMD ["/bin/sh",".docker/entrypoint.sh"]
18 changes: 18 additions & 0 deletions README.md
Expand Up @@ -10,3 +10,21 @@
## Description

A small web app writen in Node.JS to practice NoSQLi and deserialization exploits.

Working exploits may be found in `./exploit`

## How to run locally

1. Clone this repo: `git clone https://github.com/bmdyy/chat.js`
2. Enter folder: `cd chat.js`
3. Run: `docker build -t chatjs .`
4. Run: `docker run -t chatjs`

To find the docker container's IP:
1. Run: `docker inspect --format '{{ .NetworkSettings.IPAddress }}' $(docker ps -q)`

To kill docker:
1. Run: `docker ps` and copy the id
2. Run: `docker kill <id>`

The app is running on `http://IP:3000`

0 comments on commit a53f33c

Please sign in to comment.