문제
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.
## 문제 요구사항
. /etc/cron.d/ 에서 설정을 확인하고 어떤 명령이 실행되는지 확인
## 내가 사용한 명령어
ssh bandit22@bandit.labs.overthewire.org -p 2220
cd /etc/cron.d
ls -l
cat cronjob_bandit23
cat /usr/bin/cronjob_bandit23.sh
echo I am user bandit23 | md5sum | cut -d ' ' -f 1
cat /tmp/8ca319486bfbbc3663ea0fbe81326349
## 왜 이 명령어를 골랐는가
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"
cat /etc/bandit_pass/$myname > /tmp/$mytarget
자신의 이름ㅇ르 password를 읽어서 /tmp/$mytarget에 저장하므로
echo I am user bandit23 | md5sum | cut -d ' ' -f 1
→ 문자열 전체의 md5 해시값을 출력한다.


'Security > OverTheWire' 카테고리의 다른 글
| Bandit Level 24 → Level 25 (brute force) (0) | 2025.12.02 |
|---|---|
| Bandit Level 23 → Level 24 (스크립트 작성) (0) | 2025.12.02 |
| Bandit Level 21 → Level 22 (cron) (0) | 2025.12.01 |
| Bandit Level 20 → Level 21 (nc) (0) | 2025.12.01 |
| Bandit Level 19 → Level 20 (setuid) (0) | 2025.12.01 |