본문 바로가기

전체 글

(304)
Dreamhack : xss-1 Write-Up def read_url(url, cookie={"name": "name", "value": "value"}): cookie.update({"domain": "127.0.0.1"}) driver.add_cookie(cookie) driver.get(url) read_url 함수의 주요 부분이다. cookie.update({"domain": "127.0.0.1"}) 를 통해 쿠키가 유효한 범위(도메인)가 127.0.0.1 이란 것을 알 수 있다. 여기서 127.0.0.1 은 Target 서버의 local ip이다. @app.route("/flag", methods=["GET", "POST"]) def flag(): if request.method == "GET": return render_t..
md5( ) md5( ,true) 차이 md5('value') 와 같이 쓰이는 경우와 md5('value',true) 와 같이 쓰이는 경우가 있다. 두 경우의 차이점을 어렴풋이 알고 있지만, 기회가 되어 정리하고 넘어가고자 한다. php 의 md5() 함수는 아래와 같은 형식을 가진다. md5( string $str , [ bool $raw_output = FALSE ] ) str 은 해시 값을 생성할 문자열이며, 뒤의 옵션 부분을 true로 설정하면, 32 자리 문자열 ( md5 다이제스트 ) 이 반환되는 대신에 길이가 16인 원시(raw) 바이너리 형식으로 반환된다. 위 실행 코드 중 $php_magic_hash 에 대한 결과는 PHP 의 magic hash란 특수동작에 관한 예제이다. ( a == b와 같은 약한 비교 일 경우에 발생하는..
Webhacking.kr : old-50 Write-Up
Webhacking.kr : old-8 Write-Up
LORD OF SQLINJECTION : green_dragon Write-Up if(preg_match('/prob|_|\.|\'|\"/i', $_GET[id])) exit("No Hack ~_~"); if(preg_match('/prob|_|\.|\'|\"/i', $_GET[pw])) exit("No Hack ~_~"); $query = "select id,pw from prob_green_dragon where id='{$_GET[id]}' and pw='{$_GET[pw]}'"; echo "query : {$query} "; $result = @mysqli_fetch_array(mysqli_query($db,$query)); if($result['id']){ if(preg_match('/prob|_|\.|\'|\"/i', $result['id'])) exit(..
LORD OF SQLINJECTION : evil_wizard Write-Up if(preg_match('/prob|_|\.|proc|union|sleep|benchmark/i', $_GET[order])) exit("No Hack ~_~"); $query = "select id,email,score from prob_evil_wizard where 1 order by {$_GET[order]}"; // same with hell_fire? really? echo "idemailscore"; $rows = mysqli_query($db,$query); while(($result = mysqli_fetch_array($rows))){ if($result['id'] == "admin") $result['email'] = "**************"; echo "{$r..
LORD OF SQLINJECTION : hell_fire Write-Up if(preg_match('/prob|_|\.|proc|union/i', $_GET[order])) exit("No Hack ~_~"); $query = "select id,email,score from prob_hell_fire where 1 order by {$_GET[order]}"; echo "idemailscore"; $rows = mysqli_query($db,$query); while(($result = mysqli_fetch_array($rows))){ if($result['id'] == "admin") $result['email'] = "**************"; echo "{$result[id]}{$result[email]}{$result[score]}"; } ech..
LORD OF SQLINJECTION : dark_eyes Write-Up if(preg_match('/prob|_|\.|\(\)/i', $_GET[pw])) exit("No Hack ~_~"); if(preg_match('/col|if|case|when|sleep|benchmark/i', $_GET[pw])) exit("HeHe"); $query = "select id from prob_dark_eyes where id='admin' and pw='{$_GET[pw]}'"; $result = @mysqli_fetch_array(mysqli_query($db,$query)); if(mysqli_error($db)) exit(); echo "query : {$query} "; $_GET[pw] = addslashes($_GET[pw]); $query = "sele..