# CTF-攻防世界 Reverse新手练习解析

CTF 同时被 2 个专栏收录
2 篇文章 0 订阅
3 篇文章 0 订阅

## 0x2.game

n是灯的序列号，m是灯的状态

（来自谷歌翻译·······QAQ）

shift+F12
Alt+T（搜索字符串），搜索： flag

Ctrl+X（交叉引用）
F5（生成伪代码）

#v2：原代码v2-v58的值
v2 = [123,32,18,98,119,108,65,41,124,80,125,38,124,111,74,49,83,108,94,108,84,6,96,83,44,121,104,110,32,95,117,101,99,123,127,119,96,48,107,71,92,29,81,107,90,85,64,12,43,76,86,13,114,1,117,126,0]

#v59：原代码v59-v115的值
v59 = [18,64,98,5,2,4,6,3,6,48,49,65,32,12,48,65,31,78,62,32,49,32,1,57,96,3,21,9,4,62,3,5,4,1,2,3,44,65,78,32,16,97,54,16,44,52,32,64,89,45,32,65,15,34,18,16,0]

s = ""

for i in range(57):
v2[i] = v2[i] ^ v59[i]
v2[i] = v2[i] ^ 19
s += chr(v2[i])

print(s)



## 0x3.Hello,CTF

v9为我们的输入，长度≤0x11（10进制的17）
v10储存的就是v9，和v13进行比较。相同就success

## 0x4.open-source

v3 = 11 * (25 % 17) + 1628458542 + len("h4cky0u") - 1615810207
print(v3)


## 0x5.simple-unpack

upx -d filename脱壳

## 0x6.logmein

v8是给定的字符串,v7是long long的数据类型
s是输入，v3是s的长度，v3必须≥v8的长度17，否则会进入提示输入错误的函数sub_4007C0()

v8 = ":\"AL_RT^L*.?+6/46"
v7 = 'harambe'

for i in range(len(v8)):
char = ord(v7[i % 7]) ^ ord(v8[i])
print(chr(char),end='')



#include <iostream>
using namespace std;

int main(){
long long v7 = 28537194573619560;
char *p = (char*)&v7;
char v8[] = ":\"AL_RT^L*.?+6/46";
for(int i = 0;v8[i]!=0;i++){
v8[i] = v8[i]^p[i%7];
}
cout<<v8<<endl;
return 0;
}



## 0xa.getit

v5 = 0
s = 'c61b68366edeb7bdce3c6820314b7498'
t = ['S','h','a','r','i','f','C','T','F','{','?','?','?','?','?','?','?','?','?','?','?','?','?','?','?','?','?','?','?','?','?','?','?','?','?','?','?','?','?','?','?','?','}']
v3 = 0
l = len(s)
while(v5 < l):
if( v5 & 1 ):
v3 = 1
else:
v3 = -1
t[10+v5] = chr(ord(s[v5])+v3)
v5 += 1
flag = ''
for x in t:
flag+=x
print(flag)


# encoding: utf-8
import base64
s = "XlNkVmtUI1MgXWBZXCFeKY+AaXNt"
flag = ""

#base64
b = base64.b64decode(s)# print(b)

#encode
for i in b:
i -= 16
i ^= 32
flag += chr(i)
print(flag)


## 0xC.maze

  ******
*   *  *
*** * **
**  * **
**  * **
*  *#  *
** *** *
**     *
********


RE真好玩~强颜欢笑.jpg

• 6
点赞
• 8
评论
• 27
收藏
• 一键三连
• 扫一扫，分享海报

04-13 6558
05-01 1万+
07-14 658
07-18 1641
04-10 75
05-06 3368
06-02 8361
08-27 615
08-18 1773
02-02 1229