WriteUp

    LOS-rubiya : Zombie_assassin

    query : {$query}"; $result = @mysqli_fetch_array(mysqli_query($db,$query)); if($result['id']) solve("zombie_assassin"); highlight_file(__FILE__); ?>id값을 가져오기만 하면 문제는 풀린다. 문제 자체에 strrev 함수와 addslashes 함수가 관건일거같은데 한번 알아보자 strrev 함수의 경우 문자열을 거꾸로 뒤집는 함수라고 한다. nimda 를 주면 admin으로 읽는 것이지.  이점을 이용해서 '를 \'에서 '\로 바꿀수 있다. pw 쿼리에 들어가길 원하는 것은.pw=''or 1=1%23 'or 1=1%23 를 입력값으로 주게되는데, 이것은\'or 1=1%23이 되고,..

    LOS-rubiya : Succubus

    query : {$query}"; $result = @mysqli_fetch_array(mysqli_query($db,$query)); if($result['id']) solve("succubus"); highlight_file(__FILE__); ?>드디어 single quotation 을 우회하는 기법이다. \를 이용해서 '를 문자로 만들어버리면 된다.그러면  and pw= 가 id 의 입력값이 되어버리겠지?id=\&pw=or 1=1%23

    LOS-rubiya : Assassin

    query : {$query}"; $result = @mysqli_fetch_array(mysqli_query($db,$query)); if($result['id']) echo "Hello {$result[id]}"; if($result['id'] == 'admin') solve("assassin"); highlight_file(__FILE__); ?>' 필터링 한다.그냥 찾아야하는거같은데, %붙으면 탐색하는 기능을 사용해보자.-> magic quote 라고했었던 거 같다. 일단 query 안에 들어가는 문자열을 찾아야 한다.파이썬으로 코드 짜서 보자.?pw=%________ 넣어서 비밀번호 길이가 8인것도 알았다.['0', '1', '2', '9', 'D', 'E', 'F', '_', '..

    LOS_rubiya : Giant

    LOS_rubiya : Giant

    query 가 이렇다.from 사이의 $_GET[shit] 에 공백을 넣어주면 해결된다. 공백문자를 시도해보자 %0a, %0b . . . %0b 가 된다. ?shit=%0b

    LOS_rubiya : Bugbear

    query : {$query}"; $result = @mysqli_fetch_array(mysqli_query($db,$query)); if($result['id']) echo "Hello {$result[id]}"; $_GET[pw] = addslashes($_GET[pw]); $query = "select pw from prob_bugbear where id='admin' and pw='{$_GET[pw]}'"; $result = @mysqli_fetch_array(mysqli_query($db,$query)); if(($result['pw']) && ($result['pw'] == $_GET['pw'])) solve("bugbear"); highlight_file(__..

    LOS -rubiya : Golem

    query : {$query}"; $result = @mysqli_fetch_array(mysqli_query($db,$query)); if($result['id']) echo "Hello {$result[id]}"; $_GET[pw] = addslashes($_GET[pw]); $query = "select pw from prob_golem where id='admin' and pw='{$_GET[pw]}'"; $result = @mysqli_fetch_array(mysqli_query($db,$query)); if(($result['pw']) && ($result['pw'] == $_GET['pw'])) solve("golem"); highlight_file(__FILE..

    Root-me : [Web_Server]Install files

    Root-me : [Web_Server]Install files

    Statement에 없고 제목쪽에 힌트가 주어져 있다. 사실 바로 힌트인지는 몰랐고, 문제 들어가서 알았다. 코드가 이거밖에 없었기 때문이다. 그래서 phpbb가 의미하는게 있는지 찾아보기로 했다. 전자 게시판 프로그램이란다… ㅇㅋ 한참을 찾아보다가 phpbb 설치 메뉴얼에서 답을 찾았다. install 디렉토리를 지우지 않으면, 엄청나게 취약할 수 있다는 점이다. 그래서 문제이름이 install files 인가 보다. 디렉토리를 찾았다. install.php를 보자. karambar

    Root-me : [Web_Server] HTTP - Verb tampering

    Root-me : [Web_Server] HTTP - Verb tampering

    일단 시작하자마자 alert 창이 하나 뜬다 HTTP verb tempering 이라는 취약점이 존재하는 것 같다. 이는 의도한 것보다 많은 접근을 허용하는 취약점으로, HTTP Method 중 특정 메소드에 적용되는 보안사항이, 다른 메소드에는 적용되지 않는 것이다. HTTP verb를 알아보자. GET,HEAD,POST,PUT,DELETE,CONNECT,OPTIONS,TRACE,PATCH…. 많다. 익숙한 것도 있지만 아닌것도 있음. 이제 문제를 보자. 이 request 에서는 GET 메소드로 요청하고 있다. 해당 보안 접속도 GET 메소드 하에서 유효한 것으로 볼 수 있다. 즉 GET을 POST로 바꿔보면 그대로네,,, PUT으로 바꿔보자. password 가 나타나는 것을 확인 할 수 있다. a2..

    Root-me : [Web_Server] HTTP - Improper redirect

    Root-me : [Web_Server] HTTP - Improper redirect

    index.php 를 열어야 하는데 지금 redirection 때문에 login.php로 가는것을 확인할 수 있다. 아무 일 없어보이지만, response를 잡아서 보면 코드를 보내주는 것을 확인할 수 있다. CWE-698: Execution After Redirect 해당 취약점은 302 Found 를 반환해줄 때 리다이렉트 이전의 페이지의 소스코드가 Response에서 노출된다는 취약점이다. ExecutionAfterRedirectIsBad

    Root-me : [Web_Server] HTTP - POST

    Root-me : [Web_Server] HTTP - POST

    버튼을 누르면 저렇게 숫자가 나간다. 이 숫자가 나가는 방식이 POST 방식으로 전달되는 것 같으니, Burp Suite 로 잡아서 POST 값을 변조해주면 되겠다. score를 9999999로 변조해주자. Flag : H7tp_h4s_N0_s3Cr37S_F0r_y0U