딩굴댕굴

[webhacking.kr] Challenge 33 - Ten Question 2

by jennysgap

BOX


[webhacking.kr] Challenge 33 - Ten Question 2


몇 문제까지 있는걸까?... ㅡㅡ;;



$_SERVER[REMOTE_ADDR] = 220.117.20.81

md5("$_SERVER[REMOTE_ADDR]") = c9bb43d7b19cf23affd52197a1a7f00f


$_SERVER[HTTP_USER_AGENT] = Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.113 Whale/1.0.37.16 Safari/537.36

md5("$_SERVER[HTTP_USER_AGENT]") = e0d8b7c3f85fbd60cbc43e2df1269aab


POST http://webhacking.kr/challenge/bonus/bonus-6/gpcc.php HTTP/1.1

Host: webhacking.kr

Connection: keep-alive

Cache-Control: max-age=0

Upgrade-Insecure-Requests: 1

User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.113 Whale/1.0.37.16 Safari/537.36

Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8

Referer: http://webhacking.kr/challenge/bonus/bonus-6/md555.php

Accept-Encoding: gzip, deflate

Accept-Language: ko-KR,ko;q=0.8,en-US;q=0.6,en;q=0.4

Cookie: PHPSESSID=905bda4ea3cffd731977e17ba7037582; test=c9bb43d7b19cf23affd52197a1a7f00f

Content-Length: 35

Content-Type: application/x-www-form-urlencoded


kk=e0d8b7c3f85fbd60cbc43e2df1269aab




WH.kr #20 level33-7




$_SERVER[REMOTE_ADDR] = 220.117.20.81

str_replace(".", "", $_SERVER[REMOTE_ADDR]) = 2201172081




WH.kr #20 level33-8





WH.kr #20 level33-9






WH.kr #20 level33-10




// IP 변수에 내 IP ( 220.117.20.81 ) 저장

$ip=$_SERVER[REMOTE_ADDR];

// IP 주소 길이만큼 반복
for(
$i=0;$i<=strlen($ip);$i++)
{

// ord(): 문자열의 첫번째 문자에 해당하는 아스키코드를 리턴

// 220.117.20.81

$ip=str_replace($i,ord($i),$ip);
}

//i=0 2248.117.248.81

//i=1 2248.49497.248.849

//i=2 505048.49497.5048.849

//i=3 505048.49497.5048.849

//i=4 5050528.5295297.50528.8529

//i=5 5305305328.532953297.5305328.85329

//i=6 5305305328.532953297.5305328.85329

//i=7 5305305328.5329532955.5305328.85329

//i=8 53053053256.5329532955.53053256.565329

//i=9 53053053256.532575325755.53053256.5653257

//i=10 53053053256.532575325755.53053256.5653257

...

//i=25 53053053506.535075350755.53053506.5653507

...

//i=30 55155153506.535075350755.55153506.5653507

...

//i=35 55155155106.551075510755.55155106.5655107

//i=41 55155155106.551075510755.55155106.5655107



// . 삭제

// ip=55155155106551075510755551551065655107
$ip=str_replace(".","",$ip);


// ip 변수에 ip[0]-ip[10]까지만 저장

// ip = 5515515510
$ip=substr($ip,0,10);


// IP 변수값을 디렉터리 이름으로 생성

// answerip/5515515510

@mkdir("answerip/$ip");

$answer=$ip*2;
$answer=$ip/2;
$answer=str_replace(".","",$answer);
// answer=2757757755


$pw="###";

$f=fopen("answerip/$ip/$answer.$ip","w");
fwrite($f,"Password is $pw\n\nclear ip : $_SERVER[REMOTE_ADDR]");

fclose($f);


http://webhacking.kr/pds/phppad/index.php


answerip/5515515510/2757757755.5515515510







반응형

블로그의 정보

jennysgap

jennysgap

활동하기