首页 > 其他分享 >[2019红帽杯]easyRE WP

[2019红帽杯]easyRE WP

时间:2024-10-27 15:21:03浏览次数:1  
标签:字节 异或 2019 flag v4 WP 红帽 byte 6CC0A0

[2019红帽杯]easyRE

查壳

image-20241027144149739

无壳,64位elf文件

分析

首先没找到什么有用的函数,用shift + 12搜索字符串

image-20241027144313145

定位这个字符串

x追踪到函数

image-20241027144347396

首先关注这里第一个for循环,按tab到汇编界面查看

image-20241027145347850

这是个简单的异或,写一下脚本

a = [73,111,100,108,62,81,110,98,40,111,99,121,127,
     121,46,105,127,100,96,51,119,125,119,101,107,
     57,123,105,121,61,126,121,76,64,69,67]
hint = ''
for i in range(len(a)):
    hint += chr(a[i] ^ i)
print(hint)

得到hint : Info:The first four chars are flag

第二个加密

image-20241027145512241

跟进sub_400E44函数

image-20241027145550894

查看里面的aAbcdefghijklmn字符串:

image-20241027145612961

很明显这是一个base64加密

off_6CC090变量进行解密

十次base64解密

得到https://bbs.pediy.com/thread-254172.htm

点进去是看雪论坛的一篇文章,但没有什么与flag有关的内容

后面其实就没思路了,后面也是看的别的大佬的wp:

最后加密

点进off_6CC090

image-20241027150535982

这里还有一大串字符串,对着变量名按x找到函数,f5反汇编

image-20241027150620747

直接关注这个for循环

 if ( (v1 ^ byte_6CC0A0[0]) == 'f' && (HIBYTE(v4) ^ byte_6CC0A3) == 'g' )
  {
    for ( j = 0; j <= 24; ++j )
      sub_410E90((byte_6CC0A0[j] ^ *(&v4 + j % 4)));
  }

这里最主要是拿byte_6CC0A0v4进行异或

byte_6CC0A0是已知的

现在就是要求v4

关注上面的if判断,让v1第一个字节与byte_6CC0A0[0]进行异或和让v4(v4就是v1)高字节(也就是最后一个字节与byte_6CC0A3第一个字节进行异或,分别得到字符f和g

因此猜测v4与byte_6CC0A0前四字节进行异或得到字符串flag(逆向七分技术三分猜说是)

为什么v4是四字节,可以从这里看到v4是unsigned int变量,从其在rsp寄存器中的位置也能知道他是4字节

image-20241027151551153

因此便可写脚本得到v4并进行后面的for循环异或得到flag

enc = [0x40,0x35,0x20,0x56,0x5D,0x18,0x22,0x45,0x17,0x2F,0x24,0x6E,0x62,0x3C,0x27,0x54,0x48,0x6C,0x24,0x6E,0x72,0x3C,0x32,0x45,0x5B]
key = []
enc2 = 'flag'
flag = ''
for i in range(len(enc2)):
    key.append(ord(enc2[i]) ^ enc[i])
for i in range(len(enc)):
    flag += chr(enc[i] ^ key[i % 4])
print(flag)

flag{Act1ve_Defen5e_Test}

标签:字节,异或,2019,flag,v4,WP,红帽,byte,6CC0A0
From: https://www.cnblogs.com/murasame520/p/18508472

相关文章

  • BuildCTFwp
    自己本次比赛负责reverse,misc,crypto方向,web和pwn就不写了MiscFindYourWindows告诉了key文件,应该是磁盘类的题,用veracrypt解决提示桌面有问题,改成zip文件看看BuildCTF{I2t_s0_e5sy!!!}四妹?还是萍萍呢?fromPILimportImageimportqrcodedefstitch_images(image_pat......
  • WPFLocalizeExtension 多语言组件使用和原理及拓展
    NugetWPFLocalizeExtensionYourAssembly.Resources(自行添加)文件夹添加Strings.xxx.resx(Strings.zh-CN.resx/Strings.en-US.resx)可以在XAML代码的整个VisualTree中更改任意位置的ResxLocalizationProvider.DefaultAssembly和ResxLocalizationProvider.Default......
  • # StackPanel wpf 布局
    StackPanelwpf布局GridDemo\GridDemo\MainWindow.xaml<Windowx:Class="GridDemo.MainWindow"xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml......
  • # wpf Grid布局
    wpfGrid布局效果GridDemo\GridDemo\MainWindow.xaml<Windowx:Class="GridDemo.MainWindow"xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml&q......
  • wpf baml 文件读取
    bmal文件读取运行效果Demo01\Demo01\MainWindow.xaml.csusingSystem.Collections;usingSystem.Globalization;usingSystem.IO;usingSystem.Resources;usingSystem.Text;usingSystem.Windows;usingSystem.Windows.Baml2006;usingSystem.Windows.Controls;using......
  • WPF+Mvvm案例实战(五)- 自定义雷达图实现
    文章目录1、项目准备1、创建文件2、用户控件库2、功能实现1、用户控件库1、控件样式实现2、数据模型实现2、应用程序代码实现1.UI层代码实现2、数据后台代码实现3、主界面菜单添加1、后台按钮方法改造:2、按钮添加:3、依赖注入3、运行效果4、源代码获取1、项目准......
  • WPF+MVVM案例实战(六)- 自定义分页控件实现
    文章目录1、项目准备2、功能实现1、分页控件DataPager实现2、分页控件数据模型与查询行为3、数据界面实现3、运行效果4、源代码获取1、项目准备打开项目Wpf_Examples,新建PageBarWindow.xaml界面、PageBarViewModel.cs,在用户控件库UserControlLib中创建用......
  • wpf XAML编译成BAML的过程
    XAML编译成BAML的过程xaml编译成baml,baml是一种压缩文件,为了提高加载速度构造函数中的InitializeComponent()加载baml编译过程在编译过程中,XAML文档最终被转换成BAML(二进制应用程序标记语言)作为资源嵌入到程序集中。当应用程序运行时,会从构造函数的实现方法中提取BAML......
  • wpf program.cs启动程序
    使用Program.cs启动wpf文件Demo00\Demo00\Program.csusingSystem;usingSystem.Collections.Generic;usingSystem.Linq;usingSystem.Text;usingSystem.Threading.Tasks;namespaceDemo00{internalclassProgram{[STAThread]staticvo......
  • wpf 初始项目的入口文件
    wpf项目的入口文件Demo00\Demo00\App.xaml<Applicationx:Class="Demo00.App"xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"......