当前位置:网站首页>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
边栏推荐
- 腾讯云数据库公有云市场稳居TOP 2!
- Leetcode notes
- Inventory host list in ansible (I wish you countless flowers and romance)
- [Yugong series] go teaching course 005 variables in July 2022
- R descriptive statistics and hypothesis testing
- ThinkPHP关联预载入with
- STM32 encapsulates the one key configuration function of esp8266: realize the switching between AP mode and sta mode, and the creation of server and client
- [practice leads to truth] is the introduction of import and require really the same as what is said on the Internet
- 《五》表格
- PLC模拟量输出 模拟量输出FB analog2NDA(三菱FX3U)
猜你喜欢
A row of code r shows the table of Cox regression model
批量归一化(标准化)处理
Techniques d'utilisation de sublime
记录一次压测经验总结
MySQL数据库(基础篇)
C语言中函数指针与指针函数
【愚公系列】2022年7月 Go教学课程 005-变量
U++ 游戏类 学习笔记
Section 1: (3) logic chip process substrate selection
- [email protected] Mapping relatio"/>
Why JSON is used for calls between interfaces, how fastjson is assigned, fastjson 1.2 [email protected] Mapping relatio
随机推荐
Comparison between thread and runnable in creating threads
Windows are not cheap things
【愚公系列】2022年7月 Go教学课程 005-变量
What is Web3
Field data acquisition and edge calculation scheme of CNC machine tools
第一篇论文的写作流程
Factor analysis r practice (with R installation tutorial and code)
If you‘re running pod install manually, make sure flutter pub get is executed first.
Some understandings about 01 backpacker
【數模】Matlab allcycles()函數的源代碼(2021a之前版本沒有)
offer如何选择该考虑哪些因素
Gavin teacher's perception of transformer live class - rasa project actual combat e-commerce retail customer service intelligent business dialogue robot microservice code analysis and dialogue experim
JS 的 try catch finally 中 return 的执行顺序
谈谈讲清楚这件事的重要性
[Yugong series] go teaching course 005 variables in July 2022
Leetcode minimum difference in student scores
窗口可不是什么便宜的东西
Pointer and array are input in function to realize reverse order output
Why do many people misunderstand technical debt
记录一次压测经验总结