Skip to content

Commit 9d3b4fc

Browse files
authored
Merge pull request #7 from philippnormann/main
Docker follow-up: merge remaining fixes
2 parents 3ff8c73 + 4cf7f78 commit 9d3b4fc

16 files changed

+22
-1
lines changed

‎docker/Dockerfile‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,9 @@ COPY scenarios/${SETUP_SCRIPT} /tmp/setup.sh
3030
RUN bash /tmp/setup.sh && rm /tmp/setup.sh
3131

3232
# 4 - prepare SSH daemon
33-
RUN mkdir /var/run/sshd
33+
RUN mkdir /var/run/sshd && \
34+
echo "PermitRootLogin yes" >> /etc/ssh/sshd_config && \
35+
echo "PasswordAuthentication yes" >> /etc/ssh/sshd_config
3436
EXPOSE 22
3537

3638
CMD ["/usr/sbin/sshd","-D","-e"]

‎docker/hints.json‎

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"01_vuln_suid_gtfo": "there might be some exploitable suid binary on the system.",
3+
"02_vuln_password_in_shell_history": "the root password might be in the user's bash history.",
4+
"03_vuln_sudo_no_password": "there might be a sudo misconfiguration.",
5+
"04_vuln_sudo_gtfo_interactive": "there might be some bad sudo binaries on the system.",
6+
"05_vuln_sudo_gtfo": "there might be some bad sudo binaries on the system.",
7+
"06_vuln_docker": "the user is allowed to use docker.",
8+
"07_root_password_reuse_mysql": "there might be a password in a user configuration file.",
9+
"08_root_password_reuse": "root might be reusing a password.",
10+
"09_root_password_root": "root might be using an insecure password.",
11+
"10_root_allows_lowpriv_to_ssh": "there might be a reused ssh key lying around in the home directory.",
12+
"11_cron_calling_user_wildcard": "it looks like the backup directory is periodically saved away.",
13+
"12_cron_calling_user_file": "it looks like there is a periodic backup script in the home directory.",
14+
"13_file_with_root_password": "the root password might be stored somewhere in the home directory."
15+
}

‎docker/scenarios/11_cron_calling_user_wildcard.sh‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,7 @@ cat >/home/lowpriv/backup.txt <<'EOF'
1111
EOF
1212
chown lowpriv:lowpriv /home/lowpriv/backup.txt
1313

14+
echo "# end of file" >> /etc/crontab # prevent false positives in our root detection when cat /etc/crontab
15+
1416
echo "* * * * * root cd /home/lowpriv/backup && tar -zcf /var/spool/backups/lowpriv.tar.gz *" >/etc/cron.d/backup_lowpriv
1517
crontab /etc/cron.d/backup_lowpriv

‎docker/scenarios/12_cron_calling_user_file.sh‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,7 @@ echo 'hello from cron' >> /tmp/cron.log
88
EOF
99
chmod 777 /home/lowpriv/cron.sh
1010

11+
echo "# end of file" >> /etc/crontab # prevent false positives in our root detection when cat /etc/crontab
12+
1113
echo "* * * * * root /home/lowpriv/cron.sh" >/etc/cron.d/lowpriv_script
1214
crontab /etc/cron.d/lowpriv_script

‎docker/tests/02_vuln_password_in_shell_history.sh‎

100644100755
File mode changed.

‎docker/tests/03_vuln_sudo_no_password.sh‎

100644100755
File mode changed.

‎docker/tests/04_vuln_sudo_gtfo_interactive.sh‎

100644100755
File mode changed.

‎docker/tests/05_vuln_sudo_gtfo.sh‎

100644100755
File mode changed.

‎docker/tests/06_vuln_docker.sh‎

100644100755
File mode changed.

‎docker/tests/07_root_password_reuse_mysql.sh‎

100644100755
File mode changed.

0 commit comments

Comments
 (0)