목록WebHacking/WarGame (61)
Iriton's log
보호되어 있는 글입니다.
문제 페이지 분석 admin이 작성한 FLAG 파일을 읽어내야 한다. Write 할 때 Secret check를 하면 FLAG 글처럼 접근할 수 없나 보다. 크롬 개발자모드-Network에서 한 게시물의 데이터가 어떻게 주고받는지 살펴보자. /api/board/{no}에서 GET Method를 통해 응답을 받는 구조인 거 같다. FLAG의 no는 알려지지 않았으니 우선 /api/board로 가봐야겠다. "_id": null 이라고 한다. 이때부터는 MongoDB의 ObjectID 개념을 알아야 한다. 참고 사이트 https://www.mongodb.com/docs/manual/reference/method/ObjectId/#methods ObjectId() — MongoDB Manual Docs Home..
문제 페이지에 접속하면 소스 코드를 볼 수 있게끔 하이퍼 링크가 있다. 맨 밑을 보면 blocked accounts로 guest/ blueh4g 계정이 있다. 중간에 조건문을 보면 해당 계정 아이디만 막아 뒀다. guest로 login 시도를 하니 blocked이라고 뜬다. 쿼리문을 변조해야 하나 싶었지만 조건문을 좀 허술하게 해둔 거 같아서 Guest로 입력하여 로그인을 시도해 봤다. 엥... 해결... mysql은 대소문자를 구분하지 않아서 guest로 인식하는 것이었다.
참고 문제풀이 [Dreamhack/Wargame] Lv.1 crsf-1 문제 페이지 분석 vuln(csrf) page (/vuln?param=) 파라미터 값을 출력한다. memo(/memo?memo=hello) 접속할 때마다 hello를 누적해서 출력한다. notice flag (/admin/notice_flag) admin 권한이 없어서 flag값을 보지 못한다. eunginius.tistory.com *crsf-1 문제와 비교하여 다른 점만 분석하고 풀 것이기에 위 풀이를 참고할 것. 코드 분석 1번 문제랑 다른 점은 memo 대신 login 페이지가 생겼다는 것이다. admin으로 로그인하면 flag를 띄워주나 보다. 문제 페이지에 나와 있지 않은 경로가 보인다. /change_password (이..
문제 페이지 분석 vuln(csrf) page (/vuln?param=) 파라미터 값을 출력한다. memo(/memo?memo=hello) 접속할 때마다 hello를 누적해서 출력한다. notice flag (/admin/notice_flag) admin 권한이 없어서 flag값을 보지 못한다. flag(/flag) 여기서 취약점 공격을 해야 되나 보다. 코드를 살펴 보자. 코드 분석 admin_notice_flag 함수 분석 89, 91) 조건문으로 localhost 환경이 아니라면 Access Denied를 userid가 admin이 아니라면 Access Denied2를 띄운다. 93) memo_text에 flag를 추가한다. memo_text라는 이름의 전역 변수를 사용하는 /memo로 가보자. m..
File Upload Vulnerability 파일 업로드 하는 기능에서 발생할 수 있는 취약점으로, 서버의 파일 시스템에 사용자가 원하는 경로 또는 파일 명 등으로 업로드가 가능하여 악영향을 미칠 수 있는 파일이 업로드 되는 것이다. CGI(Common Gateway Interface) 사용자의 요청을 받은 서버가 동적인 페이지를 구성하기 위해 엔진에 요청을 보내고 엔진이 처리한 결과를 서버에게 반환하는 기능을 말한다. 문제 페이지 분석 별다른 특이점은 없었다. upload php 코드를 확인하여 해당 페이지에 파일 업로드 취약점을 공격할 수 있는 법을 찾아야겠다. 코드 분석 파일 확장자나 경로에 대한 필터링이 존재하지 않는다. 취약점을 발견했으니 flag가 존재하는 경로에 접근하여 flag.txt를 ..
Command Injection Web application에서 시스템 명령을 사용할 때, ;(세미콜론) 혹은 &(또는 &&)을 사용하여 하나의 command를 injection 하여 두 개의 command가 실행되게 하는 공격이다. 문제 페이지 분석 Home ping ping 정보가 출력된다. 여기서 Flag를 출력할 수 있을 거 같다. 코드를 확인해 보자. 코드 분석 6) flag.py에 flag값이 있나 보다. 22) bash쉘 파일로 접근해서 command를 실행시킨다. 리눅스 명령어로 command injection이 필요할 것으로 보인다. 다른 코드는 별로... 쓸모는 없을 거 같아서 pass ping result 출력을 활용해서 flag.py의 위치를 알아내 볼 수 있을 거 같다. ls 명령..
* xss-1 풀이 참고 https://eunginius.tistory.com/30 [Dreamhack/Wargame] Lv.1 xss-1 문제 풀이에 앞서, XSS(Cross Site Script)취약점은 Web Application에서 사용자 입력 값에 대한 필터링이 제대로 이뤄지지 않을 경우 input 가능한 form에 script를 삽입하여 공격할 수 있는 것을 말한다. 문제 eunginius.tistory.com 문제 페이지 분석 페이지들도, 코드도 xss-1랑 너무 똑같았다. 한 가지 다른 점은 vuln page에 alert이 작동하지 않는다는 것이다. 이런 경우에는 사이트에 활성화된 방화벽을 우회해야 하는데 우회하는 방법은 case에 따라 너무 많다. 각종 태그를 활용할 수 있다. 이 풀이에..