This commit is contained in:
2025-12-31 16:00:29 +00:00
commit 3688f93d5d
310 changed files with 93400 additions and 0 deletions

331
2021/11/27/createctf.html Normal file
View File

@@ -0,0 +1,331 @@
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<!-- Begin Jekyll SEO tag v2.8.0 -->
<title>记一次CTF出题的经历 | Mayx的博客</title>
<meta name="generator" content="Jekyll v3.9.5" />
<meta property="og:title" content="记一次CTF出题的经历" />
<meta name="author" content="mayx" />
<meta property="og:locale" content="zh_CN" />
<meta name="description" content="现在我终于把CTF的全流程都体验了一遍" />
<meta property="og:description" content="现在我终于把CTF的全流程都体验了一遍" />
<meta property="og:site_name" content="Mayx的博客" />
<meta property="og:type" content="article" />
<meta property="article:published_time" content="2021-11-27T00:00:00+08:00" />
<meta name="twitter:card" content="summary" />
<meta property="twitter:title" content="记一次CTF出题的经历" />
<meta name="google-site-verification" content="huTYdEesm8NaFymixMNqflyCp6Jfvd615j5Wq1i2PHc" />
<meta name="msvalidate.01" content="0ADFCE64B3557DC4DC5F2DC224C5FDDD" />
<meta name="yandex-verification" content="fc0e535abed800be" />
<script type="application/ld+json">
{"@context":"https://schema.org","@type":"BlogPosting","author":{"@type":"Person","name":"mayx"},"dateModified":"2021-11-27T00:00:00+08:00","datePublished":"2021-11-27T00:00:00+08:00","description":"现在我终于把CTF的全流程都体验了一遍","headline":"记一次CTF出题的经历","mainEntityOfPage":{"@type":"WebPage","@id":"/2021/11/27/createctf.html"},"publisher":{"@type":"Organization","logo":{"@type":"ImageObject","url":"https://avatars0.githubusercontent.com/u/17966333"},"name":"mayx"},"url":"/2021/11/27/createctf.html"}</script>
<!-- End Jekyll SEO tag -->
<link rel="canonical" href="https://mabbs.github.io/2021/11/27/createctf.html" />
<link type="application/atom+xml" rel="alternate" href="/atom.xml" title="Mayx的博客" />
<link rel="alternate" type="application/rss+xml" title="Mayx的博客(RSS)" href="/rss.xml" />
<link rel="alternate" type="application/json" title="Mayx的博客(JSON Feed)" href="/feed.json" />
<link rel="stylesheet" href="/assets/css/style.css?v=1767196818" />
<!--[if !IE]> -->
<link rel="stylesheet" href="/Live2dHistoire/live2d/css/live2d.css" />
<!-- <![endif]-->
<link rel="search" type="application/opensearchdescription+xml" href="/opensearch.xml" title="Mayx的博客" />
<link rel="webmention" href="https://webmention.io/mabbs.github.io/webmention" />
<link rel="pingback" href="https://webmention.io/mabbs.github.io/xmlrpc" />
<link rel="preconnect" href="https://summary.mayx.eu.org" crossorigin="anonymous" />
<link rel="prefetch" href="https://www.blogsclub.org/badge/mabbs.github.io" as="image" />
<link rel="blogroll" type="text/xml" href="/blogroll.opml" />
<link rel="me" href="https://github.com/Mabbs" />
<script src="/assets/js/jquery.min.js"></script>
<!--[if lt IE 9]>
<script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery-ajaxtransport-xdomainrequest/1.0.3/jquery.xdomainrequest.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/respond.js/1.4.2/respond.min.js"></script>
<![endif]-->
<script>
var lastUpdated = new Date("Thu, 01 Jan 2026 00:00:18 +0800");
var BlogAPI = "https://summary.mayx.eu.org";
</script>
<script src="/assets/js/main.js"></script>
<!--[if !IE]> -->
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async="async" src="https://www.googletagmanager.com/gtag/js?id=UA-137710294-1"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'UA-137710294-1');
</script>
<script src="/assets/js/instant.page.js" type="module"></script>
<!-- <![endif]-->
</head>
<body>
<!--[if !IE]> --><noscript><marquee style="top: -15px; position: relative;"><small>发现当前浏览器没有启用JavaScript这不影响你的浏览但可能会有一些功能无法使用……</small></marquee></noscript><!-- <![endif]-->
<!--[if IE]><marquee style="top: -15px; position: relative;"><small>发现当前浏览器为Internet Explorer这不影响你的浏览但可能会有一些功能无法使用……</small></marquee><![endif]-->
<div class="wrapper">
<header class="h-card">
<h1><a class="u-url u-uid p-name" rel="me" href="/">Mayx的博客</a></h1>
<img src="https://avatars0.githubusercontent.com/u/17966333" fetchpriority="high" class="u-photo" alt="Logo" style="width: 90%; max-width: 300px; max-height: 300px;" />
<p class="p-note">Mayx's Home Page</p>
<form action="/search.html">
<input type="text" name="keyword" id="search-input-all" placeholder="Search blog posts.." />&#160;<input type="submit" value="搜索" />
</form>
<br />
<p class="view"><a class="u-url" href="/Mabbs/">About me</a></p>
<ul class="downloads">
<li style="width: 270px; border-right: none;"><a href="/MayxBlog.tgz">Download <strong>TGZ File</strong></a></li>
</ul>
</header>
<section class="h-entry">
<small><time class="date dt-published" datetime="2021-11-27T00:00:00+08:00">27 November 2021</time> - 字数统计1983 - 阅读大约需要6分钟 - Hits: <span id="/2021/11/27/createctf.html" class="visitors">Loading...</span></small>
<h1 class="p-name">记一次CTF出题的经历</h1>
<p class="view">by <a class="p-author h-card" href="//github.com/Mabbs">mayx</a></p>
<div id="outdate" style="display:none;">
<hr /><p>
这是一篇创建于 <span id="outime"></span> 天前的文章,其中的信息可能已经有所发展或是发生改变。
</p>
</div>
<script>
daysold = Math.floor((new Date().getTime() - new Date("Sat, 27 Nov 2021 00:00:00 +0800").getTime()) / (24 * 60 * 60 * 1000));
if (daysold > 90) {
document.getElementById("outdate").style.display = "block";
document.getElementById("outime").innerHTML = daysold;
}
</script>
<hr />
<b>AI摘要</b>
<p id="ai-output">这篇文章讲述了作者作为CTF比赛的出题者经历。作者结合自己的CTF参赛经验以既有题目和实际漏洞为基础设计了包含绕过Python条件、PHP MD5漏洞题目及利用APICloud加密功能的挑战题目。尽管第一题是拼凑的但第二题和第三题注重原创性分别测试了参赛者代码分析和调试能力。作者对解题结果感到满意指出学信息安全的学生过于依赖解题思路缺乏深入分析代码的能力。文章还提到作者另一次有趣的经历即与其他网友进行XSS漏洞的竞赛。总体上作者认为出题过程对提升自己的渗透思维和找寻真实环境漏洞有帮助并对参赛者的能力进行了评价。</p>
<hr />
<ul><li><a href="#起因">起因</a></li><li><a href="#出了什么题">出了什么题?</a><ul><li><a href="#第一题">第一题</a></li><li><a href="#第二题">第二题</a></li><li><a href="#第三题">第三题</a></li></ul></li><li><a href="#出题感受和其他">出题感受和其他</a></li></ul>
<hr />
<main class="post-content e-content" role="main"><p>现在我终于把CTF的全流程都体验了一遍<!--more--></p>
<h1 id="起因">
<a href="#起因"><svg class='octicon' viewBox='0 0 16 16' version='1.1' width='16' height='32' aria-hidden='true'><path fill-rule='evenodd' d='M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z'></path></svg></a> 起因
</h1>
<p>去年我们学校整了CTF我作为协办方的一员<a href="/2020/11/24/createctf.html">组织了那场比赛</a>而今年又是一年一度的CTF比赛这次我有了组织了经历就想换点别的因为前段时间我还在<a href="/2021/09/06/offlinectf.html">线下打过CTF</a>,相比去年有了更加丰富的经验,所以这次的比赛我就不维护平台了,而是试着去出题。</p>
<h1 id="出了什么题">
<a href="#出了什么题"><svg class='octicon' viewBox='0 0 16 16' version='1.1' width='16' height='32' aria-hidden='true'><path fill-rule='evenodd' d='M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z'></path></svg></a> 出了什么题?
</h1>
<p>说是有丰富的经验但是实际上我又不是信息安全专业的也没有专门去练过怎么打CTF所以我实际上也不咋会出题😂。不过没关系我前几次CTF也有解出来过题目那就用他们的思路来出些题目吧当然在CTF里还是得出点原创题如果直接去抄别人的题还是非常不好的行为毕竟对于这种情况搜到的人会感觉很没意思而对于没搜到的人也很不公平毕竟这不是搜索技能大赛。不过借鉴思路还是没有问题的毕竟对于普通人来说还是得用普通思路解题。</p>
<h2 id="第一题">
<a href="#第一题"><svg class='octicon' viewBox='0 0 16 16' version='1.1' width='16' height='32' aria-hidden='true'><path fill-rule='evenodd' d='M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z'></path></svg></a> 第一题
</h2>
<p>所以第一题我缝合了两年前打过的CTF中一道叫<a href="/2019/12/16/ctf.html">Swedish State Archive</a>的题目和前几个月打过的CTF中一道<a href="/2021/09/06/offlinectf.html">关于PHP判断MD5漏洞</a>的一道题。在这个题中首先要绕过Python的那些条件才能获得PHP的源码而且我没有在git中直接提交flag所以难度比那单个题目更难了获得了PHP的源码之后就可以用那个MD5的漏洞来获得真正的flag了。总的来说难度还可以毕竟这还是正常思路可以解决的问题。最终解出来的情况我也很满意有12个队伍解出来了。</p>
<h2 id="第二题">
<a href="#第二题"><svg class='octicon' viewBox='0 0 16 16' version='1.1' width='16' height='32' aria-hidden='true'><path fill-rule='evenodd' d='M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z'></path></svg></a> 第二题
</h2>
<p>第一题既然用了别人的思路,第二题自然要自己整点有意思的题目。在我弃坑<a href="https://github.com/Mabbs/Mabbs.Project">MaBBS</a>之前,我在项目中发现了严重的安全漏洞,那就是我的程序在创建比如贴子之类的东西是直接用标题作为文件名的,而且我最开始的时候没有做任何的过滤。当时我首先写了一个叫做<code class="language-plaintext highlighter-rouge">danw</code>的函数来过滤有可能出问题的字符但是我只给Wiki部分加了这个过滤函数。这是为啥呢是因为我当时想把贴子整成ID的形式然后把贴子的标题写到meta里面。可惜后来弃坑了就再也没有管这个问题只留下一句只有上帝才能看得懂这个代码就结束了MaBBS。也许<a href="/2019/07/01/mabbs.html">重建MaBBS的计划</a>也再也没有机会完成了毕竟失去了当时写程序的初心现在也只是会写程序罢了……emmmm有点跑题了。总之既然有这样的漏洞那我可以部署出来让我看看那些学信息安全的家伙到底是什么货色看看是真的只会按着解题思路来解题还是真的有分析代码的能力。结果也不出我所料果然全是一群废物除了我曾经告诉过漏洞的人除外没有一个人解出来。不过也正是因为我知道那个题有人可能知道答案所以分数也不会定很高不然我觉得这可能真的无人会解。</p>
<h2 id="第三题">
<a href="#第三题"><svg class='octicon' viewBox='0 0 16 16' version='1.1' width='16' height='32' aria-hidden='true'><path fill-rule='evenodd' d='M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z'></path></svg></a> 第三题
</h2>
<p>第二题可能太原创了对于他们没有接触过实战的人来说不合适所以第三题我和另外一个学信安的朋友一起出这道题我们决定用APICloud他们公司的能力作为这道题难度的上限。APICloud有一个加密HTML源代码的功能目前我们在网上没有搜到已经破解的方案。不过如果网上无人会破那作为出题者的我们自己也破不出来啊……毕竟这个题要是没有方案能解那出题的意义就没有了而且万一要我们自己写WriteUp的话那不就尴尬了。所以我们换了一个思路用它加密本来就不考虑让其他人解密但是我们在里面偷偷放一个可以调试的工具在里面比如vConsole。然后给JS代码二次加密使得解题者只有一条路可以走那就是使用调试功能来干涉程序。这次我们写的是一个抽卡程序目标是点够20亿次才能抽出来。所以这里我们可以直接用调试工具来修改点击次数来实现获得flag其实也主要是我们自己不会才整的这种烂方案。不过这个也不算难发现的人稍微想一想就能解出来所以如果以后有机会我还想再提高一个难度不给vConsole而是写一个请求比如<code class="language-plaintext highlighter-rouge">https://example.com/hello.js</code>然后需要解题者劫持hello.js来实现修改变量这样才更有意思可惜这次出题没想到这一点所以只能出个比较简单的。不过那群信安的家伙真的还是不行这么简单的题居然只有一个队伍解出来不过他能解出来我也觉得挺不错的证明他的思维比较开阔不那么局限。</p>
<h1 id="出题感受和其他">
<a href="#出题感受和其他"><svg class='octicon' viewBox='0 0 16 16' version='1.1' width='16' height='32' aria-hidden='true'><path fill-rule='evenodd' d='M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z'></path></svg></a> 出题感受和其他
</h1>
<p>这次CTF出题感觉还是挺有意思的而且挖坑还要想到自己怎么填这个也对找坑很有帮助。毕竟大多数情况真正的环境漏洞不会按常规路走能按常规路走的漏洞绝大多数情况都已经被人踏过了所以思维要开阔真正优秀的渗透工程师肯定是思路开阔想法很独特而目前那些学信安的就是一群思维固化除了解题不懂得其他东西的家伙以后找不到坑就等着背锅吧😂。 </p><p>
另外上个月末我还遇到一次很有意思的事情,有一个叫做<a href="https://icp.gov.moe/">萌国ICP备案</a>的网站有个XSS漏洞于是我和同在那个网站上的几个网友进行了一次XSS AWD大战为了自己链接的特效而战非常的有意思可惜这个月初我生病了没能记录下这有趣的事情等我过两天再次想写博客时就分享一下这个有趣的事情吧</p></main>
<small style="display: block">tags: <a rel="category tag" class="p-category" href="/search.html?keyword=CTF"><em>CTF</em></a> - <a rel="category tag" class="p-category" href="/search.html?keyword=%E8%AE%B0%E5%BD%95"><em>记录</em></a> <span style="float: right;"><a href="https://gitlab.com/mayx/mayx.gitlab.io/tree/master/_posts/2021-11-27-createctf.md">查看原始文件</a></span></small>
<h4 style="border-bottom: 1px solid #e5e5e5;margin: 2em 0 5px;">推荐文章</h4>
<p id="suggest-container">Loading...</p>
<script>
var suggest = $("#suggest-container");
$.get(BlogAPI + "/suggest?id=/2021/11/27/createctf.html&update=" + lastUpdated.valueOf(), function (data) {
if (data.length) {
getSearchJSON(function (search) {
suggest.empty();
var searchMap = {};
for (var i = 0; i < search.length; i++) {
searchMap[search[i].url] = search[i];
}
var tooltip = $('<div class="content-tooltip"></div>').appendTo('body').hide();
for (var j = 0; j < data.length; j++) {
var item = searchMap[data[j].id];
if (item) {
var link = $('<a href="' + item.url + '">' + item.title + '</a>');
var contentPreview = item.content.substring(0, 100);
if (item.content.length > 100) {
contentPreview += "……";
}
link.hover(
function(e) {
tooltip.text($(this).data('content'))
.css({
top: e.pageY + 10,
left: e.pageX + 10
})
.show();
},
function() {
tooltip.hide();
}
).mousemove(function(e) {
tooltip.css({
top: e.pageY + 10,
left: e.pageX + 10
});
}).data('content', contentPreview);
suggest.append(link);
suggest.append(' - ' + item.date + '<br />');
}
}
});
} else {
suggest.html("暂无推荐文章……");
}
});
</script>
<br />
<div class="pagination">
<span class="prev">
<a href="/2021/10/23/microsoft.html">
上一篇:微软产品使用体验与感想
</a>
</span>
<br />
<span class="next">
<a href="/2021/11/28/spam.html">
下一篇Mayx被拍了糟糕的视频
</a>
</span>
</div>
<!--[if !IE]> -->
<link rel="stylesheet" href="/assets/css/gitalk.css">
<script src="/assets/js/gitalk.min.js"></script>
<div id="gitalk-container"></div>
<script>
var gitalk = new Gitalk({
clientID: '36557aec4c3cb04f7ac6',
clientSecret: 'ac32993299751cb5a9ba81cf2b171cca65879cdb',
repo: 'mabbs.github.io',
owner: 'Mabbs',
admin: ['Mabbs'],
id: '/2021/11/27/createctf', // Ensure uniqueness and length less than 50
distractionFreeMode: false, // Facebook-like distraction free mode
proxy: "https://cors-anywhere.mayx.eu.org/?https://github.com/login/oauth/access_token"
})
gitalk.render('gitalk-container')
</script>
<!-- <![endif]-->
</section>
<!--[if !IE]> -->
<div id="landlord" style="left:5px;bottom:0px;">
<div class="message" style="opacity:0"></div>
<canvas id="live2d" width="500" height="560" class="live2d"></canvas>
<div class="live_talk_input_body">
<form id="live_talk_input_form">
<div class="live_talk_input_name_body" >
<input type="checkbox" id="load_this" />
<input type="hidden" id="post_id" value="/2021/11/27/createctf.html" />
<label for="load_this">
<span style="font-size: 11px; color: #fff;">&#160;想问这篇文章</span>
</label>
</div>
<div class="live_talk_input_text_body">
<input name="talk" type="text" class="live_talk_talk white_input" id="AIuserText" autocomplete="off" placeholder="要和我聊什么呀?" />
<button type="submit" class="live_talk_send_btn" id="talk_send">发送</button>
</div>
</form>
</div>
<input name="live_talk" id="live_talk" value="1" type="hidden" />
<div class="live_ico_box" style="display:none;">
<div class="live_ico_item type_info" id="showInfoBtn"></div>
<div class="live_ico_item type_talk" id="showTalkBtn"></div>
<div class="live_ico_item type_music" id="musicButton"></div>
<div class="live_ico_item type_youdu" id="youduButton"></div>
<div class="live_ico_item type_quit" id="hideButton"></div>
<input name="live_statu_val" id="live_statu_val" value="0" type="hidden" />
<audio src="" style="display:none;" id="live2d_bgm" data-bgm="0" preload="none"></audio>
<input id="duType" value="douqilai" type="hidden" />
</div>
</div>
<div id="open_live2d">召唤伊斯特瓦尔</div>
<!-- <![endif]-->
<footer>
<p>
<small>Made with ❤ by Mayx<br />Last updated at 2026-01-01 00:00:18<br /> 总字数614622 - 文章数178 - <a href="/atom.xml" >Atom</a> - <a href="/README.html" >About</a></small>
</p>
</footer>
</div>
<script src="/assets/js/scale.fix.js"></script>
<!--[if !IE]> -->
<script src="/assets/js/main_new.js"></script>
<script src="/Live2dHistoire/live2d/js/live2d.js"></script>
<script src="/Live2dHistoire/live2d/js/message.js"></script>
<!-- <![endif]-->
</body>
</html>

364
2021/11/28/spam.html Normal file

File diff suppressed because one or more lines are too long