念のために各サービスのバイナリの SHA256 取って VirusTotal に投げてみる。
まず、
$ cat <<EOD | while read -r i; do sha256sum "$(cygpath -m "$i")"; done | awk '{url="https://www.virustotal.com/ja/file/" $1 "/analysis/";print "- [[" gensub("^.", "\\h", 1, url) ">" url "]]";}'
C:\Windows\system32\es.dll
C:\Windows\system32\FntCache.dll
C:\Windows\system32\netprofm.dll
C:\Windows\system32\nsisvc.dll
C:\Windows\system32\wdi.dll
c:\windows\system32\winhttp.dll
EOD
として以下の URL を得た。
まぁ、当然なんだけど、どれもアラートには引っかからない状態。
また、
C:\Windows\system32\FntCache.dll
以外は
"Trusted source! This file belongs to the Microsoft Corporation software catalogue."
って言われて、
"Signature verification" も "Signed file, verified signature"
って出る。
まぁ、検証出来てるよってのは良いんだけど、
これは一体何を根拠にしているんだろう?
少なくとも手元のバイナリ見る限り、
これらのファイルの「プロパティ」を開いてみても「デジタル署名」のタブが出て来ないので、
コードサイニングはされてない気がするのだが、
"Signed file, verified signature"
は何を根拠にそう言っているのかが不明。
また、FntCache.dll だけがそこから除外されているのはなぜなのか???
改めて、C:\Windos 以下のバイナリを眺めてみると sytem32\drivers 以下の .sys ファイルは「プロパティ」開くとある程度の確率で「デジタル署名」のタブが出て来るんだけど、例えば、system32\drivers\1394ophci.sys なんかは「詳細」タブ見ると Microsoft 製って出てるのに、「デジタル署名」のタブ出て来ない。
これは、ちょっと驚きと言うか、ドライバは要コードサイニングになったって話はどこに行った???って感じ。
Windows SDK に入ってる signtool.exe も使って確認してみたけど、以下の様な感じで、やっぱり「プロパティ」に「デジタル署名」のタブがないファイルは検証出来ない。
C:\Windows\system32>"C:\Program Files (x86)\Windows Kits\8.0\bin\x64\signtool.exe" verify C:\Windows\system32\drivers\acpi.sys
File: C:\Windows\system32\drivers\acpi.sys
Index Algorithm Timestamp
========================================
0 sha1 Authenticode
Successfully verified: C:\Windows\system32\drivers\acpi.sys
C:\Windows\system32>"C:\Program Files (x86)\Windows Kits\8.0\bin\x64\signtool.exe" verify C:\Windows\system32\drivers\1394ohci.sys
File: C:\Windows\system32\drivers\1394ohci.sys
Index Algorithm Timestamp
========================================
SignTool Error: WinVerifyTrust returned error: 0x00000057
Number of errors: 1
C:\Windows\system32>"C:\Program Files (x86)\Windows Kits\8.0\bin\x64\signtool.exe" verify C:\Windows\system32\es.dll
File: C:\Windows\system32\es.dll
Index Algorithm Timestamp
========================================
SignTool Error: WinVerifyTrust returned error: 0x00000057
Number of errors: 1
Windows 10 だと流石に explorer.exe くらいにはコードサイニングされているのは確認したけど、少なくとも Windows 7 だと explorer.exe でさえもコードサイニングされてない。
コードサイニングの枠組み入れておきながら、なんで、こんなにガバガバなの!?
コアなバイナリにさえも使ってないとか、そりゃ、世間一般にウイルスにも蔓延するわって思う。
コードサイニングのない野良バイナリを一切実行させるなとは言わないし、現実問題としてそれをされてしまうと、自分でビルドしたバイナリの実行に不自由生じて地味に困る状況が目に見えるため、流石にそこまではやってくれるなとは思うけど、
少なくとも Microsoft 製を名乗るバイナリが偽造や改竄されてない事は検証できて然るべきだろう。
ウイルス対策ソフトによる誤検出対策としても極めて有効なはずだし。
Microsoft は阿呆なんだろうか?