{"id":1789,"date":"2016-01-25T05:27:45","date_gmt":"2016-01-25T05:27:45","guid":{"rendered":"https:\/\/www.hackmethod.com\/?p=1789"},"modified":"2022-06-03T06:01:31","modified_gmt":"2022-06-03T06:01:31","slug":"overthewire-narnia-0","status":"publish","type":"post","link":"https:\/\/hackmethod.com\/overthewire-narnia-0\/","title":{"rendered":"OverTheWire &#8211; Narnia 0"},"content":{"rendered":"<table bgcolor=\"#DCDCDC\">\n<tbody>\n<tr>\n<td><a href=\"#introduction\">Introduction<\/a> <a href=\"#sourcevsexecutable\">Source Code vs Executable Code<\/a> <a href=\"#narniasourcecode\">Narnia Level 0 &#8211; Source Code<\/a> <a href=\"#narniaexploitation\">Narnia Level 0 &#8211; Exploitation<\/a> <a href=\"#narniasolution\">Narnia Level 0 &#8211; Solution<\/a><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<div dir=\"ltr\" data-blogger-escaped-style=\"margin-bottom: 0pt; margin-top: 0pt;\">\n<div data-blogger-escaped-style=\"line-height: 1.38; text-align: center;\">\n<div id=\"introduction\">\n<h4><span style=\"text-decoration: underline;\"><strong><span data-blogger-escaped-style=\"white-space: pre-wrap;\"><span data-blogger-escaped-style=\"font-family: &quot;verdana&quot; , sans-serif;\">Introduction<\/span><\/span><\/strong><\/span><\/h4>\n<\/div>\n<div data-blogger-escaped-style=\"line-height: 1.38;\"><span data-blogger-escaped-style=\"white-space: pre-wrap;\"><span data-blogger-escaped-style=\"font-family: &quot;verdana&quot; , sans-serif;\">This is an introduction to reverse engineering. I will be going through a series of reverse engineering puzzles developed by OverTheWire&nbsp;and explaining the methodology I used to solve these puzzles.<\/span><\/span><\/div>\n<p><!--more--><\/p>\n<p><span data-blogger-escaped-style=\"font-family: &quot;verdana&quot; , sans-serif;\"><span data-blogger-escaped-style=\"line-height: 1.38; white-space: pre-wrap;\">In the challenges that are provided, you are given an executable and the source code to a program. The goal is to figure out a way to exploit or PWN the executable. Exploitation in this context typically refers to <\/span><span data-blogger-escaped-style=\"line-height: 22.08px; white-space: pre-wrap;\">overwriting<\/span><span data-blogger-escaped-style=\"line-height: 1.38; white-space: pre-wrap;\"> system memory to achieve some unintended outcome. Lets first talk about the files that are give to you.<\/span><\/span><\/p>\n<div data-blogger-escaped-style=\"text-align: center;\">\n<div id=\"sourcevsexecutable\">\n<h4><span style=\"text-decoration: underline;\"><strong>Source Code vs Executable Code<\/strong><\/span><\/h4>\n<p><span data-blogger-escaped-style=\"font-family: &quot;verdana&quot; , sans-serif;\"><span data-blogger-escaped-style=\"line-height: 20.24px; white-space: pre-wrap;\"><span data-blogger-escaped-style=\"font-family: &quot;verdana&quot; , sans-serif;\">Source code is the original language that a program is written in. Source code is then compiled into a set of instructions that the computer processor can execute. This translation from source code to executable&nbsp;<\/span><\/span><span data-blogger-escaped-style=\"line-height: 20.24px; white-space: pre-wrap;\">code must happen, because computer processors do not understand source code, but they do understand the machine instructions inside executable code. Lets take <\/span><\/span>a look at the difference<\/p>\n<\/div>\n<\/div>\n<div dir=\"ltr\" data-blogger-escaped-style=\"margin-bottom: 0pt; margin-top: 0pt;\" style=\"text-align: center;\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"aligncenter\" src=\"https:\/\/i0.wp.com\/www.hackmethod.com\/wp-content\/uploads\/2016\/01\/HelloWorld.c.jpg?resize=424%2C147&#038;ssl=1\" alt=\"HelloWorld.c\" scale=\"0\" width=\"424\" height=\"147\">&nbsp;&nbsp;&nbsp; Figure 1. Example C Source Code<\/div>\n<div dir=\"ltr\" data-blogger-escaped-style=\"margin-bottom: 0pt; margin-top: 0pt;\"><\/div>\n<div dir=\"ltr\" data-blogger-escaped-style=\"margin-bottom: 0pt; margin-top: 0pt;\" style=\"text-align: center;\">\n<div data-blogger-escaped-style=\"line-height: 1.38;\"><a href=\"https:\/\/i0.wp.com\/www.hackmethod.com\/wp-content\/uploads\/2016\/01\/HelloWorld.obj_.jpg?ssl=1\" rel=\"attachment wp-att-1797\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"aligncenter\" src=\"https:\/\/i0.wp.com\/www.hackmethod.com\/wp-content\/uploads\/2016\/01\/HelloWorld.obj_.jpg?resize=629%2C230&#038;ssl=1\" alt=\"HelloWorld.obj\" scale=\"0\" width=\"629\" height=\"230\"><\/a>Figure 2. Example C Executable&nbsp;Code<\/div>\n<div data-blogger-escaped-style=\"line-height: 1.38;\"><\/div>\n<\/div>\n<\/div>\n<\/div>\n<div data-blogger-escaped-style=\"line-height: 1.38;\"><\/div>\n<div data-blogger-escaped-style=\"line-height: 1.38;\"><\/div>\n<div dir=\"ltr\" data-blogger-escaped-style=\"margin-bottom: 0pt; margin-top: 0pt;\">\n<div data-blogger-escaped-style=\"line-height: 1.38; text-align: center;\">\n<div dir=\"ltr\" data-blogger-escaped-style=\"margin-bottom: 0pt; margin-top: 0pt;\">\n<div data-blogger-escaped-style=\"line-height: 1.38;\">As you can see from the examples above, even for a small &#8220;Hello World!&#8221; program, machine instructions are not easy to read, which is why high level source code exists in the first place. High level programming languages such as C, C++ and Java, are easier to understand and are human readable. Even without being a programmer, you can probably determine that the source code in figure 1 prints the text &#8220;Hello World&#8221; to the screen.<\/div>\n<div data-blogger-escaped-style=\"line-height: 1.38;\"><\/div>\n<div data-blogger-escaped-style=\"line-height: 1.38;\"><span data-blogger-escaped-style=\"font-family: &quot;verdana&quot; , sans-serif;\">Unfortunately for the reverse engineer, most compiled programs do not come with the source code that was used to generate them. This is done for a couple of reasons, first, the source code is not needed for a program to run, the only thing a computer needs is the compiled object code, therefore shipping a program without the source code makes it smaller. Second, people who sell their programs for a profit, don&#8217;t want you to see how they created the program, or else anyone could steal the code and compile it for themselves without paying.&nbsp;<\/span><\/div>\n<div dir=\"ltr\" data-blogger-escaped-style=\"line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;\">\n<div data-blogger-escaped-style=\"text-align: center;\">\n<div id=\"narniasourcecode\">\n<h1><span style=\"text-decoration: underline;\"><strong><span data-blogger-escaped-style=\"color: black; font-family: &quot;verdana&quot; , sans-serif; vertical-align: baseline; white-space: pre-wrap;\">Narnia Level 0 &#8211; Source Code<\/span><\/strong><\/span><\/h1>\n<p>Lets get started&#8230;<\/p>\n<\/div>\n<p>First we must ssh into the game server using the following credentials:<\/p>\n<p><strong>Server<\/strong>: narnia.labs.overthewrite.org <strong>Username<\/strong>: narnia0 <strong>Password<\/strong>: narnia0<\/p>\n<\/div>\n<div dir=\"ltr\" data-blogger-escaped-style=\"margin-bottom: 0pt; margin-top: 0pt;\">\n<div data-blogger-escaped-style=\"line-height: 1.38;\"><span data-blogger-escaped-style=\"color: black; font-family: &quot;verdana&quot; , sans-serif; vertical-align: baseline; white-space: pre-wrap;\">The <strong>\/narnia<\/strong>&nbsp;folder holds all of the challanges for each level, but our current permissions level only allows us access to the level 0 files, which are: <strong>narnia0<\/strong> and <strong>narnia0.c<\/strong> . What are these two files? The first one is the compiled program and the second one is the source code.<\/span><\/div>\n<div data-blogger-escaped-style=\"line-height: 1.38;\"><span data-blogger-escaped-style=\"color: black; font-family: &quot;verdana&quot; , sans-serif; vertical-align: baseline; white-space: pre-wrap;\">Lets first look at the source code<\/span><\/div>\n<div data-blogger-escaped-style=\"line-height: 1.38;\">\n<table>\n<tbody>\n<tr>\n<td><span data-blogger-escaped-style=\"color: black; font-family: &quot;verdana&quot; , sans-serif; vertical-align: baseline; white-space: pre-wrap;\"><span data-blogger-escaped-style=\"font-family: &quot;verdana&quot; , sans-serif;\"><a href=\"https:\/\/i0.wp.com\/www.hackmethod.com\/wp-content\/uploads\/2016\/01\/Narnia0Source1-1.jpg?ssl=1\" rel=\"attachment wp-att-1805\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"1805\" data-permalink=\"https:\/\/hackmethod.com\/overthewire-narnia-0\/narnia0source1-2\/\" data-orig-file=\"https:\/\/i0.wp.com\/hackmethod.com\/wp-content\/uploads\/2016\/01\/Narnia0Source1-1.jpg?fit=676%2C74&amp;ssl=1\" data-orig-size=\"676,74\" data-comments-opened=\"0\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;Boosta&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;1453671972&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"Narnia0Source1\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/i0.wp.com\/hackmethod.com\/wp-content\/uploads\/2016\/01\/Narnia0Source1-1.jpg?fit=300%2C33&amp;ssl=1\" data-large-file=\"https:\/\/i0.wp.com\/hackmethod.com\/wp-content\/uploads\/2016\/01\/Narnia0Source1-1.jpg?fit=676%2C74&amp;ssl=1\" class=\"aligncenter size-full wp-image-1805\" src=\"https:\/\/i0.wp.com\/www.hackmethod.com\/wp-content\/uploads\/2016\/01\/Narnia0Source1-1.jpg?resize=676%2C74&#038;ssl=1\" alt=\"Narnia0Source1\" scale=\"0\" width=\"676\" height=\"74\" srcset=\"https:\/\/i0.wp.com\/hackmethod.com\/wp-content\/uploads\/2016\/01\/Narnia0Source1-1.jpg?w=676&amp;ssl=1 676w, https:\/\/i0.wp.com\/hackmethod.com\/wp-content\/uploads\/2016\/01\/Narnia0Source1-1.jpg?resize=600%2C66&amp;ssl=1 600w, https:\/\/i0.wp.com\/hackmethod.com\/wp-content\/uploads\/2016\/01\/Narnia0Source1-1.jpg?resize=300%2C33&amp;ssl=1 300w\" sizes=\"(max-width: 676px) 100vw, 676px\" \/><\/a><\/span><\/span><p><\/p>\n<p><span data-blogger-escaped-style=\"font-family: &quot;verdana&quot; , sans-serif;\">Here we see two variables being created, <strong>val<\/strong> is initialized to the hex value <em>0x41414141<\/em> and <strong>buf<\/strong> is an array that is not initialized to any value, but space has been reserved for 20 1-byte values. <\/span><span data-blogger-escaped-style=\"font-family: &quot;verdana&quot; , sans-serif;\">The &#8220;char&#8221; data type in C is defined as 1-byte in length, therefore char <strong>buf[20]<\/strong> reserves 20 consecutive 1-byte memory locations.&nbsp;<\/span><\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<div dir=\"ltr\" data-blogger-escaped-style=\"margin-bottom: 0pt; margin-top: 0pt;\">\n<table>\n<tbody>\n<tr>\n<td><span data-blogger-escaped-style=\"font-family: &quot;verdana&quot; , sans-serif;\"><a href=\"https:\/\/i0.wp.com\/www.hackmethod.com\/wp-content\/uploads\/2016\/01\/Narnia0Source2.jpg?ssl=1\" rel=\"attachment wp-att-1806\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"1806\" data-permalink=\"https:\/\/hackmethod.com\/overthewire-narnia-0\/narnia0source2\/\" data-orig-file=\"https:\/\/i0.wp.com\/hackmethod.com\/wp-content\/uploads\/2016\/01\/Narnia0Source2.jpg?fit=690%2C41&amp;ssl=1\" data-orig-size=\"690,41\" data-comments-opened=\"0\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;Boosta&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;1453672081&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"Narnia0Source2\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/i0.wp.com\/hackmethod.com\/wp-content\/uploads\/2016\/01\/Narnia0Source2.jpg?fit=300%2C18&amp;ssl=1\" data-large-file=\"https:\/\/i0.wp.com\/hackmethod.com\/wp-content\/uploads\/2016\/01\/Narnia0Source2.jpg?fit=690%2C41&amp;ssl=1\" class=\"aligncenter wp-image-1806 size-full\" src=\"https:\/\/i0.wp.com\/www.hackmethod.com\/wp-content\/uploads\/2016\/01\/Narnia0Source2.jpg?resize=690%2C41&#038;ssl=1\" alt=\"Narnia0Source2\" scale=\"0\" width=\"690\" height=\"41\" srcset=\"https:\/\/i0.wp.com\/hackmethod.com\/wp-content\/uploads\/2016\/01\/Narnia0Source2.jpg?w=690&amp;ssl=1 690w, https:\/\/i0.wp.com\/hackmethod.com\/wp-content\/uploads\/2016\/01\/Narnia0Source2.jpg?resize=600%2C36&amp;ssl=1 600w, https:\/\/i0.wp.com\/hackmethod.com\/wp-content\/uploads\/2016\/01\/Narnia0Source2.jpg?resize=300%2C18&amp;ssl=1 300w\" sizes=\"(max-width: 690px) 100vw, 690px\" \/><\/a><\/span>These are the instructions that tell you what your trying to accomplish. The variable <strong>val<\/strong>, has been initialized to the value <em>0x41414141<\/em>, the program wants you to somehow change it to the value <em>0xdeadbeef<\/em>.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<div dir=\"ltr\" data-blogger-escaped-style=\"margin-bottom: 0pt; margin-top: 0pt;\">\n<div data-blogger-escaped-style=\"line-height: 1.38; text-align: center;\">\n<div dir=\"ltr\" data-blogger-escaped-style=\"margin-bottom: 0pt; margin-top: 0pt;\">\n<div dir=\"ltr\" data-blogger-escaped-style=\"line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;\">\n<div dir=\"ltr\" data-blogger-escaped-style=\"margin-bottom: 0pt; margin-top: 0pt;\">\n<div data-blogger-escaped-style=\"line-height: 1.38;\">\n<div data-blogger-escaped-style=\"line-height: 1.38;\">\n<table>\n<tbody>\n<tr>\n<td>\n<div data-blogger-escaped-style=\"line-height: 1.38;\"><a href=\"https:\/\/i0.wp.com\/www.hackmethod.com\/wp-content\/uploads\/2016\/01\/Narnia0Source3.jpg?ssl=1\" rel=\"attachment wp-att-1812\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"1812\" data-permalink=\"https:\/\/hackmethod.com\/overthewire-narnia-0\/narnia0source3\/\" data-orig-file=\"https:\/\/i0.wp.com\/hackmethod.com\/wp-content\/uploads\/2016\/01\/Narnia0Source3.jpg?fit=683%2C22&amp;ssl=1\" data-orig-size=\"683,22\" data-comments-opened=\"0\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;Boosta&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;1453672621&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"Narnia0Source3\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/i0.wp.com\/hackmethod.com\/wp-content\/uploads\/2016\/01\/Narnia0Source3.jpg?fit=300%2C10&amp;ssl=1\" data-large-file=\"https:\/\/i0.wp.com\/hackmethod.com\/wp-content\/uploads\/2016\/01\/Narnia0Source3.jpg?fit=683%2C22&amp;ssl=1\" class=\"aligncenter size-full wp-image-1812\" src=\"https:\/\/i0.wp.com\/www.hackmethod.com\/wp-content\/uploads\/2016\/01\/Narnia0Source3.jpg?resize=683%2C22&#038;ssl=1\" alt=\"Narnia0Source3\" scale=\"0\" width=\"683\" height=\"22\" srcset=\"https:\/\/i0.wp.com\/hackmethod.com\/wp-content\/uploads\/2016\/01\/Narnia0Source3.jpg?w=683&amp;ssl=1 683w, https:\/\/i0.wp.com\/hackmethod.com\/wp-content\/uploads\/2016\/01\/Narnia0Source3.jpg?resize=600%2C19&amp;ssl=1 600w, https:\/\/i0.wp.com\/hackmethod.com\/wp-content\/uploads\/2016\/01\/Narnia0Source3.jpg?resize=300%2C10&amp;ssl=1 300w\" sizes=\"(max-width: 683px) 100vw, 683px\" \/><\/a><\/div>\n<div data-blogger-escaped-style=\"line-height: 1.38;\">&nbsp;The scanf function is used for user input. The %24s means that the function will accept a 24 byte character string (1 char = 1 byte) and store that into the <strong>buf<\/strong> variable, but if you remember <strong>buf<\/strong> was only allocated 20 bytes of memory. This is how we&#8217;re going to exploit the program, more on this later.<\/div>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<table>\n<tbody>\n<tr>\n<td><a href=\"https:\/\/i0.wp.com\/www.hackmethod.com\/wp-content\/uploads\/2016\/01\/Narnia0Source4.jpg?ssl=1\" rel=\"attachment wp-att-1813\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"1813\" data-permalink=\"https:\/\/hackmethod.com\/overthewire-narnia-0\/narnia0source4\/\" data-orig-file=\"https:\/\/i0.wp.com\/hackmethod.com\/wp-content\/uploads\/2016\/01\/Narnia0Source4.jpg?fit=684%2C60&amp;ssl=1\" data-orig-size=\"684,60\" data-comments-opened=\"0\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;Boosta&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;1453672723&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"Narnia0Source4\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/i0.wp.com\/hackmethod.com\/wp-content\/uploads\/2016\/01\/Narnia0Source4.jpg?fit=300%2C26&amp;ssl=1\" data-large-file=\"https:\/\/i0.wp.com\/hackmethod.com\/wp-content\/uploads\/2016\/01\/Narnia0Source4.jpg?fit=684%2C60&amp;ssl=1\" class=\"aligncenter size-full wp-image-1813\" src=\"https:\/\/i0.wp.com\/www.hackmethod.com\/wp-content\/uploads\/2016\/01\/Narnia0Source4.jpg?resize=684%2C60&#038;ssl=1\" alt=\"Narnia0Source4\" scale=\"0\" width=\"684\" height=\"60\" srcset=\"https:\/\/i0.wp.com\/hackmethod.com\/wp-content\/uploads\/2016\/01\/Narnia0Source4.jpg?w=684&amp;ssl=1 684w, https:\/\/i0.wp.com\/hackmethod.com\/wp-content\/uploads\/2016\/01\/Narnia0Source4.jpg?resize=600%2C53&amp;ssl=1 600w, https:\/\/i0.wp.com\/hackmethod.com\/wp-content\/uploads\/2016\/01\/Narnia0Source4.jpg?resize=300%2C26&amp;ssl=1 300w\" sizes=\"(max-width: 684px) 100vw, 684px\" \/><\/a><span data-blogger-escaped-style=\"line-height: 1.38; white-space: pre-wrap;\">These two lines help you see what values were actually stored in <strong>buf<\/strong> and <strong>val<\/strong> after <strong>scanf()<\/strong><\/span><span data-blogger-escaped-style=\"line-height: 22.08px; white-space: pre-wrap;\">received<\/span><span data-blogger-escaped-style=\"line-height: 1.38; white-space: pre-wrap;\"> user input.<\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<table>\n<tbody>\n<tr>\n<td><a href=\"https:\/\/i0.wp.com\/www.hackmethod.com\/wp-content\/uploads\/2016\/01\/Narnia0Source5.jpg?ssl=1\" rel=\"attachment wp-att-1814\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"1814\" data-permalink=\"https:\/\/hackmethod.com\/overthewire-narnia-0\/narnia0source5\/\" data-orig-file=\"https:\/\/i0.wp.com\/hackmethod.com\/wp-content\/uploads\/2016\/01\/Narnia0Source5.jpg?fit=696%2C121&amp;ssl=1\" data-orig-size=\"696,121\" data-comments-opened=\"0\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;Boosta&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;1453672833&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"Narnia0Source5\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/i0.wp.com\/hackmethod.com\/wp-content\/uploads\/2016\/01\/Narnia0Source5.jpg?fit=300%2C52&amp;ssl=1\" data-large-file=\"https:\/\/i0.wp.com\/hackmethod.com\/wp-content\/uploads\/2016\/01\/Narnia0Source5.jpg?fit=696%2C121&amp;ssl=1\" class=\"aligncenter size-full wp-image-1814\" src=\"https:\/\/i0.wp.com\/www.hackmethod.com\/wp-content\/uploads\/2016\/01\/Narnia0Source5.jpg?resize=696%2C121&#038;ssl=1\" alt=\"Narnia0Source5\" scale=\"0\" width=\"696\" height=\"121\" srcset=\"https:\/\/i0.wp.com\/hackmethod.com\/wp-content\/uploads\/2016\/01\/Narnia0Source5.jpg?w=696&amp;ssl=1 696w, https:\/\/i0.wp.com\/hackmethod.com\/wp-content\/uploads\/2016\/01\/Narnia0Source5.jpg?resize=600%2C104&amp;ssl=1 600w, https:\/\/i0.wp.com\/hackmethod.com\/wp-content\/uploads\/2016\/01\/Narnia0Source5.jpg?resize=300%2C52&amp;ssl=1 300w\" sizes=\"(max-width: 696px) 100vw, 696px\" \/><\/a>If you correctly overwrite <strong>va<\/strong>l&#8217;s memory location to hold <em>0xdeadbeef<\/em>, then this branching statement gives you a shell (command prompt). Otherwise, it prints &#8220;<em>WAY OFF!!!!&#8221;<\/em> and then exits. Don&#8217;t despair, it doesn&#8217;t matter how close you are, it will always print this statement if it is incorrect.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<div>\n<div data-blogger-escaped-style=\"text-align: center;\">\n<div id=\"narniaexploitation\">\n<h1><span style=\"text-decoration: underline;\"><strong><span data-blogger-escaped-style=\"font-family: &quot;verdana&quot; , sans-serif;\">Narnia Level 0 &#8211; Exploitation<\/span><\/strong><\/span><\/h1>\n<p>As I stated before, we will need to take advantage of<\/p>\n<p><strong>scanf()<\/strong> in order to exploit this program, but to understand how, we first need to understand how programs get mapped into system memory.<\/p>\n<\/div>\n<p><span data-blogger-escaped-style=\"font-family: &quot;verdana&quot; , sans-serif;\"> Every program gets mapped into memory and uses a data structure known as &#8220;the stack&#8221; to store information such as variables, arguments and what instruction to execute next. It make sense to store these variables on the stack so that they can be easily and quickly retrieved as the program runs. Here is a graphical representation of&nbsp;what the stack looks like.&nbsp;<\/span> <span data-blogger-escaped-style=\"font-family: &quot;verdana&quot; , sans-serif;\"><a href=\"https:\/\/i0.wp.com\/1.bp.blogspot.com\/-XskvavAYEiI\/VqUQ-0mamuI\/AAAAAAAANe8\/02h_THxKh7I\/s1600\/stack%2Bexample%2B4.JPG\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/1.bp.blogspot.com\/-XskvavAYEiI\/VqUQ-0mamuI\/AAAAAAAANe8\/02h_THxKh7I\/s640\/stack%2Bexample%2B4.JPG?resize=640%2C334\" alt=\"\" scale=\"0\" class=\"aligncenter\" width=\"640\" height=\"334\" border=\"0\"><\/a><\/span><\/p>\n<p><span data-blogger-escaped-style=\"font-family: &quot;verdana&quot; , sans-serif;\">Notice the arrow pointing from high memory to low memory, this is because the stack grows towards the lower memory locations. That means that if a programs defines three variables in the following order&#8230; <\/span><span data-blogger-escaped-style=\"font-family: &quot;verdana&quot; , sans-serif;\">int x= 10 <\/span><span data-blogger-escaped-style=\"font-family: &quot;verdana&quot; , sans-serif;\">int y = 20 <\/span><span data-blogger-escaped-style=\"font-family: &quot;verdana&quot; , sans-serif;\">int z = 30 <\/span><span data-blogger-escaped-style=\"font-family: &quot;verdana&quot; , sans-serif;\">&#8230;then they will be stored on the stack as such.&nbsp;<\/span><\/p>\n<p data-blogger-escaped-style=\"clear: both; text-align: center;\"><a href=\"https:\/\/i0.wp.com\/3.bp.blogspot.com\/-pEY9SqVYqAc\/VqURMeSmJcI\/AAAAAAAANfI\/Jfy0azrzkXI\/s1600\/stack%2Bexample%2B5.JPG\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/3.bp.blogspot.com\/-pEY9SqVYqAc\/VqURMeSmJcI\/AAAAAAAANfI\/Jfy0azrzkXI\/s640\/stack%2Bexample%2B5.JPG?resize=640%2C330\" alt=\"\" scale=\"0\" class=\"aligncenter\" width=\"640\" height=\"330\" border=\"0\"><\/a><span data-blogger-escaped-style=\"font-family: &quot;verdana&quot; , sans-serif;\"><\/span><\/p>\n<p data-blogger-escaped-style=\"clear: both; text-align: center;\"><span data-blogger-escaped-style=\"font-family: &quot;verdana&quot; , sans-serif;\">In order to exploit <strong>narnia0<\/strong>, this is all the information that we need to know. Other details about the stack such as the return address and old EBP (base pointer) will be explained in detail as we progress through the other levels.&nbsp;<\/span><span data-blogger-escaped-style=\"font-family: &quot;verdana&quot; , sans-serif;\">Lets see how the the <strong>narnia0<\/strong> program looks on the stack.<\/span><span data-blogger-escaped-style=\"font-family: &quot;verdana&quot; , sans-serif;\"><a href=\"https:\/\/i0.wp.com\/1.bp.blogspot.com\/-1tD-5mJfctw\/VqUH87fSZHI\/AAAAAAAANeU\/crb-bIGpem8\/s1600\/stack%2Bexample%2B2.JPG\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"aligncenter\" src=\"https:\/\/i0.wp.com\/1.bp.blogspot.com\/-1tD-5mJfctw\/VqUH87fSZHI\/AAAAAAAANeU\/crb-bIGpem8\/s640\/stack%2Bexample%2B2.JPG?resize=640%2C362&#038;ssl=1\" alt=\"\" scale=\"0\" width=\"640\" height=\"362\" border=\"0\"><\/a><\/span><\/p>\n<p>Since the stack grows from high memory to low memory, <strong>val<\/strong> is stored at a higher memory address than <strong>buf<\/strong>, because <strong>val<\/strong> was declared first in the program. Notice that the main program does not take any arguments on the command line, so those memory locations on the stack have been grey out (in reality they don&#8217;t even exist), and since this&nbsp;challenge only require us to manipulate <strong>buf<\/strong> and <strong>val<\/strong>, I&#8217;ve also grayed out Old EBP and Return Address, again we&#8217;ll discuss the purpose of these during future levels. <span data-blogger-escaped-style=\"font-family: verdana, sans-serif;\">How are we going to change <strong>val<\/strong> on the stack, so that it reads <em>0xdeadbeef<\/em>? Remember the <strong>scanf()<\/strong> function that reads in 24 bytes of data? For the visual learners, here&#8217;s how that looks in memory.&nbsp;<\/span><span data-blogger-escaped-style=\"font-family: &quot;verdana&quot; , sans-serif;\"><a href=\"https:\/\/i0.wp.com\/www.hackmethod.com\/wp-content\/uploads\/2016\/01\/NarniaStackFrame.jpg?ssl=1\" rel=\"attachment wp-att-1836\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"1837\" data-permalink=\"https:\/\/hackmethod.com\/overthewire-narnia-0\/narniastackframe\/\" data-orig-file=\"https:\/\/i0.wp.com\/hackmethod.com\/wp-content\/uploads\/2016\/01\/NarniaStackFrame.jpg?fit=594%2C681&amp;ssl=1\" data-orig-size=\"594,681\" data-comments-opened=\"0\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;Boosta&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;1453676742&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"NarniaStackFrame\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/i0.wp.com\/hackmethod.com\/wp-content\/uploads\/2016\/01\/NarniaStackFrame.jpg?fit=262%2C300&amp;ssl=1\" data-large-file=\"https:\/\/i0.wp.com\/hackmethod.com\/wp-content\/uploads\/2016\/01\/NarniaStackFrame.jpg?fit=594%2C681&amp;ssl=1\" class=\"aligncenter wp-image-1837 size-full\" src=\"https:\/\/i0.wp.com\/www.hackmethod.com\/wp-content\/uploads\/2016\/01\/NarniaStackFrame.jpg?resize=594%2C681&#038;ssl=1\" alt=\"\" scale=\"0\" width=\"594\" height=\"681\" srcset=\"https:\/\/i0.wp.com\/hackmethod.com\/wp-content\/uploads\/2016\/01\/NarniaStackFrame.jpg?w=594&amp;ssl=1 594w, https:\/\/i0.wp.com\/hackmethod.com\/wp-content\/uploads\/2016\/01\/NarniaStackFrame.jpg?resize=262%2C300&amp;ssl=1 262w\" sizes=\"(max-width: 594px) 100vw, 594px\" \/><\/a><\/span><\/p>\n<p><span data-blogger-escaped-style=\"font-family: &quot;verdana&quot; , sans-serif;\">Each square in the illustration above represents 1-byte. <strong>val<\/strong> is of type long and long is defined as being 8-bytes. Again, we see that <strong>scanf()<\/strong>&nbsp;is set to take in&nbsp;24-bytes of input and store them in the memory location of <strong>buf<\/strong>. The <strong>scanf()<\/strong> function does not check or care how big the destination location is;&nbsp;therefore, by filling up the <strong>scanf()<\/strong> buffer, we can overwrite the adjacent memory location of&nbsp;<strong>val<\/strong>.<\/span><\/p>\n<div id=\"narniasolution\">\n<h1><strong><span style=\"text-decoration: underline;\"><span data-blogger-escaped-style=\"font-family: &quot;verdana&quot; , sans-serif;\">Narnia Level 0 &#8211; Solution<\/span><\/span><\/strong><\/h1>\n<p><span data-blogger-escaped-style=\"font-family: &quot;verdana&quot; , sans-serif;\">Armed with the knowledge above, you may be temped (as I was) to try and solve the puzzle.<\/span> <strong><span data-blogger-escaped-style=\"font-family: &quot;verdana&quot; , sans-serif;\">Attempt 1:<\/span><\/strong><\/p>\n<p><span data-blogger-escaped-style=\"font-family: &quot;verdana&quot; , sans-serif;\"><a href=\"https:\/\/i0.wp.com\/www.hackmethod.com\/wp-content\/uploads\/2016\/01\/NarniaAttemp1-1.jpg?ssl=1\" rel=\"attachment wp-att-1831\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"1831\" data-permalink=\"https:\/\/hackmethod.com\/overthewire-narnia-0\/narniaattemp1-2\/\" data-orig-file=\"https:\/\/i0.wp.com\/hackmethod.com\/wp-content\/uploads\/2016\/01\/NarniaAttemp1-1.jpg?fit=540%2C137&amp;ssl=1\" data-orig-size=\"540,137\" data-comments-opened=\"0\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;Boosta&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;1453674548&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"NarniaAttemp1\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/i0.wp.com\/hackmethod.com\/wp-content\/uploads\/2016\/01\/NarniaAttemp1-1.jpg?fit=300%2C76&amp;ssl=1\" data-large-file=\"https:\/\/i0.wp.com\/hackmethod.com\/wp-content\/uploads\/2016\/01\/NarniaAttemp1-1.jpg?fit=540%2C137&amp;ssl=1\" class=\"aligncenter size-full wp-image-1831\" src=\"https:\/\/i0.wp.com\/www.hackmethod.com\/wp-content\/uploads\/2016\/01\/NarniaAttemp1-1.jpg?resize=540%2C137&#038;ssl=1\" alt=\"NarniaAttemp1\" scale=\"0\" width=\"540\" height=\"137\" srcset=\"https:\/\/i0.wp.com\/hackmethod.com\/wp-content\/uploads\/2016\/01\/NarniaAttemp1-1.jpg?w=540&amp;ssl=1 540w, https:\/\/i0.wp.com\/hackmethod.com\/wp-content\/uploads\/2016\/01\/NarniaAttemp1-1.jpg?resize=300%2C76&amp;ssl=1 300w\" sizes=\"(max-width: 540px) 100vw, 540px\" \/><\/a><\/span><\/p>\n<p>Although this did not work, important information can be gleaned from our failure. The first thing to notice is that value 0x64616564 is no where close to 0xdeadbeef. The answer to why lies on the second line that says &#8220;Correct val&#8217;s value from 0x4141414141 to 0xdeadbeef&#8221;. The 0x portion means that it wants the value of val to be in hex, but instead we passed it ASCII. The second thing to notice is that 0x64616564 is the ASCII equivalent of daed&nbsp;(or dead backwards).&nbsp;The reason our input was displayed backwards is because most x86 architectures store data in little-endian format when it is pushed onto the stack. This means that the least significant byte (far right value) gets stored in the lowest memory location, for example, if we set <strong>val&nbsp;<\/strong>to <em>Hello<\/em>, it would be stored in memory like this&#8230; <a href=\"https:\/\/i0.wp.com\/2.bp.blogspot.com\/-I2l_k31qqI0\/VqVEWB06_4I\/AAAAAAAANf4\/NK0LpvBpbmc\/s1600\/little-endian.JPG\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"aligncenter\" src=\"https:\/\/i0.wp.com\/2.bp.blogspot.com\/-I2l_k31qqI0\/VqVEWB06_4I\/AAAAAAAANf4\/NK0LpvBpbmc\/s640\/little-endian.JPG?resize=640%2C168\" alt=\"\" scale=\"0\" width=\"640\" height=\"168\" border=\"0\"><\/a><\/p>\n<p>Using this information lets try&nbsp;again. <strong>Attempt 2:<\/strong><a href=\"https:\/\/i0.wp.com\/www.hackmethod.com\/wp-content\/uploads\/2016\/01\/NarniaAttemp2.jpg?ssl=1\" rel=\"attachment wp-att-1832\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"1832\" data-permalink=\"https:\/\/hackmethod.com\/overthewire-narnia-0\/narniaattemp2\/\" data-orig-file=\"https:\/\/i0.wp.com\/hackmethod.com\/wp-content\/uploads\/2016\/01\/NarniaAttemp2.jpg?fit=806%2C161&amp;ssl=1\" data-orig-size=\"806,161\" data-comments-opened=\"0\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;Boosta&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;1453674702&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"NarniaAttemp2\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/i0.wp.com\/hackmethod.com\/wp-content\/uploads\/2016\/01\/NarniaAttemp2.jpg?fit=300%2C60&amp;ssl=1\" data-large-file=\"https:\/\/i0.wp.com\/hackmethod.com\/wp-content\/uploads\/2016\/01\/NarniaAttemp2.jpg?fit=806%2C161&amp;ssl=1\" class=\"aligncenter size-full wp-image-1832\" src=\"https:\/\/i0.wp.com\/www.hackmethod.com\/wp-content\/uploads\/2016\/01\/NarniaAttemp2.jpg?resize=806%2C161&#038;ssl=1\" alt=\"NarniaAttemp2\" scale=\"0\" width=\"806\" height=\"161\" srcset=\"https:\/\/i0.wp.com\/hackmethod.com\/wp-content\/uploads\/2016\/01\/NarniaAttemp2.jpg?w=806&amp;ssl=1 806w, https:\/\/i0.wp.com\/hackmethod.com\/wp-content\/uploads\/2016\/01\/NarniaAttemp2.jpg?resize=600%2C120&amp;ssl=1 600w, https:\/\/i0.wp.com\/hackmethod.com\/wp-content\/uploads\/2016\/01\/NarniaAttemp2.jpg?resize=300%2C60&amp;ssl=1 300w, https:\/\/i0.wp.com\/hackmethod.com\/wp-content\/uploads\/2016\/01\/NarniaAttemp2.jpg?resize=768%2C153&amp;ssl=1 768w, https:\/\/i0.wp.com\/hackmethod.com\/wp-content\/uploads\/2016\/01\/NarniaAttemp2.jpg?resize=730%2C146&amp;ssl=1 730w\" sizes=\"(max-width: 806px) 100vw, 806px\" \/><\/a><\/p>\n<p>First we need to figure out how to get hex into our ASCII input. The BASH shell has the ability to represent hex using the&nbsp;<em>\\x&nbsp;<\/em>escape sequence, but in order for echo to parse escape sequence we have to add the -e option. Since hex values outside the ASCII range contain non-printable characters that are not easily copied and pasted, we are going to pipe the output directly to the program. This has the affect of storing our custom string into a buffer and waiting for scanf() to read it. Success? Sort of. The program didn&#8217;t yell at us and the <strong>val<\/strong>&nbsp;has been overwritten to the correct value, but the program closes immediately without allowing us to use our newly acquired privileges. <strong>Attempt 3:<\/strong> SUCCESS!<\/p>\n<p><a href=\"https:\/\/i0.wp.com\/www.hackmethod.com\/wp-content\/uploads\/2016\/01\/NarniaAttemp3.jpg?ssl=1\" rel=\"attachment wp-att-1833\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"1833\" data-permalink=\"https:\/\/hackmethod.com\/overthewire-narnia-0\/narniaattemp3\/\" data-orig-file=\"https:\/\/i0.wp.com\/hackmethod.com\/wp-content\/uploads\/2016\/01\/NarniaAttemp3.jpg?fit=865%2C213&amp;ssl=1\" data-orig-size=\"865,213\" data-comments-opened=\"0\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;Boosta&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;1453675647&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"NarniaAttemp3\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/i0.wp.com\/hackmethod.com\/wp-content\/uploads\/2016\/01\/NarniaAttemp3.jpg?fit=300%2C74&amp;ssl=1\" data-large-file=\"https:\/\/i0.wp.com\/hackmethod.com\/wp-content\/uploads\/2016\/01\/NarniaAttemp3.jpg?fit=865%2C213&amp;ssl=1\" class=\"aligncenter size-full wp-image-1833\" src=\"https:\/\/i0.wp.com\/www.hackmethod.com\/wp-content\/uploads\/2016\/01\/NarniaAttemp3.jpg?resize=865%2C213&#038;ssl=1\" alt=\"NarniaAttemp3\" scale=\"0\" width=\"865\" height=\"213\" srcset=\"https:\/\/i0.wp.com\/hackmethod.com\/wp-content\/uploads\/2016\/01\/NarniaAttemp3.jpg?w=865&amp;ssl=1 865w, https:\/\/i0.wp.com\/hackmethod.com\/wp-content\/uploads\/2016\/01\/NarniaAttemp3.jpg?resize=600%2C148&amp;ssl=1 600w, https:\/\/i0.wp.com\/hackmethod.com\/wp-content\/uploads\/2016\/01\/NarniaAttemp3.jpg?resize=300%2C74&amp;ssl=1 300w, https:\/\/i0.wp.com\/hackmethod.com\/wp-content\/uploads\/2016\/01\/NarniaAttemp3.jpg?resize=768%2C189&amp;ssl=1 768w, https:\/\/i0.wp.com\/hackmethod.com\/wp-content\/uploads\/2016\/01\/NarniaAttemp3.jpg?resize=730%2C180&amp;ssl=1 730w\" sizes=\"(max-width: 865px) 100vw, 865px\" \/><\/a><\/p>\n<p>If you create a command group&nbsp;<em>( command 1 ; command 2; )<\/em>&nbsp;and pipe the result to your program, each command is provided as a separate input to the program. The first input is our custom string which gets fed to the <strong>scanf()<\/strong> function. After the program executes <strong>system(&#8220;\/bin\/sh&#8221;)<\/strong>&nbsp;we are given a command shell, by passing cat to the command shell as a the second input, it keeps the command shell open, we are free to run any commands under the new elevated permissions. (I have scoured the internet high and low to figure out how and why that last part works, but have yet to find a solid answer).<\/p>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n\n\n<p>That wasn&#8217;t so difficult, was it?  Pretty simple tbh.  If you&#8217;re interested and want to keep going, check out Narnia Level 1 using the button below.<\/p>\n\n\n\n<div class=\"wp-block-columns has-2-columns is-layout-flex wp-container-core-columns-is-layout-9d6595d7 wp-block-columns-is-layout-flex\">\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\">\n<p><\/p>\n<\/div>\n\n\n\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\">\n<div class=\"wp-block-button aligncenter\"><a class=\"wp-block-button__link\" href=\"https:\/\/hackmethod.com\/overthewire-narnia-1\/\">Narnia Level 1<br><\/a><\/div>\n<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Introduction Source Code vs Executable Code Narnia Level 0 &#8211; Source Code Narnia Level 0 &#8211; Exploitation Narnia Level 0 &#8211; Solution Introduction This is an introduction to reverse engineering. I will be going through a series of reverse engineering puzzles developed by OverTheWire&nbsp;and explaining the methodology I used to solve these puzzles.<\/p>\n","protected":false},"author":8,"featured_media":1842,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_et_pb_use_builder":"","_et_pb_old_content":"","_et_gb_content_width":"","jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":true,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[52,49],"tags":[],"class_list":["post-1789","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-hacking","category-tutorials"],"jetpack_featured_media_url":"https:\/\/i0.wp.com\/hackmethod.com\/wp-content\/uploads\/2016\/01\/NarniaImage.jpeg?fit=600%2C400&ssl=1","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p5zY4D-sR","_links":{"self":[{"href":"https:\/\/hackmethod.com\/wp-json\/wp\/v2\/posts\/1789","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/hackmethod.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/hackmethod.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/hackmethod.com\/wp-json\/wp\/v2\/users\/8"}],"replies":[{"embeddable":true,"href":"https:\/\/hackmethod.com\/wp-json\/wp\/v2\/comments?post=1789"}],"version-history":[{"count":55,"href":"https:\/\/hackmethod.com\/wp-json\/wp\/v2\/posts\/1789\/revisions"}],"predecessor-version":[{"id":27862,"href":"https:\/\/hackmethod.com\/wp-json\/wp\/v2\/posts\/1789\/revisions\/27862"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/hackmethod.com\/wp-json\/wp\/v2\/media\/1842"}],"wp:attachment":[{"href":"https:\/\/hackmethod.com\/wp-json\/wp\/v2\/media?parent=1789"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/hackmethod.com\/wp-json\/wp\/v2\/categories?post=1789"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/hackmethod.com\/wp-json\/wp\/v2\/tags?post=1789"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}