@port139 Blog

基本的にはデジタル・フォレンジックの技術について取り扱っていますが、記載内容には高確率で誤りが含まれる可能性があります。

SessionEnvとTSMSISrv.dll

CCleaner version 5.33.6162 に関して下記レポートが出ています。このレポートでは、Persistenceの仕組みとしてマルウェアがサービスを利用している事を説明しています。

Progress on CCleaner Investigation より引用
The second part of the payload is responsible for persistence. Here, a different mechanism is used on Windows 7+ than on Windows XP. On Windows 7+, the binary is dumped to a file called “C:\Windows\system32\lTSMSISrv.dll” and automatic loading of the library is ensured by autorunning the NT service “SessionEnv” (the RDP service). On XP, the binary is saved as "C:\Windows\system32\spool\prtprocs\w32x86\localspl.dll” and the code uses the “Spooler” service to load.

上記レポートではDLLのファイル名が「lTSMSISrv.dll」となっていますが、下記シマンテック社の資料では「TSMSISrv.dll」となっています。

www.symantec.com

Windows 7のデフォルト環境に、TSMSISrv.dll ファイルは存在していません。

f:id:hideakii:20170930190108p:plain

SessionEnv サービスは Windows 7 環境にデフォルトで存在する、「Remote Desktop Configuration」の事になります。

マルウェアはレジストリを変更し、このサービスが自動で開始されるように設定します。(デフォルトは手動です)

f:id:hideakii:20170930185758p:plain

f:id:hideakii:20170930194722p:plain

 試しに、SessionEnv サービスを開始し、Process Monitorで読み込まれるDLLファイルを確認してみます。Process Monitor の結果に TSMSISrv.dll が登場します。

f:id:hideakii:20170930190833p:plain

 私はTSMSISrv.dll を入手していないので、実際にどの様に読み込まれるかは未確認です。

仮に、SessionEnv サービスが自動的にTSMSISrv.dllを読み込む場合、Autorunsツールでは検出できないですね。自動起動の仕組みとしては、見つけるのが簡単ではない点で興味深いですね。

 

 64bit版は「EFACli64.dll」という記述がありますが、これはどの様にロードされるのでしょうかね?

 

 参考URL:

www.reverse.it

 

www.ghacks.net

 

tdaitoku.hatenablog.com

f:id:hideakii:20170930195723j:plain