C2とWeb Storage
「New Pacifier APT Components Point to Russian-Linked Turla Group」のレポート内には、Webブラウザのキャッシュを利用するマルウェアの話題が記載されています。
https://media.scmagazine.com/documents/314/bitdefender-whitepaper-pacifie_78483.pdf
2. Using Browser Cache to Evade Securityより引用
The website the Trojan connects to is perfectly legitimate, but it also contains a JavaScript (placed by the attacker) that uses a legitimate
method of writing in the browser’s local cache. Consequently, the JavaScript will write instructions from the C&C into the local browser
cache of Internet Explorer. Since the script is not malicious per se, this is the novelty of the Trojan that reveals a radically new attack avenue.
On the victim’s side, the backdoor simply checks if something new has been written in the browser’s cache, looking for instructions. The
Trojan doesn’t constantly scan the cache for new instructions, it only does so at various time intervals to avoid triggering security warnings.
マルウェアがC2と通信する手口として、Web Storageを利用する手口が解説されています。
マルウェアはブラウザのスタートアップの設定を変更し、ブラウザが起動するとスタートアップに登録されているサイトへアクセスします。
マルウェアは直接C2と通信するのではなく、Web ブラウザがC2と通信し、Web storageにコマンドが格納されます。
マルウェアはWebブラウザが保存したWeb storageの内容を読み込むことでコマンドを実行するという流れのようです。
Web Storage データの保存場所
Web Storage の仕組みについては、下記URLが参考になります
Windows 7 上 の IE 11 でテストしてみます。Web Storage のデータは下記フォルダ配下にXML形式のファイルとして保存されます。
%userprofile%\AppData\LocalLow\Microsoft\Internet Explorer\DOMStore
%userprofile%\AppData\Local\Microsoft\Internet Explorer\DOMStore
レジストリにもパスが登録されているようです。
テストデータの作成
Web Storage をテスト出来るサイトは色々とありますが、今回は下記サイトを使わせていただきます。
localStorageに確認用のデータを書き込みます。
エクスプローラで XML ファイルを参照。
ESEDatabaseView を利用すれば、DOMStore の URL と Filename を確認できます。
マイクロソフトが公開しているサンプルアプリケーション。電卓に入力した値が Web Storage 内に保存されています。
マルウェアが Web Storage を利用している場合、どの様に調査すればそれを発見する事が出来るでしょうか?
参考URL:
モダンブラウザのストレージ容量まとめ
https://www.html5rocks.com/ja/tutorials/offline/quota-research/