
CVE-2017-5638 の悪用可能なターゲット
完全に基づく: https://github.com/piesecurity/apache-struts2-CVE-2017-5638
フレームワークのリファレンスプロジェクトがコンテナにデプロイされるが、悲惨な結果を招く現実的なシナリオ。慣れるためにコードを見てコンパイルしてください。また、dockerfileを調査してください - 何か特定の点が注意を引くでしょうか?
日常の判断と連鎖する複数の脆弱性がいかに簡単に悪用されるかを示しています。
前提条件:
準備:
./mvnw clean package を実行docker build -t hackme \. を実行docker run -d -p 9080:8080 hackme を実行注意: Dockerがインストールされていない場合は、./mvnw jetty:run を実行できます
RCEのテストを開始するには、exploit.py ファイルを実行:
python exploit.py http://localhost:9080/orders/3 "CMD" を実行java -jar jython*.jar exploit.py http://localhost:9080/orders/3 "CMD" を実行異なるCMDで試してみてください。例:
pwd - 現在の場所は?whomai - どのユーザーで実行しているか?ls -la - ディレクトリ内には何がある?ls / - マシンの構成は?ls /etc - 他に何が見つかる?Nexus Lifecycleのコンポーネント情報パネルを使用して、struts2-coreの脆弱性のないバージョンを特定してください。 POMをそのバージョンに更新して再ビルドしてください。また、Dockerイメージを再ビルドして実行し、攻撃を再試行することもできます。
また、ここのIssuesを確認してDepShieldの結果を参照してください
https://github.com/apache/struts/tree/master/apps/rest-showcase
README.txt - Rest Showcase Webapp
Rest Showcase is a simple example of REST app build with the REST plugin.
For more on getting started with Struts, see
* http://cwiki.apache.org/WW/home.html
I18N:
=====
Please note that this project was created with the assumption that it will be run
in an environment where the default locale is set to English. This means that
the default messages defined in package.properties are in English. If the default
locale for your server is different, then rename package.properties to package_en.properties
and create a new package.properties with proper values for your default locale.