{"id":438,"date":"2015-01-20T02:24:27","date_gmt":"2015-01-20T02:24:27","guid":{"rendered":"https:\/\/www.hackmethod.com\/?p=438"},"modified":"2022-06-03T05:40:09","modified_gmt":"2022-06-03T05:40:09","slug":"overthewire-bandit-12","status":"publish","type":"post","link":"https:\/\/hackmethod.com\/overthewire-bandit-12\/","title":{"rendered":"OvertheWire &#8211; Bandit 12"},"content":{"rendered":"<p>[et_pb_section fb_built=&#8221;1&#8243; admin_label=&#8221;section&#8221; _builder_version=&#8221;3.22&#8243;][et_pb_row admin_label=&#8221;row&#8221; _builder_version=&#8221;3.25&#8243; background_size=&#8221;initial&#8221; background_position=&#8221;top_left&#8221; background_repeat=&#8221;repeat&#8221;][et_pb_column type=&#8221;4_4&#8243; _builder_version=&#8221;3.25&#8243; custom_padding=&#8221;|||&#8221; custom_padding__hover=&#8221;|||&#8221;][et_pb_text admin_label=&#8221;Text&#8221; _builder_version=&#8221;4.7.5&#8243; background_size=&#8221;initial&#8221; background_position=&#8221;top_left&#8221; background_repeat=&#8221;repeat&#8221; hover_enabled=&#8221;0&#8243; sticky_enabled=&#8221;0&#8243;]<strong>Recap of Level 11: <\/strong>Learned how to decode strings that have been obfuscated by base64<\/p>\n<p>&nbsp;<\/p>\n<p><a href=\"http:\/\/overthewire.org\/wargames\/bandit\/bandit12.html\" target=\"_blank\" rel=\"noopener\"><strong>Bandit Level 12<\/strong><\/a><\/p>\n<h4><strong>Objective:<\/strong><\/h4>\n<p>Find the password to the next level<\/p>\n<h4><strong>Intel Given:<\/strong><\/h4>\n<ul>\n<li>Password is in data.txt<\/li>\n<li>The password has been changed\u00a0where all lowercase (a-z) and uppercase (A-Z) letters have been rotated by 13 positions<\/li>\n<\/ul>\n<p><!--more--><\/p>\n<h4><strong>How to:<\/strong><\/h4>\n<p>We&#8217;re still in obfuscation. Once again this is knowledge that I don&#8217;t have off of the top of my head. A quick google search of the following term\u00a0&#8220;change character 13 positions obfuscation&#8221; reveals <a href=\"http:\/\/en.wikipedia.org\/wiki\/ROT13\" target=\"_blank\" rel=\"noopener\">this article<\/a>. You can read that article if you so wish, but I&#8217;ll explain it in my own words.<\/p>\n<p>This is simply taking a letter, and moving it a pre-set amount\u00a0times down to the alphabet to the new letter. The &#8220;key&#8221; to this cipher is knowing how many letters it has changed and as luck would have it we know its 13 due to our intel. This means that the letter A is actually N, G is T, u is h (It loops back around the alphabet) and so forth.<\/p>\n<p><a href=\"https:\/\/i0.wp.com\/www.hackmethod.com\/wp-content\/uploads\/2015\/01\/Screen-Shot-2015-01-19-at-8.08.45-PM.png?ssl=1\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"439\" data-permalink=\"https:\/\/hackmethod.com\/overthewire-bandit-12\/screen-shot-2015-01-19-at-8-08-45-pm\/\" data-orig-file=\"https:\/\/i0.wp.com\/hackmethod.com\/wp-content\/uploads\/2015\/01\/Screen-Shot-2015-01-19-at-8.08.45-PM.png?fit=355%2C33&amp;ssl=1\" data-orig-size=\"355,33\" data-comments-opened=\"0\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&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=\"Screen Shot 2015-01-19 at 8.08.45 PM\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/i0.wp.com\/hackmethod.com\/wp-content\/uploads\/2015\/01\/Screen-Shot-2015-01-19-at-8.08.45-PM.png?fit=300%2C28&amp;ssl=1\" data-large-file=\"https:\/\/i0.wp.com\/hackmethod.com\/wp-content\/uploads\/2015\/01\/Screen-Shot-2015-01-19-at-8.08.45-PM.png?fit=355%2C33&amp;ssl=1\" class=\" size-full wp-image-439 aligncenter\" src=\"https:\/\/i0.wp.com\/www.hackmethod.com\/wp-content\/uploads\/2015\/01\/Screen-Shot-2015-01-19-at-8.08.45-PM.png?resize=355%2C33&#038;ssl=1\" alt=\"Screen Shot 2015-01-19 at 8.08.45 PM\" width=\"355\" height=\"33\" srcset=\"https:\/\/i0.wp.com\/hackmethod.com\/wp-content\/uploads\/2015\/01\/Screen-Shot-2015-01-19-at-8.08.45-PM.png?w=355&amp;ssl=1 355w, https:\/\/i0.wp.com\/hackmethod.com\/wp-content\/uploads\/2015\/01\/Screen-Shot-2015-01-19-at-8.08.45-PM.png?resize=300%2C28&amp;ssl=1 300w, https:\/\/i0.wp.com\/hackmethod.com\/wp-content\/uploads\/2015\/01\/Screen-Shot-2015-01-19-at-8.08.45-PM.png?resize=350%2C33&amp;ssl=1 350w\" sizes=\"(max-width: 355px) 100vw, 355px\" \/><\/a><\/p>\n<p>As we can see when reading the file it looks garbled. Well *nix has a command to translate characters (letters &amp; numbers). The command &#8216;tr&#8217; when assigned with the correct switches will give us our solution. In our case, we need to tell the command that we wish to take THIS set of rules, and change them to THOSE set of rules. Look below for the solution and further explanation.<\/p>\n<p><a href=\"https:\/\/i0.wp.com\/www.hackmethod.com\/wp-content\/uploads\/2015\/01\/Screen-Shot-2015-01-19-at-8.08.55-PM.png?ssl=1\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"440\" data-permalink=\"https:\/\/hackmethod.com\/overthewire-bandit-12\/screen-shot-2015-01-19-at-8-08-55-pm\/\" data-orig-file=\"https:\/\/i0.wp.com\/hackmethod.com\/wp-content\/uploads\/2015\/01\/Screen-Shot-2015-01-19-at-8.08.55-PM.png?fit=438%2C37&amp;ssl=1\" data-orig-size=\"438,37\" data-comments-opened=\"0\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&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=\"Screen Shot 2015-01-19 at 8.08.55 PM\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/i0.wp.com\/hackmethod.com\/wp-content\/uploads\/2015\/01\/Screen-Shot-2015-01-19-at-8.08.55-PM.png?fit=300%2C25&amp;ssl=1\" data-large-file=\"https:\/\/i0.wp.com\/hackmethod.com\/wp-content\/uploads\/2015\/01\/Screen-Shot-2015-01-19-at-8.08.55-PM.png?fit=438%2C37&amp;ssl=1\" class=\" size-full wp-image-440 aligncenter\" src=\"https:\/\/i0.wp.com\/www.hackmethod.com\/wp-content\/uploads\/2015\/01\/Screen-Shot-2015-01-19-at-8.08.55-PM.png?resize=438%2C37&#038;ssl=1\" alt=\"Screen Shot 2015-01-19 at 8.08.55 PM\" width=\"438\" height=\"37\" srcset=\"https:\/\/i0.wp.com\/hackmethod.com\/wp-content\/uploads\/2015\/01\/Screen-Shot-2015-01-19-at-8.08.55-PM.png?w=438&amp;ssl=1 438w, https:\/\/i0.wp.com\/hackmethod.com\/wp-content\/uploads\/2015\/01\/Screen-Shot-2015-01-19-at-8.08.55-PM.png?resize=300%2C25&amp;ssl=1 300w\" sizes=\"(max-width: 438px) 100vw, 438px\" \/><\/a><\/p>\n<p>So as you can see I&#8217;m piping the string from the data.txt file into our translate command. Breaking down the &#8216;tr&#8217; command arguments in layman&#8217;s terms I&#8217;m saying &#8220;Take the Uppercase and Lowercase letters A-Z and substitute them starting with N-ZA-M&#8221;. Remember I need to include wrapping around the alphabet in my argument or it won&#8217;t work correctly.<\/p>\n<h4><strong>Conclusion:<\/strong><\/h4>\n<p>We went a little more advanced into obfuscation, now we had to input a few arguments into our command rather than letting our machine do the work for us. \u00a0This gave us a little bit of insight as to how simple ciphers can be used to hide intended communications in cleartext.<br \/>\n[\/et_pb_text][\/et_pb_column][\/et_pb_row][et_pb_row _builder_version=&#8221;4.7.5&#8243; _module_preset=&#8221;default&#8221; column_structure=&#8221;1_2,1_2&#8243;][et_pb_column _builder_version=&#8221;4.7.5&#8243; _module_preset=&#8221;default&#8221; type=&#8221;1_2&#8243;][et_pb_image src=&#8221;https:\/\/hackmethod.com\/wp-content\/uploads\/2020\/12\/Previous.png&#8221; _builder_version=&#8221;4.7.5&#8243; _module_preset=&#8221;default&#8221; alt=&#8221;Previous Level&#8221; title_text=&#8221;Previous&#8221; url=&#8221;https:\/\/hackmethod.com\/overthewire-bandit-11&#8243; hover_enabled=&#8221;0&#8243; sticky_enabled=&#8221;0&#8243;][\/et_pb_image][\/et_pb_column][et_pb_column _builder_version=&#8221;4.7.5&#8243; _module_preset=&#8221;default&#8221; type=&#8221;1_2&#8243;][et_pb_image src=&#8221;https:\/\/hackmethod.com\/wp-content\/uploads\/2020\/12\/Next.png&#8221; _builder_version=&#8221;4.7.5&#8243; _module_preset=&#8221;default&#8221; alt=&#8221;Next Level&#8221; title_text=&#8221;Next&#8221; url=&#8221;https:\/\/hackmethod.com\/overthewire-bandit-13&#8243; align=&#8221;right&#8221; hover_enabled=&#8221;0&#8243; sticky_enabled=&#8221;0&#8243;][\/et_pb_image][\/et_pb_column][\/et_pb_row][\/et_pb_section]<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Recap of Level 11: Learned how to decode strings that have been obfuscated by base64 &nbsp; Bandit Level 12 Objective: Find the password to the next level Intel Given: Password is in data.txt The password has been changed\u00a0where all lowercase (a-z) and uppercase (A-Z) letters have been rotated by 13 positions How to: We&#8217;re still [&hellip;]<\/p>\n","protected":false},"author":8,"featured_media":439,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_et_pb_use_builder":"on","_et_pb_old_content":"<strong>Recap of <a href=\"https:\/\/www.hackmethod.com\/overthewire-bandit-11\/\" target=\"_blank\">Last\u00a0Lesson<\/a>:\u00a0<\/strong>Learned how to decode strings that have been obfuscated by base64\r\n\r\n<a href=\"http:\/\/overthewire.org\/wargames\/bandit\/bandit12.html\" target=\"_blank\"><strong>Bandit Level 12<\/strong><\/a>\r\n\r\n<strong>Objective<\/strong>\r\n\r\nFind the password to the next level\r\n\r\n<strong>Intel Given<\/strong>\r\n<ul>\r\n\t<li>Password is in data.txt<\/li>\r\n\t<li>The password has been changed\u00a0where all lowercase (a-z) and uppercase (A-Z) letters have been rotated by 13 positions<\/li>\r\n<\/ul>\r\n<!--more-->\r\n\r\n<strong>How to<\/strong>\r\n\r\nWe're still in obfuscation. Once again this is knowledge that I don't have off of the top of my head. A quick google search of the following term\u00a0\"change character 13 positions obfuscation\" reveals <a href=\"http:\/\/en.wikipedia.org\/wiki\/ROT13\" target=\"_blank\">this article<\/a>. You can read that article if you so wish, but I'll explain it in my own words.\r\n\r\nThis is simply taking a letter, and moving it a pre-set amount\u00a0times down to the alphabet to the new letter. The \"key\" to this cipher is knowing how many letters it has changed and as luck would have it we know its 13 due to our intel. This means that the letter A is actually N, G is T, u is h (It loops back around the alphabet) and so forth.\r\n\r\n<a href=\"https:\/\/www.hackmethod.com\/wp-content\/uploads\/2015\/01\/Screen-Shot-2015-01-19-at-8.08.45-PM.png\"><img class=\" size-full wp-image-439 aligncenter\" src=\"https:\/\/www.hackmethod.com\/wp-content\/uploads\/2015\/01\/Screen-Shot-2015-01-19-at-8.08.45-PM.png\" alt=\"Screen Shot 2015-01-19 at 8.08.45 PM\" width=\"355\" height=\"33\" \/><\/a>\r\n\r\nAs we can see when reading the file it looks garbled. Well *nix has a command to translate characters (letters &amp; numbers). The command 'tr' when assigned with the correct switches will give us our solution. In our case, we need to tell the command that we wish to take THIS set of rules, and change them to THOSE set of rules. Look below for the solution and further explanation.\r\n\r\n<a href=\"https:\/\/www.hackmethod.com\/wp-content\/uploads\/2015\/01\/Screen-Shot-2015-01-19-at-8.08.55-PM.png\"><img class=\" size-full wp-image-440 aligncenter\" src=\"https:\/\/www.hackmethod.com\/wp-content\/uploads\/2015\/01\/Screen-Shot-2015-01-19-at-8.08.55-PM.png\" alt=\"Screen Shot 2015-01-19 at 8.08.55 PM\" width=\"438\" height=\"37\" \/><\/a>\r\n\r\nSo as you can see I'm piping the string from the data.txt file into our translate command. Breaking down the 'tr' command arguments in layman's terms I'm saying \"Take the Uppercase and Lowercase letters A-Z and substitute them starting with N-ZA-M\". Remember I need to include wrapping around the alphabet in my argument or it won't work correctly.\r\n\r\n<strong>Conclusion<\/strong>\r\n\r\nWe went a little more advanced into obfuscation, now we had to input a few arguments into our command rather than letting our machine do the work for us. \u00a0This gave us a little bit of insight as to how simple ciphers can be used to hide intended communications in cleartext.","_et_gb_content_width":"","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":""},"categories":[44],"tags":[43,45,46],"class_list":["post-438","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-overthewire","tag-bandit","tag-overthewire","tag-tutorials"],"jetpack_featured_media_url":"https:\/\/i0.wp.com\/hackmethod.com\/wp-content\/uploads\/2015\/01\/Screen-Shot-2015-01-19-at-8.08.45-PM.png?fit=355%2C33&ssl=1","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p5zY4D-74","_links":{"self":[{"href":"https:\/\/hackmethod.com\/wp-json\/wp\/v2\/posts\/438","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=438"}],"version-history":[{"count":4,"href":"https:\/\/hackmethod.com\/wp-json\/wp\/v2\/posts\/438\/revisions"}],"predecessor-version":[{"id":27518,"href":"https:\/\/hackmethod.com\/wp-json\/wp\/v2\/posts\/438\/revisions\/27518"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/hackmethod.com\/wp-json\/wp\/v2\/media\/439"}],"wp:attachment":[{"href":"https:\/\/hackmethod.com\/wp-json\/wp\/v2\/media?parent=438"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/hackmethod.com\/wp-json\/wp\/v2\/categories?post=438"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/hackmethod.com\/wp-json\/wp\/v2\/tags?post=438"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}