docker recipe for running backdoor

This commit is contained in:
2019-11-02 11:51:13 +02:00
parent e069ad7612
commit 1a107fdd50
6 changed files with 66 additions and 1 deletions

View File

@@ -1,5 +1,5 @@
# Host name of the SSH server (and user name)
BACKDOORHOST=admin@my.server.org
BACKDOORHOST=user@my.server.org
# Port of the SSH server
BACKDOORPORT=22
# Where to download the ssh-backdoor-open and ssh-backdoor-connect script (may be left empty)

14
docker/README.md Normal file
View 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
View 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
View File

@@ -0,0 +1,5 @@
#!/bin/bash
cd /backdoor
make install

12
docker/code/run.sh Executable file
View 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

View 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