欢迎加入N0wayback喵~
SU_checkin
大致浏览流量包内容,发现流量包内为爆破目录时产生的流量,大多响应都是404。这里将404响应筛除,得到几个关键的信息
java -jarsuctf-0.0.1-SNAPSHOT.jar --password=SePassWordLen23SUCT
algorithm=PBEWithMD5AndDES
spring.application.name=suctf
server.port = 8888
OUTPUT=ElV+bGCnJYHVR8m23GLhprTGY0gHi/tNXBkGBtQusB/zs0uIHHoXMJoYd6oSOoKuFWmAHYrxkbg=
至此我们得到了加密方式,密文,以及密码。将得到的信息去解码,却发现报错。这时候我们看密码中有含义的部分,提示长度为23,但是已知部分长度只有19,在原来代码基础上进行爆破得到完整密码。观察可以发现后面肯定是F???,所以只用爆破3位节省时间。
import base64
import hashlib
import os
from Crypto.Cipher import DES
from Crypto.Util.Padding import unpad, pad
def get_derived_key(password, salt, count):
password_bytes = password.encode('utf-8')
salt_bytes = salt
key = password_bytes + salt_bytes
for i in range(count):
key = hashlib.md5(key).digest()
return key[:8], key[8:]
def decrypt(msg, password):
msg_bytes = base64.b64decode(msg)
salt = msg_bytes[:8]
enc_text = msg_bytes[8:]
dk, iv = get_derived_key(password, salt, 1000)
crypter = DES.new(dk, DES.MODE_CBC, iv)
decrypted_text = unpad(crypter.decrypt(enc_text), DES.block_size)
return decrypted_text.decode('utf-8')
def encrypt(msg, password):
salt = os.urandom(8)
msg_bytes = msg.encode('utf-8')
padded_msg = pad(msg_bytes, DES.block_size)
dk, iv = get_derived_key(password, salt, 1000)
crypter = DES.new(dk, DES.MODE_CBC, iv)
enc_text = crypter.encrypt(padded_msg)
return base64.b64encode(salt + enc_text).decode('utf-8')
msg = "ElV+bGCnJYHVR8m23GLhprTGY0gHi/tNXBkGBtQusB/zs0uIHHoXMJoYd6oSOoKuFWmAHYrxkbg="
passwd = "SePassWordLen23SUCT"
dic = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-_}{'
# encrypted = encrypt(msg, passwd)
# print(f"Encrypted (Base64): {encrypted}")
for i in dic:
for j in dic:
for k in dic:
# for l in dic:
passwd = "SePassWordLen23SUCTF" + i + j + k #+ l
try:
decrypted = decrypt(msg, passwd)
print(f"Find the Password:{passwd}")
print(f"Decrypted: {decrypted}")
exit(0)
except Exception as e:
print(f"Wrong Password: {passwd}")
得到的结果如下
Find the Password:SePassWordLen23SUCTF666
Decrypted: SUCTF{338dbe11-e9f6-4e46-b1e5-eca84fb6af3f}
SU_forensics
根据题目描述通过DiskGenius恢复被删除的文件
K1sme4师傅是利用内存数据明文存储的特性,直接通过string进行查找
得到下列信息
echo "My secret has disappeared from this space and time, and you will never be able to find it."
curl -s -o /dev/null https://www.cnblogs.com/cuisha12138/p/18631364
sudo reboot
访问网页发现页面已经被删除,查看网页快照,可以看到一个Github仓库
访问发现仓库里的部分与图片上的不符合,缺少了部分文件,这里爆破Commit(写的比较简陋,感兴趣的可以自己添加多线程和其他功能)
import requests
url_head = 'https://github.com/testtttsu/homework/commit/'
log_file = 'broken_log.txt'
with open(log_file, 'w') as log:
for i in range(0, 0x10000):
num = format(i, '04x')
url = f'{url_head}{num}'
print(f'Trying Hash: {num}')
requests.packages.urllib3.disable_warnings()
response = requests.get(url, verify=False)
if response.status_code == 200:
print(f'Suspicious Commit Found: {url}')
log.write(url + '\n')
可以找到这个Url
https://github.com/testtttsu/homework/commit/1227
访问能够得到 lost_flag.txt ,git下来后发现是zip文件的16进制,转为zip文件。
回到之前网页快照得到的图片,可以看到打码的地方可以通过调整对比度看清楚密码
2phxMo8iUE2bAVvdsBwZ
解压后得到一张象形文字的图片
图片中一共有27种图案,猜测应该为26个大写字母加上空格。并且每一行只有25个图案,将每一行缺少的图案提取出来
根据Flag的格式可以得到SUCTF????FU?,猜一下得到Flag
SUCTF{HAVEFUN}
SU_RealCheckin
题目附件如下
hello ctf -> 🏠🦅🍋🍋🍊 🐈🌮🍟
$flag -> 🐍☂️🐈🌮🍟{🐋🦅🍋🐈🍊🏔️🦅_🌮🍊_🐍☂️🐈🌮🍟_🧶🍊☂️_🐈🍎🌃_🌈🦅🍎🍋🍋🧶_🐬🍎🌃🐈🦅}
根据单表替换和语义可以得到Flag
suctf{welcome_to_suctf_you_can_really_dance}