一、查看文件类型ELF32 有upx壳脱壳后kali中运行二、IDA静态分析1.查看main程序逻辑分析:程序会创建一个管道,然后开启一个子进程进行进程间通信。子进程将 69800876143568214356928753 发送给父进程。父进程要求用户输入一个整数,并且等于子进程的 pid 。后面就会对发送过来的数据进行解码成 flag 输出来。lol() 函数就是解码函数查看lol()用IDA7.6和7.5 F5后都没有程序内容查看汇编窗口发现有内容,可能新版IDA反编译此程序有问题查看WP后发现别人的没有问题三、解题脚本如下:a='69800876143568214356928753' v2=chr(2*ord(a[1])) v3=chr(ord(a[4])+ord(a[5])) v4=chr(ord(a[8])+ord(a[9])) v5=chr(2*ord(a[12])) v6=chr(ord(a[18])+ord(a[17])) v7=chr(ord(a[10])+ord(a[21])) v8=chr(ord(a[9])+ord(a[25]))
1.查壳ELF32 无壳kali中运行2.IDA静态分析(1)mainint __cdecl main() { _DWORD *v0; // eax int v2; // [esp+14h] [ebp-Ch] _DWORD *v3; // [esp+1Ch] [ebp-4h] memset(&input, 0, 0x4000u); puts("input raw_flag please:"); v3 = &input; do { v0 = v3++; scanf("%d", v0); } while ( *(v3 - 1) ); v2 = check1((int)&input); if ( v2 == -1 ) { printf("check1 not pass"); system("pause"); } if ( (unsigned __int8)check2(&input, v
1.查壳PE32 有UPX壳运行脱壳2.IDA静态分析(1)mainint __cdecl main(int argc, const char **argv, const char **envp) { int v3; // kr00_4 char Buffer[40]; // [esp+4h] [ebp-2Ch] BYREF memset(Buffer, 0, sizeof(Buffer)); printf("Welcome The System\nPlease Input Key:"); gets_s(Buffer, 0x28u); v3 = strlen(Buffer); if ( (unsigned int)(v3 - 35) <= 2 ) { if ( sub_401090((int)Buffer, v3) == 1 ) printf("Well Done!\n"); else printf("Your Wrong!\n"); }
1.查壳PE32 无壳尝试运行提示输入flag,但是发现输入不进去,程序也没有卡顿,光标闪烁很流畅,猜测是程序内部分代码阻止了输入。2.IDA逆向分析题目名为Newbie_calculations,也是一种提示,表示此题与运算相关打开看到一堆变量定义和一堆函数调用,逆序阅读代码发现程序最后直接输出flag,其值在数组v120中,并且知道其长度为32。向上跟踪数组v120在栈中修改数组长度后,代码变的好看一点了,但还是没能完全解决IDA拆分的问题首先初始化数组v120[32], 其中32个元素全初始化为1阅读代码后发现,main函数中没有执行用户输入的函数,一大堆的函数执行中实际上只有三个函数sub_731100 ,sub_731000 和sub_731220分别查看main函数代码如下:(三个函数已经经过改名)int __cdecl main(int argc, const char **argv, const char **envp) { _DWORD *v3; // eax _DWORD *v4; // eax _DWORD *v5; // eax _DWORD *
一、查看文件类型PE32 无壳二、HOOK原理1.什么是hook(钩子)对于Windows系统,它是建立在事件驱动机制上的,说白了就是整个系统都是通过消息传递实现的。hook(钩子)是一种特殊的消息处理机制,它可以监视系统或者进程中的各种事件消息,截获发往目标窗口的消息并进行处理。所以说,我们可以在系统中自定义钩子,用来监视系统中特定事件的发生,完成特定功能,如屏幕取词,监视日志,截获键盘、鼠标输入等等。 钩子的种类很多,每种钩子可以截获相应的消息,如键盘钩子可以截获键盘消息,外壳钩子可以截取、启动和关闭应用程序的消息等。钩子可以分为线程钩子和系统钩子,线程钩子可以监视指定线程的事件消息,系统钩子监视系统中的所有线程的事件消息。因为系统钩子会影响系统中所有的应用程序,所以钩子函数必须放在独立的动态链接库(DLL) 中。 所以说,hook(钩子)就是一个Windows消息的拦截机制,可以拦截单个进程的消息(线程钩子),也可以拦截所有进程的消息(系统钩子),也可以对拦截的消息进行自定义的处理。Windows消息带了一些程序有用的信息,比如Mouse类信息,就带有鼠标所在窗体句柄、鼠标位置
Norman1z