상세 컨텐츠

본문 제목

01.The basics technique of Shellcode

Pwnable Exploitation/01.Shellcode

by RACC8N 2020. 5. 4. 10:32

본문

Shellcode

- shellcode라고 불리는 이유는 일반적으로 명령 shell을 실행하여 공격자가 해당 시스템을 제어하기 때문이라고 한다.

- shellcode는 Machine code로 작성된 작은 크기의 프로그램

- shellcode는 실행중인 프로그램에 삽입된 코드

- shellcode는 실제로 실행 가능한 프로그램은 아니므로 작성할 때 메모리상 배치, 메모리 세그먼트 등에 신경 쓰지 않아도 됨.

- shellcode는 Assembly, Machine code 같은 저수준 언어로 개발

 

Assembly code에서 시스템 함수 호출

Instruction Meaning Architecture
INT <Operand 1> Call to interrupt x86, x86_64
SYSCALL System call x86_64

※ X86 Assembly/Interfacing with Linux

시스템 함수 호출 번호 (System Call)

  • 32bit : /usr/include/x86_64-linux-gnu/asm/unistd_32.h
  • 64bit : /usr/include/x86_64-linux-gnu/asm/unistd_64.h

Argument

- Register (32bit) Register (64bit)
System call EAX RAX
Argument 1 EBX RDI
Argument 2 ECX RSI
Argument 3 EDX RDX
Argument 4 ESI R10
Argument 5 EDI R9
Argument 6 EBP R9

[EXAMPLE]  How To make Shellcode

1. Assembly code ("Hello, world!")

2. Build assembly code(32 bit)

- nasm Asm.s

- ndisasm Asm 

3. Make shellcode type 

4. Run 

 

 

REF: https://www.lazenca.net/display/TEC/01.The+basics+technic+of+Shellcode

 

01.The basics technic of Shellcode - TechNote - Lazenca.0x0

Excuse the ads! We need some help to keep our site up. List Shellcode Shellcode라고 불리는 이유는 일반적으로 명령 shell을 실행하여 공격자가 해당 시스템을 제어하기 때문이라고 합니다.Shellcode는 Machine code로 ��

www.lazenca.net

 

'Pwnable Exploitation > 01.Shellcode' 카테고리의 다른 글

04.Pwntools Shellcode(Shellcraft)  (0) 2020.05.04
03.Bind & Reverse Shellcode  (0) 2020.05.04
02.Basic & Change permissions Shellcode  (0) 2020.05.04

관련글 더보기

댓글 영역