吾杯网络安全技能大赛WP(部分)

发布于:2024-12-05 ⋅ 阅读:(105) ⋅ 点赞:(0)

吾杯网络安全技能大赛WP(部分)

MISC

Sign

直接16进制解码即可

image-20241202083944961-1733106176910-3

原神启动

  1. 将图片用StegSolve打开

image-20241202084129902-1733106172537-1

找到了压缩包密码

将解出docx文件改为zip

找到了一张图片和zip

image-20241202084228316-1733106195652-5

image-20241202084238107-1733106198167-7

再把图片放到stegSlove里找到了img压缩包的密码

image-20241202084250361-1733106200655-9

然后在document.xml里找到了text.zip压缩包密码

image-20241202084301873-1733106202772-11

然后就出来flag了

image-20241202084325196-1733106205060-13

太极

image-20241202084503181-1733106207472-15

先把编码格式转换为utf-8

image-20241202084538008-1733106210596-17

根据提示4,找到了拼音规律,

image-20241202084553885-1733106216052-19

每一段的第一个字取第一个字母,第二个取第二个字母,如果拼音不足的话再从头数

image-20241202084606452-1733106218291-21

旋转木马

给了两段base编码,先把他们合并到一起

因为两个文件太大了所以只能用脚本了

import os

def concatenate_files(file1_path, file2_path, output_path):
    try:
        # 检查文件是否存在
        if not os.path.exists(file1_path) or not os.path.exists(file2_path):
            print("一个或多个文件不存在。")
            return

        # 打开并读取第一个文件
        with open(file1_path, 'r', encoding='utf-8') as file1:
            content1 = file1.read()

        # 打开并读取第二个文件
        with open(file2_path, 'r', encoding='utf-8') as file2:
            content2 = file2.read()

        # 将两个文件内容拼接
        combined_content = content1 + content2

        # 将拼接后的内容写入新文件
        with open(output_path, 'w', encoding='utf-8') as output_file:
            output_file.write(combined_content)

        print(f"文件内容已成功拼接并保存到 '{output_path}'.")
    
    except FileNotFoundError as e:
        print(f"文件未找到: {e}")
    except IOError as e:
        print(f"文件操作错误: {e}")
    except Exception as e:
        print(f"发生未知错误: {e}")

file1_path = 'flag1'
file2_path = 'flag2'
output_path = 'out.txt'

concatenate_files(file1_path, file2_path, output_path)

然后将合并后的base编码循环解码

import base64

def decode(f):
    n = 0
    while True:
        try:
            f = base64.b64decode(f)
            n += 1
        except base64.binascii.Error as e:
            print(f"[+] Base64共解码了{n}次,最终解码结果如下:")
            print(f.decode('utf-8', errors='replace'))  # 处理无效的UTF-8序列
            break
        except Exception as e:
            print(f"[!] 发生未知错误: {e}")
            break


if __name__ == '__main__':
    # 使用 with 语句确保文件正确关闭
    with open('./out.txt', 'r', encoding='utf-8') as file:
        content = file.read().strip()  # 去除首尾空白字符

    # 尝试Base64解码
    decode(content)

image-20241202085824509-1733106224854-25

解出一个16进制,再解码

image-20241202085927776-1733106222834-23

音文

给了一个wav文件,先用Audacity看一下

image-20241202091536611-1733106226438-27

看不太懂,

slienteye也试了,没东西

用kali foremost 一下找到了一个zip文件

image-20241202092951188-1733106247977-29

这里就想到把文件里的所有文件名提取出来

import os
import re

def extract_number(file_name):
    # 使用正则表达式查找文件名中的第一个数字序列
    match = re.search(r'(\d+)', file_name)
    if match:
        return int(match.group())
    else:
        return float('inf')  # 如果没有找到数字,返回一个很大的值,以确保这些文件排在最后

# 获取并过滤掉非文件项(如目录)
file_names = [f for f in os.listdir('.') if os.path.isfile(f)]

# 根据文件名中的数字排序
file_names_sorted = sorted(file_names, key=extract_number)

# 拼接文件名中的中文字符
result = ''.join(
    chinese_chars
    for file_name in file_names_sorted
    for chinese_chars in re.findall(r'[\u4e00-\u9fa5]', file_name)
)

# 写入结果到 out.txt 文件
output_path = 'out.txt'
try:
    with open(output_path, 'w', encoding='utf-8') as f:
        f.write(result)
    print(f"结果已保存到 {output_path}")
except IOError as e:
    print(f"写入文件时出错: {e}")

image-20241202093140207-1733106251004-31

然后发现类似与摩斯密码

将苏珊替换为.哎哟替换为-你干嘛替换为空格

image-20241202093352614-1733106253172-33

然后发现了一个地址

image-20241202093528525-1733106254971-35

下载下来是一个apk文件

拖进模拟器

image-20241202093806447-1733106258572-37

发现是一个解密软件,需要输入文件路径

考虑把wav放进去

image-20241202093959072-1733106260459-39

找到文件路径

image-20241202094021466-1733106262586-41

/mnt/shared/Pictures/AT.wav

image-20241202094141755-1733106264412-43

image-20241202094151920-1733106266106-45

解密失败,文件hash不对

考虑把wav里的压缩包去掉

这里用手动去,foremost后的不行(我也不知道为啥)

image-20241202094454432-1733106268213-47

image-20241202094517595-1733106270484-49

然后再拖进模拟器中,再解密

image-20241202094644044-1733106272347-51

Crypto

Easy

给了两个文件

flag.txt:

d8d2 963e 0d8a b853 3d2a 7fe2 96c5 2923
3924 6eba 0d29 2d57 5257 8359 322c 3a77
892d fa72 61b8 4f

附件.txt

get buf unsign s[256]

get buf t[256]

we have key:hello world

we have flag:????????????????????????????????


for i:0 to 256
    
set s[i]:i

for i:0 to 256
    set t[i]:key[(i)mod(key.lenth)]

for i:0 to 256
    set j:(j+s[i]+t[i])mod(256)
        swap:s[i],s[j]

for m:0 to 37
    set i:(i + 1)mod(256)
    set j:(j + S[i])mod(256)
    swap:s[i],s[j]
    set x:(s[i] + (s[j]mod(256))mod(256))
    set flag[m]:flag[m]^s[x]

fprint flagx to file

直接通义出

import binascii

def rc4(key, data):
    # Initialize S and T arrays
    s = list(range(256))
    j = 0
    for i in range(256):
        j = (j + s[i] + key[i % len(key)]) % 256
        s[i], s[j] = s[j], s[i]

    # Pseudo-random generation algorithm (PRGA)
    i = j = 0
    result = []
    for byte in data:
        i = (i + 1) % 256
        j = (j + s[i]) % 256
        s[i], s[j] = s[j], s[i]
        k = s[(s[i] + s[j]) % 256]
        result.append(byte ^ k)

    return bytes(result)

# Provided key and flag as hex string
key = b'hello world'
hex_flag = "d8d2963e0d8ab8533d2a7fe296c5292339246eba0d292d5752578359322c3a77892dfa7261b84f"

# Convert hex string to bytes
flag_bytes = binascii.unhexlify(hex_flag)

# Decrypt the flag using RC4
decrypted_flag = rc4(key, flag_bytes)

# Print the decrypted flag
print(decrypted_flag.decode('utf-8', errors='replace'))

image-20241202095118277-1733106275715-53

web

sign

image-20241202095256266

访问页面发现给了密码了,根据提示直接用蚁剑连即可。

clip_image002

clip_image004

然后在根目录下找到了flag

clip_image006

clip_image008


网站公告

今日签到

点亮在社区的每一天
去签到