{"id":32,"date":"2021-11-10T21:16:14","date_gmt":"2021-11-10T21:16:14","guid":{"rendered":"https:\/\/blogs.oregonstate.edu\/paul\/?p=32"},"modified":"2021-11-17T04:56:36","modified_gmt":"2021-11-17T04:56:36","slug":"writeup-hash-browns","status":"publish","type":"post","link":"https:\/\/blogs.oregonstate.edu\/paul\/2021\/11\/10\/writeup-hash-browns\/","title":{"rendered":"Writeup: Hash Browns"},"content":{"rendered":"\n<p>In our first OSUSEC challenge of 2021, we were given the instructions to &#8220;open the linked website in your browser. Good luck!&#8221;<\/p>\n\n\n\n<p>Opening the link in Firefox, we reach this site prompting for a password.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"941\" height=\"441\" src=\"https:\/\/osu-wams-blogs-uploads.s3.amazonaws.com\/blogs.dir\/4941\/files\/2021\/11\/site-1.png\" alt=\"\" class=\"wp-image-34\" srcset=\"https:\/\/osu-wams-blogs-uploads.s3.amazonaws.com\/blogs.dir\/4941\/files\/2021\/11\/site-1.png 941w, https:\/\/osu-wams-blogs-uploads.s3.amazonaws.com\/blogs.dir\/4941\/files\/2021\/11\/site-1-300x141.png 300w, https:\/\/osu-wams-blogs-uploads.s3.amazonaws.com\/blogs.dir\/4941\/files\/2021\/11\/site-1-768x360.png 768w\" sizes=\"auto, (max-width: 941px) 100vw, 941px\" \/><\/figure>\n\n\n\n<p>My spidey-senses tingling, I opened inspect element. This revealed some javascript that activated when the submit button was pressed:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>function check_password() {\n  let password = document.getElementById(\"password\").value;\n  let hash = get_sha256(password);\n  if (hash == \"b0fef621727ff82a7d334d9f1f047dc662ed0e27e05aa8fd1aefd19b0fff312c\") {\n    document.getElementById(\"login\").submit();\n  }\n}  <\/code><\/pre>\n\n\n\n<p>We see that there is a sha256 hash in the script. Using <a href=\"https:\/\/hashtoolkit.com\/decrypt-sha256-hash\/b0fef621727ff82a7d334d9f1f047dc662ed0e27e05aa8fd1aefd19b0fff312c\">Hash Toolkit<\/a> on the hash reveals that the password is &#8220;pineapple.&#8221; Hit submit, and getting the flag should be trivial from here!<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"707\" height=\"524\" src=\"https:\/\/osu-wams-blogs-uploads.s3.amazonaws.com\/blogs.dir\/4941\/files\/2021\/11\/catchme.png\" alt=\"\" class=\"wp-image-35\" srcset=\"https:\/\/osu-wams-blogs-uploads.s3.amazonaws.com\/blogs.dir\/4941\/files\/2021\/11\/catchme.png 707w, https:\/\/osu-wams-blogs-uploads.s3.amazonaws.com\/blogs.dir\/4941\/files\/2021\/11\/catchme-300x222.png 300w\" sizes=\"auto, (max-width: 707px) 100vw, 707px\" \/><\/figure>\n\n\n\n<p>Looks like we&#8217;re in for a bit more! We&#8217;ve got to click the link, which is twisting and turning all about the webpage. We can either click it (the fun way) or pretend to click it (the 1337 way).<\/p>\n\n\n\n<p>Looks like it calls a function called print_flag(), which can be entered using the web console. After this function is called, the text &#8220;Get the flag!&#8221; is replaced with the flag. Hitting Ctrl-A selects the text, which can then be copied and submitted!<\/p>\n\n\n\n<p>This was a fun, goofy introduction to OSUSEC, and I enjoyed my first-ever CTF challenge \ud83d\ude42<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In our first OSUSEC challenge of 2021, we were given the instructions to &#8220;open the linked website in your browser. Good luck!&#8221; Opening the link in Firefox, we reach this site prompting for a password. My spidey-senses tingling, I opened inspect element. This revealed some javascript that activated when the submit button was pressed: We &hellip; <a href=\"https:\/\/blogs.oregonstate.edu\/paul\/2021\/11\/10\/writeup-hash-browns\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Writeup: Hash Browns<\/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-32","post","type-post","status-publish","format-standard","hentry","category-writeups"],"_links":{"self":[{"href":"https:\/\/blogs.oregonstate.edu\/paul\/wp-json\/wp\/v2\/posts\/32","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=32"}],"version-history":[{"count":5,"href":"https:\/\/blogs.oregonstate.edu\/paul\/wp-json\/wp\/v2\/posts\/32\/revisions"}],"predecessor-version":[{"id":46,"href":"https:\/\/blogs.oregonstate.edu\/paul\/wp-json\/wp\/v2\/posts\/32\/revisions\/46"}],"wp:attachment":[{"href":"https:\/\/blogs.oregonstate.edu\/paul\/wp-json\/wp\/v2\/media?parent=32"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.oregonstate.edu\/paul\/wp-json\/wp\/v2\/categories?post=32"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.oregonstate.edu\/paul\/wp-json\/wp\/v2\/tags?post=32"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}