0%

mongodb蜜罐- mongodb-honeyproxy

1
2
3
4
5
6
7
8
9
10
11
12
13
apt-get install nodejs-legacy
https://github.com/Plazmaz/MongoDB-HoneyProxy

npm config set strict-ssl false
npm config set registry="http://registry.npmjs.org/"
npm install nan
npm install gyp
npm install ref
npm install
npm cache clean -f

mkdir /data/db
mongoimport --db users --collection contacts --file primer-dataset.json

mongo
use users
db.contacts.find()
确保mongod可以正常运行
mongod –dbpath=/data/db –fork –logpath=/data/db/log –port 27016

node index.js

docker build –tag=”changeme” .
docker run -d -p 27017:27017 –name=”changeme” changeme
docker exec -it changeme bash

docker-compose up –no-recreate

制作自己的mongodb蜜罐

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
docker pull ubuntu:18.04
docker run -it ubuntu:18.04 /bin/bash
sed -i s@/archive.ubuntu.com/@/mirrors.aliyun.com/@g /etc/apt/sources.list
apt-get clean
apt-get update -y
apt-get upgrade -y
apt-get dist-upgrade -y
apt-get install mongodb mongodb-server nodejs vim net-tools wget -y
mkdir -p /data/db
apt-get install nodejs npm gcc g++ git -y
git clone https://github.com/Plazmaz/MongoDB-HoneyProxy.git
cd MongoDB-HoneyProxy
wget https://raw.githubusercontent.com/mongodb/docs-assets/primer-dataset/primer-dataset.json

npm config set strict-ssl false
npm config set registry="http://registry.npmjs.org/"
npm install nan gyp ref
npm install
# vi mongodb.cnf
dbpath=/data/db/
logpath=/data/db/mongo.log
logappend=true
fork=true
port=27016
mongod -f mongodb.cnf
mongoimport --db users --collection contacts --port 27016 --file primer-dataset.json
exit
docker container ls -a
docker commit 容器ID ubuntu:mongodb-honeypot
编辑Dockerfile和docker-compose.yml

docker-compose up –no-recreate
docker run -it ubuntu:mongodb-honeypot /bin/bash

mongodb –port 27016