当前位置:网站首页>SQL injection HTTP header injection
SQL injection HTTP header injection
2022-07-07 05:04:00 【In a word, the Trojan horse (the growth road of Wang an Xiaobai)】
Catalog
One 、http Head injection -User-Agent
Two 、http Head injection -- x-forwarded-for
3、 ... and 、http Head injection -- Referer
One 、http Head injection -User-Agent
1.user-agent What is it?
The user agent (User Agent, abbreviation UA), Is a special string header , Enables the server to identify the operating system And version 、CPU type 、 browser And version 、 Browser rendering engine 、 Browser language 、 Browser plug-in etc. .
2.http Head (user-agent) Principle of injection
Because the back-end pair user-agent The data of is saved in the data , At this point, we can use SQL Inject .
3.http Head (user-agent) Implementation of Injection
3.1. open sqlilabs/Less-18/index.php, Open before entering password and user name burp suite Tools . Click on submit Get packets .
3.2. Get packet usage burp suite Of repeater Module operation
3.3. First, in the user-agent Add characters to see if it can cause an error , Then try to close
3.4. closed , Due to the use and '1'='1 closed , therefore payload Need to be in and Front write
3.5. Because the error message can be echoed , So you can use error injection to get the current database
payload:' and updatexml(1,concat(0x7e,(select database()),0x7e),1) and '1'='1
Two 、http Head injection -- x-forwarded-for
1. What is? x-forwarded-for
X-Forwarded-For(XFF) Is used to identify the pass HTTP agent or Load balancing Way to connect to Web The server The most original client IP Address Of HTTP Request header field .
effect : get HTTP The requester is real IP
2.x-forwarder-for Injection principle
x-forwarder-for Injection and user-agent The injection principle is similar , The back end saves the data to the database
3.x-forwarder-for Implementation of Injection
3.1. open sqlilabs/Less-18/index.php, Open before entering password and user name burp suite Tools . Click on submit Get packets .
3.2. Add X-forwarded-for Field . Before adding a field, it is host Address .
3.3 After adding X-forwarded-for After the field IP The address is IP Address .
3.4. Add a single quotation mark after the field to see if it can cause an error .
3.5 Try to close
3.6 Use error injection to obtain the database name of the current database
payload:X-forwarded-for:172.63.25.3' and updatexml(1,concat(0x7e,(selectdatabase()),0x7e),1) and '1'='1 .
3、 ... and 、http Head injection -- Referer
1. What is? referer
Referer yes http A field in the request header in the request package , It means this url The source of the .
2.referer Injection principle
Similar to the two above , The back-end code will referer The parameters in the field are saved to the database .
3.referer Implementation of Injection
3.1. open sqlilabs/Less-19/index.php, Open before entering password and user name burp suite Tools . Click on submit Get packets .
3.2. Add a single quotation mark directly after the field to see if it can cause an error
3.3 Try to close Use and '1'='1 Successfully closed
3.4 Use error injection to view the current database name
payload:' and extractvalue(1,concat(0x7e,(select database()),0x7e)) and '1'='1
边栏推荐
- C语言中函数指针与指针函数
- Operand of null-aware operation ‘!‘ has type ‘SchedulerBinding‘ which excludes null.
- [digital analog] source code of MATLAB allcycles() function (not available before 2021a)
- Ansible中的inventory主机清单(预祝你我有数不尽的鲜花和浪漫)
- PLC Analog output analog output FB analog2nda (Mitsubishi FX3U)
- 想要选择一些部门优先使用 OKR, 应该如何选择试点部门?
- Tiktok may launch an independent grass planting community platform: will it become the second little red book
- The execution order of return in JS' try catch finally
- 【PHP SPL笔记】
- No experts! Growth secrets for junior and intermediate programmers and "quasi programmers" who are still practicing in Universities
猜你喜欢
Field data acquisition and edge calculation scheme of CNC machine tools
ThinkPHP关联预载入with
Weebly mobile website editor mobile browsing New Era
指针与数组在函数中输入实现逆序输出
U++ 游戏类 学习笔记
《二》标签
Markdown编辑器
Ansible reports an error: "MSG": "invalid/incorrect password: permission denied, please try again“
JDBC link Oracle reference code
Mysql database (basic)
随机推荐
Time complexity & space complexity
全国气象数据/降雨量分布数据/太阳辐射数据/NPP净初级生产力数据/植被覆盖度数据
Basic knowledge of road loss of 3GPP channel model
Weebly移动端网站编辑器 手机浏览新时代
Ansible reports an error: "MSG": "invalid/incorrect password: permission denied, please try again“
npm ERR! 400 Bad Request - PUT xxx - “devDependencies“ dep “xx“ is not a valid dependency name
史上最全学习率调整策略lr_scheduler
Why do many people misunderstand technical debt
Servicemesh mainly solves three pain points
JS variable case output user name
MySQL数据库(基础篇)
npm ERR! 400 Bad Request - PUT xxx - “devDependencies“ dep “xx“ is not a valid dependency name
3GPP信道模型路损基础知识
U++ 元数据说明符 学习笔记
Leetcode minimum difference in student scores
IMS data channel concept of 5g vonr+
R language principal component PCA, factor analysis, clustering analysis of regional economy analysis of Chongqing Economic Indicators
JS also exports Excel
STM32F103实现IAP在线升级应用程序
Terms used in the Web3 community