Skip to content

Commit 8c35c14

Browse files
committed
Initial commit
0 parents  commit 8c35c14

File tree

5 files changed

+303
-0
lines changed

5 files changed

+303
-0
lines changed

Dockerfile

+49
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# used Image is docker-specialised ubuntu
2+
FROM phusion/baseimage
3+
4+
ENV GIT_APP_ID=000000
5+
ENV GIT_APP_SECRET=0000000
6+
ENV PORT=3000
7+
8+
EXPOSE ${PORT}
9+
10+
# Install all needed requirements
11+
RUN /bin/sh -c 'apt-get update && apt-get upgrade -y -o Dpkg::Options::="--force-confold"; \
12+
curl -sL https://deb.nodesource.com/setup_8.x | bash - ; \
13+
apt-get install --yes \
14+
mongodb \
15+
git \
16+
gcc \
17+
g++ \
18+
make;\
19+
apt-get install --yes \
20+
nodejs; \
21+
npm i -g yarn; \
22+
yarn global add typescript; \
23+
yarn global add pm2; \
24+
git clone https://github.com/samdenty/injectify.git /Injectify; \
25+
cd /Injectify; \
26+
rm -rf /var/lib/apt/lists/*; '
27+
28+
# Autostart MongoDB
29+
#Initialize My_Init_Folder first
30+
RUN mkdir -p /etc/my_init.d
31+
COPY mongod_start.sh /Injectify/mongod_start.sh
32+
33+
# Copy needed server.config.js and insert given ENV values
34+
COPY server.config.js /Injectify/server.config.js
35+
COPY env.sh /Injectify/env.sh
36+
37+
RUN /bin/sh -c 'chmod +x /Injectify/mongod_start.sh; \
38+
chmod +x /Injectify/env.sh; '
39+
40+
#RUN /bin/bash -c "sed -i 's/MY_APP_ID/${GIT_APP_ID}/g' /Injectify/server.config.js; \
41+
#sed -i 's/MY_APP_SECRET/${GIT_APP_SECRET}/g' /Injectify/server.config.js; \
42+
#sed -i 's/express: 3000,/express: ${PORT},/g' /Injectify/server.config.js; "
43+
44+
45+
# Building the finished tool
46+
WORKDIR /Injectify
47+
RUN /bin/sh -c 'cd /Injectify; yarn run install:all; '
48+
49+
CMD /Injectify/env.sh; /Injectify/mongod_start.sh; /usr/bin/yarn run deploy > /tmp/injectify.log; tail -f /tmp/injectify.log

README.md

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# docker-injectify
2+
3+
## Description
4+
This image allows to run [Injectify](https://github.com/samdenty/injectify) by samdenty localy inside of a docker container with a local database.
5+
6+
Injectify is a web based MiTM tool, similiar to BeEF (although completely unrelated in terms of source code). It uses modern web technologies such as ReactJS, Redux, Typescript and Webpack.
7+
8+
----------------------------------------
9+
10+
[github.com/evait-security/docker-injectify]( https://github.com/evait-security/docker-injectify)
11+
12+
13+
# Build
14+
15+
git clone https://github.com/evait-security/docker-injectify
16+
17+
cd docker-injectify
18+
19+
docker build -t injectify .
20+
21+
# Instructions
22+
23+
## Requirements
24+
25+
To use Injectify properly, you first need to [register a new OAuth-Application](https://github.com/settings/applications/new) in Github. In the field ** *Authorization callback URL* ** you need to input your url **(with http)** where the finished Injectify-Website will be available , *e.g http://192.168.0.53:3000*. All other fields in the form can be choosen freely.
26+
27+
*Note: The default port of Injectify is 3000 but can be changed at startup*
28+
29+
## Run the container
30+
```bash
31+
docker run -d --name Injectify -e GIT_APP_ID=<your-app-id> -e GIT_APP_SECRET=<your-app-secret> evait/injectify:latest
32+
33+
```
34+
35+
## Advanced usage
36+
To change the port to listen to, you can change the *PORT*-Enviroment variable
37+
```bash
38+
docker run -d --name Injectify -p <desired-port>:<desired-port> -e PORT=<desired-port> -e GIT_APP_ID=<your-app-id> -e GIT_APP_SECRET=<your-app-secret> evait/injectify:latest
39+
```

env.sh

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#! /bin/bash
2+
sed -i 's/MY_APP_ID/'"$GIT_APP_ID"'/g' /Injectify/server.config.js
3+
sed -i 's/MY_APP_SECRET/'"$GIT_APP_SECRET"'/g' /Injectify/server.config.js
4+
sed -i 's/express: 3000,/express: '"$PORT"',/g' /Injectify/server.config.js

mongod_start.sh

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#! /bin/bash
2+
/usr/bin/mongod --config /etc/mongodb.conf --fork

server.config.js

+209
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,209 @@
1+
module.exports = {
2+
injectify: {
3+
/**
4+
* WARNING: Anyone in the below array
5+
* will have full access to all the projects
6+
* along with the ability to execute server-side
7+
* Javascript in the superuser control panel
8+
*
9+
* http://caius.github.io/github_id/
10+
*/
11+
superusers: [
12+
13242392 // @samdenty99
13+
],
14+
15+
/**
16+
* Your GitHub application configuration
17+
*/
18+
github: {
19+
client_id: 'MY_APP_ID',
20+
client_secret: 'MY_APP_SECRET',
21+
scope: 'read:user gist'
22+
},
23+
24+
/**
25+
* MongoDB configuration
26+
* Passed directly to node-mongodb-native
27+
*/
28+
mongodb: 'mongodb://localhost:27017',
29+
30+
/**
31+
* The port on which to host the website
32+
*/
33+
express: 3000,
34+
35+
/**
36+
* Make it available over the internet without port forwarding
37+
*/
38+
localtunnel: {
39+
enable: false,
40+
/**
41+
* Set the below variable to use a custom fixed domain
42+
* Subdomains must be lowercase and between 4 and 63 alphanumeric characters.
43+
*
44+
* Set to false to default to random domain
45+
*/
46+
subdomain: false
47+
},
48+
49+
/**
50+
* Enable compression - can be disabled to reduce cpu usage
51+
*/
52+
compression: true,
53+
54+
/**
55+
* Server-side code execution in modules
56+
*/
57+
serverExecution: {
58+
/**
59+
* Commands to enable, comment out to disable them
60+
*/
61+
enabledCommands: [
62+
'_',
63+
'SHELL',
64+
'FUNCTION',
65+
'OBJECT',
66+
'NUMBER',
67+
'STRING',
68+
'WRITE',
69+
'BOOLEAN',
70+
'ARRAY',
71+
]
72+
},
73+
74+
/**
75+
* Rate limiting
76+
*/
77+
rateLimiting: {
78+
/**
79+
* Injectify project API aka 'View JSON'
80+
*
81+
* This requires a lot of CPU to perform (database side)
82+
*/
83+
api: {
84+
windowMs: 2 * 60 * 1000,
85+
max: 70,
86+
delayAfter: 10,
87+
delayMs: 300,
88+
message: JSON.stringify({
89+
success: false,
90+
reason: 'Too many requests, please try again later'
91+
}, null, ' ')
92+
},
93+
inject: {
94+
/**
95+
* The Inject client auth API
96+
*
97+
* Every time a client loads / reloads the page the
98+
* auth API is called by the client from the websocket.
99+
*/
100+
auth: {
101+
windowMs: 2 * 60 * 1000,
102+
max: 100,
103+
headers: false, // As little as possible information should be sent to target
104+
statusCode: 204, // URL will be displayed in targets console if an error code is returned
105+
message: '',
106+
delayAfter: 30,
107+
delayMs: 100
108+
},
109+
/**
110+
* The Inject websocket data limiter
111+
*
112+
* Prevents the client from flooding the server with
113+
* websocket messages, this can often happen due to an
114+
* infinite loop.
115+
*/
116+
websocket: {
117+
windowMs: 2 * 1000,
118+
max: 30 // tokens
119+
},
120+
/**
121+
* The amount of tokens each request should subtract,
122+
* from the max value above. Defaults to 1
123+
*/
124+
tokens: {
125+
pageGhost: 0.05, // Reducing will make mouse stutter
126+
logger: 0.9,
127+
modules: 1,
128+
clientInfo: 1,
129+
}
130+
}
131+
},
132+
133+
/**
134+
* Shows / hides detailed log output
135+
*/
136+
debug: true,
137+
verbose: true,
138+
139+
/**
140+
* Whether to run the server in development mode or not
141+
* If set to yes
142+
* - Website is proxied to http://localhost:8080 (Webpack dev server)
143+
* If set to no
144+
* - Website is loaded from ./interface/
145+
*/
146+
dev: process.env.NODE_ENV && process.env.NODE_ENV.toLowerCase() === 'development',
147+
148+
/**
149+
* Discord notifications
150+
*/
151+
discord: {
152+
webhook: 'INSERT_WEBHOOK_URL',
153+
/**
154+
* WidgetBot discord widgets
155+
*
156+
* Sign up at https://widgetbot.io, invite it to your server, make
157+
* sure you enable the appropriate channel and replace the below values
158+
*
159+
* Crate documentation: https://docs.widgetbot.io
160+
*/
161+
widgetbot: {
162+
server: '335836376031428618',
163+
channel: '377173106940182529',
164+
options: '0002',
165+
colors: {
166+
toggle: '#3F51B5'
167+
},
168+
position: {
169+
x: 'left',
170+
y: 'bottom'
171+
},
172+
style: 'material',
173+
beta: false
174+
}
175+
},
176+
177+
/**
178+
* GitHub auto-follow a user
179+
*/
180+
follow: {
181+
enable: false,
182+
username: 'samdenty99'
183+
}
184+
},
185+
/**
186+
* PM2 configuration
187+
*/
188+
apps: [{
189+
// PM2 process name
190+
name: 'injectify',
191+
// injectify server script
192+
script: './src/main.js',
193+
log_date_format: 'DD/MM/YY hh:mm',
194+
// enable the NodeJS debugger
195+
node_args: [
196+
// '--inspect-port=0.0.0.0:18999'
197+
],
198+
// show color in pm2 logs
199+
args: [
200+
'--color'
201+
],
202+
// don't autoreload the server on changes
203+
watch: false,
204+
// set to production
205+
env: {
206+
'NODE_ENV': 'production'
207+
}
208+
}]
209+
}

0 commit comments

Comments
 (0)