自学内容网 自学内容网

misc合集(1)

[Week3] 这是一个压缩包

有密码,提示QmFzZUNURj8/Pz8/P0ZUQ2VzYUI=

base64解密是BaseCTF??????FTCesaB

猜测这应该是⼀个轴对称的密码

python ⽣成了密码字典,再通过 ARCHPR 进⾏字典爆破

lowercase = 'abcdefghijklmnopqrstuvwxyz'
uppercase = lowercase.upper()
digits = '0123456789'
symbols = '!@#$%^&*()-_=+'
ls = lowercase+uppercase+digits+symbols
with open('passwd.txt','w') as f:
    for t1 in ls:
        for t2 in ls:
            for t3 in ls:
                password = 'BaseCTF'+t1+t2+t3+t3+t2+t1+'FTCesaB'
                f.write(password+'\n')

[Week3] Base revenge
把 hint 丢⼊随波逐流,跑了⼀下,发现是 Atbash加密
Base64 隐写
 Atbash解密
Base64解码,得flag
[Week3] broken.mp4

有关untrunc_x64工具的用法

是一种用于恢复损坏或截断的视频文件的工具。你可以在以下几种情况下使用这类工具:

  1. 文件损坏:如果你的视频文件在下载、传输或保存过程中出现了损坏,导致视频无法正常播放,untrunc_x64 可以帮助你尝试修复这些损坏的文件。

  2. 截断文件:有时视频文件在录制或保存时可能会被意外截断,导致文件不完整。untrunc_x64 可以帮助恢复这些截断的文件,使其恢复为完整的视频文件。

  3. 格式兼容性问题:如果你的视频文件的格式或头部信息被破坏,untrunc_x64 可以尝试修复这些格式问题,使文件能够被正确识别和播放。

  4. 数据恢复:在某些数据恢复场景中,如硬盘故障或文件系统错误,untrunc_x64 可以用来修复受损的视频文件。

使用时,通常需要提供一个与损坏文件相同格式且没有损坏的视频文件作为参考,这样工具才能进行修复。如果你遇到这类问题,可以尝试使用 untrunc_x64 进行修复。不过,修复的效果可能会因损坏程度和文件格式等因素而有所不同。

[Week3] 纯鹿人
得到⼀个密码,可能和 word ⽂档中的图⽚有关,把 word ⽂档后缀改为 zip,解压后在 ⾥⾯找到图⽚,然后 binwalk 分离,得到⼀个压缩包。
压缩包密码就是刚才解出来的,解压后得到 flag。

[Week3] 白丝上的flag

运行python脚本

from PIL import Image
from random import randint
import sys

def ez_add(a,b,c,d):
    global iv
    h = (a+b+c+d+iv) % 256
    e = b
    f = c
    g = d
    iv = (b+c+d+iv) % 256
    return e,f,g,h

def confuse(data):
    r,g,b,a = data
    for _ in range(8):
        r,g,b,a = ez_add(r,g,b,a)
    return r,g,b,a

def confuse_image(flag):
    global iv
    iv = flag.getpixel((1,1))[0]
    img = Image.new('RGBA', (flag.width, flag.height))
    for w in range(img.width):
        for h in range(img.height):
            img.putpixel((w, h), confuse(flag.getpixel((w,h))))
    return img

if __name__ == '__main__':
    iv = 0
    flag = Image.open("image.png")
    img = confuse_image(flag)
    img.save("en_image1.png")



双图异或

脚本如下

from PIL import Image
import numpy as np

def xor_images(img1_path, img2_path, output_path):
    # 打开图像
    img1 = Image.open(img1_path).convert('RGB')
    img2 = Image.open(img2_path).convert('RGB')

    # 转换图像为 numpy 数组
    img1_array = np.array(img1)
    img2_array = np.array(img2)

    # 确保图像尺寸相同
    if img1_array.shape != img2_array.shape:
        raise ValueError("The images must have the same dimensions")

    # 进行异或操作
    xor_array = np.bitwise_xor(img1_array, img2_array)

    # 将结果转换回图像
    xor_image = Image.fromarray(xor_array)

    # 保存结果图像
    xor_image.save(output_path)

# 使用示例
img1_path = r"E:\练习\白丝上的flag\en_image.png"# 第一个图像的路径
img2_path = r"E:\练习\白丝上的flag\en_image1.png"  # 第二个图像的路径
output_path = 'E:\练习\白丝上的flag\output.png'  # 输出结果图像的路径

xor_images(img1_path, img2_path, output_path)

[Week3] 我要吃火腿!
是兽⾳加密,加密脚本,解密,foremost 可以分出来东⻄,⼀个 wav ⾳频,⽤⼯具 RXSSTV 跑⼀下
def xor_with_ham(input_file, output_file):
    ham_bytes = [0x48, 0x61, 0x6D]
    
    with open(input_file, 'rb') as f:
        data = bytearray(f.read())

    for i in range(len(data)):
        data[i] ^= ham_bytes[i % 3]

    with open(output_file, 'wb') as f:
        f.write(data)

xor_with_ham('Hamorl.jpg', 'Ham.jpg')
def recover_from_xor(encrypted_file, recovered_file):
    ham_bytes = [0x48, 0x61, 0x6D]  # 加密时使用的字节序列

    # 读取加密后的文件数据
    with open(encrypted_file, 'rb') as f:
        encrypted_data = bytearray(f.read())

    # 创建一个与加密数据相同大小的bytearray用于存储解密数据
    recovered_data = bytearray(len(encrypted_data))

    # 对加密数据应用XOR操作以恢复原始数据
    for i in range(len(encrypted_data)):
        # 使用ham_bytes中的字节进行XOR操作
        recovered_data[i] = encrypted_data[i] ^ ham_bytes[i % 3]

    # 将恢复的数据写入到新的文件中
    with open(recovered_file, 'wb') as f:
        f.write(recovered_data)


# 调用解密函数,恢复文件
recover_from_xor('Ham.jpg', 'Recovered_Hamorl.jpg')


原文地址:https://blog.csdn.net/lzx13290757580/article/details/142264647

免责声明:本站文章内容转载自网络资源,如本站内容侵犯了原著者的合法权益,可联系本站删除。更多内容请关注自学内容网(zxcms.com)!