{"id":3522,"date":"2022-01-22T13:45:42","date_gmt":"2022-01-22T12:45:42","guid":{"rendered":"https:\/\/andreas-klingler.de\/infosec\/?p=3522"},"modified":"2023-12-24T12:51:01","modified_gmt":"2023-12-24T11:51:01","slug":"escaping-from-restricted-shells-jails","status":"publish","type":"post","link":"https:\/\/infosec.andreas-klingler.de\/?p=3522","title":{"rendered":"Escaping from restricted shells \/&nbsp;jails"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">First, try to deter\u00admine the&nbsp;shell<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">echo $PATH\necho $SHELL<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Try to set the <span class=\"caps\">PATH<\/span> variable<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">export PATH=\/usr\/local\/sbin:\/usr\/sbin:\/sbin:\/usr\/local\/bin:\/usr\/bin:\/bin<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Upload the escape_from_restricted_shell.c pro\u00adgram (scripts directory).<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Have a look into a local bin direc\u00adto\u00adry and <a href=\"https:\/\/gtfobins.github.io\/\">see if you can use any bina\u00adry there to escape<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>First, try to deter\u00admine the&nbsp;shell echo $<span class=\"caps\">PATH<\/span> echo $<span class=\"caps\">SHELL<\/span> Try to set the <span class=\"caps\">PATH<\/span> vari\u00adable export <span class=\"caps\">PATH<\/span>=\/usr\/local\/sbin:\/usr\/sbin:\/sbin:\/usr\/local\/bin:\/usr\/bin:\/bin Upload the escape_from_restricted_shell.c pro\u00adgram (scripts direc\u00adto\u00adry). Have a look into a local bin direc\u00adto\u00adry and see if you can use any bina\u00adry there to escape.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"wp_typography_post_enhancements_disabled":false,"footnotes":""},"categories":[468],"tags":[445,446,59],"class_list":["post-3522","post","type-post","status-publish","format-standard","hentry","category-general","tag-escape","tag-rbash","tag-shell"],"_links":{"self":[{"href":"https:\/\/infosec.andreas-klingler.de\/index.php?rest_route=\/wp\/v2\/posts\/3522","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/infosec.andreas-klingler.de\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/infosec.andreas-klingler.de\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/infosec.andreas-klingler.de\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/infosec.andreas-klingler.de\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=3522"}],"version-history":[{"count":4,"href":"https:\/\/infosec.andreas-klingler.de\/index.php?rest_route=\/wp\/v2\/posts\/3522\/revisions"}],"predecessor-version":[{"id":3527,"href":"https:\/\/infosec.andreas-klingler.de\/index.php?rest_route=\/wp\/v2\/posts\/3522\/revisions\/3527"}],"wp:attachment":[{"href":"https:\/\/infosec.andreas-klingler.de\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3522"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/infosec.andreas-klingler.de\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3522"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/infosec.andreas-klingler.de\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3522"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}