WINDOWS
- dll, exe
LINUX
- so PE file
Windows 의 DLL 검증
[ LoadLibrary , GetProcAddress , FreeLibrary ]
[ DLL 프로젝트에 DLL_dll을 dll로 추가 ]
[ dll 의 소스코드 ]
dwReason
EXPORT : 함수호출
DWORD : 함수호출x
[ DLL이 없는 경우 ]
[ DLL이 없는 경우 ]
- VAS(Virtual Address Space)
[ VAS ]
- Library(Lib)
- Static Link Library
- Link (compile = bulid될때) 라이브러리가 실행파일 안에 들어가 있다. 따라서, PE file하나만
- Static Link Library
- Link (compile = bulid될때) 라이브러리가 실행파일 안에 들어가 있다. 따라서, PE file하나만
- Dynamic Link Library
- build하는 시점이 아니라 나중에 compile됨.
- 내용변경하려면 Sll은 전체를 수정, Dll은 하나만 해도 ㅇㅋ
- Dynamic Link Library
- build하는 시점이 아니라 나중에 compile됨.
- 내용변경하려면 Sll은 전체를 수정, Dll은 하나만 해도 ㅇㅋ
- 나중에의 경우
- 나중에의 경우
- Load Time Link
- exe가 메모리에 로딩될 때 필요한 dll이 같이 로딩되는 방식
- cons. dll이 하나라도 문제가 생기면 exe가 안됨
[ pexplorer.exe 에서 pexdll2.dll이 없는 경우, Process Explorer 의 반응 ]
pros. loading할 때 빠름 (무겁게 모두 로딩할 필요가 없으니까)
- INT(Import Name Table) & IAT(Import Address Table)
; 어떤 dll에 어떤 함수가 필요한지 정리해놓은 표 (exe)
- ENT(Export Name Table) & EAT(Export Address Table)
; 나한테 정리해놓은 표가 있으니 쓰시오 (dll)
- C++ 함수 오버로딩
; 같은 이름의 함수, 다른 매개변수
# SIEM(Security information and event management) <--발전--ESM(Enterprise Security Management)
# SPYWARE
KERNEL을 통해 DLL로 훔쳐오기
- Hooking 기법 (Hook procedure 설치)
- Hook procedure 설치
- Hook procedure 설치
: 커널이 함수에 갈고리를 걸어줌
- Message Hook
- Message Hook
: GetMessage()에 갈고리를 거는 hook ===>kernel의 기본적인 기능을 악용
[ 메인함수의 소스코드 ]
SetWindowsHookEx
SetWindowsHookEx(hook procedure, hook함수, hook함수dll, 0)
[ dll 함수의 소스코드 ]
GetMassage 가 실행될 때 hooking인 GetMsgProc이 먼저 실행되고, GetMassage가 실행(선택적)
[ 위의 코드를 Debugging ]
[ 만들어진 exe와 dll의 RealMemory, notepad에서의 VAS ]
[ 위의 exe를 실행하였을때 ProcessExplorer반응 ]
kerneldl.exe 작동중임을 확인
No comments:
Post a Comment