Posts

Showing posts with the label Reverse Engineering

How I Compile Reverse Engineering Exercises For Maximum Learning And Minimum Noise

Image
Imagine if your first reverse engineering exercise was to reconstruct an encrypted IAT – if you don’t fully know what that means, that’s the point: beginner reverse engineering exercises should be clear (and fun)!
Anything that can throw off the analysis of a reverse engineer, such as optimized inlined functions, shouldn’t be in beginner exercises. Secondly, I would like my exercises to run on as students' computers as possible. These are the goals I strive for when creating CyberQueens exercises, and here is how I configure my compiler to meet those goals.

Ensuring A Clear And Concise Executable is Compiled To prevent the compiler from adding any unintended opcodes or logic, which could confuse aspiring reverse engineers, set all of the following build properties:
To disable uninitialized memory checks (and other debugging) checks from being automatically compiled into the code, set the compilation target to Release. This can be done from VS’s main page, as seen in Figure 1.

To o…

Windows Source Code Leaks & A Story Of Lost Source Code

Image
Disclaimer: The information presented in this blog post is for educational purposes only.

When researching or just tinkering with Windows and Microsoft executables, having the source code is a great advantage. This short article is a collection of links to Windows and Microsoft code.
Leaked Windows Source Code Links to leaked Windows source files:
Windows NT4 https://github.com/ZoloZiak/WinNT4Windows 2000 https://github.com/pustladi/Windows-2000Windows Research Kit https://github.com/Zer0Mem0ry/ntoskrnl Links aggregated from BlueHatIL talk “Fuzzing on the windshield”
Official Microsoft Published Source Code Microsoft has recently become significantly more Open Source oriented, and has even started actively developing Open Source projects and publishing some of its own code.
Links to published Microsoft code:
Microsoft .NET source https://referencesource.microsoft.com/Microsoft’s Github https://github.com/Microsoft Other Resources Other resources to help you with your Windows and Microso…

Guy's 30 Reverse Engineering Tips & Tricks

Image
Good morning lovely people!

During April I challenged myself to tweet 1 reverse engineering tip every day. For your viewing pleasure, here I aggregated all 30 tips.

Be sure to follow me @va_start for my latest tweets and more reverse engineering extravaganza.
Leave a comment on this post or tag me on Twitter - I reply pretty quickly :)

If the tweets aren't displayed properly (for example if there are no pictures), temporarily turn off tracker protection, which blocks loading the required resources from twitter
Tips & Tricks Tip 1 *Reverse Engineering Tip 1/30*
long branch-less functions w/many xors & rols are usually hash functions. IDA view of MD5 func:#BinReversingTipspic.twitter.com/cLSGfxNupK — Guy🏂 (@va_start) April 1, 2020 Tip 2 -Reversing Tip 2/30-
Building on the last tip, after finding a hash function, google its constant to identify the exact hash algorithm. #BinReversingTipspic.twitter.com/MJJIBY9pde — Guy🏂 (@va_start) April 2, 2020 Tip 3 -Reversing Tip 3/30-

Calling Arbitrary Functions In EXEs: Performing Calls to EXE Functions Like DLL Exports

Image
Motivation When reversing or fuzzing an executable, being able to run an arbitrary function with controlled data is extremely helpful. Through iteratively playing with the function's parameters and examining the output, we can better understand the function's logic.
Background A dll (Dynamic Linked Library) with our target function would allow us to conveniently review and test the function as we wish. The only problem is that usually the function we want to examine resides in an exe, not a dll. Converting¹ an exe to a dll is a solvable challenge. After all, both an exe and a dll share the same PE (Portable Executable) file format.  So let's explore, how can we convert¹ an exe to a dll?
Spoiler: there are a few more steps than just changing the extension 😉
¹ "convert to DLL" = fundamentally behave like a DLL.

I'll use this exe created from the following code and target the decode_string function for demonstration purposes throughout this post.

Challenges Th…

Stack Overflow CVE-2019-17424 Vulnerability Write-Up and RCE Exploit Walk Through

Image
Stack Overflow CVE-2019-17424 Vulnerability Write-Up and RCE Exploit Walk Through This is Part 2 in a 4 part series about my process hunting for vulnerabilities in a network auditing tool (used to protect networks by detecting and fixing security holes), and fully exploiting one of the vulnerabilities I found. I recommend reading the series in ascending numeric order. Link to part 1 here. Links to parts 3, and 4 at the end of this post.

This post describes how I found CVE-2019-17424 and successfully exploited the vulnerability in the precompiled, packaged product.
Vulnerability ⚡ Reader’s Exercise 🔎 I found CVE-2019-17424 by manually reviewing the source code of nipper-ng. Provided below is an excerpt from the source code containing only the vulnerable function. You are welcome to take it as an exercise to find the vulnerability in the code below:

Notice: The vulnerability in the code above is identified in the paragraph below. If you want to try to find the vulnerability yourself, o…