[webhacking.kr]old-36 write up

zzsla·2023년 5월 30일
0

문제정보

없다

문제

문제에 들어가면 "While editing index.php file using vi editor in the current directory, a power outage caused the source code to disappear.
Please help me recover." 라고 적혀있다. 해석을 하자면 vi editor로 index.php 편집 중이였는데 정전이 나서 파일이 사라졌으니 소스코드 복구해 달라는 내용이다.

분석

vi editor로 작업 중에 예기치 않게 종료해버렸을 때 복구를 시켜주기 위해 vi editor에서 swp파일을 숨김파일로 생성시켜준다. 파일명은 .원본파일.swp이다.
그래서 url 뒤에 .index.php.swp를 적으면 index.php.swp 파일이 다운로드가 된다.

이제 shell로 들어가서 index.php.swp파일이 있는 디렉토리까지 온 뒤에 파일을 복구하기 위해 vi -r index.php.swp라고 명령어를 치면 flag를 얻을 수 있다.

FLAG{what_about_the_nano_editor?}

profile
[README]newbi security hacker :p

0개의 댓글