
모든 (IME를 사용하지 않는) 언어를 올바르게 지원하는 Win32 키로거
이 저장소는 입력 방법 편집기를 사용하지 않는 모든 언어를 지원하는 win32 키로거를 구축하는 방법을 다루는 이 글과 관련된 코드를 포함합니다.
모든 테스트는 Windows 10(22h2)에서 수행되었습니다.
. # keylog code
├── cap_gks.c # sample keylogger using GetKeyState()
├── cap_llh.c # sample keylogger using SetWindowsHookEx(WH_KEYBOARD_LL)
├── cap_rid.c # sample keylogger using GetRawInputData()
├── process.c # retrieve key-strokes context
├── process.h
├── vk_names.h # virtual key to string (name) macro
│
│ # processing code
├── dumper.cpp # program to dump windows KBD*.DLL contents to json
├── kbdhdr.h # slightly modified windows headers
├── reconstruct.py # reconstructs character stream from keylogs
├── replayer.py # win32 python program to replay scan codes and extract resulting characters
│
│ # various
├── kbdlmap.py # KLID to dll name mapping
├── vk_names.py # virtual key number to/from name
├── Makefile # build keylogger with mingw-w64
│
│ # external dependencies
├── extern
│ └── json.hpp # by Niels Lohmann from https://github.com/nlohmann/json
│
│ # json files
├── inputs # input test cases
└── layouts # output of dumper on all win32 kbd*.dll
$ sudo apt install mingw-w64 python3
Windows에서 exe 파일이 바탕 화면에 배치되어 있다고 가정하고 다음 명령 중 하나를 입력합니다:
c:\Users\user\Desktop> cap_gks.exe > keylog1.jsonl
c:\Users\user\Desktop> cap_llh.exe > keylog2.jsonl
c:\Users\user\Desktop> cap_rid.exe > keylog3.jsonl
DLL의 내용을 json으로 덤프하려면:
c:\Users\user\Desktop> dmp.exe kbdfr > kbdfr.json
키 입력을 다시 주입하려면:
c:\Users\user\Desktop> python replayer.py keylog1.jsonl > keylog1_ref.txt
키 입력에서 텍스트를 재구성하려면(결과 검증 포함):
$ python3 reconstruct.py -v -l kbdfr.dll -c keylog1_ref.txt keylog1.jsonl