일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- C언어 패킷캡쳐
- Windows Kernel Debug
- Windows Kernel
- 해킹
- Windows
- apphelp.dll
- windows kernel debugging
- 네트워크 바이트 오더
- 윈도우 커널 드라이버
- pcap packet capture
- 개발하기
- vcruntime.dll
- 포너블
- 시스템해킹
- pwnable
- packet capture
- 윈도우 커널 디버깅
- Windows Kernel Driver
- 바이트 오더
- arudino
- Network Byte Order
- vcruntime140.dll
- 윈도우 커널
- hacking
- HackCTF
- ucrtbase.dll
- pcap packet
- Msvcrt.dll
- IAT Hooking
- 개발 환경 준비
- Today
- Total
미친해커
[Reversing] DLL Injection Step 2 본문
이번엔 DLL Injection에 사용할 DLL을 제작해볼거다. 이 카테고리는 DLL Injection에 대해서만 서술할 것이기 때문에 이번에 제작할 DLL은 간단하게 DLL Injection에 성공시 메시지 박스를 띄워주는 DLL을 만들어볼 것이다. 사용할 API 함수는 다음과 같다.
MessageBoxA function (winuser.h) - Win32 apps
Displays a modal dialog box that contains a system icon, a set of buttons, and a brief application-specific message, such as status or error information. The message box returns an integer value that indicates which button the user clicked.
docs.microsoft.com
또 DLL에서 사용하는 main 함수는 일반적인 main 함수와는 다른 DllMain 이라고 하는 함수를 사용한다. 잘 모른다면 다음 문서를 참고하면 된다.
DllMain 진입점 (처리 .h) - Win32 apps
DLL (동적 연결 라이브러리)에 대 한 선택적 진입점입니다. 시스템은 프로세스나 스레드를 시작 하거나 종료할 때 프로세스의 첫 번째 스레드를 사용 하 여 로드 된 각 DLL에 대 한 진입점 함수를
docs.microsoft.com
#include <windows.h>
BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD fdwReason, LPVOID lpReserved)
{
switch (fdwReason)
{
case DLL_PROCESS_ATTACH:
MessageBoxA(NULL, "DLL Injection!", "DLL Injection!", 0);
break;
}
}
이 DLL은 로드될 시 "DLL Injection!" 이라는 메시지 박스를 띄우게 된다.
'Reversing > DLL Injection' 카테고리의 다른 글
[Reversing] DLL Injection Step 3 (0) | 2022.01.18 |
---|---|
[Reversing] DLL Injection Step 1 (0) | 2022.01.18 |
[Reversing] DLL Injection Step 0 (0) | 2022.01.18 |