-
[Linux 공부] Bandit wargames 21~22 단계 crontab카테고리 없음 2025. 5. 19. 11:41728x90반응형
OverTheWire: Level Goal
We're hackers, and we are good-looking. We are the 1%. <!-- Please read and accept the Rules! --> 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
overthewire.org
해당 문제는 cron을 읽고 어디에 저장하는 확인하는 문제입니다.
1. SSH 접속
21 ~ 22 단계 접속 비밀번호 EeoULMCra2q0dSkYj561DX7s1CpBuOBt 입니다.
ssh bandit21@bandit.labs.overthewire.org -p 22202. Cron 확인하기
cd etc/cron.d ls 결과 clean_tmp cronjob_bandit24 sysstat cronjob_bandit22 e2scrub_all cronjob_bandit23 otw-tmp-dir cat cronjob_bandit22 결과 @reboot bandit22 /usr/bin/cronjob_bandit22.sh &> /dev/null * * * * * bandit22 /usr/bin/cronjob_bandit22.sh &> /dev/null cat /usr/bin/cronjob_bandit22.sh 결과 #!/bin/bash chmod 644 /tmp/t7O6lds9S0RqQh9aMcz6ShpAoZKF7fgv cat /etc/bandit_pass/bandit22 > /tmp/t7O6lds9S0RqQh9aMcz6ShpAoZKF7fgv cat /tmp/t7O6lds9S0RqQh9aMcz6ShpAoZKF7fgv 결과 tRae0UfB9v0UzbCdn9cY0gQnds9GF58Q3. 추가 확인 사항
Chmod 644
소유자는 쓰기 및 읽기 권한을 주고 그외는 읽기 권한만 부여하고 있습니다.cat /etc/bandit_pass/bandit22 cat: /etc/bandit_pass/bandit22: Permission denied이렇게 권한이 없는데 지금 crontab에서 이 파일에 있는걸 매분 tmp쪽에 덮어쓰고 있습니다.
728x90반응형