2023红明谷杯misc方向wp

hacker

导出http对象

img

发现有shell.php,分析后大概了解其是一个带加密的shell。

img

一个简单的异或加密,但是不知道admin的key。继续追踪http流

img

在这里找到admin的password,现在有了key,之后过滤dns请求

img

现在明文密文都有了,开始写解密脚本(这里写了两个,一个php,一个python,反正都是用chatgpt嗦的)

这里hex转出来如下:

ACCAGTAAAACG{AATTCAACAACATGCTGCCTACA-AACAAAAACAAT-TCATCAACAAAT-AACAACTGGTGA-TTCTTCTCATGATGAAAAACTTCTTCTGCTGC}

猜测是四进制,开始手撸

img

一个个对应过去,最后发现我们用脚本解出来的在拼接的部分少了一位的样子

flag{d1ee66(CT)e-babd-11ed-00155d(AC)0066}

接下来就是猜测 CT 和 AC分别缺什么。经过对照,flag生成的原理是16进制数,所以不可能超过f,第一位CT只有一个字符4(TCT)符合条件,那么只用考虑第二位的AC。第二位的AC可能是 b.e.f这三个,一个个试过去,当输入b的时候直接正确。

<?php
$hex_xor_subdomain = "79227024716c7522787370254c777230667673222570247b76677322632671";
$password = '8a3e684c923b763d252cf1e8734a7a29';
$hex_password = bin2hex($password);
$len_password = strlen($hex_password);
// echo $new_password;
$len_output = strlen($hex_xor_subdomain);
for ($i=0;$i<$len_output;$i++){
$char_output = $hex_xor_subdomain[$i];
// echo $char_password;
$char_password = $hex_password[$i % $len_password];
// echo $char_password;
$char_xor = dechex(hexdec($char_output) ^ hexdec($char_password));
// echo $char_xor;
$res .= $char_xor;

}
echo $res;
// echo "hello";
?>

hex_xor_subdomain = "79227024716c7522787370254c777230667673222570247b76677322632671"
password = '8a3e684c923b763d252cf1e8734a7a29'

hex_password = password.encode('utf-8').hex()
len_password = len(hex_password)

len_output = len(hex_xor_subdomain)
res = ""

for i in range(len_output):
char_output = hex_xor_subdomain[i]
char_password = hex_password[i % len_password]
char_xor = hex(int(char_output, 16) ^ int(char_password, 16))[2:]
res += char_xor

print(res)

最终得到flag{d1ee664e-babd-11ed-bb75-00155db0066}

阿尼亚

文件尾找到一串数字,解两次hex之后像是一种编码

image-20230419153039325

image-20230419153202548

image-20230419153210584

直接暴力解一下编码方式得到密码简单的编码

image-20230419153355887

搜索图片文件名netpixeljihad得到一个在线网站,文字隐写术 - PixelJihad - ZOOTU用上面的密码解得zip密码

image-20230419153542262

得到一串±编码,用dcode.fr直接识别

image-20230419153637981

image-20230419161027239

image-20230419161120270

X光的秘密

逐帧查看时发现最后三帧图片一模一样,尝试使用python将图片逐帧全部导出

image-20230419153722277

import pydicom
from PIL import Image

# Load the DICOM file
dcm = pydicom.dcmread('task.dcm')

# Iterate through each frame and save as PNG file
for i, image in enumerate(dcm.pixel_array):
    # Convert pixel data to Pillow image object
    img = Image.fromarray(image)

    # Save the image as PNG file
    img.save(f'frame_{i}.png')

读取最后三帧图片的r,g,b值时发现17,18,19三帧图片刚好都只有一个通道,将三张图片的通道都提取出来分别作为新图片的RGB通道值组成新的一张图片(17,18,19三张图对应的通道大概猜一下即可,无非就是BGR或者RGB)

import cv2
import numpy as np

# Load the input images and extract the color channels
img1 = cv2.imread('frame_17.png')
r_channel = img1[:, :, 0]  # Extract the B channel

img2 = cv2.imread('frame_18.png')
g_channel = img2[:, :, 1]  # Extract the G channel

img3 = cv2.imread('frame_19.png')
b_channel = img3[:, :, 2]  # Extract the Rchannel

# Create a new image with the combined channels
new_img = np.zeros_like(img1)  # Create an empty image with the same size as img1
new_img[:, :, 0] = b_channel
new_img[:, :, 1] = g_channel
new_img[:, :, 2] = r_channel

# Save the new image
cv2.imwrite('new.png', new_img)

lsb得到flag

image-20230419154138754

  • 7
    点赞
  • 10
    收藏
    觉得还不错? 一键收藏
  • 2
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值