2019红帽杯-MISC-复盘WriteUp(更新中)

前言:

  前阵子玩了玩今年的红帽杯,题目质量很高,值得记录一下。

  题目见:https://github.com/DrsEeker/redhat2019

0x01: Advertising for marriage

 拿到题目,是一个500多M的RAW文件,可知这是一道内存取证题目,使用内存取证工具Volatility进行分析:

使用格式:Volatility -f [imgfile] [command]

  

发现是WindowsXPSP2,查看进程信息:

Volatility -f [imgfile] --profile=WinXPSP2 psscan

发现两个可疑进程:notepad.exe(记事本)和mspaint.exe(画图)

查看记事本内容:Volatility -f [imgfile] --profile=WinXPSP2x86 notepad

 看到提示:????needmoneyandgirlfirend(吐槽一下,这里的girlfriend还打错了)

前四个字符不可知,dump画图进程:

Volatility -f [imgfile] --profile=WinXPSP2x86 memdump -p [pid] --dump-dir [outdir]

 

 使用GIMP工具载入原始图像数据(先重命名后缀为data),具体操作:

 调整位移可以调整图像在内存中的偏移,调整高度和宽度则是图像分辨率,先调整高度至一个适合的值,再调整宽度,再慢慢调整位移,可以得到进程在内存中的图像信息。

hint:每个宽度与高度均对应了一个分辨率,不同分辨率可以呈现的画面是不同的

经过我的多次调试后发现,把图像宽度调至960可以发现:

 其中的图片是镜像的,这便是画图界面在内存中的图像信息,镜像反转后可以得到b1cx这四个字符,结合notepad中提取的hint可以得到:b1cxneedmoneyandgirlfirend

到现在并没有发现一些直截了当的信息,于是,转变方向,我们可以尝试查看一下桌面上有什么内容:

volatility -f [imgfile] --profile=[imgversion] filescan | grep [arg]

可以看到桌面上有Dump It.exe(就是这个程序生成的内存dump文件,即我们拿到的题目文件),HP-xxxx.raw(这个raw文件就是我们的题目文件了),vegetable.png(可疑,dump下来看看)

volatility -f [imgfile] --profile=[imgversion] dumpfiles -Q [file_offset] --dump-dir [outdir]

 

查看dump出的图片:

 打开图片时遇到错误,提示CRC校验出错,猜测是高度或者宽度有问题,利用CRC爆破可以得到图片的正确高度为:

 

 贴上脚本:

# -*- coding: utf-8 -*-
import binascii
import struct
crc32key = 0xB80A1736
height = 0
width = 0x11f
for i in range(0, 0xffff):
  height = struct.pack('>i', i)
  #width = struct.pack('>i',i)
  data = '\x49\x48\x44\x52' + struct.pack('>i',width) + height + '\x08\x06\x00\x00\x00' #爆破高度用
  #data = '\x49\x48\x44\x52' + width + struct.pack('>i',height) + '\x08\x06\x00\x00\x00' #爆破宽度用
  crc32result = binascii.crc32(data) & 0xffffffff
  if crc32result == crc32key:
    print(''.join(map(lambda c: "%02X" % ord(c), height)))

在010editor中改好打开图片看到:

 看到是模糊的flag,使用binwalk也没有什么发现,怀疑是LSB隐写,使用cloacked-pixel工具:

python extract [infile] [outfile] [pass]

 可以看到

 Base64解密得:

Virginia ciphertext:gnxtmwg7r1417psedbs62587h0

看到是维吉尼亚密码,由于维吉尼亚密码的秘钥只能是字母,所以从b1cxneedmoneyandgirlfirend剔除掉1再解密

可以得到

 flag : flagisd7f1417bfafbf62587e0

猜你喜欢

转载自www.cnblogs.com/basstorm/p/11885798.html