syscall59
Published in

syscall59

Reverse Engineering And Cracking A .Net Binary Using dnSpy

Learning how to crack a .net binary

Photo by mahdis mousavi on Unsplash

Let’s see how to solve this .net crackme. Let’s try the crackme with some random credentials to see how it goes.

:( author isn’t pleased by my creds

We can see reading through the code that the registration key depends on the result of a random value. My first idea was that maybe the random number generation is guessable when providing no seed for the constructor. Here’s the validation code.

But after checking how the Random constructor work when it’s given no seed I concluded that’s not an option. Here are the official docs for you to check.

As the key depends on this random value given by the Random.Next()method the most efficient way to crack the binary is to patch it.

I removed the validation for the serial using dnSpy and as you can see here the cracked binary works for any username and password you provide.

And that was it! Hope you enjoyed this writeup

--

--

--

Hacking/Infosec writeups and articles

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Syscall59 — Alan Vivona

Syscall59 — Alan Vivona

Golang, Python, Javascript, Linux & Infosec. https://twitter.com/syscall59

More from Medium

Exploiting Azure Queue Storage: Unexpired SAS Token with Excessive Permission

Thread Local Storage

TLS message box

Broken Access Control vs. Broken Authentication

Understanding Spring4Shell RCE from an engineer’s perspective (with code)