Articles

Affichage des articles du 2017

Himayatic rev_400 Writeup (.NET Crackme)

Image
Hello, today I'll crack a .NET crackme, it was featured on Himayatic CTF, November 2nd 2017. Download link : https://drive.google.com/open?id=0B7U3AsTA9UVfRHdTY2hfQzZrQm8 Let's start :) First, we notice that it's a .NET crackme, it asks for a serial, and displays " Wrong Serial ... !!! " when we enter a random one. We open it in a .NET decompiler (I used dnSpy, which is a fork of ILSpy), and we immediately locate this function :   The code looks obfuscated, we follow the N and M functions in the namespace A, and we find this: Looks like they used CryptoObfuscator to obfuscate the code, we'll use a .NET deobfuscator (de4dot : https://github.com/0xd4d/de4dot ) to clean the executable. We open the cleaned executable in dnSpy, the obfuscation is gone! But it's a wrong flag, if it were the real flag, the else part would display "Wrong Serial ... !!!" and not "Illusion ... !!" (of course, we still try it, who know

Cracking Lua program using code injection

Image
Hello, t his is the writeup of a small crackme I made. Crackme download links: 32 bit : https://drive.google.com/open?id=0B7U3AsTA9UVfQzVGbHl0cTRTa00 64 bit : https://drive.google.com/open?id=0B7U3AsTA9UVfYTYwZWt3dER0ems Source code : https://pastebin.com/v3EfAtLu Method 1 (The recommended way) After reading the hints (there is an obvious flaw in the source code), we start thinking, what are the possible security flaws in a Lua program? After looking at the Wikipedia page of Lua, we find an interesting section : the C API, we find a code snippet that executes code in the context of the program. #include <stdio.h> #include <lua.h> //Lua main library (lua_*) #include <lauxlib.h> //Lua auxiliary library (luaL_*) int main(void) {     //create a Lua state     lua_State *L = luaL_newstate();     //load and execute a string     if (luaL_dostring(L, "function foo (x,y) return x+y end")) {         return -1;     }     lua_close(L);     return 0; } One