DLL Injection 3

DLL vs Reflected Injection

개요DLL Injection과 Reflected Injection의 개념이 서로 비슷한 부분도 존재하고 명확하게 구분이 잘 안가는 부분이 존재하여 개인적으로 정리하고자 포스팅을 진행함 DLL Injection?디스크에 존재하는 DLL을 사용하여 타겟 프로세스에 Injection 후 Execution 시키는 공격으로 타겟 프로세스에 Handle 획득이 선행되며, 타겟 프로세스의 메모리 영역 생성 및 RWX 권한 할당을 할당하여 디스크에 저장된 DLL 경로를 기입 및 실행시키는 기법임타겟 프로세스의 Handle 획득 및 메모리 생성과 권한 할당에 있어서는 Reflected DLL Injection과 동일하지만 DLL 경로를 기입한다는 점에서 Reflected DLL Injection과 다르다고 볼수 있음 R..

[Hook] MinHook 빌드 및 사용 방법

Hooking을 쉽게 구현할수 있는 MinHook이라는 라이브러리가 존재하는데, 아래의 github 레포에서 다운받아 빌드하여 사용할 수 있음https://github.com/TsudaKageyu/minhook/releases/tag/v1.3.4 Release v1.3.4 · TsudaKageyu/minhookImproved error handling for enumerating and suspending threads. Visual Studio 2022 support. CMake support. Fixed compilation with Clang. Fixed compilation as C++ code.github.com 링크에 접근한 후 Release / v1.3.4의 Source code를 다운받음다..

[c++] dll injection 탐지

#include #include #include #include #include #include #include #include #include #pragma comment(lib, "psapi.lib")// 제외할 경로 리스트 (이 경로에 있는 DLL은 탐지 대상에서 제외됨)std::vector excludedPaths = { //"C:\\Windows\\System32\\", //"C:\\Program Files\\Common Files\\"};// 특정 경로의 DLL을 제외하는 필터 함수bool isExcludedDll(const std::string& dllPath) { return std::any_of(excludedPaths.begin(), excludedPaths.end(),..

Programming/c++ 2025.03.08