티스토리 뷰

web wargame/OverTheWire:Natas

overthewire natas6

삼전동해커 2020. 7. 25. 16:46

6번을 풀어보장.


비밀번호를 넣으면 된다. 뭔지 모르니 소스를 보자.



그냥 post로 알맞은 비밀번호 전송하라고 한다..

근데 이상하게 include "includes/secret.inc";가 있다.


여기서 include함수의 취약점을 이용할 수 있다.


include함수의 취약점

include함수는 php에서 외부의 파일을 사용하고 싶을 때 불러오는 기능이다.

이 함수의 문제점은 다른 서버에서도 불러올 수 있다는 점이다.


예를 들어 B서버에 body.php라는 파일에 header.php 파일을 include했다.

A서버에 있는 script.php라는 파일이 header.php를 include해도 잘 작동된다.


그럼 내가 includes/secret.inc에 들어가보자.


바로 나왔다.


끝.


'web wargame > OverTheWire:Natas' 카테고리의 다른 글

overthewire natas8  (0) 2020.09.16
overthewire natas7  (2) 2020.07.25
overthewire natas5  (0) 2020.07.24
overthewire natas4  (0) 2020.07.24
overthewire natas3  (0) 2020.07.23
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
링크
«   2024/05   »
1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31
글 보관함