BP Code Calc Exe
the first part of this tutorial includes an example of what a public key is, and how a public/private key pair is used. it's one of the simplest examples of public/private key encryption, but there are so many details that you'll want to understand to read the rest of the tutorial. much of the rest of the tutorial comes from other sources, but it's a good place to start. those details are outlined in the in this section, and elsewhere.
the main objective of the challenge was to create a stub programme that would have no existing functionality, other than launching a shellcode downloader. the downloader would then download a zip file that when opened, would attempt to crack a password if one had been supplied. however, the solution does a little more than this. after all the decryption, it then calls a known routine to set the flag and then exit. this causes the target exe to run normally, except that it will have a flag set. the remainder of this writeup will walk you through the solution with explanations and analysis.
it is important to note that i discovered that i could search for a function string in the.net framework if the program was already running rather than from a debugger. this is why you can see that the code locations are green in windbg.
let's start by creating a simple shellcode downloader and password cracker, in this case written in c#. for simplicity, it will have no functionality other than downloading a zip file from a url, extracting the contents into the current directory (you can use curl on linux), and then trying to crack a hard-coded password and set the flag.