WaniCTF 2024 部分 WP

记录下wp,如有错误请指正

Forensics

tiny_usb

下载附件后解压得到一个 ISO 文件

7z 打开后 一张 flag图片
在这里插入图片描述

Surveillance_of_sus

解压附件之后 得到一个 bin 文件

文件头为
在这里插入图片描述
找到这篇文章

https://www.heetian.com/info/1030

解释为:Windows为了加速RDP连接时的显示,减少数据量的传输,改善RDP连接体验的一种缓存机制。而 bin 文件是win7以上的位图缓存文件

看了下面的文件是可以恢复成 bmp 文件的

找到工具 梭哈

https://github.com/ANSSI-FR/bmc-tools
在这里插入图片描述
在这里插入图片描述
根据不全的flag信息猜测
FLAG{RDP_is_useful_yipeee}

I_wanna_be_a_streamer

解压后是个数据包 ,想的应该是从流量中提取视频文件
题目提示 H.264
在这里插入图片描述

这里可以看到 传数的都是 rtp 协议的数据包

google 找到从 pcap 提取 h264 流

插件(需要安装)https://github.com/volvet/h264extractor

然后根据这边文章进行 解码 rtp 数据

https://blog.csdn.net/jingjiankai5228/article/details/130477949

一、随便找个 rtp 数据包,然后追踪流,定位到所属的组
在这里插入图片描述
这里为 udp.stream eq 4

二、右键一个数据包 Decode As…
然后选择 rtp
在这里插入图片描述
三、编辑-》首选项-》Protocols,找到H.264 ,payload类型为 96
在这里插入图片描述
数据包被解码成 H.246 流

为什么是 payload 类型 为 96 ,可以在sdp类型的数据包中看到
在这里插入图片描述
四、工具-》运行 rtp_h264_extractor.lua 脚本
在这里插入图片描述

打开视频得到flag
在这里插入图片描述

Web

Bad_Worker

点击Fetch FLAG.txt 会将 FLAG.txt 替换成 DUMMY.txt,得到一个 假的flag
在这里插入图片描述
使用 发包工具请求 FLAG.txt 即可
在这里插入图片描述

Crypto

beginners_rsa

Do you know RSA?
chall.py

from Crypto.Util.number import *

p = getPrime(64)
q = getPrime(64)
r = getPrime(64)
s = getPrime(64)
a = getPrime(64)
n = p*q*r*s*a
e = 0x10001

FLAG = b'FLAG{This_is_a_fake_flag}'
m = bytes_to_long(FLAG)
enc = pow(m, e, n)
print(f'n = {n}')
print(f'e = {e}')
print(f'enc = {enc}')

output.txt

n = 317903423385943473062528814030345176720578295695512495346444822768171649361480819163749494400347
e = 65537
enc = 127075137729897107295787718796341877071536678034322988535029776806418266591167534816788125330265

已知 n e c

factor 分解 n 得到 p q r s a

![外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传](https://img-home.csdnimg.cn/images/20230724024159.png?origin_url=https%3A%2F%2Fprod-files-secure.s3.us-west-2.amazonaws.com%2Fb3b6f82c-6c31-4f6b-886f-508d8e0b0300%2F35e9bfd4-612d-47ab-a2d8-2e2cbe9bd458%2FUntitled.png&pos_id=img-HaJqZnZM-1719194550385

decrypto

p = 9953162929836910171
q = 11771834931016130837
r = 12109985960354612149
s = 13079524394617385153
a = 17129880600534041513
n = p*q*r*s*a

e = 65537
enc = 127075137729897107295787718796341877071536678034322988535029776806418266591167534816788125330265

import libnum

phi = (p-1)*(q-1)*(r-1)*(s-1)*(a-1)
d = libnum.invmod(e, phi)

c = pow(enc, d, n)
print(c)
print(hex(c))
print(libnum.n2s(c))

### b'FLAG{S0_3a5y_1254!!}'

beginners_aes

AES is one of the most important encryption methods in our daily lives.

chall.py

# https://pycryptodome.readthedocs.io/en/latest/src/cipher/aes.html
from Crypto.Util.Padding import pad
from Crypto.Cipher import AES
from os import urandom
import hashlib

key = b'the_enc_key_is_'
iv = b'my_great_iv_is_'
key += urandom(1)
iv += urandom(1)

cipher = AES.new(key, AES.MODE_CBC, iv)
FLAG = b'FLAG{This_is_a_dummy_flag}'
flag_hash = hashlib.sha256(FLAG).hexdigest()

msg = pad(FLAG, 16)
enc = cipher.encrypt(msg)

print(f'enc = {enc}') # bytes object
print(f'flag_hash = {flag_hash}') # str object

output.txt

enc = b'\x16\x97,\xa7\xfb_\xf3\x15.\x87jKRaF&"\xb6\xc4x\xf4.K\xd77j\xe5MLI_y\xd96\xf1$\xc5\xa3\x03\x990Q^\xc0\x17M2\x18'
flag_hash = 6a96111d69e015a07e96dcd141d31e7fc81c4420dbbef75aef5201809093210e

decrypto

from Crypto.Util.Padding import unpad
from Crypto.Cipher import AES
import hashlib

# 已知的部分密钥和初始向量
key_prefix = b'the_enc_key_is_'
iv_prefix = b'my_great_iv_is_'

# 给定的密文
enc = b'\x16\x97,\xa7\xfb_\xf3\x15.\x87jKRaF&"\xb6\xc4x\xf4.K\xd77j\xe5MLI_y\xd96\xf1$\xc5\xa3\x03\x990Q^\xc0\x17M2\x18'
flag_hash = '6a96111d69e015a07e96dcd141d31e7fc81c4420dbbef75aef5201809093210e'

# 尝试所有可能的最后一个字节
for i in range(256):
    key = key_prefix + bytes([i])
    for j in range(256):
        iv = iv_prefix + bytes([j])
        cipher = AES.new(key, AES.MODE_CBC, iv)
        try:
            # 解密并去除填充
            decrypted_msg = unpad(cipher.decrypt(enc), 16)
            # 检查哈希值是否匹配
            if hashlib.sha256(decrypted_msg).hexdigest() == flag_hash:
                print(f'Found! Key: {key}, IV: {iv}')
                print(f'Decrypted message: {decrypted_msg}')
                break
        except ValueError:
            # 填充错误,继续尝试下一个
            continue
    else:
        continue
    break

Found! Key: b'the_enc_key_is_$', IV: b'my_great_iv_is_O'
Decrypted message: b'FLAG{7h3_f1r57_5t3p_t0_Crypt0!!}'

replacement

No one can read my diary!

chall.py

from secret import cal
import hashlib

enc = []
for char in cal:
    x = ord(char)
    x = hashlib.md5(str(x).encode()).hexdigest()
    enc.append(int(x, 16))
        
with open('my_diary_11_8_Wednesday.txt', 'w') as f:
    f.write(str(enc))

my_diary_11_8_Wednesday.txt

[265685380796387128074260337556987156845, 75371056103973480373443517203033791314, 330443362254714811278522520670919771869, 127044987962124214100696270195559210814, 75371056103973480373443517203033791314, 57512852240092789512489991536185408584, 330443362254714811278522520670919771869, 301648155472379285594517050531127483548, 101473043316046160883738884593606957434, 328441037604453537976363247914938474182, 132117099947440863086225782187112663809, 324787361952219506718126426467652498112, 324787361952219506718126426467652498112, 137941842177346839522203666758205652951, 211852213467947252418279649849888928870, 328441037604453537976363247914938474182, 132117099947440863086225782187112663809, 229138548907862643092856609226723050075, 217694107356916866121607052237984398603, 75371056103973480373443517203033791314, 301648155472379285594517050531127483548, 127360297788558372456973998053019048669, 132117099947440863086225782187112663809, 57512852240092789512489991536185408584, 225291938577970489582719213714180290820, 135217442928347349540220511812067137647, 75371056103973480373443517203033791314, 57512852240092789512489991536185408584, 289548202804218369273708443831392368399, 132117099947440863086225782187112663809, 139335500873816609567900312949843139873, 268343242210070543641525550351035429524, 135217442928347349540220511812067137647, 57512852240092789512489991536185408584, 132117099947440863086225782187112663809, 52025852590564328496031723616521325469, 140302709094137701773086334180578563688, 127360297788558372456973998053019048669, 127044987962124214100696270195559210814, 135217442928347349540220511812067137647, 127044987962124214100696270195559210814, 140175431361313732288440547599619953992, 328441037604453537976363247914938474182, 132117099947440863086225782187112663809, 280290124780175821729678400814355564485, 132117099947440863086225782187112663809, 268343242210070543641525550351035429524, 301648155472379285594517050531127483548, 330443362254714811278522520670919771869, 132117099947440863086225782187112663809, 315344660197335367320188253944546305738, 127360297788558372456973998053019048669, 75371056103973480373443517203033791314, 301648155472379285594517050531127483548, 225291938577970489582719213714180290820, 314410903843616126162868425563187236446, 301648155472379285594517050531127483548, 57512852240092789512489991536185408584, 260950720930659604756740365450507371663, 132117099947440863086225782187112663809, 301648155472379285594517050531127483548, 260950720930659604756740365450507371663, 132117099947440863086225782187112663809, 52025852590564328496031723616521325469, 101473043316046160883738884593606957434, 132117099947440863086225782187112663809, 314410903843616126162868425563187236446, 301648155472379285594517050531127483548, 126195399674046097926516865351960453821, 140302709094137701773086334180578563688, 127360297788558372456973998053019048669, 135217442928347349540220511812067137647, 260950720930659604756740365450507371663, 75371056103973480373443517203033791314, 132117099947440863086225782187112663809, 229138548907862643092856609226723050075, 301648155472379285594517050531127483548, 314410903843616126162868425563187236446, 75371056103973480373443517203033791314, 289548202804218369273708443831392368399, 132117099947440863086225782187112663809, 217928829273870340501940171394986772443, 127360297788558372456973998053019048669, 135217442928347349540220511812067137647, 127044987962124214100696270195559210814, 225291938577970489582719213714180290820, 135217442928347349540220511812067137647, 127044987962124214100696270195559210814, 140175431361313732288440547599619953992, 132117099947440863086225782187112663809, 260950720930659604756740365450507371663, 268343242210070543641525550351035429524, 75371056103973480373443517203033791314, 132117099947440863086225782187112663809, 314410903843616126162868425563187236446, 127360297788558372456973998053019048669, 75371056103973480373443517203033791314, 57512852240092789512489991536185408584, 268343242210070543641525550351035429524, 217694107356916866121607052237984398603, 101473043316046160883738884593606957434, 132117099947440863086225782187112663809, 315344660197335367320188253944546305738, 127360297788558372456973998053019048669, 75371056103973480373443517203033791314, 10477030623836167233684437098032507967, 75371056103973480373443517203033791314, 330443362254714811278522520670919771869, 132117099947440863086225782187112663809, 229138548907862643092856609226723050075, 140302709094137701773086334180578563688, 314410903843616126162868425563187236446, 314410903843616126162868425563187236446, 75371056103973480373443517203033791314, 75371056103973480373443517203033791314, 132117099947440863086225782187112663809, 301648155472379285594517050531127483548, 127044987962124214100696270195559210814, 330443362254714811278522520670919771869, 132117099947440863086225782187112663809, 57512852240092789512489991536185408584, 301648155472379285594517050531127483548, 126195399674046097926516865351960453821, 140302709094137701773086334180578563688, 127360297788558372456973998053019048669, 135217442928347349540220511812067137647, 127044987962124214100696270195559210814, 140175431361313732288440547599619953992, 132117099947440863086225782187112663809, 260950720930659604756740365450507371663, 268343242210070543641525550351035429524, 75371056103973480373443517203033791314, 132117099947440863086225782187112663809, 10477030623836167233684437098032507967, 301648155472379285594517050531127483548, 127360297788558372456973998053019048669, 52025852590564328496031723616521325469, 132117099947440863086225782187112663809, 315344660197335367320188253944546305738, 312483091106876729395161500591121481064, 260950720930659604756740365450507371663, 260950720930659604756740365450507371663, 75371056103973480373443517203033791314, 127360297788558372456973998053019048669, 101473043316046160883738884593606957434, 132117099947440863086225782187112663809, 260950720930659604756740365450507371663, 140302709094137701773086334180578563688, 301648155472379285594517050531127483548, 57512852240092789512489991536185408584, 260950720930659604756740365450507371663, 132117099947440863086225782187112663809, 135217442928347349540220511812067137647, 57512852240092789512489991536185408584, 132117099947440863086225782187112663809, 260950720930659604756740365450507371663, 268343242210070543641525550351035429524, 75371056103973480373443517203033791314, 132117099947440863086225782187112663809, 315344660197335367320188253944546305738, 75371056103973480373443517203033791314, 57512852240092789512489991536185408584, 260950720930659604756740365450507371663, 289548202804218369273708443831392368399, 132117099947440863086225782187112663809, 153336653484216014488860143974073426008, 268343242210070543641525550351035429524, 301648155472379285594517050531127483548, 127044987962124214100696270195559210814, 140175431361313732288440547599619953992, 135217442928347349540220511812067137647, 127044987962124214100696270195559210814, 140175431361313732288440547599619953992, 132117099947440863086225782187112663809, 260950720930659604756740365450507371663, 268343242210070543641525550351035429524, 75371056103973480373443517203033791314, 132117099947440863086225782187112663809, 57512852240092789512489991536185408584, 312483091106876729395161500591121481064, 315344660197335367320188253944546305738, 319779899260524384061247969332041066255, 75371056103973480373443517203033791314, 229138548907862643092856609226723050075, 260950720930659604756740365450507371663, 328441037604453537976363247914938474182, 132117099947440863086225782187112663809, 280290124780175821729678400814355564485, 132117099947440863086225782187112663809, 127360297788558372456973998053019048669, 75371056103973480373443517203033791314, 229138548907862643092856609226723050075, 75371056103973480373443517203033791314, 135217442928347349540220511812067137647, 126195399674046097926516865351960453821, 75371056103973480373443517203033791314, 330443362254714811278522520670919771869, 132117099947440863086225782187112663809, 301648155472379285594517050531127483548, 127044987962124214100696270195559210814, 132117099947440863086225782187112663809, 75371056103973480373443517203033791314, 52025852590564328496031723616521325469, 301648155472379285594517050531127483548, 135217442928347349540220511812067137647, 217694107356916866121607052237984398603, 132117099947440863086225782187112663809, 260950720930659604756740365450507371663, 140302709094137701773086334180578563688, 330443362254714811278522520670919771869, 301648155472379285594517050531127483548, 101473043316046160883738884593606957434, 132117099947440863086225782187112663809, 10477030623836167233684437098032507967, 135217442928347349540220511812067137647, 260950720930659604756740365450507371663, 268343242210070543641525550351035429524, 132117099947440863086225782187112663809, 57512852240092789512489991536185408584, 140302709094137701773086334180578563688, 52025852590564328496031723616521325469, 75371056103973480373443517203033791314, 260950720930659604756740365450507371663, 268343242210070543641525550351035429524, 135217442928347349540220511812067137647, 127044987962124214100696270195559210814, 140175431361313732288440547599619953992, 132117099947440863086225782187112663809, 127360297788558372456973998053019048669, 301648155472379285594517050531127483548, 260950720930659604756740365450507371663, 268343242210070543641525550351035429524, 75371056103973480373443517203033791314, 127360297788558372456973998053019048669, 132117099947440863086225782187112663809, 169393384228144871625990433807197966773, 75371056103973480373443517203033791314, 229138548907862643092856609226723050075, 312483091106876729395161500591121481064, 217694107356916866121607052237984398603, 135217442928347349540220511812067137647, 301648155472379285594517050531127483548, 127360297788558372456973998053019048669, 132117099947440863086225782187112663809, 135217442928347349540220511812067137647, 127044987962124214100696270195559210814, 132117099947440863086225782187112663809, 135217442928347349540220511812067137647, 260950720930659604756740365450507371663, 289548202804218369273708443831392368399, 132117099947440863086225782187112663809, 280290124780175821729678400814355564485, 260950720930659604756740365450507371663, 132117099947440863086225782187112663809, 229138548907862643092856609226723050075, 140302709094137701773086334180578563688, 127044987962124214100696270195559210814, 260950720930659604756740365450507371663, 301648155472379285594517050531127483548, 135217442928347349540220511812067137647, 127044987962124214100696270195559210814, 75371056103973480373443517203033791314, 330443362254714811278522520670919771869, 132117099947440863086225782187112663809, 301648155472379285594517050531127483548, 132117099947440863086225782187112663809, 52025852590564328496031723616521325469, 101473043316046160883738884593606957434, 57512852240092789512489991536185408584, 260950720930659604756740365450507371663, 75371056103973480373443517203033791314, 127360297788558372456973998053019048669, 135217442928347349540220511812067137647, 140302709094137701773086334180578563688, 312483091106876729395161500591121481064, 57512852240092789512489991536185408584, 132117099947440863086225782187112663809, 52025852590564328496031723616521325469, 75371056103973480373443517203033791314, 57512852240092789512489991536185408584, 57512852240092789512489991536185408584, 301648155472379285594517050531127483548, 140175431361313732288440547599619953992, 75371056103973480373443517203033791314, 132117099947440863086225782187112663809, 260950720930659604756740365450507371663, 268343242210070543641525550351035429524, 301648155472379285594517050531127483548, 260950720930659604756740365450507371663, 132117099947440863086225782187112663809, 57512852240092789512489991536185408584, 301648155472379285594517050531127483548, 135217442928347349540220511812067137647, 330443362254714811278522520670919771869, 132117099947440863086225782187112663809, 302282648683284548814202807340787655613, 139335500873816609567900312949843139873, 268343242210070543641525550351035429524, 135217442928347349540220511812067137647, 57512852240092789512489991536185408584, 132117099947440863086225782187112663809, 135217442928347349540220511812067137647, 57512852240092789512489991536185408584, 132117099947440863086225782187112663809, 301648155472379285594517050531127483548, 132117099947440863086225782187112663809, 57512852240092789512489991536185408584, 75371056103973480373443517203033791314, 229138548907862643092856609226723050075, 127360297788558372456973998053019048669, 75371056103973480373443517203033791314, 260950720930659604756740365450507371663, 132117099947440863086225782187112663809, 229138548907862643092856609226723050075, 140302709094137701773086334180578563688, 330443362254714811278522520670919771869, 75371056103973480373443517203033791314, 328441037604453537976363247914938474182, 132117099947440863086225782187112663809, 57512852240092789512489991536185408584, 140302709094137701773086334180578563688, 132117099947440863086225782187112663809, 169393384228144871625990433807197966773, 217694107356916866121607052237984398603, 75371056103973480373443517203033791314, 301648155472379285594517050531127483548, 57512852240092789512489991536185408584, 75371056103973480373443517203033791314, 132117099947440863086225782187112663809, 330443362254714811278522520670919771869, 140302709094137701773086334180578563688, 127044987962124214100696270195559210814, 285106641514631128245889883706054218556, 260950720930659604756740365450507371663, 132117099947440863086225782187112663809, 260950720930659604756740365450507371663, 75371056103973480373443517203033791314, 217694107356916866121607052237984398603, 217694107356916866121607052237984398603, 132117099947440863086225782187112663809, 301648155472379285594517050531127483548, 127044987962124214100696270195559210814, 101473043316046160883738884593606957434, 140302709094137701773086334180578563688, 127044987962124214100696270195559210814, 75371056103973480373443517203033791314, 289548202804218369273708443831392368399, 132117099947440863086225782187112663809, 165799207128434858641672726827070059029, 334755564751598048042394781213255939012, 335344749019279195985775024993445213947, 301423883473918993177634428163190101268, 42767516990368493138776584305024125808, 324787361952219506718126426467652498112, 53459933652527578064242465506376923016, 75371056103973480373443517203033791314, 169393384228144871625990433807197966773, 217694107356916866121607052237984398603, 204791166937441563272975036703176244680, 229138548907862643092856609226723050075, 75371056103973480373443517203033791314, 52025852590564328496031723616521325469, 53459933652527578064242465506376923016, 127044987962124214100696270195559210814, 260950720930659604756740365450507371663, 82324359399928500054185503234815398877, 302282648683284548814202807340787655613, 289548202804218369273708443831392368399, 132117099947440863086225782187112663809, 67435298396569627229809714987765527069, 140302709094137701773086334180578563688, 10477030623836167233684437098032507967, 132117099947440863086225782187112663809, 57512852240092789512489991536185408584, 260950720930659604756740365450507371663, 127360297788558372456973998053019048669, 301648155472379285594517050531127483548, 127044987962124214100696270195559210814, 140175431361313732288440547599619953992, 75371056103973480373443517203033791314, 32129299595146848534093479265394572654, 281595222973318803755638905082365601824, 281595222973318803755638905082365601824, 301423883473918993177634428163190101268, 312483091106876729395161500591121481064, 127360297788558372456973998053019048669, 75371056103973480373443517203033791314, 135217442928347349540220511812067137647, 57512852240092789512489991536185408584, 101473043316046160883738884593606957434, 301648155472379285594517050531127483548]

decrypto

import hashlib

def md5_hash(value):
    return hashlib.md5(str(value).encode()).hexdigest()

# 从文件中读取加密数据
with open(r'C:\Users\Administrator\Desktop\my_diary_11_8_Wednesday.txt', 'r') as f:
    enc = eval(f.read())

decrypted_chars = []

# 尝试所有可能的 ASCII 值来逆转 MD5 哈希
for enc_value in enc:
    for i in range(256):
        if int(md5_hash(i), 16) == enc_value:
            decrypted_chars.append(chr(i))
            break

# 将解密后的字符拼接成字符串
decrypted_message = ''.join(decrypted_chars)
print(f'Decrypted message: {decrypted_message}')

'''
Decrypted message: Wednesday, 11/8, clear skies. This morning, I had breakfast at my favorite cafe. Drinking the freshly brewed coffee and savoring the warm buttery toast is the best. Changing the subject, I received an email today with something rather peculiar in it. It contained a mysterious message that said "This is a secret code, so please don't tell anyone. FLAG{13epl4cem3nt}". How strange!

Gureisya
'''

Pwnable

nc

连上就有 0x15 + 0x1 =?

在这里插入图片描述

  • 25
    点赞
  • 17
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值