Reverse Engineering And Cracking A .Net Binary Using dnSpy

Learning how to crack a .net binary

Dec 22, 2019 · 2 min read
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


Written by




Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade