当前位置:网站首页>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

边栏推荐
- Decorator basic learning 02
- Chapter 9 Yunji datacanvas company won the highest honor of the "fifth digital finance innovation competition"!
- [digital analog] source code of MATLAB allcycles() function (not available before 2021a)
- Leetcode minimum difference in student scores
- CentOS 7.9安装Oracle 21c历险记
- Why do many people misunderstand technical debt
- Chapter 9 Yunji datacanvas company has been ranked top 3 in China's machine learning platform market
- Pointer and array are input in function to realize reverse order output
- npm ERR! 400 Bad Request - PUT xxx - “devDependencies“ dep “xx“ is not a valid dependency name
- sublime使用技巧
猜你喜欢

offer如何选择该考虑哪些因素

Flask project uses flask socketio exception: typeerror: function() argument 1 must be code, not str

Chapter 9 Yunji datacanvas company has been ranked top 3 in China's machine learning platform market

torch optimizer小解析

一文搞懂常见的网络I/O模型

Vscode automatically adds a semicolon and jumps to the next line

CentOS 7.9安装Oracle 21c历险记

When knative meets webassembly

Inventory host list in ansible (I wish you countless flowers and romance)

How does vscade use the built-in browser?
随机推荐
精彩速递|腾讯云数据库6月刊
一个酷酷的“幽灵”控制台工具
Dynamically generate tables
Ansible中的inventory主机清单(预祝你我有数不尽的鲜花和浪漫)
Ansible overview and module explanation (you just passed today, but yesterday came to your face)
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
【二叉树】二叉树寻路
If you ask me about R code debugging, I will tell you head, STR, help
深入解析Kubebuilder
[736. LISP syntax parsing]
01机器学习相关规定
Chapter 9 Yunji datacanvas company won the highest honor of the "fifth digital finance innovation competition"!
U++ game learning notes
AOSP ~Binder 通信原理 (一) - 概要
Ansible中的inventory主機清單(預祝你我有數不盡的鮮花和浪漫)
Terms used in the Web3 community
R descriptive statistics and hypothesis testing
当 Knative 遇见 WebAssembly
Windows are not cheap things
如何设计 API 接口,实现统一格式返回?