DozerCTF 2020


CRYPTO

真·签到

这是真的签到题

附件:baby_base.exe

查看文本,Base64+Base32+Hex+Base58 解码得flag。

easy_bag

这莫非就是传说中的灵异背包?

nc 118.31.11.216 30003

提示很明显,背包密码

nc取得公钥与密文,修改参考脚本后Sage运行得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
###Sage###
import binascii
pubKey = [] #公钥
pubKey = pubKey.replace(' ', '').replace('L', '').strip('[]').split(',')
nbit = len(pubKey)
encoded = #密文
encoded = encoded.replace('L', '')
print("start")
# create a large matrix of 0's (dimensions are public key length +1)
A = Matrix(ZZ, nbit + 1, nbit + 1)
# fill in the identity matrix
for i in range(nbit):
A[i, i] = 1
# replace the bottom row with your public key
for i in range(nbit):
A[i, nbit] = pubKey[i]
# last element is the encoded message
A[nbit, nbit] = -int(encoded)

res = A.LLL()
for i in range(0, nbit + 1):
# print solution
M = res.row(i).list()
flag = True
for m in M:
if m != 0 and m != 1:
flag = False
break
if flag:
print i, M
M = ''.join(str(j) for j in M)
# remove the last bit
M = M[:-1]
M = hex(int(M, 2))[2:-1]
print(bytes.fromhex(M))

REVERSE

貌似有些不对

这是谁的课程设计?做的好烂!

附件:Cipher.exe

IDA查看字符串,发现 OEG7U19kUvCsV29qzT9qcUm0yDCwy2CiWjOrU2OrZYXABCDEFGHIJKLMNOPQRSTUVWzyxabcdefghijklmnopqrstuvw0123456789+/,猜测为自定义码表的Base64编码。

CyberChef解码得 Dr{__g_!ocomiom}ztlasoaefdn_dn

根据最终flag格式 Dozerctf{xxx},对比尝试用栅栏密码解密:

Dr{__g_!

ocomiom}

ztlasoa

efdn_dn

按上下顺序取出拼接得到flag。


MISC

upload

where is the file?(flag格式Dozerctf{XXXXXXXXXXXXXXX})

链接:https://share.weiyun.com/frfkQQvq 密码:rkbpx2

wireshark打开pcap流量包,文件→导出对象→HTTP,发现flag.jpg文件。

保存到本地,用010editor查看文件头504B0304为zip压缩文件格式。

修改文件名flag.zip,打开发现需要密码,其中的5个txt文件均为6字节大小。

6字节CRC碰撞脚本分别爆破5个文件CRC值,选取有含义的爆破值为每个文件的内容,拼接得flag。

py吗?

链接:https://share.weiyun.com/btEdYZcA 密码:ssihnd

png图,LSB低位隐写,Stegsolve提取出一串字符串,Base64解码出flag。

夏日计划

欢迎来到夏日计划,enjoy the game

链接:https://share.weiyun.com/MUdUEP0h 密码:twfn5u

010editor查看下载文件的文件头Rar,为rar文件格式。

360压缩打开压缩包,发现important.txt:secret.rar,为NTFS隐写,提取出secret.rar。

尝试打开secret.rar发现有错误,使用WinRAR修复压缩包,得到secret1/secret2/secret3/secret4四个文件,打开发现每行两个数,易知为坐标。

拼接四个文件,使用gnuplot画图工具,plot画图命令得到一个图片,有网鼎杯经验不难知为汉信码,但被反色处理过。

反色与修复处理得到汉信码,用极不稳定在线识别器http://www.efittech.com/hxdec.html 解码得flag。

easy_analysis

Can you find the secret from her/his computer?

链接:https://share.weiyun.com/lAcsmVU6 密码:xqrxwg

内存取证,上volatility工具分析一波,每种使用情况都查看一遍。

查看profile值:

volatility -f memory imageinfo

得到profile值为Win7SP1x64。

按关键字扫描文件:

volatility -f memory --profile=Win7SP1x64 filescan | grep "flag"

结果:

0x000000001e2fa940 2 1 R--rwd \Device\HarddiskVolume1\Users\13m0nade\Desktop\flag
0x000000001e314f20 2 1 R--rwd \Device\HarddiskVolume1\Users\13m0nade\Desktop\flag
0x000000001e76e070 1 1 R--rw- \Device\HarddiskVolume1\Users\13m0nade\Desktop\flag
0x000000001e85f430 2 0 RW---- \Device\HarddiskVolume1\Users\13m0nade\Desktop\flag\analys

尝试导出analys文件:

volatility -f memory --profile=Win7SP1x64 dumpfiles -D ./ -Q 0x000000001e85f430

010editor查看为zip文件,改文件名打开,加密,有提示:

Why you don’t know my password?

It’s so easy.

Maybe you can log in to my computer.

猜测与登录信息有关。

提取登录用户信息,查看password hash:

volatility -f memory --profile=Win7SP1x64 hivelist (列举缓存在内存中的注册表)

volatility -f memory --profile=Win7SP1x64 hashdump -y 0xfffff8a000024010 -s 0xfffff8a00167a010 -D ./ (提取注册表system和SAM虚拟地址的hash内容)

结果:

Administrator:500:aad3b435b51404eeaad3b435b51404ee:31d6cfe0d16ae931b73c59d7e0c089c0:::
Guest:501:aad3b435b51404eeaad3b435b51404ee:31d6cfe0d16ae931b73c59d7e0c089c0:::
13m0nade:1000:aad3b435b51404eeaad3b435b51404ee:575f5313970908467a19d3a5aa269743:::

尝试在线md5解密 31d6cfe0d16ae931b73c59d7e0c089c0575f5313970908467a19d3a5aa269743

31d6cfe0d16ae931b73c59d7e0c089c0 → [空密码]

575f5313970908467a19d3a5aa269743 → AaBbCc123

用AaBbCc123解密zip文件成功,得到flag.zip和usb.pcap。

flag.zip,加密,有提示:

密码很长,字母全部小写

wireshark打开usb.pcap,易知为usb流量,先用tshark工具得到leftover capture data:

tshark -r usb.pcap -T fields -e usb.capdata

再用以下脚本或UsbKeyboardDataHacker脚本恢复击键信息:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
mappings = { 0x04:"A",  0x05:"B",  0x06:"C", 0x07:"D", 0x08:"E", 0x09:"F", 0x0A:"G",  0x0B:"H", 0x0C:"I",  0x0D:"J", 0x0E:"K", 0x0F:"L", 0x10:"M", 0x11:"N",0x12:"O",  0x13:"P", 0x14:"Q", 0x15:"R", 0x16:"S", 0x17:"T", 0x18:"U",0x19:"V", 0x1A:"W", 0x1B:"X", 0x1C:"Y", 0x1D:"Z", 0x1E:"1", 0x1F:"2", 0x20:"3", 0x21:"4", 0x22:"5",  0x23:"6", 0x24:"7", 0x25:"8", 0x26:"9", 0x27:"0", 0x28:"n", 0x2a:"[DEL]",  0X2B:"    ", 0x2C:" ",  0x2D:"-", 0x2E:"=", 0x2F:"[",  0x30:"]",  0x31:"\\", 0x32:"~", 0x33:";",  0x34:"'", 0x36:",",  0x37:"." }
nums = []
keys = open('usbdata.txt')
for line in keys:
if line[0]!='0' or line[1]!='0' or line[2]!='0' or line[3]!='0' or line[6]!='0' or line[7]!='0' or line[8]!='0' or line[9]!='0' or line[10]!='0' or line[11]!='0' or line[12]!='0' or line[13]!='0' or line[14]!='0' or line[15]!='0':
continue
nums.append(int(line[4:6],16))
# 00:00:xx:....
keys.close()
output = ""
for n in nums:
if n == 0 :
continue
if n in mappings:
output += mappings[n]
else:
output += '[unknown]'
print('output :n' + output)

结果:

output :n[unknown][unknown][DEL][DEL][DEL][DEL]nnn[unknown]UTO KEY[DEL][DEL][DEL][DEL]KEY YLLTMFTNXBKGVCYYDBUHDLCPSPSPS[DEL]TSWRMWJJMNJGTYLKEGITTOIBGO[DEL]O GOOD LUCK

猜测为Autokey加密,密文:YLLTMFTNXBKGVCYYDBUHDLCPSPSPTSWRMWJJMNJGTYLKEGITTOIBGO

修改脚本爆破,结果:

-359.75078413 autokey, klen 3 :"KGT", OFSFHNOGKNEWIYCQFZECEHALLPHEELSNBEWIIRBYCXNIHTAMAOWBSS
-324.335522444 autokey, klen 4 :"GHAT", SELAUBINDACTSCWFLZYCSMENADOCTPIPTHBUTGIMASDYEOFVPADGRO
-323.532048185 autokey, klen 5 :"XRAEF", BULPHEZCIUGHTUESWIADLPUPPEDVEDSORSGRYWRACAPTEEIEAKETCO
-327.336020209 autokey, klen 6 :"WGUMES", CFRHINRIGUCTEUSEBIQNLHBHCCHISLUPFORYSYESCATMAOGTACINAV
-306.901215421 autokey, klen 7 :"QSLAYRJ", ITATOOKFEBRSHSTUCKCALSININSEBKJJZEFICEAHPTDIAGBEALABAN
-297.048582118 autokey, klen 8 :"UISMBHTT", EDTHLYAUTYRZKEYEKDDITHELIMPHALSGEKUCMCRAPORISERTEARTOK
-255.780042935 autokey, klen 9 :"KEYFORZIP", OHNOYOUFINDTHEKEYTHEKEYFORZIPISTHISKEYBOARDSUCKSFORYOU

得到解压密码thiskeyboardsuckforyou,得到flag.txt。

打开发现多行Base64编码密文,解码得到16进制字符串,开头89504E47为png文件头,还原得到的png图片无信息。

猜测为Base64隐写,尝试跑解密脚本,得到flag~