回答編集履歴
3
文言修正
answer
CHANGED
@@ -36,7 +36,7 @@
|
|
36
36
|
|
37
37
|
(1) DLL インジェクション
|
38
38
|
|
39
|
-
プログラムの IAT(Import Address Table) を書き換えて、自分で用意した関数
|
39
|
+
プログラムの IAT(Import Address Table) を書き換えて、自分で用意した関数を呼ばせます。
|
40
40
|
CreteProcess と GetProcAddress が対象になります。
|
41
41
|
|
42
42
|
現状、32bit/64bit プロセスが混在する環境があるので対応が難しいと思います。
|
2
ドライバーを使わない方法
answer
CHANGED
@@ -22,4 +22,32 @@
|
|
22
22
|
ntddk.h と NtosKrnl.lib は WDK に入っていると思います。(未確認)
|
23
23
|
|
24
24
|
「Windows Driver Kit (WDK) のダウンロード」
|
25
|
-
[https://docs.microsoft.com/ja-jp/windows-hardware/drivers/download-the-wdk](https://docs.microsoft.com/ja-jp/windows-hardware/drivers/download-the-wdk)
|
25
|
+
[https://docs.microsoft.com/ja-jp/windows-hardware/drivers/download-the-wdk](https://docs.microsoft.com/ja-jp/windows-hardware/drivers/download-the-wdk)
|
26
|
+
|
27
|
+
#追記
|
28
|
+
ドライバーの作り方については
|
29
|
+
|
30
|
+
「初めてのドライバーの作成」
|
31
|
+
[https://docs.microsoft.com/ja-jp/windows-hardware/drivers/gettingstarted/writing-your-first-driver](https://docs.microsoft.com/ja-jp/windows-hardware/drivers/gettingstarted/writing-your-first-driver)
|
32
|
+
|
33
|
+
を紹介しておきます。(私もわからないですし)
|
34
|
+
|
35
|
+
ドライバーを使わない方法だと
|
36
|
+
|
37
|
+
(1) DLL インジェクション
|
38
|
+
|
39
|
+
プログラムの IAT(Import Address Table) を書き換えて、自分で用意した関数のアドレスを呼ばせます。
|
40
|
+
CreteProcess と GetProcAddress が対象になります。
|
41
|
+
|
42
|
+
現状、32bit/64bit プロセスが混在する環境があるので対応が難しいと思います。
|
43
|
+
|
44
|
+
|
45
|
+
(2) CreateWindow を捕まえてお茶を濁す。
|
46
|
+
|
47
|
+
SetWindowsHookEx で WH_CBT フックを行います。
|
48
|
+
|
49
|
+
「280_アプリの起動と終了を知る WH_CBT フック」
|
50
|
+
[http://mrxray.on.coocan.jp/Delphi/plSamples/280_HookCBTActivate.htm](http://mrxray.on.coocan.jp/Delphi/plSamples/280_HookCBTActivate.htm)
|
51
|
+
|
52
|
+
実際にやっているのは CreateWindow の補足で、起動を補足しているわけではないです。
|
53
|
+
Delphi で書かれてますが、使っている API は参考になるかと。
|
1
リンク追加
answer
CHANGED
@@ -1,10 +1,10 @@
|
|
1
1
|
解説とサンプルコードが以下にあります。
|
2
2
|
|
3
3
|
「Detecting Windows NT/2K process execution」
|
4
|
-
https://www.codeproject.com/Articles/2018/Detecting-Windows-NT-2K-process-execution
|
4
|
+
[https://www.codeproject.com/Articles/2018/Detecting-Windows-NT-2K-process-execution](https://www.codeproject.com/Articles/2018/Detecting-Windows-NT-2K-process-execution)
|
5
5
|
|
6
6
|
ユーザ登録すればソースコードがダウンロードできます。
|
7
|
-
https://www.codeproject.com/KB/threads/procmon/ProcMon.zip
|
7
|
+
[https://www.codeproject.com/KB/threads/procmon/ProcMon.zip](https://www.codeproject.com/KB/threads/procmon/ProcMon.zip)
|
8
8
|
|
9
9
|
PsSetCreateProcessNotifyRoutine という API を使っているのですが カーネルモードで動作する API なのでドライバーを書く必要があるようです。
|
10
10
|
zip に含まれている ProcObsrv.sys がドライバーです。
|