Live2D

UWSP Pointer Overflow CTF

Sight Without Vision

image
翻译了一下
您寻求的解决方案近在咫尺。我会给你一些线索......你也有一个。你走到哪里都带着它,但它并不重。它可以是干净的,也可以是泥巴。它不会改变玫瑰的气味。您将需要这个和这个: poctf{uwsp_ _ _ }
得到 在this那里给了一个超链接
https://md5decrypt.net/en/Leet-translator/
image
所以flag为
poctf{uwsp_519h7_w17h0u7_v1510n}

Here You See A Passer By

image
得到题目下载得到附件为一张迷宫图
根据走出迷宫即可得到flag
image
所以flag:poctf{uwsp_pr377y_bu7_p377y_bu7_pr337y}

Better to Burn in the Light

得到题目
image
翻译得到
这是曾经包含多个文件的磁盘映像。不幸的是,它们在成像之前就被删除了。为了找到这面旗帜,我们需要把它们中的一些人从死里复活。这面旗帜实际上是在他们两个之间分解的。从映像中雕刻出文件并恢复任何丢失的文件头,以找到要重新组合的部分。
猜测为一个镜像取证题目
使用取证工具 AXIOMProcess
image
继续下一步
选择证据源'计算机'-'windows'-'加载证据'-'镜像'
然后下一步
image
开始分析
image
选择 查看所有使用痕迹类别
image
在媒体这里看到两张图片
image
poctf{uwsp_5h1v
image
3r_m3_71mb3r5}
但是中间的'r'和'm'比较模糊,看不清楚
这是我非预期的效果。查询wp发现其他人是通过d.docx修改文件头得到图片查看flag2的图片
我使用的工具为 RStudioPortable
image
导入文件扫描
image
这个doc文件点进去很明显看到jpg的文件格式
image
将其导出 补全其文件头 FFD8FFE0
image
得到flag2图片
继续往下滑
image
将m.jpg图片导出 查看其16进制发现有两个文件头,删除一个
image
得到flag1图片,虽然有点模糊,比前面的flag2图片好一点
poctf{uwsp_5h1v3r_m3_71mb3r5}

We Rest Upon a Single Hope

image
得到题目,翻译一下
我们寄托于一个希望
我是 Vinz,Vinz Clortho,Gozer 的 Keymaster。Volguus Zildrohar,Sebouillia 领主。你是看门人吗?
得到网址,是一个输入框
image
随便输入一个数字在url会显示?key=___ (一开始以为是sql注入,但还是习惯性的F12一下看到源码)
image

点击查看代码
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<META charset="utf-8"/>

<HTML>
  <HEAD>
    <TITLE>I dreamed a dream the other night...</TITLE>
    <LINK rel="stylesheet" type="text/css" href="./static/style.css">
	<SCRIPT>
		function Gozer(key) {
			var hash = 0, i, chr;
			for (i = 0; i < key.length; i++) {
				chr   = key.charCodeAt(i);
				hash  = ((hash << 5) - hash) + chr;
				hash |= 0;
			}
			return hash;
		}
		function conv(s)	{
			var a = [];
			for (var n = 0, l = s.length; n < l; n ++) {
				var hex = Number(s.charCodeAt(n)).toString(16);
				a.push(hex);
			}
			return a.join('');
		}
		function Zuul(key) {
			if (key == v) {
				var Gatekeeper = [];
				var y = [];
				var z = [];
				Gatekeeper[0] = "706f6374667b75777370";
				Gatekeeper[1] = "formal";
				Gatekeeper[2] = "88410";
				for (var i = 0, l = Gatekeeper[0].length; i < l; i ++) {
					if (i == 0 || i % 2 == 0) {
						y += String.fromCharCode(parseInt((Gatekeeper[0].substring(i, i+2)), 16));
					}
				}
				z[0] = y;
				z[1] = Gatekeeper[2][3];
				z[2] = Gatekeeper[2][2] + Gatekeeper[1][3];
				z[3] = z[2][0] + Gatekeeper[1][5] + Gatekeeper[1][5];
				z[4] = (Gatekeeper[2]/12630) + "h" + z[2][0] + (Gatekeeper[2][0]-1);
				z[5] = z[4][0] + z[4][1] + '3' + Gatekeeper[1][2] + '3';
				z[6] = (Gatekeeper[2]/Gatekeeper[2]) + '5';
				z[7] = (Gatekeeper[2]*0) + Gatekeeper[1][0];
				z[8] = (Gatekeeper[2]/12630) + "h" + '3';
				z[9] = Gatekeeper[1][3] + (Gatekeeper[2]*0) + '5' + (Gatekeeper[2][0]-1);
				z[10] = 'r' + '3' + z[2][0] + Gatekeeper[1][5] + '}';
				console.log(z.join("_"));
			} else {
				console.log("Gozer the Traveler. He will come in one of the pre-chosen forms. During the rectification of the Vuldrini, the traveler came as a large and moving Torg! Then, during the third reconciliation of the last of the McKetrick supplicants, they chose a new form for him: that of a giant Slor! Many Shuvs and Zuuls knew what it was to be roasted in the depths of the Slor that day, I can tell you!");
			}
		}
		var p = navigator.mimeTypes+navigator.doNotTrack;
		var o = navigator.deviceMemory;
		var c = navigator.vendor+navigator.userAgent;
		var t = navigator.product+p;
		var f = o+c+p;
		var v = Gozer(p/((o+c)*t)+f);
	</SCRIPT>
  </HEAD>

  <BODY>
    <H1>We rest upon a single hope...</H1>
	<FORM name="Gatekeeper">
		<DIV>
		    <LABEL>Are you the Keymaster?</LABEL>
			<INPUT id="key" name="key" type="password">
		</DIV>
		<DIV>
			<INPUT id="login" type="submit" value="Submit" onclick="return Zuul(key.value)">
		</DIV>
	</FORM>
  </BODY>
</HTML>

观察到 Gatekeeper[0] = "706f6374667b75777370" 这一段,于是hex解码一下
image
poctf{uwsp
于是开始读代码发现

点击查看解析
Gozer 函数:
这个函数接收一个字符串参数 key。
通过循环遍历输入字符串的每个字符,将字符的 Unicode 编码加入到一个计算的哈希值中。
最终返回计算得到的哈希值。

conv 函数:
这个函数接收一个字符串参数 s。
将输入字符串中每个字符的 Unicode 编码转换为十六进制表示,并存储在一个数组中。
返回将数组中的十六进制值连接成的字符串。

Zuul 函数:
这个函数接收一个参数 key,通常是用户输入的值。
如果输入的 key 等于之前定义的变量 v,则执行一系列操作,生成一组字符串并输出到控制台。
如果不相等,输出一段默认的文本。

加密比对过程:
在代码的末尾,通过一系列浏览器属性的值计算了一个变量 v,该值为调用 Gozer 函数计算得到的哈希值。
在 Zuul 函数中,通过比对用户输入的 key 是否等于 v,来决定是否执行一系列操作。

具体操作:
在相等的情况下,使用一个事先定义好的数组 Gatekeeper 中的值进行一些运算和拼接,最终输出一组字符串到控制台。
在不相等的情况下,输出一段默认的文本

于是我尝试直接在控制台将if (key == v)改为if (1),如下:

if (1) {
    var Gatekeeper = [];
    var y = [];
    var z = [];
    Gatekeeper[0] = "706f6374667b75777370";
    Gatekeeper[1] = "formal";
    Gatekeeper[2] = "88410";
    for (var i = 0, l = Gatekeeper[0].length; i < l; i ++) {
        if (i == 0 || i % 2 == 0) {
y += String.fromCharCode(parseInt((Gatekeeper[0].substring(i, i+2)), 16));
        }
    }
    z[0] = y;
    z[1] = Gatekeeper[2][3];
    z[2] = Gatekeeper[2][2] + Gatekeeper[1][3];
    z[3] = z[2][0] + Gatekeeper[1][5] + Gatekeeper[1][5];
    z[4] = (Gatekeeper[2]/12630) + "h" + z[2][0] + (Gatekeeper[2][0]-1);
    z[5] = z[4][0] + z[4][1] + '3' + Gatekeeper[1][2] + '3';
    z[6] = (Gatekeeper[2]/Gatekeeper[2]) + '5';
    z[7] = (Gatekeeper[2]*0) + Gatekeeper[1][0];
    z[8] = (Gatekeeper[2]/12630) + "h" + '3';
    z[9] = Gatekeeper[1][3] + (Gatekeeper[2]*0) + '5' + (Gatekeeper[2][0]-1);
    z[10] = 'r' + '3' + z[2][0] + Gatekeeper[1][5] + '}';
    console.log(z.join("_"));
}

效果如下
image
poctf{uwsp_1_4m_4ll_7h47_7h3r3_15_0f_7h3_m057_r34l}
这是非预期的效果,

我直接if(1)
将 if (key == v) 改为 if (1),实际上是将条件判断的逻辑修改为始终为真。这意味着无论用户输入什么值作为密钥,都会满足条件,因为 if (1) 始终为真。

这导致了以下情况:
首先,代码块内的操作将被执行,包括生成一组字符串并输出到控制台。
由于条件始终为真,将忽略 else 块内的代码,即默认的文本输出不会执行。
因此,当你在浏览器控制台中测试时,无论输入什么值,都会执行 if (1) 内的操作,导致输出一组字符串,这可能被认为是 "flag"。
需要注意的是,这种修改只是为了演示和测试,并不符合实际应用中的安全标准。在真实的应用中,安全验证应该依赖于实际的密钥验证逻辑,而不是硬编码为 if (1) 这样的条件。

之后我查询wp的解析
其他师傅先随便输入一个数字,通过console.log(数字)在控制台获取数值再用Zuul(数值)输出flag

通过查询
1.URL参数传递: 通过在URL中添加 ?key=随便一个数字,将一个数字作为键(key)的值传递给页面。
2.JavaScript计算: 页面加载时,JavaScript 通过获取 URL 参数的方式得到传递的数字。在你提供的代码中,这个数字被计算为 v = Gozer(p/((o+c)*t)+f),其中 p、o、c、t、f 是一些浏览器属性的信息。
3.控制台输出: 使用 console.log(v) 将计算得到的数字输出到浏览器控制台。
4.手动填入函数: 将输出的数字手动填入 Zuul 函数的调用中,例如 Zuul(输出的数字)。
5.获取 flag: 如果填入的数字满足 if (key == v) 中的条件,将执行相应的操作并输出 flag。

image
得到flag

最后附上加密过程
function Zuul(key) {
    // 判断输入的 key 是否等于之前定义的变量 v
    if (key == v) {
        // 如果相等,执行以下操作

        // 定义一个数组 Gatekeeper,存储一些十六进制字符串
        var Gatekeeper = [];
        // 定义两个空数组 y 和 z,用于存储后续处理的结果
        var y = [];
        var z = [];

        // Gatekeeper 数组的元素赋值
        Gatekeeper[0] = "706f6374667b75777370";
        Gatekeeper[1] = "formal";
        Gatekeeper[2] = "88410";

        // 遍历 Gatekeeper[0] 中的字符
        for (var i = 0, l = Gatekeeper[0].length; i < l; i++) {
            // 如果是第一个字符或索引为偶数
            if (i == 0 || i % 2 == 0) {
                // 将两个字符的十六进制表示转换为相应的字符,然后添加到数组 y 中
                y += String.fromCharCode(parseInt((Gatekeeper[0].substring(i, i + 2)), 16));
            }
        }

        // 将处理后的字符串存储到数组 z 中的第一个元素
        z[0] = y;
        // 将 Gatekeeper[2] 的第四个字符存储到数组 z 中的第二个元素
        z[1] = Gatekeeper[2][3];
        // 将 Gatekeeper[2] 的第三个字符与 Gatekeeper[1] 的第四个字符相加,存储到数组 z 中的第三个元素
        z[2] = Gatekeeper[2][2] + Gatekeeper[1][3];
        // 将 z[2] 的第一个字符、Gatekeeper[1] 的第六个字符、Gatekeeper[1] 的第六个字符相加,存储到数组 z 中的第四个元素
        z[3] = z[2][0] + Gatekeeper[1][5] + Gatekeeper[1][5];
        // 将 Gatekeeper[2] 除以 12630 的结果加上 "h"、z[2] 的第一个字符、(Gatekeeper[2][0]-1) 的结果,存储到数组 z 中的第五个元素
        z[4] = (Gatekeeper[2] / 12630) + "h" + z[2][0] + (Gatekeeper[2][0] - 1);
        // 将 z[4] 的前两个字符、'3'、Gatekeeper[1] 的第三个字符、'3' 相加,存储到数组 z 中的第六个元素
        z[5] = z[4][0] + z[4][1] + '3' + Gatekeeper[1][2] + '3';
        // 将 Gatekeeper[2] 除以 Gatekeeper[2] 的结果加上 '5',存储到数组 z 中的第七个元素
        z[6] = (Gatekeeper[2] / Gatekeeper[2]) + '5';
        // 将 Gatekeeper[2] 乘以 0 加上 Gatekeeper[1] 的第一个字符,存储到数组 z 中的第八个元素
        z[7] = (Gatekeeper[2] * 0) + Gatekeeper[1][0];
        // 将 Gatekeeper[2] 除以 12630 的结果加上 "h"、'3',存储到数组 z 中的第九个元素
        z[8] = (Gatekeeper[2] / 12630) + "h" + '3';
        // 将 Gatekeeper[1] 的第四个字符、Gatekeeper[2] 乘以 0、'5'、(Gatekeeper[2][0]-1) 的结果相加,存储到数组 z 中的第十个元素
        z[9] = Gatekeeper[1][3] + (Gatekeeper[2] * 0) + '5' + (Gatekeeper[2][0] - 1);
        // 将 'r'、'3'、z[2] 的第一个字符、Gatekeeper[1] 的第六个字符、'}' 相加,存储到数组 z 中的第十一个元素
        z[10] = 'r' + '3' + z[2][0] + Gatekeeper[1][5] + '}';

        // 输出处理后的字符串,使用下划线连接数组中的元素
        console.log(z.join("_"));
    } else {
        // 如果输入的 key 不等于 v,输出默认文本
        console.log("Gozer the Traveler. He will come in one of the pre-chosen forms. During the rectification of the Vuldrini, the traveler came as a large and moving Torg! Then, during the third reconciliation of the last of the McKetrick supplicants, they chose a new form for him: that of a giant Slor! Many Shuvs and Zuuls knew what it was to be roasted in the depths of the Slor that day, I can tell you!");
    }
}

这个函数的主要目的是根据输入的 key 值进行一系列计算和字符串操作,最终输出一组字符串到控制台 flag:poctf{uwsp_1_4m_4ll_7h47_7h3r3_15_0f_7h3_m057_r34l}

Vigil of the Ceaseless Eyes

得到题目
image
继续翻译一下:
守夜无尽的眼睛
嘿,参赛者们!请允许我借此机会推出这个星球上最热门的新社交媒体平台。我称它为 ManyKins!它有任何漏洞的可能性也为零,这些漏洞可能允许人们找到标志(在/secret/flag.pdf下)!
在给的目录进行访问
image
访问不了,保存到本地strings查看得到flag
image
flag:poctf{uwsp_71m3_15_4n_1llu510n}

We Mighty, We Meek

image
得到题目,翻译一下:
我们强大,我们温顺
此 MS Excel 文档已进行文件级加密。我不得不更改文件扩展名。破解密码以找到标志。
提示:密码仅包含字母字符(A-Z、a-z)。没有数字,没有特殊字符,没有空格。
通过提示,需要对下载得到的附件进行爆破,密码为英文
在网上查询查到jhon工具对其进行爆破 教程在这:https://www.cnblogs.com/AirCrk/p/12939305.htmlhttps://www.cnblogs.com/Hekeats-L/p/16745318.htmloffice2john.py自取
使用脚本对文件得哈希值取值
image
将“crack1.xls:”删除保存
然后用jhon工具进行爆破,我跑的字典是“rockyou.txt”。因为提示我将(A-Z、a-z)的密码筛选出来,和提交答案的“punct”
strings rockyou.txt | grep -v '[0-9]' rockyou.txt | grep -v '[[:punct:]]' | grep -v " " > wordlistalpha.txt
接着用jhon工具开始爆破
john.exe 目录\hash.txt --wordlist='目录\wordlistalpha.txt'
image
密码为 hsppyhsppyjoyjoy
(想查看换成缓存的哈希密码命令为:john.exe 目录\hash.txt --show)
image
image
拿到flag:poctf{uwsp_j3_p3n53_d0nc_j35_5u15} 
最后发现用使用Hashcat破解也可以做,看个人情况
image
爆破了两个半小时
image

Unquestioned and Unrestrained

image
得到题目翻译:
第一个加密挑战,所以我们必须保持简单。这是标志,但它是编码的。您所要做的就是弄清楚使用了哪种方法。幸运的是,这是一个常见的。
cG9jdGZ7dXdzcF80MTFfeTB1Ml84NDUzXzQyM184MzEwbjlfNzBfdTV9
猜测为base64,解码得到flag
image
poctf{uwsp_411_y0u2_8453_423_8310n9_70_u5}

Missing and Missed

image

点击查看代码
++++++++++[>+>+++>+++++++>++++++++++<<<<-]>>>>++++++++++++.-.------------.+++++++++++++++++.--------------.+++++++++++++++++++++.------.++.----.---.-----------------.<<++++++++++++++++++++.-.++++++++.>>+++++++++.<<--.>>---------.++++++++++++++++++++++++.<<-----.--.>>---------.<<+++++++++.>>---------------.<<---------.++.>>.+++++++.<<--.++.+++++++.---------.+++++++..----.>>++++++++.+++++++++++++++.

得到题目,为brainfuck加密
解码得到flag:poctf{uwsp_219h7_w20n9_02_f0290773n}

If You Don't, Remember Me

image
翻译一下:
如果你不这样做,记住我100分
这是一个似乎存在一些问题的 PDF 文件。我不确定它曾经是什么,但这并不重要。我知道它包含标志,但我相信您可以找到它并以某种方式将其拖出文件。这是一个两步标志,因为您会发现它已部分编码。
下载 DF1.pdf
打开给的附件地址,无法正常下载需要点击右上角退出去然后选中下载
得到附件无法正常打开用srtings命令直接查看
strings DF1.pdf
image
得到flag:poctf(uwsp_77333163306D335F37305F3768335F39346D33}
提交发现不对 需要对其进行hex转码
image
得到flag为:poctf(uwsp_w31c0m3_70_7h3_94m3}
注意:里边的ctf(括号有问题,我折腾了很久最后才发现。
正确flag:poctf{uwsp_w31c0m3_70_7h3_94m3}

A Petty Wage in Regret

image
得到题目,继续翻译一下
后悔中的微薄工资200积分
这是一个非常有趣的图像。这面旗帜被分解成几个部分并嵌入其中,因此组装它需要各种技能。

用010打开发现
image
有ASCII提示,于是16进制解码
image
得到:::P1/2:: poctf{uwsp_7h3_w0rld_h4d
后面那段代码找了好久,后来在Stegsolve工具发现有东西或者https://www.aperisolve.com/
image
中间的“f”看的有点不那么明显(中间的17前面有_,折腾了好久)
得到:_17_f1257
最后flag为:poctf{uwsp_7h3_w0rld_h4d_17_f1257}

posted @ 2024-01-12 18:51  胖迪助理小玳  阅读(245)  评论(0编辑  收藏  举报