일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |
- ucrtbase.dll
- vcruntime140.dll
- 개발 환경 준비
- apphelp.dll
- 윈도우 커널 드라이버
- pcap packet
- hacking
- Windows Kernel
- Windows Kernel Debug
- C언어 패킷캡쳐
- 해킹
- 포너블
- packet capture
- pcap packet capture
- pwnable
- IAT Hooking
- 윈도우 커널 디버깅
- arudino
- Windows Kernel Driver
- Windows
- Msvcrt.dll
- 네트워크 바이트 오더
- 개발하기
- 윈도우 커널
- HackCTF
- vcruntime.dll
- windows kernel debugging
- 시스템해킹
- Network Byte Order
- 바이트 오더
- Today
- Total
미친해커
[Reversing] Code Injection Step 0 본문
코드 인젝션 (Code Injection) 정의
Code Injection이란 실행 가능한 코드를 대상 메모리 영역으로 삽입하여 실행하는 것을 말한다.
코드 인젝션 활용 영역
- 프로그램의 기능 개선 및 버그 패치
- API 후킹
- 일반 응용 프로그램에 특별한 목적의 코드를 추가
- 악성코드에서의 활용
코드 인젝션 주요 동작 흐름
Windows API / Kernel Function
- 프로세스 권한 획득 : OpenProcess() / NtOpenProcess()
- 메모리 공간 할당 : VirtualAllocEx() / NtAllocateVirtualMemory()
- 코드 삽입 : WriteProcessMemory() / NtWriteVirtualMemory()
- 코드 실행 : CreateRemoteThread() / NtCreateThreadEx()
코드 인젝션 관련 주요 API
OpenProcess function (processthreadsapi.h) - Win32 apps
Opens an existing local process object.
docs.microsoft.com
VirtualAllocEx function (memoryapi.h) - Win32 apps
Reserves, commits, or changes the state of a region of memory within the virtual address space of a specified process. The function initializes the memory it allocates to zero.
docs.microsoft.com
VirtualProtectEx function (memoryapi.h) - Win32 apps
Changes the protection on a region of committed pages in the virtual address space of a specified process.
docs.microsoft.com
WriteProcessMemory function (memoryapi.h) - Win32 apps
Writes data to an area of memory in a specified process. The entire area to be written to must be accessible or the operation fails.
docs.microsoft.com
CreateRemoteThread function (processthreadsapi.h) - Win32 apps
Creates a thread that runs in the virtual address space of another process.
docs.microsoft.com
공격 원리
'Reversing > Code Injection' 카테고리의 다른 글
[Reversing] Code Injection Step 2 (0) | 2022.04.07 |
---|---|
[Reversing] Code Injection Step 1 (0) | 2022.04.05 |