ssh bandit22@bandit.labs.overthewire.org -p 2220
#WdDozAdTM2z9DiFEQ2mGlwngMfj4EZff
A program is running automatically at regular intervals from cron, the time-based job scheduler. Look in /etc/cron.d/ for the configuration and see what command is being executed.
NOTE: Looking at shell scripts written by other people is a very useful skill. The script for this level is intentionally made easy to read. If you are having problems understanding what it does, try executing it to see the debug information it prints.프로그램은 시간 기반 작업 스케줄러인 cron에서 일정한 간격으로 자동으로 실행됩니다. /etc/cron.d/에서 구성을 확인하고 실행 중인 명령을 확인합니다.
md5sum이란?
cut이란?
/etc/cron.d/cronjob_bandit22를 확인한다
bandit22@bandit:/etc/cron.d$ cat cronjob_bandit23
@reboot bandit23 /usr/bin/cronjob_bandit23.sh &> /dev/null
* * * * * bandit23 /usr/bin/cronjob_bandit23.sh &> /dev/null
/usr/bin/cronjob_bandit23.sh를 읽어본다
bandit22@bandit:/etc/cron.d$ cat /usr/bin/cronjob_bandit23.sh
#!/bin/bash
myname=$(whoami)
mytarget=$(echo I am user $myname | md5sum | cut -d ' ' -f 1)
echo "Copying passwordfile /etc/bandit_pass/$myname to /tmp/$mytarget"
# 대충 i am user 현유저이름 => 이를 해시로, 공백을 기준으로 자르고 첫번째거 반환
# 이대로 해보면
bandit22@bandit:/tmp$ echo I am user bandit23 | md5sum | cut -d ' ' -f 1
8ca319486bfbbc3663ea0fbe81326349
마지막으로, /tmp/8ca319486bfbbc3663ea0fbe81326349를 읽으면 된다
bandit22@bandit:/tmp$ cat /tmp/8ca319486bfbbc3663ea0fbe81326349
QYw0Y2aiA672PsMmh9puTQuhoz8SyR2G