Flare ON Challenge #7
I was debating on whether or not I wanted to do a blog entry on my failed yet successful attempt at the FLARE On challenge (I only completed up to binary #10) and am still thinking it over. However, I am reading write ups and I see that my approach to #7 is a lot easier than most and I wanted to share it. Needless to say if you know me or my work, I was very excited this was a .NET binary!
The binary “YUSoMeta.exe” presents a nice message for us
I decided to throw the binary into one of my favorite .NET tools, Gray Wolf, which also does deobfuscation!
Throwing the binary in without deobfuscating reveals it is obfuscated..
So go and be rid of that!
Now looking at all of the source code I came across the main method that does the decryption of our key in System.Void ns0.Class1::Main(System.String)
(code cut for brevity)
So it needs us to input some string value and if it matches “b” it will decrypt our key. Notice the 3rd WriteLine is taking text and putting it through another routine with byte_. I thought this was the key and instantly traced Class1.smethod_1.
and saw it was doing crypto.. boring.
I then noticed Class1.smethod_0 was generating the “b” string which is compared to our string so I traced smethod_0.
and now we need to look at smethod_2 to see what this loop does
Ah! It is looking at some runtime information which is why it cannot be edited!
The line making string “b” also called into smethod_3() which also uses runtime information in the form of GetExecutingAssembly().
Well, this was all I needed and I started copy/pasting the logic into my own C# project.
Note that we need runtime information to perform smethod_2 and smethod_3… I just used reflection to load the binary in my project!
and performed the same conversion for smethod_3()
Doing this and copying all of the other needed information reveals my new main() without any checking because I have all of the needed information already using reflection!
Notice in the main I also replaced the call to smethod_1 with “b” instead of “text”, which is no longer in mine as the original main checked “if (text == b)” meaning they are the same!
Running this reveals the magic (and yes, I like to tamper so I left the last WriteLine which is the failed attempt)
and I not only read the source, but changed it!
Time permitting I hope to write the steps I took to solve the challenges I did! Like I said, while I may not have been “successful” at winning, I learned an awful lot from participating in FLARE ON!