仮想ファイルのストリーミング

□未翻訳

□翻訳中

□翻訳完了(Yota Ichino)

■レビュー(Omi Chiba)

仮想ファイルのストリーミング

悪意ある攻撃者にとってwebサイトが脆弱かどうかをスキャンするのはよくあることです。彼らはNessusといったセキュリティスキャナを使いスクリプトに脆弱性があるかを知ることで標的となるウェブサイトを探索します。スキャンされたマシンからのwebサーバログや既知の脆弱性の多く示すNessusデータベースでの直接の解析はPHPスクリプトやASPスクリプトにおけるものです。我々はweb2pyを稼動させて以降も、それらの脆弱性が無いにもかかわらず、彼らから未だにスキャンされます。迷惑なので、これらの脆弱性に対応し、攻撃者に彼らの時間を空費することを理解させるのが望ましいです。

It is common for malicious attackers to scan web sites for vulnerabilities. They use security scanners like Nessus to explore the target web sites for scripts that are known to have vulnerabilities. An analysis of web server logs from a scanned machine or directly in the Nessus database reveals that most of the known vulnerabilities are in PHP scripts and ASP scripts. Since we are running web2py, we do not have those vulnerabilities, but we will still be scanned for them. This is annoying, so we like to respond to those vulnerability scans and make the attacker understand their time is being wasted.

1つの方法は攻撃に対抗して.php、.asp、疑わしいダミーアクションへの全リクエストをリダイレクトすることで、攻撃者を長時間忙しくさせ続けることです。そのうち攻撃者はあきらめ、私たちをを二度とスキャンしないでしょう。

One possibility is to redirect all requests for .php, .asp, and anything suspicious to a dummy action that will respond to the attack by keeping the attacker busy for a large amount of time. Eventually the attacker will give up and will not scan us again.

このレシピは2つの部品を必要とします。

This recipe requires two parts.

次のように"default.py"コントローラにjammerという専用のアプリケーションを作成します:

A dedicated application called jammer with a "default.py" controller as follows:

1.

2.

3.

class Jammer():

def read(self,n): return 'x'*n

def jam(): return response.stream(Jammer(),40000)

このアクションが呼ばれたときに、一度に40000文字の"x"で満たされた無限のデータストリームを返します。

When this action is called, it responds with an infinite data stream full of "x"-es. 40000 characters at a time.

2つ目の要素は.php、.aps(大文字、小文字どちらも)などで終わるどのようなリクエストもこのコントローラにリダイレクトする"route.py"ファイルです。

The second ingredient is a "route.py" file that redirects any request ending in .php, .asp, etc. (both upper case and lower case) to this controller.

1.

2.

3.

route_in=(

('.*\.(php|PHP|asp|ASP|jsp|JSP)','jammer/default/jam'),

)

一度目に攻撃を受けた際には小さなオーバヘッドしかないかもしれませんが、私たちの経験からして同じ攻撃者は2度と攻撃してきません。

The first time you are attacked you may incur a small overhead, but our experience is that the same attacker will not try twice.