SquareCTF-2023 Web Writeups

news/2024/5/19 21:56:40 标签: 前端, Web安全, CTF

官方wp:CTFtime.org / Square CTF 2023 tasks and writeups

sandbox

Description:

I “made” “a” “python” “sandbox” “”“”

nc 184.72.87.9 8008

先nc连上看看,只允许一个单词,空格之后的直接无效了。

image-20231118031937600

flag就在当前目录下的flag.txt文件中,我们用<来代替空格

cat<flag.txt

image-20231118032626824

There’s plenty of ways to break the sandbox, the two easiest that come to mind are cat${IFS}flag or python3 -> open(“flag.txt”, “r”).read()

Be The Admin

Description:

This is a very basic website where you can view other user’s profiles, but you can only see your own secret. I’ll bet other users’ secrets have something of interest

用户身份是通过Cookie认证的,Cookie就是用户名的base64编码(暂且认为)

image-20231118024233142

那我们把session改成Admin的base64编码QWRtaW4=就好啦,删掉一个等号,最后是QWRtaW4。为什么要删掉最后一个等号呢?因为出于安全性考虑,在cookie的名或值中不能使用分号(;)、逗号(,)、等号(=)以及空格。而且等号在base64编码中起到补位作用,去掉也不影响解码后的数据。

image-20231118141757027

image-20231118141807725

Just Go Around

Description: This website is a forum where people can make posts, though it’s so broken right now that you can probably only search them. It turns out that someone posted something top secret and later deleted it, but was it truly deleted?

**Hints: ** Have you heard of “soft deletes”?

官方wp:

The index page of the website provides a search feature that performs fuzzy text search, which should indicate that it uses a modern NoSQL DB. There’s also a commented out link to the post page where you can attempt to create a new post, but when you submit the post, you are redirected to another page that says this feature no longer works. However, you can look at the HTTP requests used in that workflow and see that the post is serialized into XML before submitting, which should prompt you to try an XXE attack. Once you get that working, your goal is to use the XXE as an SSRF to query the backend elasticsearch db and get the “deleted” post. You can get the DB host name “db” by guessing/brute forcing or using the XXE for LFI and reading source/config files (or the env file)

翻译后:

网站的索引页提供了一个搜索功能,执行模糊文本搜索,这应该表明它使用了现代NoSQL数据库。还有一个评论链接到帖子页面,在那里你可以尝试创建一个新的帖子,但是当你提交帖子时,你被重定向到另一个页面,上面说这个功能不再有效。但是,您可以查看该工作流中使用的HTTP请求,并看到文章在提交之前被序列化为XML,这应该提示您尝试XXE攻击。一旦您使其工作,您的目标是使用XXE作为SSRF来查询后端elasticsearch数据库并获取“已删除”的帖子。您可以通过猜测/暴力强制或使用LFI的XXE和读取源/配置文件(或env文件)来获得DB主机名“DB”。


http://www.niftyadmin.cn/n/5200861.html

相关文章

外卖小程序系统:数字化时代餐饮业的技术奇迹

在当今数字化时代&#xff0c;外卖小程序系统正以其强大的技术背后支持&#xff0c;成为餐饮业务的一项奇迹。这个系统不仅提供了便捷的点餐体验&#xff0c;更通过先进的技术手段&#xff0c;实现了高效订单处理、智能推荐以及实时配送追踪。下面&#xff0c;我们将深入探讨外…

OpenLayers实战,WebGL图层根据Feature要素的变量动态渲染多种颜色的三角形,适用于大量三角形渲染不同颜色

专栏目录: OpenLayers实战进阶专栏目录 前言 本章使用OpenLayers根据Feature要素的变量动态渲染不同颜色的三角形。 通过一个WebGL图层生成四种不同颜色的图形要素,适用于WebGL图层需要根据大量点要素区分颜色显示的需求。 更多的WebGL图层使用运算符动态生成样式的内容将会…

使用netty实现WebSocket协议通信

服务器与浏览器之间实现通信&#xff0c;一般都是由浏览器发起http请求&#xff0c;服务端对http请求进行响应&#xff0c;要实现服务端主动向浏览器推送数据&#xff0c;一般采用的方案都是websocket主动推送&#xff0c;或者前端实现轮询方式拉取数据&#xff0c;轮询方式多少…

渲染器——简单Diff算法

介绍渲染器的核心 Diff 算法。简单来说&#xff0c;当新旧 vnode 的子节点都是一组节点时&#xff0c;为了以最小的性能开销完成更新操作&#xff0c;需要比较两组子节点&#xff0c;用于比较的算法就叫作 Diff 算法。我们知道&#xff0c;操作 DOM 的性能开销通常比较大&#…

锯木棍

题目描述 有一根粗细均匀长度为 L 的木棍&#xff0c;先用红颜色刻度线将它 m 等分&#xff0c;再用蓝色刻度线将 其 n 等分&#xff08; m>n &#xff09;&#xff0c;然后按所有刻度线将该木棍锯成小段&#xff0c;计算并输出长度最长的木棍的长度和根数。 输入格式…

如何在外部数据库中存储空间化表时使用Mapinfo_mapcatalog

开始创建地图目录表之前 您将使用EasyLoader在要使用的数据库中创建地图目录表。EasyLoader与MapInfo Pro一起安装。 &#xff08;工具“DBMS_Catalog”不再随MapInfo Professional 64位一起提供&#xff0c;因为它的功能可以在EasyLoader工具中找到。&#xff09; ​ 注&…

matlab求矩阵的伪逆或者负二分之一次方

如果X不是满秩矩阵的时候&#xff0c;那么不能使用inv()函数来求X的逆&#xff0c;因为X此时不存在逆&#xff0c;但是我们可以求X的伪逆。 &#xff08;1&#xff09;有以下两种方法求X的伪逆&#xff1a; 假设 X[1 2 1;1 2 1;2 3 4]; 1, pinvXpinv(X); 2, [U,D,P]svd(X); r…