{"id":9051,"date":"2012-05-14T15:00:07","date_gmt":"2012-05-14T13:00:07","guid":{"rendered":"https:\/\/www.corelan.be\/?p=9051"},"modified":"2012-05-14T15:00:07","modified_gmt":"2012-05-14T13:00:07","slug":"reversing-101-solving-a-protectionscheme","status":"publish","type":"post","link":"https:\/\/www.corelan.be\/index.php\/2012\/05\/14\/reversing-101-solving-a-protectionscheme\/","title":{"rendered":"Reversing 101 - Solving a protection scheme"},"content":{"rendered":"<p>&nbsp;<\/p>\n<h3><strong>Introduction:<\/strong><\/h3>\n<p>In this post, we'll look at an application reversing challenge from HTS (hackthissite.org) resembling a real-life protection scheme. You can find a copy of the challenge here:\u00a0\u00a0 <a href=\"http:\/\/www.hackthissite.org\/missions\/application\/app17win.zip\">http:\/\/www.hackthissite.org\/missions\/application\/app17win.zip<\/a><\/p>\n<p>Put simple, the program creates a key for your username, and compares it to the one you enter.<\/p>\n<p>This tutorial is not meant as a spoiler for HTS since for every username a dedicated password will be computed. This tutorial is purely written to allow you to understand how some (even real-life) protection schemes are implemented.<\/p>\n<p>The goal of the HTS challenge is to create a key generator, but in this tutorial I just want to find out my own dedicated password.<\/p>\n<p>Note: the length of the password is NOT static, and there are no anti-debugging mechanisms in effect \ud83d\ude42<\/p>\n<p>I used Windows XP SP3, so if you have a different windows version the addresses may be different as well.<\/p>\n<p>Thanks to HTS, and thanks to NightQuest for coding this nice application.<\/p>\n<p>&nbsp;<\/p>\n<h3><strong>Run the application:<\/strong><\/h3>\n<pre style=\"background-color: #191919; min-height: 40px; width: 650px; overflow: auto; border: #cecece 1px solid; padding: 5px;\">Z:\\HTS\\app17win&gt;app17win.exe\n******************************************\n* HackThisSite Application Challenge <span style=\"color: #008000;\">#17 *<\/span>\n*    Coded by NightQuest - 02-14-2009    *\n******************************************\nObjective:\nYou need to create a key that is unique to your HackThisSite username.\nThe idea is to create a keygen, but any method is allowed.\nAn example would be:\nUsername: SomeUserName\nPassword: HTS-1234-5678-9012-3456\nUsername: fancy\nPassword: **********\nUsername: fancy\nPassword: ****\nUsername:<\/pre>\n<p>As you can see, when you supply the wrong password, you'll be asked to input your username again!<\/p>\n<p>&nbsp;<\/p>\n<h3><strong>Find the password:<\/strong><\/h3>\n<p>Start the program (inside the debugger right away), enter your username and an arbitrary password. Do NOT press enter after entering the password.\u00a0 The idea is to use the debugger to \"hook\" into the execution flow at this point, and see what happens.<\/p>\n<pre style=\"background-color: #191919; min-height: 40px; width: 650px; overflow: auto; border: #cecece 1px solid; padding: 5px;\">Username: fancy\nPassword: 123456<\/pre>\n<p>Press the pause button (or press F12) in the debugger (OllyDbg or Immunity Debugger) to interrupt the execution.\u00a0 Next, press Alt-F9 (return to user).\u00a0 This will tell the debugger to break as soon as it returns from any Operating System code and starts executing code from the application itself again.<\/p>\n<p>The process should now be running again.\u00a0 Open the command prompt and press enter.\u00a0 You'll notice that the debugger will intervene and pause the process again right after a call to kernel32.ReadConsoleInputA<\/p>\n<p><a class=\"thickbox\" href=\"https:\/\/www.corelan.be\/wp-content\/uploads\/2012\/05\/app17_13.jpg\"><img loading=\"lazy\" decoding=\"async\" style=\"background-image: none; margin: 7px; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border: 0px;\" title=\"app17_1\" src=\"https:\/\/www.corelan.be\/wp-content\/uploads\/2012\/05\/app17_1_thumb3.jpg\" alt=\"app17_1\" width=\"600\" height=\"258\" border=\"0\" \/><\/a><\/p>\n<p>The idea now is to continue to step through the application, and try to see where our input was used.\u00a0 Let's use F8 (step over) to step through the instructions at this time.\u00a0 F8 will step over CALL instructions (to keep things a bit easier at this point), but we do need to keep an eye on the stack, every time we're about the execute a CALL.<\/p>\n<p>In fact, whenever reaching a CALL instruction, before pressing F8, check the stack and see if we can see our username and password on the stack.<\/p>\n<p>Press F8, and you should find this \"magic call\":<\/p>\n<pre style=\"background-color: #191919; min-height: 40px; width: 650px; overflow: auto; border: #cecece 1px solid; padding: 5px;\">00402210   E8 8AEEFFFF     CALL app17win.0040109F         ; <span style=\"color: #008000;\"># magic call<\/span><\/pre>\n<p>&nbsp;<\/p>\n<p><a class=\"thickbox\" href=\"https:\/\/www.corelan.be\/wp-content\/uploads\/2012\/05\/app17_26.jpg\"><img loading=\"lazy\" decoding=\"async\" style=\"background-image: none; margin: 7px; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border: 0px;\" title=\"app17_2\" src=\"https:\/\/www.corelan.be\/wp-content\/uploads\/2012\/05\/app17_2_thumb6.jpg\" alt=\"app17_2\" width=\"600\" height=\"302\" border=\"0\" \/><\/a><\/p>\n<h5>W<strong>hy is this the \"magic\" call? <\/strong><\/h5>\n<p>Well, not only does it use the input, but also returns a value in eax.\u00a0 It basically sets AL to 1 if a wrong password is given. When it returns AL=0, the \"TEST AL,AL\" would set the zero flag, so the \"JNZ\" instruction below would not be taken. The app will then tell you: \"<em>Congratulations! Enter that password on HackThisSite<\/em>.<\/p>\n<p>Let's evaluate what happens inside this call. Instead of setting over the call with F8, use F7 to step into the call.<\/p>\n<p>Then use F8 to step until you reach 0x004012B2.\u00a0 This is where AL is set to 1 (indicating the password is wrong).\u00a0 You'll notice that the routine jumped directly to the MOV AL,1 instruction, and didn't execute the XOR AL,AL and JMP just above it:<\/p>\n<p><a class=\"thickbox\" href=\"https:\/\/www.corelan.be\/wp-content\/uploads\/2012\/05\/app17_34.jpg\"><img loading=\"lazy\" decoding=\"async\" style=\"background-image: none; margin: 7px; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border: 0px;\" title=\"app17_3\" src=\"https:\/\/www.corelan.be\/wp-content\/uploads\/2012\/05\/app17_3_thumb4.jpg\" alt=\"app17_3\" width=\"600\" height=\"538\" border=\"0\" \/><\/a><\/p>\n<p>Anyways, AL is set to 1, but we we should avoid this !!!\u00a0 In fact, we should try to make the application jump to<\/p>\n<pre style=\"background-color: #191919; min-height: 40px; width: 650px; overflow: auto; border: #cecece 1px solid; padding: 5px;\">004012AE     32C0         XOR AL,AL<\/pre>\n<p>&nbsp;<\/p>\n<p>There are a lot of compare functions in this routine, and a lot of things are going on.<\/p>\n<p>Let\u2019s set a breakpoint at the magic CALL at 00402210, restart the application and enter a password in the format suggested by the application. In fact, you'll need to use your hackthissite.org username.<\/p>\n<p>I used \"fancy\" before, but my real username is \"fancy__004\", so that's what I'll use from this point forward \ud83d\ude42<\/p>\n<pre style=\"background-color: #191919; min-height: 40px; width: 650px; overflow: auto; border: #cecece 1px solid; padding: 5px;\">Username: fancy__04\nPassword: HTS-1234-5678-9900-1122<\/pre>\n<p>&nbsp;<\/p>\n<p>When the breakpoint at 0x00402210 gets hit, we can enter the function again with F7 and step through the routine.<\/p>\n<p>You'll see that there's a a lot of calls to this function:<\/p>\n<pre style=\"background-color: #191919; min-height: 40px; width: 650px; overflow: auto; border: #cecece 1px solid; padding: 5px;\">004011B3     E8 68150000       CALL app17win.00402720<\/pre>\n<p>By stepping into this function you\u2019ll see that there\u2019s a lot of computing done. To understand the algorithm behind calculating the password you have to examine this function.<\/p>\n<p>But I\u2019ll continue since I just want to have my password.<\/p>\n<p>We will encounter 2 compare functions which are not important to us, like this one:<\/p>\n<p><a class=\"thickbox\" href=\"https:\/\/www.corelan.be\/wp-content\/uploads\/2012\/05\/app17_3b4.jpg\"><img loading=\"lazy\" decoding=\"async\" style=\"background-image: none; margin: 7px; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border: 0px;\" title=\"app17_3b\" src=\"https:\/\/www.corelan.be\/wp-content\/uploads\/2012\/05\/app17_3b_thumb4.jpg\" alt=\"app17_3b\" width=\"600\" height=\"318\" border=\"0\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<p>But then this compare function is interesting:<\/p>\n<p><a class=\"thickbox\" href=\"https:\/\/www.corelan.be\/wp-content\/uploads\/2012\/05\/app17_44.jpg\"><img loading=\"lazy\" decoding=\"async\" style=\"background-image: none; margin: 7px; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border: 0px;\" title=\"app17_4\" src=\"https:\/\/www.corelan.be\/wp-content\/uploads\/2012\/05\/app17_4_thumb4.jpg\" alt=\"app17_4\" width=\"600\" height=\"325\" border=\"0\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<h5>Why is this compare interesting?<\/h5>\n<p>If you follow the jump which is taken when these values are not equal, AL is set to 1 (remember: we need <strong>AL = 0<\/strong>) and then the function returns.<\/p>\n<p><a class=\"thickbox\" href=\"https:\/\/www.corelan.be\/wp-content\/uploads\/2012\/05\/app17_4b4.jpg\"><img loading=\"lazy\" decoding=\"async\" style=\"background-image: none; margin: 7px; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border: 0px;\" title=\"app17_4b\" src=\"https:\/\/www.corelan.be\/wp-content\/uploads\/2012\/05\/app17_4b_thumb4.jpg\" alt=\"app17_4b\" width=\"600\" height=\"195\" border=\"0\" \/><\/a><\/p>\n<p>So here we have a compare of the values <strong>10<\/strong> and <strong>12<\/strong>.<\/p>\n<p>Note: it\u2019s in hex, in decimal it is: 16 != 18<\/p>\n<h5>So what does that mean??<\/h5>\n<p>Well, based on the input we provided (the username &amp; password), we can derive this relationship:<\/p>\n<ul>\n<li><strong>16<\/strong> = the number of digits in the password<\/li>\n<li><strong>18<\/strong> = twice the number of characters of your username<\/li>\n<\/ul>\n<p>Since my username has a fixed length, maybe the password is too short??\u00a0 Let's add some digits, according to the password convention, and use this password:<\/p>\n<pre style=\"background-color: #191919; min-height: 40px; width: 650px; overflow: auto; border: #cecece 1px solid; padding: 5px;\">Password: HTS-1234-5678-9900-1122-00<\/pre>\n<p>Restart the application, use the \"new\" password and stop again at the same location:<\/p>\n<p><a class=\"thickbox\" href=\"https:\/\/www.corelan.be\/wp-content\/uploads\/2012\/05\/app17_52.jpg\"><img loading=\"lazy\" decoding=\"async\" style=\"background-image: none; margin: 7px; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border: 0px;\" title=\"app17_5\" src=\"https:\/\/www.corelan.be\/wp-content\/uploads\/2012\/05\/app17_5_thumb2.jpg\" alt=\"app17_5\" width=\"600\" height=\"262\" border=\"0\" \/><\/a><\/p>\n<p>This time, we pass the test. Good !!!!<\/p>\n<p>Let's recap real quick.\u00a0 The following compare instruction validates if the number of digits in the password is correct:<\/p>\n<pre style=\"background-color: #191919; min-height: 40px; width: 650px; overflow: auto; border: #cecece 1px solid; padding: 5px;\"> 004011BA    3BF8          CMP EDI, EAX<\/pre>\n<p>Let's step further.\u00a0 The next interesting compare is this one:<\/p>\n<p><a class=\"thickbox\" href=\"https:\/\/www.corelan.be\/wp-content\/uploads\/2012\/05\/app17_74.jpg\"><img loading=\"lazy\" decoding=\"async\" style=\"background-image: none; margin: 7px; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border: 0px;\" title=\"app17_7\" src=\"https:\/\/www.corelan.be\/wp-content\/uploads\/2012\/05\/app17_7_thumb4.jpg\" alt=\"app17_7\" width=\"600\" height=\"288\" border=\"0\" \/><\/a><\/p>\n<h5><strong>Why is this compare interesting?<\/strong><\/h5>\n<p>Again if the values don\u2019t match we take the jump to the instruction setting AL = 1.<\/p>\n<p>What\u2019s compared here?<\/p>\n<ul>\n<li><strong>12<\/strong> = first 2 digits of my password:<em> <\/em>HTS-<strong><span style=\"color: #ff0000;\">12<\/span><\/strong>34-5678-9900-1122-00<\/li>\n<li><strong>11<\/strong> = ??? Maybe the real digits of the password? I think so \ud83d\ude42<\/li>\n<\/ul>\n<p>So, in short: this instruction validates 2 digits in the provided password by comparing what I entered with what the application has computed.<\/p>\n<pre style=\"background-color: #191919; min-height: 40px; width: 650px; overflow: auto; border: #cecece 1px solid; padding: 5px;\"> 0040128C       3B75 94          CMP ESI,DWORD PTR SS:[EBP-6C]<\/pre>\n<p>Let's set a breakpoint at this location, restart the app and only change the corresponding part of the password.\u00a0 Since we know the first 2 digits should be 11, we simply update the password and replace 12 with 11.<\/p>\n<p>When using password HTS-<strong><span style=\"color: #ff0000;\">11<\/span><\/strong>34-5678-9900-1122-00, the compare will pass:<\/p>\n<p><a class=\"thickbox\" href=\"https:\/\/www.corelan.be\/wp-content\/uploads\/2012\/05\/app17_84.jpg\"><img loading=\"lazy\" decoding=\"async\" style=\"background-image: none; margin: 7px; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border: 0px;\" title=\"app17_8\" src=\"https:\/\/www.corelan.be\/wp-content\/uploads\/2012\/05\/app17_8_thumb4.jpg\" alt=\"app17_8\" width=\"600\" height=\"275\" border=\"0\" \/><\/a><\/p>\n<p>Excellent. Press F9 to let the application to run, and the breakpoint will get hit a second time.<\/p>\n<p><a class=\"thickbox\" href=\"https:\/\/www.corelan.be\/wp-content\/uploads\/2012\/05\/app17_94.jpg\"><img loading=\"lazy\" decoding=\"async\" style=\"background-image: none; margin: 7px; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border: 0px;\" title=\"app17_9\" src=\"https:\/\/www.corelan.be\/wp-content\/uploads\/2012\/05\/app17_9_thumb4.jpg\" alt=\"app17_9\" width=\"600\" height=\"300\" border=\"0\" \/><\/a><\/p>\n<p>This time, it shows the next 2 digits from the password, and it indicates what the calculated value is.\u00a0 Based on that info, we know that the next 2 digits of the password should be <strong><span style=\"color: #ff0000;\">28<\/span><\/strong><\/p>\n<p>Restart the application again, and change the next 2 digits, so the new password would be HTS-<strong><span style=\"color: #ff0000;\">1128<\/span><\/strong>-5678-9900-1122-00 this time.<\/p>\n<p>Since the calculated values can be seen at the breakpoint, we can now manually generate the entire password, 2 digits at a time:<\/p>\n<p>HTS-<strong><span style=\"color: #ff0000;\">1128<\/span><\/strong>-5678-9900-1122-00<\/p>\n<p>HTS-<span style=\"color: #ff0000;\"><strong>1128<\/strong>-<strong>56<\/strong><\/span>78-9900-1122-00<\/p>\n<p>HTS-<span style=\"color: #ff0000;\"><strong>1128<\/strong>-<strong>5678<\/strong><\/span>-9900-1122-00<\/p>\n<p>HTS-<span style=\"color: #ff0000;\"><strong>1128<\/strong>-<strong>5678<\/strong>-<strong>99<\/strong><\/span>00-1122-00<\/p>\n<p>HTS-<span style=\"color: #ff0000;\"><strong>1128<\/strong>-<strong>5678<\/strong>-<strong>9900<\/strong><\/span>-1122-00<\/p>\n<p>HTS-<span style=\"color: #ff0000;\"><strong>1128<\/strong>-<strong>5678<\/strong>-<strong>9900<\/strong>-<strong>11<\/strong><\/span>22-00<\/p>\n<p>HTS-<span style=\"color: #ff0000;\"><strong>1128<\/strong>-<strong>5678<\/strong>-<strong>9900<\/strong>-<strong>1122<\/strong><\/span>-00<\/p>\n<p>HTS-<span style=\"color: #ff0000;\"><strong>1128<\/strong>-<strong>5678<\/strong>-<strong>9900<\/strong>-<strong>1122<\/strong>-<strong>00<\/strong><\/span><\/p>\n<p>&nbsp;<\/p>\n<p>Let's validate if this works.\u00a0 Let's enter the following credentials:<\/p>\n<pre style=\"background-color: #191919; min-height: 40px; width: 650px; overflow: auto; border: #cecece 1px solid; padding: 5px;\">Username: fancy__04\nPassword: HTS-1128-2320-040D-2903-18<\/pre>\n<pre style=\"background-color: #191919; min-height: 40px; width: 650px; overflow: auto; border: #cecece 1px solid; padding: 5px;\">Z:\\HTS\\app17win&gt;app17win.exe\n******************************************\n* HackThisSite Application Challenge <span style=\"color: #008000;\">#17 *<\/span>\n*    Coded by NightQuest - 02-14-2009    *\n******************************************\nObjective:\nYou need to create a key that is unique to your HackThisSite username.\nThe idea is to create a keygen, but any method is allowed.\nAn example would be:\nUsername: SomeUserName\nPassword: HTS-1234-5678-9012-3456\nUsername: fancy__04\nPassword: **************************\nCongratulations! Enter that password on HackThisSite.<\/pre>\n<p>w00t.<\/p>\n<hr \/>\n","protected":false},"excerpt":{"rendered":"<p>In this post, we'll look at an application reversing challenge from HTS (hackthissite.org) resembling a real-life protection scheme.<br \/>\nPut simple, the program creates a key for your username, and compares it to the one you enter.<br \/>\nThe goal of the HTS challenge is to create a key generator, but I just want to demonstrate how to retrieve the password.<\/p>\n","protected":false},"author":5,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[2561],"tags":[3733,2676,2327,2308,2128,261,32],"class_list":["post-9051","post","type-post","status-publish","format-standard","hentry","category-malware-and-reversing","tag-exploit-development-tutorial","tag-reverse-engineering","tag-breakpoint","tag-ctf","tag-immunity-debugger","tag-corelan","tag-active-directory"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.5 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Reversing 101 - Solving a protection scheme - Corelan | Exploit Development &amp; Vulnerability Research<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.corelan.be\/index.php\/2012\/05\/14\/reversing-101-solving-a-protectionscheme\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Reversing 101 - Solving a protection scheme - Corelan | Exploit Development &amp; Vulnerability Research\" \/>\n<meta property=\"og:description\" content=\"In this post, we&#039;ll look at an application reversing challenge from HTS (hackthissite.org) resembling a real-life protection scheme. Put simple, the program creates a key for your username, and compares it to the one you enter. The goal of the HTS challenge is to create a key generator, but I just want to demonstrate how to retrieve the password.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.corelan.be\/index.php\/2012\/05\/14\/reversing-101-solving-a-protectionscheme\/\" \/>\n<meta property=\"og:site_name\" content=\"Corelan | Exploit Development &amp; Vulnerability Research\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/corelanconsulting\" \/>\n<meta property=\"article:published_time\" content=\"2012-05-14T13:00:07+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.corelan.be\/wp-content\/uploads\/2012\/05\/app17_1_thumb3.jpg\" \/>\n<meta name=\"author\" content=\"Corelan Team (fancy)\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@corelanc0d3r\" \/>\n<meta name=\"twitter:site\" content=\"@corelanc0d3r\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"TechArticle\",\"@id\":\"https:\\\/\\\/www.corelan.be\\\/index.php\\\/2012\\\/05\\\/14\\\/reversing-101-solving-a-protectionscheme\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.corelan.be\\\/index.php\\\/2012\\\/05\\\/14\\\/reversing-101-solving-a-protectionscheme\\\/\"},\"author\":{\"name\":\"Corelan Team (fancy)\",\"@id\":\"https:\\\/\\\/www.corelan.be\\\/#\\\/schema\\\/person\\\/19ac49794ad03a4f053203b956e97513\"},\"headline\":\"Reversing 101 - Solving a protection scheme\",\"datePublished\":\"2012-05-14T13:00:07+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.corelan.be\\\/index.php\\\/2012\\\/05\\\/14\\\/reversing-101-solving-a-protectionscheme\\\/\"},\"wordCount\":1184,\"publisher\":{\"@id\":\"https:\\\/\\\/www.corelan.be\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.corelan.be\\\/index.php\\\/2012\\\/05\\\/14\\\/reversing-101-solving-a-protectionscheme\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.corelan.be\\\/wp-content\\\/uploads\\\/2012\\\/05\\\/app17_1_thumb3.jpg\",\"keywords\":[\"exploit development tutorial\",\"reverse engineering\",\"breakpoint\",\"ctf\",\"immunity debugger\",\"corelan\",\"Active Directory\"],\"articleSection\":[\"Malware and Reversing\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.corelan.be\\\/index.php\\\/2012\\\/05\\\/14\\\/reversing-101-solving-a-protectionscheme\\\/\",\"url\":\"https:\\\/\\\/www.corelan.be\\\/index.php\\\/2012\\\/05\\\/14\\\/reversing-101-solving-a-protectionscheme\\\/\",\"name\":\"Reversing 101 - Solving a protection scheme - Corelan | Exploit Development &amp; Vulnerability Research\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.corelan.be\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.corelan.be\\\/index.php\\\/2012\\\/05\\\/14\\\/reversing-101-solving-a-protectionscheme\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.corelan.be\\\/index.php\\\/2012\\\/05\\\/14\\\/reversing-101-solving-a-protectionscheme\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.corelan.be\\\/wp-content\\\/uploads\\\/2012\\\/05\\\/app17_1_thumb3.jpg\",\"datePublished\":\"2012-05-14T13:00:07+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.corelan.be\\\/index.php\\\/2012\\\/05\\\/14\\\/reversing-101-solving-a-protectionscheme\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.corelan.be\\\/index.php\\\/2012\\\/05\\\/14\\\/reversing-101-solving-a-protectionscheme\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.corelan.be\\\/index.php\\\/2012\\\/05\\\/14\\\/reversing-101-solving-a-protectionscheme\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.corelan.be\\\/wp-content\\\/uploads\\\/2012\\\/05\\\/app17_1_thumb3.jpg\",\"contentUrl\":\"https:\\\/\\\/www.corelan.be\\\/wp-content\\\/uploads\\\/2012\\\/05\\\/app17_1_thumb3.jpg\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.corelan.be\\\/index.php\\\/2012\\\/05\\\/14\\\/reversing-101-solving-a-protectionscheme\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.corelan.be\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Reversing 101 &#8211; Solving a protection scheme\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.corelan.be\\\/#website\",\"url\":\"https:\\\/\\\/www.corelan.be\\\/\",\"name\":\"Corelan CyberSecurity Research\",\"description\":\"Corelan publishes in-depth tutorials on exploit development, Windows exploitation, vulnerability research, heap internals, reverse engineering and security tooling used by professionals worldwide.\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.corelan.be\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.corelan.be\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.corelan.be\\\/#organization\",\"name\":\"Corelan CyberSecurity Research\",\"url\":\"https:\\\/\\\/www.corelan.be\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.corelan.be\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.corelan.be\\\/wp-content\\\/uploads\\\/2026\\\/03\\\/corelanlogo2_small-20.png\",\"contentUrl\":\"https:\\\/\\\/www.corelan.be\\\/wp-content\\\/uploads\\\/2026\\\/03\\\/corelanlogo2_small-20.png\",\"width\":200,\"height\":200,\"caption\":\"Corelan CyberSecurity Research\"},\"image\":{\"@id\":\"https:\\\/\\\/www.corelan.be\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/corelanconsulting\",\"https:\\\/\\\/x.com\\\/corelanc0d3r\",\"https:\\\/\\\/x.com\\\/corelanconsulting\",\"https:\\\/\\\/instagram.com\\\/corelanconsult\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.corelan.be\\\/#\\\/schema\\\/person\\\/19ac49794ad03a4f053203b956e97513\",\"name\":\"Corelan Team (fancy)\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/e61c2a72c3ac875b017df8edf75c236f8c0147bee76db02a9b84f58d24283ed9?s=96&d=mm&r=x\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/e61c2a72c3ac875b017df8edf75c236f8c0147bee76db02a9b84f58d24283ed9?s=96&d=mm&r=x\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/e61c2a72c3ac875b017df8edf75c236f8c0147bee76db02a9b84f58d24283ed9?s=96&d=mm&r=x\",\"caption\":\"Corelan Team (fancy)\"},\"url\":\"https:\\\/\\\/www.corelan.be\\\/index.php\\\/author\\\/fancy\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Reversing 101 - Solving a protection scheme - Corelan | Exploit Development &amp; Vulnerability Research","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.corelan.be\/index.php\/2012\/05\/14\/reversing-101-solving-a-protectionscheme\/","og_locale":"en_US","og_type":"article","og_title":"Reversing 101 - Solving a protection scheme - Corelan | Exploit Development &amp; Vulnerability Research","og_description":"In this post, we'll look at an application reversing challenge from HTS (hackthissite.org) resembling a real-life protection scheme. Put simple, the program creates a key for your username, and compares it to the one you enter. The goal of the HTS challenge is to create a key generator, but I just want to demonstrate how to retrieve the password.","og_url":"https:\/\/www.corelan.be\/index.php\/2012\/05\/14\/reversing-101-solving-a-protectionscheme\/","og_site_name":"Corelan | Exploit Development &amp; Vulnerability Research","article_publisher":"https:\/\/www.facebook.com\/corelanconsulting","article_published_time":"2012-05-14T13:00:07+00:00","og_image":[{"url":"https:\/\/www.corelan.be\/wp-content\/uploads\/2012\/05\/app17_1_thumb3.jpg","type":"","width":"","height":""}],"author":"Corelan Team (fancy)","twitter_card":"summary_large_image","twitter_creator":"@corelanc0d3r","twitter_site":"@corelanc0d3r","schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"TechArticle","@id":"https:\/\/www.corelan.be\/index.php\/2012\/05\/14\/reversing-101-solving-a-protectionscheme\/#article","isPartOf":{"@id":"https:\/\/www.corelan.be\/index.php\/2012\/05\/14\/reversing-101-solving-a-protectionscheme\/"},"author":{"name":"Corelan Team (fancy)","@id":"https:\/\/www.corelan.be\/#\/schema\/person\/19ac49794ad03a4f053203b956e97513"},"headline":"Reversing 101 - Solving a protection scheme","datePublished":"2012-05-14T13:00:07+00:00","mainEntityOfPage":{"@id":"https:\/\/www.corelan.be\/index.php\/2012\/05\/14\/reversing-101-solving-a-protectionscheme\/"},"wordCount":1184,"publisher":{"@id":"https:\/\/www.corelan.be\/#organization"},"image":{"@id":"https:\/\/www.corelan.be\/index.php\/2012\/05\/14\/reversing-101-solving-a-protectionscheme\/#primaryimage"},"thumbnailUrl":"https:\/\/www.corelan.be\/wp-content\/uploads\/2012\/05\/app17_1_thumb3.jpg","keywords":["exploit development tutorial","reverse engineering","breakpoint","ctf","immunity debugger","corelan","Active Directory"],"articleSection":["Malware and Reversing"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/www.corelan.be\/index.php\/2012\/05\/14\/reversing-101-solving-a-protectionscheme\/","url":"https:\/\/www.corelan.be\/index.php\/2012\/05\/14\/reversing-101-solving-a-protectionscheme\/","name":"Reversing 101 - Solving a protection scheme - Corelan | Exploit Development &amp; Vulnerability Research","isPartOf":{"@id":"https:\/\/www.corelan.be\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.corelan.be\/index.php\/2012\/05\/14\/reversing-101-solving-a-protectionscheme\/#primaryimage"},"image":{"@id":"https:\/\/www.corelan.be\/index.php\/2012\/05\/14\/reversing-101-solving-a-protectionscheme\/#primaryimage"},"thumbnailUrl":"https:\/\/www.corelan.be\/wp-content\/uploads\/2012\/05\/app17_1_thumb3.jpg","datePublished":"2012-05-14T13:00:07+00:00","breadcrumb":{"@id":"https:\/\/www.corelan.be\/index.php\/2012\/05\/14\/reversing-101-solving-a-protectionscheme\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.corelan.be\/index.php\/2012\/05\/14\/reversing-101-solving-a-protectionscheme\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.corelan.be\/index.php\/2012\/05\/14\/reversing-101-solving-a-protectionscheme\/#primaryimage","url":"https:\/\/www.corelan.be\/wp-content\/uploads\/2012\/05\/app17_1_thumb3.jpg","contentUrl":"https:\/\/www.corelan.be\/wp-content\/uploads\/2012\/05\/app17_1_thumb3.jpg"},{"@type":"BreadcrumbList","@id":"https:\/\/www.corelan.be\/index.php\/2012\/05\/14\/reversing-101-solving-a-protectionscheme\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.corelan.be\/"},{"@type":"ListItem","position":2,"name":"Reversing 101 &#8211; Solving a protection scheme"}]},{"@type":"WebSite","@id":"https:\/\/www.corelan.be\/#website","url":"https:\/\/www.corelan.be\/","name":"Corelan CyberSecurity Research","description":"Corelan publishes in-depth tutorials on exploit development, Windows exploitation, vulnerability research, heap internals, reverse engineering and security tooling used by professionals worldwide.","publisher":{"@id":"https:\/\/www.corelan.be\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.corelan.be\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.corelan.be\/#organization","name":"Corelan CyberSecurity Research","url":"https:\/\/www.corelan.be\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.corelan.be\/#\/schema\/logo\/image\/","url":"https:\/\/www.corelan.be\/wp-content\/uploads\/2026\/03\/corelanlogo2_small-20.png","contentUrl":"https:\/\/www.corelan.be\/wp-content\/uploads\/2026\/03\/corelanlogo2_small-20.png","width":200,"height":200,"caption":"Corelan CyberSecurity Research"},"image":{"@id":"https:\/\/www.corelan.be\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/corelanconsulting","https:\/\/x.com\/corelanc0d3r","https:\/\/x.com\/corelanconsulting","https:\/\/instagram.com\/corelanconsult"]},{"@type":"Person","@id":"https:\/\/www.corelan.be\/#\/schema\/person\/19ac49794ad03a4f053203b956e97513","name":"Corelan Team (fancy)","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/e61c2a72c3ac875b017df8edf75c236f8c0147bee76db02a9b84f58d24283ed9?s=96&d=mm&r=x","url":"https:\/\/secure.gravatar.com\/avatar\/e61c2a72c3ac875b017df8edf75c236f8c0147bee76db02a9b84f58d24283ed9?s=96&d=mm&r=x","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/e61c2a72c3ac875b017df8edf75c236f8c0147bee76db02a9b84f58d24283ed9?s=96&d=mm&r=x","caption":"Corelan Team (fancy)"},"url":"https:\/\/www.corelan.be\/index.php\/author\/fancy\/"}]}},"views":14087,"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.corelan.be\/index.php\/wp-json\/wp\/v2\/posts\/9051","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.corelan.be\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.corelan.be\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.corelan.be\/index.php\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/www.corelan.be\/index.php\/wp-json\/wp\/v2\/comments?post=9051"}],"version-history":[{"count":0,"href":"https:\/\/www.corelan.be\/index.php\/wp-json\/wp\/v2\/posts\/9051\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.corelan.be\/index.php\/wp-json\/wp\/v2\/media?parent=9051"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.corelan.be\/index.php\/wp-json\/wp\/v2\/categories?post=9051"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.corelan.be\/index.php\/wp-json\/wp\/v2\/tags?post=9051"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}