プラグインベースのスキャナーであり、セキュリティ研究者が複数のCMSに関する問題を特定するのを支援します。
droopescanを、事前の相互同意なしにターゲットを攻撃する目的で使用することは違法です。エンドユーザーは、適用されるすべての地域、州、連邦法を遵守する責任を負います。開発者は一切の責任を負わず、本プログラムの誤用または損害についても責任を負いません。droopescanはリモートホストにインストールされている可能性が最も高いCMSのバージョンを出力しますが、バージョン番号と脆弱性との関連付けはユーザーが手動で行う必要があることに注意してください。
サポートされているCMS:
部分的な機能:
computer:~/droopescan$ droopescan scan drupal -u http://example.org/ -t 32
[+] No themes found.
[+] Possible interesting urls found:
Default changelog file - https://www.example.org/CHANGELOG.txt
Default admin - https://www.example.org/user/login
[+] Possible version(s):
7.34
[+] Plugins found:
views https://www.example.org/sites/all/modules/views/
https://www.example.org/sites/all/modules/views/README.txt
https://www.example.org/sites/all/modules/views/LICENSE.txt
token https://www.example.org/sites/all/modules/token/
https://www.example.org/sites/all/modules/token/README.txt
https://www.example.org/sites/all/modules/token/LICENSE.txt
pathauto https://www.example.org/sites/all/modules/pathauto/
https://www.example.org/sites/all/modules/pathauto/README.txt
https://www.example.org/sites/all/modules/pathauto/LICENSE.txt
https://www.example.org/sites/all/modules/pathauto/API.txt
libraries https://www.example.org/sites/all/modules/libraries/
https://www.example.org/sites/all/modules/libraries/CHANGELOG.txt
https://www.example.org/sites/all/modules/libraries/README.txt
https://www.example.org/sites/all/modules/libraries/LICENSE.txt
entity https://www.example.org/sites/all/modules/entity/
https://www.example.org/sites/all/modules/entity/README.txt
https://www.example.org/sites/all/modules/entity/LICENSE.txt
google_analytics https://www.example.org/sites/all/modules/google_analytics/
https://www.example.org/sites/all/modules/google_analytics/README.txt
https://www.example.org/sites/all/modules/google_analytics/LICENSE.txt
ctools https://www.example.org/sites/all/modules/ctools/
https://www.example.org/sites/all/modules/ctools/CHANGELOG.txt
https://www.example.org/sites/all/modules/ctools/LICENSE.txt
https://www.example.org/sites/all/modules/ctools/API.txt
features https://www.example.org/sites/all/modules/features/
https://www.example.org/sites/all/modules/features/CHANGELOG.txt
https://www.example.org/sites/all/modules/features/README.txt
https://www.example.org/sites/all/modules/features/LICENSE.txt
https://www.example.org/sites/all/modules/features/API.txt
[... snip for README ...]
[+] Scan finished (0:04:59.502427 elapsed)
オプションの完全なリストは、以下を実行することで取得できます:
droopescan --help
droopescan scan --help
なぜならdroopescanは:
pip を使用したインストールは簡単です:
apt-get install python-pip
pip install droopescan
手動インストールは以下のとおりです:
git clone https://github.com/droope/droopescan.git
cd droopescan
pip install -r requirements.txt
./droopescan scan --help
masterブランチは最新のリリース(pypiにあるもの)に対応しています。開発ブランチは不安定であり、すべてのプルリクエストは開発ブランチに対して行う必要があります。
BlackArch パッケージ インストール (サードパーティによってメンテナンス):
sudo pacman -S droopescan
Dockerイメージをビルドして、Dockerからdroopescanを実行できます:
git clone https://github.com/droope/droopescan.git
cd droopescan
docker build -t droope/droopescan .
# ヘルプを表示
docker run --rm droope/droopescan
# drupalサイトをスキャンする例
docker run --rm droope/droopescan scan drupal -u https://drupal.example.com
droopescanは、過剰な同時リクエストでターゲットサーバーに負荷をかけず、デフォルトで最も正確になることを目指しています。このため、デフォルトでは4つのスレッドで多数のリクエストが行われます。これらの設定は、それぞれ--numberおよび--threads引数を使用して変更できます。
このツールは4種類のテストを実行できます。デフォルトではすべてのテストが実行されますが、-eまたは--enumerateフラグを使用して次のいずれかを指定できます:
特定のホストをスキャンするには、-uまたは--urlパラメータを渡します:
droopescan scan drupal -u example.org
drupal引数を省略することもできます。これにより、「CMS識別」がトリガーされます。例:
droopescan scan -u example.org
複数のURLをスキャンするには、-Uまたは--url-fileパラメータを使用します。このパラメータには、URLのリストを含むファイルへのパスを設定します。
droopescan scan drupal -U list_of_urls.txt
この例でもdrupalパラメータは省略可能です。各サイトに対して、CMS識別を行うために複数のGETリクエストが行われ、サポートされているCMSと判断された場合、スキャンされて出力リストに追加されます。これは、例えば、組織のすべてのサイトに対してdroopescanを実行する場合に便利です。
droopescan scan -U list_of_urls.txt
以下のコードブロックは、URLリストの例 (1行に1つのURL) です:
http://localhost/drupal/6.0/
http://localhost/drupal/6.1/
http://localhost/drupal/6.10/
http://localhost/drupal/6.11/
http://localhost/drupal/6.12/
URLと、デフォルトのホストヘッダーを上書きする値をタブまたはスペースで区切ったファイルもURLファイルとして使用できます。これは、大量のホストをスキャンする際に不要なDNSクエリを防ぎたい場合に便利です。明確にするために、以下に例を示します:
192.168.1.1 example.org
http://192.168.1.1/ example.org
http://192.168.1.2/drupal/ example.org
公式サイト (例: wordpressの場合はwordpress.org) をスキャンしてスキャナーが特定のCMSで動作するかテストしたくなるのは非常に魅力的ですが、公式サイトは通常、バニラインストールを実行しておらず、型にはまらないことを行っています。たとえば、wordpress.orgはwordpressの最先端バージョンを実行しており、チェックサムが既知のwordpressバージョンと一致しないため、droopescanによってwordpressとして識別されることはありません。
このアプリケーションは.netrcファイルとhttp_proxy環境変数を完全にサポートしています。
基本認証には.netrcファイルを使用します。.netrcファイル(ホームディレクトリに配置される.netrcという名前のファイル)の例は次のようになります:
machine secret.google.com
login [email protected]
password Winter01
http_proxyおよびhttps_proxy変数を設定できます。これにより、親HTTPプロキシを設定でき、より複雑な種類の認証 (例: Fiddler、ZAP、Burp) を処理できます。
export http_proxy='user:password@localhost:8080'
export https_proxy='user:password@localhost:8080'
droopescan scan drupal --url http://localhost/drupal
警告: 設計上、インターセプトプロキシやSSLの不適切なアプリケーションのテストを可能にするために、droopescanは自己署名証明書や無効な証明書を許可します。˙ ͜ʟ˙
このアプリケーションは、人間が読むための「標準出力」と、機械が消費するのに適したJSONの両方をサポートしています。この出力はメジャーバージョン間で安定しています。
これは--outputフラグで制御できます。JSON出力のサンプルは次のようになります (余分な空白は除く):
{
"themes": {
"is_empty": true,
"finds": [
]
},
"interesting urls": {
"is_empty": false,
"finds": [
{
"url": "https:\/\/www.drupal.org\/CHANGELOG.txt",
"description": "デフォルトの変更ログファイル。"
},
{
"url": "https:\/\/www.drupal.org\/user\/login",
"description": "デフォルトの管理ページ。"
}
]
},
"version": {
"is_empty": false,
"finds": [
"7.29",
"7.30",
"7.31"
]
},
"plugins": {
"is_empty": false,
"finds": [
{
"url": "https:\/\/www.drupal.org\/sites\/all\/modules\/views\/",
"name": "views"
},
[...snip...]
]
}
}
スキャンの一部が実行されなかった場合、JSONオブジェクトから一部の属性が欠落している可能性があります。
マルチサイト出力は次のようになります。各行には上記のような有効なJSONオブジェクトが含まれています。
$ droopescan scan drupal -U six_and_above.txt -e v
{"host": "http://localhost/drupal-7.6/", "version": {"is_empty": false, "finds": ["7.6"]}}
{"host": "http://localhost/drupal-7.7/", "version": {"is_empty": false, "finds": ["7.7"]}}
{"host": "http://localhost/drupal-7.8/", "version": {"is_empty": false, "finds": ["7.8"]}}
{"host": "http://localhost/drupal-7.9/", "version": {"is_empty": false, "finds": ["7.9"]}}
{"host": "http://localhost/drupal-7.10/", "version": {"is_empty": false, "finds": ["7.10"]}}
{"host": "http://localhost/drupal-7.11/", "version": {"is_empty": false, "finds": ["7.11"]}}
{"host": "http://localhost/drupal-7.12/", "version": {"is_empty": false, "finds": ["7.12"]}}
{"host": "http://localhost/drupal-7.13/", "version": {"is_empty": false, "finds": ["7.13"]}}
{"host": "http://localhost/drupal-7.14/", "version": {"is_empty": false, "finds": ["7.14"]}}
{"host": "http://localhost/drupal-7.15/", "version": {"is_empty": false, "finds": ["7.15"]}}
{"host": "http://localhost/drupal-7.16/", "version": {"is_empty": false, "finds": ["7.16"]}}
{"host": "http://localhost/drupal-7.17/", "version": {"is_empty": false, "finds": ["7.17"]}}
{"host": "http://localhost/drupal-7.18/", "version": {"is_empty": false, "finds": ["7.18"]}}
{"host": "http://localhost/drupal-7.19/", "version": {"is_empty": false, "finds": ["7.19"]}}
{"host": "http://localhost/drupal-7.20/", "version": {"is_empty": false, "finds": ["7.20"]}}
{"host": "http://localhost/drupal-7.21/", "version": {"is_empty": false, "finds": ["7.21"]}}
{"host": "http://localhost/drupal-7.22/", "version": {"is_empty": false, "finds": ["7.22"]}}
{"host": "http://localhost/drupal-7.23/", "version": {"is_empty": false, "finds": ["7.23"]}}
{"host": "http://localhost/drupal-7.24/", "version": {"is_empty": false, "finds": ["7.24"]}}
{"host": "http://localhost/drupal-7.25/", "version": {"is_empty": false, "finds": ["7.25"]}}
{"host": "http://localhost/drupal-7.26/", "version": {"is_empty": false, "finds": ["7.26"]}}
{"host": "http://localhost/drupal-7.27/", "version": {"is_empty": false, "finds": ["7.27"]}}
{"host": "http://localhost/drupal-7.28/", "version": {"is_empty": false, "finds": ["7.28"]}}
{"host": "http://localhost/drupal-7.29/", "version": {"is_empty": false, "finds": ["7.29"]}}
{"host": "http://localhost/drupal-7.30/", "version": {"is_empty": false, "finds": ["7.30"]}}
{"host": "http://localhost/drupal-7.31/", "version": {"is_empty": false, "finds": ["7.31"]}}
{"host": "http://localhost/drupal-7.32/", "version": {"is_empty": false, "finds": ["7.32"]}}
{"host": "http://localhost/drupal-7.33/", "version": {"is_empty": false, "finds": ["7.33"]}}
{"host": "http://localhost/drupal-7.34/", "version": {"is_empty": false, "finds": ["7.34"]}}
思い通りにいかない場合、--debug-requestsコマンドを使用して原因を確認できます。
出力例は次のようになります:
computer:~/droopescan# droopescan scan silverstripe -u http://localhost -n 10 -e p --debug-requests
[head] http://localhost/framework/... 403
[head] http://localhost/cms/css/layout.css... 404
[head] http://localhost/framework/css/UploadField.css... 200
[head] http://localhost/misc/test/error/404/ispresent.html... 404
[head] http://localhost/widgetextensions/... 404
[head] http://localhost/orbit/... 404
[head] http://localhost/sitemap/... 404
[head] http://localhost/simplestspam/... 404
[head] http://localhost/ecommerce_modifier_example/... 404
[head] http://localhost/silverstripe-hashpath/... 404
[head] http://localhost/timeline/... 404
[head] http://localhost/silverstripe-hiddenfields/... 404
[head] http://localhost/addressable/... 404
[head] http://localhost/silverstripe-description/... 404
[+] No plugins found.
[+] Scan finished (0:00:00.058422 elapsed)
--debugパラメータも存在し、アプリケーション内部のデバッグに使用できます。
スキャナーの機能に関する最新レポートを取得するには、次のコマンドを実行します
droopescan stats
出力例は次のようになります:
Functionality available for ‘drupal’:
- Enumerate plugins (XXXX plugins.)
- Enumerate themes (XXXX themes.)
- Enumerate interesting urls (X urls.)
- Enumerate version (up to version X.X.X-alphaXX, X.XX, X.XX.)
Functionality available for ‘joomla’:
- Enumerate interesting urls (X urls.)
- Enumerate version (up to version XX.X, X.X.X, X.X.XX.rcX.)
Functionality available for ‘wordpress’:
- Enumerate interesting urls (X urls.)
- Enumerate version (up to version X.X.X, X.X.X, X.X.X.)
Functionality available for ‘silverstripe’:
- Enumerate plugins (XXX plugins.)
- Enumerate themes (XX themes.)
- Enumerate interesting urls (X urls.)
- Enumerate version (up to version X.X.XX, X.X.XX, X.X.XX.)
CMSインストールに利用可能な最新バージョンがdroopescan内で利用可能であることを確認することが重要です。そうしないと、結果が不正確になる可能性があります。
お気に入りのCMSのサポートを追加できます。そのプロセスは実際には非常に簡単で、多くの情報はplugins/フォルダーのexample.pyファイルを参照することで得られます。
このファイルは実装のベースとして役立ちます。
Joomla用の独自プラグインを作成し、次のように有効化できます:
$ cp plugins/example.py plugins/joomla.py
$ cp plugins.d/example.conf plugins.d/joomla.conf
次に、plugins/joomla.pyに移動していくつかの変更を行う必要があります:
@controller.expose(help='example scanner')
def joomla(self):
self.plugin_init()
また、plugins.d/joomla.confファイルを変更し、次のようにします:
[joomla]
enable_plugin = true
これで次のような状態になるはずです:
$ droopescan scan joomla
[+] --url parameter is required.
次のステップは、有効なプラグインワードリスト、有効なテーマワードリスト、versions.xmlファイル、そしてオプションで興味深いURLのリストを生成し、joomla.py内のすべての変数を実装に正しい値に置き換えることです。
プラグインがプルリクエストとして受け入れられるためには、自動更新が必要です。詳細なドキュメントは後日提供される可能性がありますが、今のところ、update_version_check、update_version、update_plugins_check、update_pluginsを実装する必要があることに留意してください。参考までに、drupal.pyファイルを確認してください。これはプラグインを最新に保つために必要です。
新しいプラグインを作成するプルリクエストは、それらのプラグインのメンテナンスが自動的に行われる場合に歓迎します。
プルリクエストはmasterではなく開発ブランチに対して行ってください。問題はGitHub上のIssueトラッカーで報告できます。
テストを実行するには、いくつかの依存関係をインストールする必要があります。以下のコマンドを実行すると、それらがインストールされ、テストが実行されます:
apt-get install libxslt1-dev libxml2-dev zlib1g-dev python python-pip python-dev python3 python3-pip python3-dev
pip install -r requirements.txt -r requirements_test.txt
pip3 install -r requirements.txt -r requirements_test.txt
./droopescan test
個別のテストは-sフラグで実行できます。
./droopescan test -s test_integration_drupal
このプロジェクトはAGPLライセンスの下でライセンスされています。LICENSEファイルを参照してください。