30回 初心者のためのセキュリティ勉強会(オンライン開催)で発表した Web Cache Deception Attack のデモです
発表資料はこちら
なにか質問等あればTwitterで連絡ください
- 本リポジトリをクローンします
git clone [email protected]:kuzushiki/cache-deception-demo.git
- ディレクトリを移動します
cd cache-deception-demo
- Docker Composeでコンテナを起動します
docker compose up
- URLにアクセスして、ページが表示されることを確認します
http://localhost:12345
- 適当なブラウザでURLにアクセスします
http://localhost:12345
-
ログインページにて、ID:
adminPW:adminでログインします -
ログイン後の管理者ページ (http://localhost:12345/index.php) にてセンシティブな情報 (
phpinfo()) が出力されていることを確認しましょう
- (攻撃者が作成した罠リンクにアクセスする体で) 下記のようなURLにアクセスします
管理者のページが返ってくることを確認しましょう
http://localhost:12345/index.php/hogehoge.css
- 新しいシークレットウィンドウを立ち上げ、管理者ページ (http://localhost:12345/index.php) にアクセスします
Cookieが発行されていないため、ログインページに飛ばされることでしょう
- 手順4でアクセスしたURLにシークレットウィンドウでアクセスします
キャッシュされた管理者ページのコンテンツが返ってくることを確認しましょう
phpinfo()の出力に被害者のCookieの値が含まれることを利用して、
Cookie内のPHPSESSIDの値を管理者ページ内のPHPSESSIDの値に差し替えてみましょう
- その後、管理者ページ (http://localhost:12345/index.php) にアクセスすると管理者ページのコンテンツが表示されます
被害者になりすますことができました (いわゆるAccount Takeover)






