2018暑假校内赛SJUCTF

WEB

Warm up

js解密->md5解密

image

babyweb

根据hint提醒user/user登陆,发现只有visitor才能得falg

抓包修改session的user为visitor得到flag

image

exec

回车符%0a绕过(抓包内修改)

redis

redis getshell

首先找到web根目录

image

telnet过去写shell

telnet 192.168.19.211 6379

image

image

CRYPTO

MD5 is dead

image

题目要求md5相同sha1不同的两个文件,同时要求大小在2017kib~2018kib范围

首先生成一个符合大小的文件(python)

1
2
#with open('test','w+') as f:
# f.write('1'*2017*1024)

然后用fastcoll工具碰撞md5生成两个文件上传得到flag

SHA-1 is dead too

image

题目要求sha1相同但sha256不同的两个文件,同时要求大小在2018kib~2019kib范围

https://ctf-wiki.github.io/ctf-wiki/crypto/hash/sha1/

在谷歌之前公布文档下载好两个pdf,修改一下题目要求大小的脚本,运行后得到两个文件上传得flag

1
2
3
4
5
6
7
8
9
10
11
12
13
14
from hashlib import sha1
from hashlib import sha256

pdf1 = open('./shattered-1.pdf').read(320)
pdf2 = open('./shattered-2.pdf').read(320)
pdf1 = pdf1.ljust(2019 * 1024 + 1 - 320, "\00") #padding pdf to 2017Kib + 1
pdf2 = pdf2.ljust(2019 * 1024 + 1 - 320, "\00")
open("upload1", "w").write(pdf1)
open("upload2", "w").write(pdf2)

print sha1(pdf1).hexdigest()
print sha1(pdf2).hexdigest()
print sha256(pdf1).hexdigest()
print sha256(pdf2).hexdigest()

MISC

CLANNAD

下载后是wav音频文件 (MP3 Stego工具)

image

image

隐写

用BlindWaterMark工具盲水印

https://github.com/chishaxie/BlindWaterMark

image

image

ZipCRC32

CRC32攻击脚本:得到一串base64码,解码Pk可知是zip文件

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
#coding:utf-8

import zipfile

import string

import binascii



def CrackCrc(crc):

for i in dic:

for j in dic:

for p in dic:

for q in dic:

s = i + j + p + q

if crc == (binascii.crc32(s) & 0xffffffff):

print s

f.write(s)

return



def CrackZip():

for I in range(54):

file = 'chunk' + str(I) + '.zip'

f = zipfile.ZipFile(file, 'r')

GetCrc = f.getinfo('data.txt')

crc = GetCrc.CRC

#以上3行为获取压缩包CRC32值的步骤

print hex(crc)

CrackCrc(crc)



dic = string.ascii_letters + string.digits + '+/='



f = open('data.txt', 'w')

CrackZip()

f.close()

上脚本,将字符串转为zip文件

1
2
3
4
5
6
7
import base64

fin=open("1.txt","r")
fout=open('2.zip',"wb")
base64.decode(fin,fout)
fin.close()
fout.close()

上工具Ziperello爆破密码得到flag

Easy Forensics

过滤http流 导出HTTP upload文件 save

image

保存为zip文件,图片一半flag,属性另一半

文章目录
  1. 1. WEB
    1. 1.1. Warm up
    2. 1.2. babyweb
    3. 1.3. exec
    4. 1.4. redis
  2. 2. CRYPTO
    1. 2.1. MD5 is dead
    2. 2.2. SHA-1 is dead too
  3. 3. MISC
    1. 3.1. CLANNAD
    2. 3.2. 隐写
    3. 3.3. ZipCRC32
    4. 3.4. Easy Forensics
,