プリンキピア

第14章サイバー資源の品質とサイバーコンピューティングのガバナンス

Common Cyber Threat Defenses一般的なサイバー脅威への防御
Common cyber threats were introduced earlier along with various examples of malware. Protection against malware involves the use of an intrusion detection system (IDS) as well as an intrusion prevention system (IPS). An IDS may be host- or network-based (i.e., HIDS or NIDS). In this case, detection happens after the attack (i.e. the memory is already corrupted due to a buffer overflow attack). A preventive measure must stop the attack before it reaches the system (i.e., the shield does packet filtering). Some tools support both IDS and IPS (e.g., Snort).
英語のヒント
一般的なサイバー脅威と、さまざまなマルウェアの例は先に紹介した。マルウェアからの保護には、侵入検知システム(IDS)と侵入防止システム(IPS)を使う。IDSはホスト型またはネットワーク型(HIDS、NIDS)である。この場合、検知は攻撃後に起こる。たとえばバッファーオーバーフローで、メモリーはすでに破損している。予防策は、攻撃がシステムへ届く前に止めなければならない。防壁でパケットをフィルタリングするなどである。Snortのように、IDSとIPSの両方を支援するツールもある。
Malware Detection Methods
マルウェアの検出方法
In general, some types of malware may rely on some delay based on a trigger to run (e.g., time bomb, logic bomb), and they may include a backdoor to serve as ransom. Other types of malware piggyback on other pieces of code. For example, viruses run when users initiate a task (e.g., run a program, open an attachment, boot the machine). Worms run while another program is running and do not require user intervention. Therefore, a virus propagates by ensuring it is eventually executed, assuming user intervention. Once executed, the virus creates a new separate instance of itself and typically infects by altering stored code. A worm self-propagates by making sure it is immediately executed without user intervention. Once executed, the worm creates a new separate instance of itself, and it typically infects by altering the running code. There is a fine line between viruses and worms; some malware uses both types.
英語のヒント
ある種のマルウェアは、時限爆弾や論理爆弾のように、引き金となる条件に基づいて実行を遅らせる。また、身代金の要求に使うバックドアを含む場合がある。別のマルウェアは、他のコードに便乗する。たとえばウイルスは、プログラム実行、添付ファイルの開封、機械の起動など、利用者が作業を始めると動く。ワームは、別のプログラムの実行中に動き、利用者の介入を必要としない。したがってウイルスは、利用者の介入を前提に、最終的に実行されるようにして広がる。実行されると、自分の別のインスタンスを作り、通常は保存済みコードを改変して感染する。ワームは、利用者の介入なしに直ちに実行されるようにして、自己増殖する。実行されると、自分の別のインスタンスを作り、通常は実行中のコードを改変して感染する。ウイルスとワームの境界は微妙で、両方の性質を使うマルウェアもある。
Detecting self-propagating malware (e.g., viruses or worms) is challenging. While antivirus software attempts to detect viruses, virus writers strive to evade human response and avoid detection for as long as possible. In the case of worms, the virus writer wants to spread the worm and hit many machines as quickly as possible to outpace the human response. Viruses have been around since the 1970s. They are opportunistic and eventually run as a result of a user action. Two orthogonal aspects define a virus: the way it propagates and what it does (i.e., the “payload”). A general infection strategy consists of altering existing code to incorporate the virus, share it, and expect users to (unwittingly) re-share it. Viruses infect other programs by taking over their entry point so the virus is run when executing these programs. They infect documents, boot sectors, or run as memory resident code. They increase their chances of running by attaching malicious code to a program a user is likely to run (e.g., email attachments). Once viruses run, they also look for an opportunity to infect other systems (e.g., proactive creation of emails).
英語のヒント
ウイルスやワームのように自己増殖するマルウェアの検出は難しい。ウイルス対策ソフトが検出を試みる一方、作成者は人間の対処をかわし、できるだけ長く検出を避けようとする。ワームでは、作成者は人間の対処を上回る速度で拡散させ、できるだけ早く多数の機械に届かせたい。ウイルスは1970年代から存在する。機会を捉え、最終的には利用者の行動をきっかけに動く。ウイルスを定める独立した二つの側面は、広がり方と、何をするか、つまり「ペイロード」である。一般的な感染戦略は、既存コードを変えてウイルスを組み込み、共有し、利用者が気付かず再共有するのを期待することだ。他のプログラムの入口を乗っ取り、その実行時にウイルスが動くようにして感染する。文書やブートセクターに感染したり、メモリー常駐コードとして動いたりする。利用者が実行しやすいプログラム、たとえばメール添付に悪意あるコードを付け、実行の可能性を高める。実行後は、メールを能動的に作るなど、他のシステムへ感染する機会も探す。
An obvious method for detecting viruses is to use signature-based detection, which consists of looking for bytes corresponding to injected virus code and protecting other systems by installing a recognizer for a known virus within them. This approach requires fast scanning algorithms and has resulted in creating a multi-billion-dollar antivirus market. Adding recognized signatures to that market enables marketing and leads to competition. To combat this detection method, virus writers give viruses harder signatures to match by creating polymorphic viruses. In this case, the virus generates a semantically different version of the code every time it propagates. While the higher-level semantics of the virus remain the same, the actual execution code differs (e.g., machine code instructions are different, different algorithms are used to achieve the same purpose, the code makes use of different registers, or different constants are used). This can be accomplished by including a code rewriter with a virus or adding some complex code that never runs to evade detection attempts. Instead of appending the program to the virus, virus writers surround the program with virus code, or overwrite uncommonly used parts of the program in order to confuse virus scanners. They also change the virus code so scanners cannot pin down a signature. Code changes can be mechanized so that the code looks different every time it is injected. To do so, they use public key encryption (and the fact that it is nondeterministic) to generate different virus code each time they encrypt the virus. At the same time, decryption always produces the same virus code (Figure 14.32). Virus writers also iteratively obfuscate the code (i.e., encrypt + jmp + …) using different encryption algorithms until the obfuscated code is fully undetectable.
英語のヒント
明らかな検出法は、シグネチャーに基づく検出である。注入されたウイルスコードに対応するバイト列を探し、他のシステムにも既知のウイルスの認識機構を入れて保護する。高速な走査アルゴリズムが必要であり、数十億ドル規模のウイルス対策市場の形成につながった。認識済みシグネチャーを増やすことは宣伝材料となり、競争を生む。これに対抗し、作成者はポリモーフィック型ウイルスを作り、照合しにくいシグネチャーにする。拡散するたび、意味的に異なるコード版を生成する。ウイルスの高水準の意味は同じでも、実際の実行コードは異なる。機械語命令、同じ目的を果たすアルゴリズム、レジスター、定数などを変える。コード書き換え機構を含めたり、決して実行されない複雑なコードを加えたりして、検出をかわす。ウイルスへプログラムを付ける代わりに、プログラムをウイルスコードで取り囲んだり、あまり使わない部分を上書きしたりして、スキャナーを混乱させる。シグネチャーを特定できないようコードも変える。コード変更は自動化でき、注入のたびに違って見えるようにできる。そのために、公開鍵暗号とその非決定性を利用し、暗号化のたびに異なるウイルスコードを生成する。一方、復号は常に同じウイルスコードを生む(図14.32)。また、異なる暗号アルゴリズムで、暗号化+jmp+…とコードを繰り返し難読化し、完全に検出できなくなるまで続ける。
Image omitted because its reuse rights could not be verified.権利の確認ができないため画像を割愛。
Figure 14.32 Virus writers generate a different virus code each time they encrypt the virus, while decryption always produces the same virus code. (attribution: Copyright Rice University, OpenStax, under CC BY 4.0 license; credit: reproduced with permission from Dave Levin)
図14.32 ウイルス作成者は、暗号化のたびに異なるウイルスコードを生成するが、復号すると常に同じウイルスコードになる。(帰属表示:著作権 Rice University、OpenStax。CC BY 4.0ライセンス。出典:Dave Levinの許可を得て転載。)
Scanning is insufficient to detect metamorphic viruses, and proper detection requires analysis of the code execution behavior. Two general approaches can be applied to facilitate detection, and both need to be conducted in a safe environment (e.g., gdb or a virtual machine). One of the approaches used by antivirus companies focuses on analyzing a new virus to locate its behavioral signature. Another approach focuses on suspicious code analysis to see if it matches the signature. In general, attackers have the upper hand because antivirus systems share signatures, which provides insight that attackers may use to react. Attackers change viruses slowly to make it hard to create a matching behavioral signature or they can start acting differently to avoid detection. In order to detect polymorphic viruses, antivirus writers can record narrow signatures used by virus writers to catch the associated decrypters. Because these signatures are often very small, this approach can result in many false positives. To counter this approach, attackers may spread small decrypter code around and use a jmp instruction to get to the virus code. Another approach to detecting polymorphic viruses is executing or statically analyzing the suspicious code to see if it decrypts. The issue with this last approach is that it is hard to differentiate an encrypted virus from a valid common “packers” program that does something similar (e.g., decompression). It also depends on how long the code can be executed without any side effects. Virus writers can combat these approaches by changing the decrypter. For example, oligomorphic viruses change from one of a fixed set of decrypters, and true polymorphic viruses can generate an endless number of decrypters (e.g., brute force key break). While this approach leads to inefficiencies, it makes it extremely difficult for antivirus software to detect viruses.
英語のヒント
メタモーフィック型ウイルスは走査だけでは検出できず、適切な検出にはコード実行時の振る舞いの分析が必要である。一般的な方法は二つあり、どちらもgdbや仮想マシンのような安全な環境で行う。一つは、新しいウイルスを分析し、その振る舞いのシグネチャーを見つけること。もう一つは、疑わしいコードを分析し、シグネチャーに一致するかを調べることだ。一般に攻撃者が優位に立つ。対策システムがシグネチャーを共有すると、それが攻撃者の対応に役立つ知識にもなるからである。攻撃者は、振る舞いのシグネチャーを作りにくくするため少しずつウイルスを変えたり、検出を避けるため別の振る舞いを始めたりする。ポリモーフィック型ウイルスの検出では、対策ソフトの作成者は、ウイルス作成者が使う小さなシグネチャーを記録して、対応する復号器を捕捉できる。ただし、シグネチャーが非常に小さいため、多数の誤検知につながりうる。攻撃者は、小さな復号コードを分散させ、jmp命令でウイルスコードへ進むことで対抗できる。別の検出法は、疑わしいコードを実行または静的解析し、復号を行うか調べることだ。問題は、暗号化されたウイルスと、展開など類似の動作をする正当な一般的「パッカー」プログラムを区別しにくいことである。副作用なしに、どのくらい長くコードを実行できるかにも依存する。ウイルス作成者は、復号器を変えて対抗できる。オリゴモーフィック型は固定された一群の復号器から選んで変更し、真のポリモーフィック型は、鍵の総当たり解読などにより、無数の復号器を生成できる。この方法は効率を下げるが、対策ソフトによる検出を非常に難しくする。
Today, malware detection is a technological arms race between detection and avoidance. Initially, only a few very clever people were capable of creating viruses. Viruses are now commoditized, and anyone can launch one. The creation of viruses remains hard. Still, it is no longer an academic interest focus but is rather driven by economic pursuits (e.g., zero-day markets) and cyberwarfare.
英語のヒント
今日のマルウェア検出は、検出と回避の間の技術的な軍拡競争である。初めは、ごく少数の非常に巧みな人だけがウイルスを作れた。今では商品化され、誰でも実行できる。作成自体は今も難しいが、もはや学術的な関心が中心ではない。ゼロデイ市場などの経済的追求や、サイバー戦争が動機となっている。
Infection Cleanup
感染後の除去
Cleaning up after an infection highly depends on the extent of the damage. It may be necessary to restore and/or repair files; numerous antivirus companies provide this type of service. In some cases, when a virus runs with root privileges, it may be necessary to rebuild the entire system. In this case, recompiling the system may not be sufficient. The malware may have infected the compiler and created a backdoor, such that recompiling will simply reintroduce the malware into the compiler. In that case, it may be necessary to resort to original media and data backups.
英語のヒント
感染後の除去は、被害の範囲に大きく左右される。ファイルの復元や修復が必要になる場合があり、多くのウイルス対策企業が提供している。ウイルスがroot権限で動いた場合などは、システム全体の再構築が必要かもしれない。その場合、再コンパイルだけでは不十分なこともある。マルウェアがコンパイラーに感染してバックドアを作っていれば、再コンパイルしても、マルウェアをコンパイラーへ再び導入するだけになる。その場合は、元のメディアとデータのバックアップに頼る必要があるかもしれない。