November 18, 2018

OverTheWire Bandit write-up(Level 21 → Level 22)

The current write-up that you are viewing is an ordinary write-up.
현재 보고계신 write-up은 일반 write-up 입니다.

To comply with the rule, in this write-up, I just deal with some hints related to this challenge. Here is no correct answer and no solution.

룰을 준수하기 위해, 이 문서에서는 이 챌린지와과 관련된 몇 가지 힌트만을 다룹니다. 여기에 정답과 솔루션은 없습니다.

For the full write-up PDF please refer to the Facebook page WARGAMER.
풀 write-up PDF는 페이스북 페이지 WARGAMER를 참고하세요.

WARGAMER(Link)




Bandit Level 21 → Level 22

Level Goal
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.

레벨 목표
어떤 프로그램은 주기적으로 cron에 의해 동작되고 있다. cron은 시간 기반의 작업 스케줄러다. "/etc/cron.d"에 가보라. 거기에 어떤 명령이 실행되고 있는지에 대한 정보가 있다.

Commands you may need to solve this level
이 레벨을 클리어하기 위해 필요할 것으로 예상되는 명령어.
cron, crontab, crontab(5) (use “man 5 crontab” to access this)

This challenge requires the ability of cron. If you experienced cron related settings, It will be easier.

이 챌린지는 cron 관련된 능력을 요구합니다. 만약 cron 설정과 관련된 경험이 있다면 보다 수월할 것입니다.

This is some part of the resolution procedures. I could find the flag as follow.
이것은 풀이 과정중 일부입니다. 아래와 같이 플래그를 찾을 수 있었습니다.

bandit21@bandit:~$ cd /etc/cron.d
bandit21@bandit:/etc/cron.d$ ls
cronjob_bandit22  cronjob_bandit23  cronjob_bandit24
bandit21@bandit:/etc/cron.d$ cat ./cronjob_bandit22
@reboot bandit22 ■■■■■■■■■andit■■■■■■.sh &> /dev/null
* * * * * bandit22 ■■■■■■■■■onjob_ban■■■■■■h &> /dev/null
bandit21@bandit:/etc/cron.d$ ls -al ■■■■■■■■■■ronjob_ba■■■■■■■■■■.sh
-rwxr-x--- 1 bandit22 bandit21 130 Oct 16 14:00 ■■■■■■■■■■ronjob_ba■■■■■■■■■■.sh
bandit21@bandit:/etc/cron.d$
bandit21@bandit:/etc/cron.d$ ■■■■■■job_b■■■■■■■■■sh
#!/bin/bash
chmod 644 /t■■■■■■S0RqQh■■■■■■■■■oZK■■■gv
cat ■■■■■■_pass/band■■■■■■ > /t■■■■■■■■■s9S0RqQ■■■■■■z6Sh■■■F7fg■■■
bandit21@bandit:/etc/cron.d$
bandit21@bandit:/etc/cron.d$ cat /t■■■■■■■■■s9S0RqQ■■■■■■z6Sh■■■F7fg■■■
Yk■■■■■MVRwrT■■■■WVO■■I