Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 2d1ff5f

Browse files
committed
add INTERNATIONALIZATION SUPPORT
1 parent 22b8eba commit 2d1ff5f

File tree

2 files changed

+72
-0
lines changed

2 files changed

+72
-0
lines changed

‎2022/hitcon-2022/checker/README.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,3 +92,34 @@ Next, the solver simulates an ioctl call by performing memory xor operations and
9292

9393
Finally, the solver loops through a provided path array and simulates the ioctl call for each element in the array. This allows the solver to determine the correct sequence and order of the thingys needed to decrypt the flag. The final result of the flag decryption is returned and can be checked against the correct flag.
9494

95+
```
96+
my@email.com
97+
trasnlate to mandarin the hitcon ppl are from asia
98+
```
99+
100+
CTF 挑战: 标志解密
101+
102+
概述:
103+
104+
挑战是一个 Windows 驱动程序,其中用户空间组件无效。驱动程序入口设置了 ioctl,当使用特定的 cmd 数字调用时,根据提供的数字执行操作。
105+
106+
驱动程序解密标志,挑战是确定正确的输入以影响解密。为了完成这一点,我们必须收集所有的 "thingys" (共八个) 并将它们的 done 标志设置为 1。这表明我们需要一个排列来解决挑战。
107+
108+
每个 thingy 都会 xor 一些驱动程序中的代码,这是一个自修改的代码。这会 xor 一个操作 uint32s 的一元标量函数的代码,然后在标志上调用该函数。为了解密标志,我们需要找到正确的 thingy 序列来 xor 该函数,并在所有八个 thingys 上按正确的顺序执行它。
109+
110+
要解决挑战,我们可以使用回溯算法,但这不是必需的,因为对于排列的第一个元素只有一个可能的有效 thingy,因此不需要 8! 您只需要尝试 8^2 组合。
111+
112+
为了让事情更容易,我们可以使用 Unicorn 引擎来模拟驱动程序。解决脚本,称为 cocksleeve.py,可以在存储
113+
114+
```
115+
my@email.com
116+
Continue
117+
```
118+
119+
库中找到,并提供了有关如何使用 Unicorn 的好文档。
120+
121+
解决代码通过使用 Unicorn 引擎来模拟驱动程序代码来解决挑战。它首先使用适当的值设置模拟器的寄存器和堆栈框架,然后以指定地址开始模拟器,并使用伪 retaddr。
122+
123+
然后,解决方案通过执行内存 xor 操作和在 flag 上调用 emulate_mathshit 函数来模拟 ioctl 调用。emulate_mathshit 函数的结果被写回 flag,并且代码被反汇编以验证解密是否正在正确执行。
124+
125+
最后,解决方案循环遍历提供的路径数组,并为数组中的每个元素模拟 ioctl 调用。这允许解决方案确定解密 flag 所需的 thingy 序列和顺序的正确值。最终的 flag 解密结果被返回,可以与正确的 flag 进行比较。

‎2022/hitcon-2022/meow-way/README.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,3 +88,44 @@ print(good_inp)
8888
```
8989

9090
This script will output the correct input that can be used to solve the challenge.
91+
92+
```
93+
my@email.com
94+
translate the writeup to mandarin the hitcon ppl are from asia
95+
```
96+
97+
这个挑战是一个 Windows 二进制文件,它使用"天堂之门"技巧从 32 位模式切换到 64 位模式。解决方案涉及逆向二进制文件并使用 Python 脚本来解析反汇编。该脚本使用 z3 库来解决二进制文件中使用的加密。
98+
99+
逆向二进制文件
100+
要逆向二进制文件,我们可以使用 IDA Pro 和一些 IDAPython 脚本来使反汇编更容易阅读。特别是,我们可以使用脚本将代码段分为不同的模式(32 位和 64 位),这取决于"天堂之门"技巧中使用的调用门。
101+
102+
一旦我们将反汇编分段,我们就可以专注于二进制文件中使用的加密。事实证明,加密是一个简单的 XOR 密码,其根据一个标志的值添加或减去一个值。我们可以使用 z3 库来求解将解密密文的正确输入。
103+
104+
解决方案脚本
105+
下面是解决挑战的 Python 脚本:
106+
```python
107+
from z3 import *
108+
109+
# define the variables used in the cipher
110+
good_inp = b''
111+
for i, ptr in enumerate(order):
112+
unk = BitVec('flag_%d' % i, 8)
113+
cl = BitVecVal(lilShitter[ptr], 8)
114+
is_add_or_sub, xor_key = wowies[ptr]
115+
if is_add_or_sub:
116+
cl += unk
117+
else:
118+
cl -= unk
119+
cl ^= xor_key
120+
121+
# use z3 to solve for the correct input
122+
s = Solver()
123+
s.add(ciphert[i] == cl)
124+
assert s.check() == sat
125+
m = s.model()
126+
inp = m[unk].as_long()
127+
good_inp += bytes([inp])
128+
129+
# print the decrypted input
130+
print(good_inp)
131+
```

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /