Search results for 'Level5'

  1. 2009.08.27 -- python challenge level5
  2. 2009.08.17 -- hey JJAAPPPHH ~ 4

python challenge level5

2009. 8. 27. 00:20

http://www.pythonchallenge.com/pc/def/peak.html

pronounce it 이라고 적혀진 페이지가 있다.

소스를 보면 아래의 내용을 볼 수 있다.

<peakhell src="banner.p"/>
<!-- peak hell sounds familiar ? -->

banner.p
파일을 다운받아서 보았지만 별다른 힌트는 없어보였다
peakhell 이 도대체 뭘까.. 이리저리 고민하다가 forum의 hint 페이지를 찾아보았다.
(http://www.pythonchallenge.com/forums/)

힌트 없냐는 말에 누군가가 "Try browsing "Global Modules Index" 라는 코멘트를 달아놓았다.

Global Module 중에 peakhell과 비슷한 발음이 나는 녀석을 찾다보니 PICKLE 이라는 녀석이 있었다.

PICKLE 에 대한 설명은 http://docs.python.org/library/pickle.html 에서 볼 수 있다.
간략히 말하면 pickle module은 python object serialization 으로 파이썬 객체를  바이트 스트림으로 바꿀 수 있다. (unplckling 이라 하면 이 반대의 과정을 의미한다)

이점에 착안해서 banner.p를 읽어와서 이를 unpickling 해보았다.


import pickle

f = open("banner.p",'rb')
result = pickle.load(f)
list_length = len(result)
i=0
temp = ()
while i < list_length:
	tuple_length  = len(result[i])
	j = 0
	word = ''
	while j < tuple_length: 
		temp = result[i][j]
		j+=1
		k = 0
		while k < temp[1]:
			if temp[0] ==' ':
				word += ' ' 				
			else:
				word += temp[0]
			k+=1
	print word
	i+=1


코드를 수행하면 banner command를 실행한 것처럼 channel 이라고 크게 찍히는 문자열을 볼 수 있다.

http://www.pythonchallenge.com/pc/def/channel.html

'War game > pythonchallenge' 카테고리의 다른 글

pythonchallenge level11  (0) 2009.10.22
pythonchallenge level10  (0) 2009.10.20
pythonchallenge level9  (0) 2009.10.16
pythonchallenge level8  (0) 2009.10.16
pythonchallenge level7  (0) 2009.10.16
python challenge level6  (0) 2009.09.21
pythonchallenge level4  (0) 2009.08.20
pythonchallenge level3  (0) 2009.08.19
pythonchallenge level2  (0) 2009.08.17
pythonchallenge level1  (0) 2009.08.17

badcob War game/pythonchallenge

hey JJAAPPPHH ~

2009. 8. 17. 18:14

 
Oops, sorry for late. 

0x080483b4 <main+0>:    push   %ebp
0x080483b5 <main+1>:    mov    %esp,%ebp
0x080483b7 <main+3>:    sub    $0xa8,%esp                        extended 168
0x080483bd <main+9>:    and    $0xfffffff0,%esp
0x080483c0 <main+12>:   mov    $0x0,%eax                   
0x080483c5 <main+17>:   sub    %eax,%esp
0x080483c7 <main+19>:  cmpl   $0x1,0x8(%ebp)           agrc is at ebp+8
0x080483cb <main+23>:   jg     0x80483d9 <main+37>              if(agrc < 1)
0x080483cd <main+25>:   movl   $0x1,0xffffff74(%ebp)                return 1;
0x080483d7 <main+35>:   jmp    0x8048413 <main+95>
0x080483d9 <main+37>:   mov    0xc(%ebp),%eax            argv is at ebp+12
0x080483dc <main+40>:   add    $0x4,%eax                          address of argv + 4  means argv[1]
0x080483df <main+43>:   mov    (%eax),%eax                       eax = *argv[1]
0x080483e1 <main+45>:   mov    %eax,0x4(%esp)             
0x080483e5 <main+49>:   lea    0xffffff78(%ebp),%eax             eax = ebp-136 
0x080483eb <main+55>:   mov    %eax,(%esp)                
0x080483ee <main+58>:   call   0x80482d4 <
strcpy@plt>         so call strcpy(ebp-136, argv[1])
0x080483f3 <main+63>:   lea    0xffffff78(%ebp),%eax       
0x080483f9 <main+69>:   mov    %eax,0x4(%esp)
0x080483fd <main+73>:   movl   $0x8048524,(%esp)
0x08048404 <main+80>:   call   0x80482b4 <
printf@plt>          printf("%s", ebp-136)
0x08048409 <main+85>:   movl   $0x0,0xffffff74(%ebp)       
0x08048413 <main+95>:   mov    0xffffff74(%ebp),%eax         return 0;
0x08048419 <main+101>:  leave
0x0804841a <main+102>:  ret

Have you checked the stack in gdb? I can`t see [?3] in disassembled code.
Stack looks like this IMAO.

   ----------
   argv            ebp + 0C
   ----------
   argc            ebp + 8
   ----------
   return address  ebp + 4
   ----------
   ebp         
   ----------
   dummy          8bytes
   ----------
   buf            128byes

   ----------
 
Stack was extened 168 bytes, but it only uses 140bytes.
(dunno why extened 168bytes. i think that it`s up to the version of compiler, or something else. :$)

'Sabzil' 카테고리의 다른 글

Linux Oracle GUI client  (0) 2013.05.15
Ubuntu 12.10 에서 libboost1.48-all-dev 가 설치 되지 않을 때  (3) 2013.02.14
how to set debug environment for android  (0) 2012.09.14
oracle sql injection with rownum  (0) 2011.09.01
Shellcode site  (0) 2009.09.29
hey JaPH  (1) 2009.08.12
6회 kisa 해킹방어대회 6번  (0) 2009.07.09
ABI (Application Binary Interface)  (0) 2009.03.17
Nefif_rx  (0) 2009.03.17
usleep에 대해서  (0) 2009.01.08

badcob Sabzil