
Level3.
level2의 문제를 통해 알게된 level3의 Password를 이용해 level3의 계정으로 접속합니다. 마찬가지로 hint 파일을 열어보면 다음과 같이 문제를 알려줍니다.

코드를 통해 autodig 프로그램의 흐름을 살펴보면 다음과 같습니다.
먼저, 스택을 구성한 후, 인자를 받습니다. argc의 값이 2가 아니면 에러 메세지를 출력한 후 종료되고, argc의 값이 2이면 [dig @ "입력받은 문자열" version.bind chaos txt] 형태의 명령을 만들어 실행합니다.
autodig 프로그램의 위치를 확인하기 위해 find 명령어를 이용합니다.

동시에 여러 명령어를 사용하기 위해서는 ; 을 사용해야 한다는 것과, 문자열 형태로 명령어를 전달하기 위해서는 "" 를 사용해야 한다는 점을 인지하고 명령어를 작성합니다.

연속된 명령어로 id를 입력하여 보니, level4의 정보가 확인되어 집니다. 이제 level4 권한의 shell을 실행시키기 위해 id 대신 sh명령어를 사용합니다. level4권한의 shell을 실행시킨 후, my-pass 명령어를 이용하여 level4의 Password를 확인합니다.

No comments:
Post a Comment