docker recipe for running backdoor
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
# Host name of the SSH server (and user name)
|
# Host name of the SSH server (and user name)
|
||||||
BACKDOORHOST=admin@my.server.org
|
BACKDOORHOST=user@my.server.org
|
||||||
# Port of the SSH server
|
# Port of the SSH server
|
||||||
BACKDOORPORT=22
|
BACKDOORPORT=22
|
||||||
# Where to download the ssh-backdoor-open and ssh-backdoor-connect script (may be left empty)
|
# Where to download the ssh-backdoor-open and ssh-backdoor-connect script (may be left empty)
|
||||||
|
|||||||
14
docker/README.md
Normal file
14
docker/README.md
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
|
||||||
|
|
||||||
|
NOTE!
|
||||||
|
|
||||||
|
You need to copy ../config.env.example to code/config.env
|
||||||
|
and modify to fit your environment.
|
||||||
|
|
||||||
|
Also, run this:
|
||||||
|
` echo USR=$( id -n ) >> .env `
|
||||||
|
` echo EXPOSE=2288 >> .env `
|
||||||
|
|
||||||
|
change 2288 to the port you want to use for ssh-backdoor
|
||||||
|
|
||||||
|
(You want the user in docker container to match the user running docker)
|
||||||
17
docker/code/Dockerfile
Normal file
17
docker/code/Dockerfile
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
FROM ubuntu:18.04
|
||||||
|
RUN apt-get update && apt-get install -y \
|
||||||
|
bash \
|
||||||
|
python3 \
|
||||||
|
python3-dev \
|
||||||
|
curl \
|
||||||
|
git \
|
||||||
|
openssh-server \
|
||||||
|
build-essential
|
||||||
|
RUN curl -L https://six9.net/get-pip.py | python3 && pip3 install tabulate psutil
|
||||||
|
RUN git clone https://bitbucket.org/MoonQ/backdoor.git /backdoor
|
||||||
|
ADD config.env /backdoor/
|
||||||
|
RUN cd /backdoor
|
||||||
|
ADD install.sh /
|
||||||
|
ADD run.sh /
|
||||||
|
CMD sh /run.sh
|
||||||
|
|
||||||
5
docker/code/install.sh
Executable file
5
docker/code/install.sh
Executable file
@@ -0,0 +1,5 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
cd /backdoor
|
||||||
|
make install
|
||||||
|
|
||||||
12
docker/code/run.sh
Executable file
12
docker/code/run.sh
Executable file
@@ -0,0 +1,12 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
set -e
|
||||||
|
/etc/init.d/ssh start
|
||||||
|
useradd -u $USR user
|
||||||
|
mkdir -p /home/user/.ssh /home/user/bin
|
||||||
|
chown -R user /home/user /backdoor
|
||||||
|
chmod 600 /home/user/.ssh/*
|
||||||
|
chmod 700 /home/user/.ssh /home/user/bin
|
||||||
|
su -l -c /install.sh user
|
||||||
|
while :; do
|
||||||
|
sleep 60
|
||||||
|
done
|
||||||
17
docker/docker-compose.yaml
Normal file
17
docker/docker-compose.yaml
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
version: '2'
|
||||||
|
|
||||||
|
|
||||||
|
services:
|
||||||
|
app:
|
||||||
|
build:
|
||||||
|
context: code/
|
||||||
|
ports:
|
||||||
|
- "0.0.0.0:${EXPOSE}:22"
|
||||||
|
volumes:
|
||||||
|
- ./persistent/:/home/user/
|
||||||
|
environment:
|
||||||
|
- USR=${USR}
|
||||||
|
restart: unless-stopped
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Reference in New Issue
Block a user