{"id":42,"date":"2021-11-17T04:50:32","date_gmt":"2021-11-17T04:50:32","guid":{"rendered":"https:\/\/blogs.oregonstate.edu\/paul\/?p=42"},"modified":"2021-11-17T04:56:59","modified_gmt":"2021-11-17T04:56:59","slug":"writeup-ultrasecure","status":"publish","type":"post","link":"https:\/\/blogs.oregonstate.edu\/paul\/2021\/11\/17\/writeup-ultrasecure\/","title":{"rendered":"Writeup: Ultrasecure"},"content":{"rendered":"\n<p>In this challenge, we are given a binary and the instructions to &#8220;Use pwntools and ghidra to reverse engineer and break into the ultrasecure(tm) vault!&#8221;<\/p>\n\n\n\n<p>Let&#8217;s check it out!<\/p>\n\n\n\n<p>Running the binary gives us the output:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ .\/ultrasecure\nProve that you are not human, repeat this to me in less than .05s: 1626412526\n1626412526\nWhoops, too slow<\/code><\/pre>\n\n\n\n<p>Looks like my reflexes aren&#8217;t quite fast enough, so we&#8217;ll have to automate the nonce. This is a good time to use pwntools! First we&#8217;ll connect to the binary, and then we&#8217;ll read in and repeat the nonce back. The code for the nonce looks like this:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\nnonce = conn.recvline()\nnonce = nonce.split()\nnonce = nonce&#091;-1]\n# Sends line\nconn.sendline(nonce)\n<\/code><\/pre>\n\n\n\n<p>Running this script gives us<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>You passed the nonce check! Now, Unlock the UltraSecure(tm) Vault:\n$ password\nWhoops, wrong password :(<\/code><\/pre>\n\n\n\n<p>Firing up Ghidra gives us a <code>password_check<\/code> function, which contains the lines below.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>  \n  local_c = -0x21524cc1;  \n__isoc99_scanf(&amp;DAT_00400b9f,&amp;local_3c);\n  if (local_c == local_3c) {\n    print_flag();\n                    \/* WARNING: Subroutine does not return *\/\n    exit(0);\n  }<\/code><\/pre>\n\n\n\n<p>-0x21524cc1 = -559041729, so we&#8217;ve got our password! Entering it after running our script gives us access to the flag.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this challenge, we are given a binary and the instructions to &#8220;Use pwntools and ghidra to reverse engineer and break into the ultrasecure(tm) vault!&#8221; Let&#8217;s check it out! Running the binary gives us the output: Looks like my reflexes aren&#8217;t quite fast enough, so we&#8217;ll have to automate the nonce. This is a good &hellip; <a href=\"https:\/\/blogs.oregonstate.edu\/paul\/2021\/11\/17\/writeup-ultrasecure\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Writeup: Ultrasecure<\/span><\/a><\/p>\n","protected":false},"author":11809,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[],"class_list":["post-42","post","type-post","status-publish","format-standard","hentry","category-writeups"],"_links":{"self":[{"href":"https:\/\/blogs.oregonstate.edu\/paul\/wp-json\/wp\/v2\/posts\/42","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blogs.oregonstate.edu\/paul\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.oregonstate.edu\/paul\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.oregonstate.edu\/paul\/wp-json\/wp\/v2\/users\/11809"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.oregonstate.edu\/paul\/wp-json\/wp\/v2\/comments?post=42"}],"version-history":[{"count":2,"href":"https:\/\/blogs.oregonstate.edu\/paul\/wp-json\/wp\/v2\/posts\/42\/revisions"}],"predecessor-version":[{"id":44,"href":"https:\/\/blogs.oregonstate.edu\/paul\/wp-json\/wp\/v2\/posts\/42\/revisions\/44"}],"wp:attachment":[{"href":"https:\/\/blogs.oregonstate.edu\/paul\/wp-json\/wp\/v2\/media?parent=42"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.oregonstate.edu\/paul\/wp-json\/wp\/v2\/categories?post=42"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.oregonstate.edu\/paul\/wp-json\/wp\/v2\/tags?post=42"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}