{"id":281,"date":"2015-01-01T03:45:31","date_gmt":"2015-01-01T03:45:31","guid":{"rendered":"http:\/\/scottyrotten.wordpress.com\/?p=281"},"modified":"2022-06-03T05:40:41","modified_gmt":"2022-06-03T05:40:41","slug":"overthewire-bandit-4","status":"publish","type":"post","link":"https:\/\/hackmethod.com\/overthewire-bandit-4\/","title":{"rendered":"OvertheWire &#8211; Bandit 4"},"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;3.27.4&#8243; background_size=&#8221;initial&#8221; background_position=&#8221;top_left&#8221; background_repeat=&#8221;repeat&#8221;]<strong>Recap of Level 3:<\/strong>\u00a0We learned about escape characters and tab completion to read a file name that had spaces.<\/p>\n<p>&nbsp;<\/p>\n<p><a title=\"Bandit Level 4\" href=\"http:\/\/overthewire.org\/wargames\/bandit\/bandit4.html\" target=\"_blank\" rel=\"noopener noreferrer\"><strong>Bandit Level\u00a04<\/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 a\u00a0hidden file<\/li>\n<li>file is located in the inhere\u00a0directory<\/li>\n<\/ul>\n<p><!--more--><\/p>\n<h4><strong>How to: <\/strong><\/h4>\n<p>To list the contents of a directory we use the command &#8216;ls&#8217; take the time to read the manual on ls by typing &#8216;man ls&#8217; to quit from the manual press &#8216;q&#8217;. It&#8217;s important to read the manuals for commands, often times I know what I want to do, but I won&#8217;t know exactly how to do it and so I start looking into the manuals of various commands. If you haven&#8217;t found it yet, you have the ability to look for hidden files by including something with your command. This is often referred to as a &#8220;switch&#8221; and in this case to see hidden files we can type &#8216;ls -a&#8217;. By adding -a to our command we&#8217;ve effectively said &#8220;List ALL the contents of the directory, and if you looked in the manual you would see that it specifies &#8220;do not ignore entries\u00a0that begin with a .&#8221;\u00a0 Why is this important?<\/p>\n<p><span style=\"text-decoration: underline;\">Hidden Files<\/span><\/p>\n<p>Well adding a period to filenames is how *nix\u00a0denotes hidden files in its structure, so if we want to see hidden files we need to include the -a. To view the hidden files within the &#8220;inhere&#8221; directory we simply append the directory to our command. &#8220;ls -a inhere&#8221;. We can see three things listed. A period, two periods and .hidden. The period denotes the current directory, two periods references the parent directory and .hidden is your hidden file!<\/p>\n<p>Try typing &#8220;cat inhere\/.hidden&#8221; and see what comes up.<\/p>\n<h4><strong>Conclusion: <\/strong><\/h4>\n<p>Once again I reference the manual and its importance. That&#8217;s twice now, if you haven&#8217;t been checking the man pages I suggest you take the time to do it now. It only gets worse from here.<\/p>\n<p>[\/et_pb_text][\/et_pb_column][\/et_pb_row][et_pb_row column_structure=&#8221;1_2,1_2&#8243; _builder_version=&#8221;4.7.4&#8243; _module_preset=&#8221;default&#8221;][et_pb_column type=&#8221;1_2&#8243; _builder_version=&#8221;4.7.4&#8243; _module_preset=&#8221;default&#8221;][et_pb_image src=&#8221;https:\/\/hackmethod.com\/wp-content\/uploads\/2020\/12\/Previous.png&#8221; alt=&#8221;Previous Level&#8221; title_text=&#8221;Previous&#8221; url=&#8221;https:\/\/hackmethod.com\/overthewire-bandit-3&#8243; _builder_version=&#8221;4.7.4&#8243; _module_preset=&#8221;default&#8221;][\/et_pb_image][\/et_pb_column][et_pb_column type=&#8221;1_2&#8243; _builder_version=&#8221;4.7.4&#8243; _module_preset=&#8221;default&#8221;][et_pb_image src=&#8221;https:\/\/hackmethod.com\/wp-content\/uploads\/2020\/12\/Next.png&#8221; alt=&#8221;Next Level&#8221; title_text=&#8221;Next&#8221; url=&#8221;https:\/\/hackmethod.com\/overthewire-bandit-5&#8243; align=&#8221;right&#8221; _builder_version=&#8221;4.7.4&#8243; _module_preset=&#8221;default&#8221;][\/et_pb_image][\/et_pb_column][\/et_pb_row][\/et_pb_section]<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Recap of Level 3:\u00a0We learned about escape characters and tab completion to read a file name that had spaces. &nbsp; Bandit Level\u00a04 Objective: Find the password to the next level Intel Given: Password is in a\u00a0hidden file file is located in the inhere\u00a0directory How to: To list the contents of a directory we use the [&hellip;]<\/p>\n","protected":false},"author":8,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_et_pb_use_builder":"on","_et_pb_old_content":"<strong>Recap of Last&nbsp;Lesson:<\/strong>&nbsp;We learned about escape characters and tab completion to read a file name that had spaces.\n\n<a title=\"Bandit Level 4\" href=\"http:\/\/overthewire.org\/wargames\/bandit\/bandit4.html\" target=\"_blank\" rel=\"noopener\"><strong>Bandit Level&nbsp;4<\/strong><\/a>\n\n<strong>Objective: <\/strong>Find the password to the next level\n\n<strong>Intel Given:<\/strong>\n\n<ul>\n    <li>Password is in a&nbsp;hidden file<\/li>\n    <li>file is located in the inhere&nbsp;directory<\/li>\n<\/ul>\n\n<!--more-->\n\n<strong>How to: <\/strong>To list the contents of a directory we use the command 'ls' take the time to read the manual on ls by typing 'man ls' to quit from the manual press 'q'. It's important to read the manuals for commands, often times I know what I want to do, but I won't know exactly how to do it and so I start looking into the manuals of various commands. If you haven't found it yet, you have the ability to look for hidden files by including something with your command. This is often referred to as a \"switch\" and in this case to see hidden files we can type 'ls -a'. By adding -a to our command we've effectively said \"List ALL the contents of the directory, and if you looked in the manual you would see that it specifies \"do not ignore entries&nbsp;that begin with a .\"&nbsp; Why is this important?\n\n<span style=\"text-decoration: underline;\">Hidden Files<\/span>\n\nWell adding a period to filenames is how *nix&nbsp;denotes hidden files in its structure, so if we want to see hidden files we need to include the -a. To view the hidden files within the \"inhere\" directory we simply append the directory to our command. \"ls -a inhere\". We can see three things listed. A period, two periods and .hidden. The period denotes the current directory, two periods references the parent directory and .hidden is your hidden file!\n\nTry typing \"cat inhere\/.hidden\" and see what comes up.\n\n<strong>Conclusion: <\/strong>Once again I reference the manual and its importance. Thats twice now, if you haven't been checking the man pages I suggest you take the time to do it now. It only gets worse from here.","_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,49],"tags":[43,45,46],"class_list":["post-281","post","type-post","status-publish","format-standard","hentry","category-overthewire","category-tutorials","tag-bandit","tag-overthewire","tag-tutorials"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p5zY4D-4x","_links":{"self":[{"href":"https:\/\/hackmethod.com\/wp-json\/wp\/v2\/posts\/281","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=281"}],"version-history":[{"count":14,"href":"https:\/\/hackmethod.com\/wp-json\/wp\/v2\/posts\/281\/revisions"}],"predecessor-version":[{"id":27481,"href":"https:\/\/hackmethod.com\/wp-json\/wp\/v2\/posts\/281\/revisions\/27481"}],"wp:attachment":[{"href":"https:\/\/hackmethod.com\/wp-json\/wp\/v2\/media?parent=281"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/hackmethod.com\/wp-json\/wp\/v2\/categories?post=281"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/hackmethod.com\/wp-json\/wp\/v2\/tags?post=281"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}