Hack This Site - Basic missions 레벨 1~10 풀이

Level 1.

Basic test of your skills to see if you can do any of these missions. Requirements: HTML
Basic 1
Level 1(the idiot test)

This level is what we call "The Idiot Test", if you can't complete it, don't give up on learning all you can, but, don't go begging to someone else for the answer, thats one way to get you hated/made fun of. Enter the password and you can continue.
첫 번째 문제답게 HTML만 안다면 쉽게 풀수 있습니다. HTML 코드를 사용할 수 있는지 알아보는 테스트 같네요. 주석을 유심히보세요.

Click to show spoiler...




Level 2.

A slightly more difficult challenge, involving an incomplete password script. Requirements: Common sense.
Basic 2
Level 2
Network Security Sam set up a password protection script. He made it load the real password from an unencrypted text file and compare it to the password the user enters. However, he neglected to upload the password file...
패스워드를 무시하는 방법을 생각해 보세요. common sense 라는데 전 생각보다 힘들게 풀었어요.

Click to show spoiler...




Level 3.

Some intuition is needed to find the location of the hidden password file. Requirements: Basic HTML knowledge
Basic 3
Level 3
This time Network Security Sam remembered to upload the password file, but there were deeper problems than that.
이것도 HTML 코드를 사용할 수 있는지 확인하는 테스트입니다. 힌트는 form 에 있습니다.

Click to show spoiler...




Level 4.

An email script has been set up, which sends the password to the administrator. Requirements: HTML knowledge, an email address
Basic 4
Level 4
This time Sam hardcoded the password into the script. However, the password is long and complex, and Sam is often forgetful. So he wrote a script that would email his password to him automatically in case he forgot. Here is the script:

['Send password to Sam' Submit Button]


이메일 주소가 필요하다는데 문제가  수정되서 그런지 이메일 주소는 필요없습니다. 이것 또한 html 을 필요하는 문제입니다.

데이터 전송 형식에는 GET, POST 등이 있고 제시한 2가지가 가장 많이 쓰입니다. 'Send password to Sam' 버튼을 눌렀을때 어떤 형식으로 가는지 잘 파악 해보세요.

Click to show spoiler...



Level 5.

Similar to the previous challenge, but with some extra security measures in place. Requirements: HTML knowledge, JS or FF, an email address.
Basic 5
Level 5
Sam has gotten wise to all the people who wrote their own forms to get the password. Rather then actually learn the password, he decided to make his email program a little more secure.

['Send password to Sam' Submit Button]
Level4와 동일한 문제지만 한가지 추가된 보안 기능이 있습니다. 똑같은 데이터 전송형식을 받지만 'Referer' 체크를 합니다. 'Referer'를 속일수 있는 방법을 생각해보세요.

Click to show spoiler...




Level 6.

An encryption system has been set up, which uses an unknown algorithm to change the text given. Requirements: Persistence, some general cryptography knowledge.
Basic 6
Level 6
Network Security Sam has encrypted his password. The encryption system is publically available and can be accessed with this form:

Please enter a string to have it encrypted.

[Input Box]
['encrypt' Submit Button]

You have recovered his encrypted password. It is:

0:;<7=:@

Decrypt the password and enter it below to advance to the next level.
일단 암호화 되는 패턴을 파악하는게 중요합니다. 간단한 값을 입력하여 패턴을 파악해봐요~

Click to show spoiler...




Level 7.


The password is hidden in an unknown file, and Sam has set up a script to display a calendar. Requirements: Basic UNIX command knowledge.
Basic 7
Level 7
This time Network Security sam has saved the unencrypted level7 password in an obscurely named file saved in this very directory.

In other unrelated news, Sam has set up a script that returns the output from the UNIX cal command. Here is the script:

Enter the year you wish to view and hit 'view'.

[Input Box]
['view' Submit Button]
입력란에 숫자(년도)를 입력하면 해당 년도의 달력이 출력되고 아무값도 입력하지 않으면 이번달 달력만 출력됩니다. 그리고 숫자 이외의 값을 입력하면 아무것도 출력되지 않구요.

Perl에서 유닉스 명령어를 사용 할 수 있는 방법을 생각해보세요.

Click to show spoiler...



Level 8.

The password is yet again hidden in an unknown file. Sam's daughter has begun learning PHP, and has a small script to demonstrate her knowledge. Requirements: Knowledge of SSI (dynamic html executed by the server, rather than the browser)
Basic 8
Level 8
Sam remains confident that an obscured password file is still the best idea, but he screwed up with the calendar program. Sam has saved the unencrypted password file in /var/www/hackthissite.org/html/missions/basic/8/

However, Sam's young daughter Stephanie has just learned to program in PHP. She's talented for her age, but she knows nothing about security. She recently learned about saving files, and she wrote an script to demonstrate her ability.

Enter your name:

[Input Box]
['submit' Submit Button]
힌트에 나와 있듯이 약간의 SSI(Server Side Include)에 대한 지식이 필요합니다. HTML주석을 사용하여 include, exec, echo 등을 사용할 수 있구요. 자세한 내용은 위 링크로 따라가 확인하길 바랍니다.

Click to show spoiler...




Level 9.

The password is again hidden in an unknown file. However, the script that was previously used to find it has some limitations. Requirements: Knowledge of SSI, unix directory structure.
Basic 9
Level 9
Network Security Sam is going down with the ship - he's determined to keep obscuring the password file, no matter how many times people manage to recover it. This time the file is saved in /var/www/hackthissite.org/html/missions/basic/9/.

In the last level, however, in my attempt to limit people to using server side includes to display the directory listing to level 8 only, I have mistakenly screwed up somewhere.. there is a way to get the obscured level 9 password. See if you can figure out how...

This level seems a lot trickier then it actually is, and it helps to have an understanding of how the script validates the user's input. The script finds the first occurance of '<--', and looks to see what follows directly after it. If it matches "#exec cmd="ls"-->" or "#exec cmd="ls /home/xec96/public_html/missions/basic/8/"-->" it accepts it. If it does not match any of the situations above, then it kicks the user out.
Level 8과 동일한 유형의 문제입니다. 똑같은 방법을 사용하여 /var/www/hackthissite.org/html/missions/basic/9/ 디렉토리에 접근 하면 됩니다.

Click to show spoiler...




Level 10.

This time, the password is encoded straight into the script. Whether the user is allowed in or not is determined by cookies; small pieces of information stored by the browser about the webpage that is being visited. Requirements: Javascript knowledge.
Basic 10
Level 10
Please enter a password to gain access to level 10
이제 드디어 Basic 마지막 레벨이군요. 이번 문제는 Cookie 관련 문제입니다. 푸는 방법은 여러가지지만 Javascript 를 이용하는 방법이 가장 간단하겠네요.

Click to show spoiler...



이로써 HackThisSite ( http://www.hackthissite.org ) - Basic Missions 풀이를 모두 풀어보았습니다.. 수정 및 질문은 coryas(at)gmail.com 메일로 받습니다. (모두 읽는다고 수고했어요~)

Posted by Coryas

2008/01/19 00:23 2008/01/19 00:23
, ,
Response
No Trackback , 12 Comments
RSS :
http://coryas.com/tc/rss/response/4

 

오늘(2007년 5월 17일) 오후 6시까지 한다...

아래 링크를 이용하면 된다...

2007 H.U.S.T HackFestival
http://hackfestival.org/



더 풀고 싶었지만...

사정상 레벨 1~3 까지만 풀었다..

나의 풀이다..

level1
http://220.95.158.11/~dhclub20/index.php

hint

1. 보물은 HUST에 있다.
2. 플라 파일
3. 디컴파일러
4. 다른 보물은 작다.
5. 보물들은 정수다.
6. 두 보물을 조합하여 관리자에게 가라.
7. 패스워드는 관리자에게 있다.
8. 관리자는 관리자실에서 기다리고 있다.


 

http://220.95.158.11/~dhclub20/board/list.php

까지 접속하면 게시판이 뜬다.

게시판 위에 보면

hust에 있는 플래쉬파일


내가 저장해둔 플래쉬파일

이런 플래쉬가 떠있다.

플래쉬 위치는

http://220.95.158.11/~dhclub20/long1.swf

이다...

자! 이플래쉬를 Sothink SWF Decompiler 으로

열어보자!

첫번째 보물인

---------------------------------------
Private_key = 77
modulus = 119
---------------------------------------

을 찾았다.

두번째 보물을 찾아보자!

---------------------------------------
4. 다른 보물은 작다.
---------------------------------------

작단다... 0아니면 1정도?

생각했다...

이 문제는 RSA 알고리즘 문제 이므로

---------------------------------------
1 ^ 77 Mod 119 = 32
---------------------------------------

으로 찍었다..

자 이제 관리자에가 가보자...

---------------------------------------
6. 두 보물을 조합하여 관리자에게 가라.
7. 패스워드는 관리자에게 있다.
8. 관리자는 관리자실에서 기다리고 있다.
---------------------------------------

http://220.95.158.11/~dhclub20/admin.php

찍었다..

들어가진다...

32를 썼더니

---------------------------------------
축하합니다. 다음 레벨로 가세요~

The FORMula of SucCess
---------------------------------------

가 떴다..



level2
http://220.95.158.11/~Redy/hust2007/thechange/hack/festival/level2/level2/level2start.html

인트로 페이지에 소스보면

login.js

가 있다.. 열어보자

level2
hust

으로 접속했다..

들어가자마자 NICK 을 묻는다...

일단 html 파일을 다운 받았다...

hiew 로 열어서

0xBC 부분을 0x31로 고쳐줬다..

html 태그를 시작하는

"<" 부분이 "1"로 바뀌면서

소스를 다 볼수 있었다..

------------------------------------------------------------------------------
1!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> 1HTML> 1HEAD> 1TITLE> HUST 6th Hacking Festival!!! The Change.. 1/TITLE> 1META NAME="Generator" CONTENT="EditPlus"> 1META NAME="Author" CONTENT=""> 1META NAME="Keywords" CONTENT=""> 1META NAME="Description" CONTENT=""> 1/HEAD> 1BODY> 1script language = JScript.Encode> 1!-- document.write(unescape("%3Cbody%20bgcolor%3D%22%23ffffff%22%20oncontextmenu%3D%22return%20false%22%20ondragstart%3D%22return%20false%22%20onselectstart%3D%22return%20false%22%3E%0D%0A%3Cscript%20language%3D%22JavaScript%22%3E%0D%0A%3C%21--%0D%0Apswd%28%29%0D%0Afunction%20pswd%28%29%20%7B%0D%0A%09var%20password%20%3D%20prompt%28%22%uC81C%20nick%uC744%20%uC54C%uACE0%20%uACC4%uC2E0%uAC00%uC694%3F%22%2C%22%22%29%0D%0A%09if%20%28password%20%3D%3D%20%22%52%65%64%79%22%29%20%7B%0D%0A%09myWin%20%3D%20window.close%28%22%2E%2E%2FRedylevel2%2Fauth.php%22%29%3B%20%20%20%20%20myWin.close%28%29%3B%0D%0A%09%7D%0D%0A%09else%20%7B%0D%0A%09window.alert%28%27%uC74C..%uAE00%uC384%uC694..%uC12D%uC12D%uD574%uC694%2E%2E%27%29%3Bself.opener%3Dself%3B%20self.close%28%29%3B%7D%09%7D//--%3E%0D%0A%3C/script%3E")); //--> 1/script> 1/BODY> 1/HTML>
------------------------------------------------------------------------------

1script language = JScript.Encode

JScriptEncode인줄 알았다..



암호화 부분만 복호화 시켰다..

http://220.95.158.11/~Redy/hust2007/thechange/hack/festival/level2/Redylevel2/auth.php

으로 가란다...

로그인하라네...

아까전에

level2
hust

이걸로 로그인했다...

http://220.95.158.11/~Redy/hust2007/thechange/hack/festival/level2/auth21ev213/closeset.html

검정색이다...

컨트롤 + A

누르니깐 굿잡이란다..

소스봤다...

------------------------------------------------------------------------------
<!--Q29uZ3JhdHVsYXRpb25zISBVIHBhc3NlZCBMZXZlbDIuLi4gTkVYVCBMZXZlbCBBdXRoZW50aWNhdGlvbiBQYXNzd29yZCBpcyAiRmluZGVycyBrZWVwZXIsIGxvc2VyIHdlZXBlcnMi-->
------------------------------------------------------------------------------

암호화 부분이 있다...

무슨 알고리즘인지 한참 고민했다..

작년 hust 문제들은 검색했더니..

base64를 사용한 문제가 있었는데..

저거랑 비슷했다...




복호화 해봤다...


------------------------------------------------------------------------------
Congratulations! U passed Level2... NEXT Level Authentication Password is "Finders keeper, loser weepers"
------------------------------------------------------------------------------



level3
http://220.95.158.11/~level3/main.php

힌트를 보면

---------------------------------------
total, flag
---------------------------------------

이거다...

get으로 계속 보냈는데..

안되길래...

패킷 캡쳐 하는 프로그램으로..

해봤다..

패킷 캡쳐해서

------------------------------------------------------------------------------
http://220.95.158.11/~level3/confirm.php

number=3&name=HUST+T-Shirt%2Fcheapest+price%21%2FLast+chance&total=0&flag=0&x=35&y=10
------------------------------------------------------------------------------

으로 보냈더니

http://220.95.158.11/~level3/dicision.php

으로 갔다...

좋아!

그림을 클릭하던가...

------------------------------------------------------------------------------
http://220.95.158.11/~level3/lk.php

success=1
------------------------------------------------------------------------------

위 처럼 패킷을 보내면

------------------------------------------------------------------------------
축하합니다.다음 레벨로 가는 암호는 BoNe To bE a HaCKeR 입니다.
------------------------------------------------------------------------------


더 하고 싶었는데..

이런 저런 사정때문에... 여기서 그만뒀다...

아쉽다..

더 풀고 싶었는데...

다음 대회를 기다려야겠다...

Posted by Coryas

2008/01/17 15:04 2008/01/17 15:04
, ,
Response
3 Trackbacks , a comment
RSS :
http://coryas.com/tc/rss/response/1