<?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 Gharnie on Medium]]></title>
        <description><![CDATA[Stories by Gharnie on Medium]]></description>
        <link>https://medium.com/@Gharnie?source=rss-b3b2358485d2------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*k-4aLwAxCqNp7O9YylakvQ.jpeg</url>
            <title>Stories by Gharnie on Medium</title>
            <link>https://medium.com/@Gharnie?source=rss-b3b2358485d2------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 06 Dec 2026 10:21:16 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@Gharnie/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[Homelab Series: Secure Remote Desktop Access in Windows — A Comprehensive Guide]]></title>
            <link>https://medium.com/@Gharnie/homelab-series-secure-remote-desktop-access-in-windows-a-comprehensive-guide-952f31e3f8f3?source=rss-b3b2358485d2------2</link>
            <guid isPermaLink="false">https://medium.com/p/952f31e3f8f3</guid>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[it-support]]></category>
            <category><![CDATA[homelab]]></category>
            <category><![CDATA[network-security]]></category>
            <category><![CDATA[system-administration]]></category>
            <dc:creator><![CDATA[Gharnie]]></dc:creator>
            <pubDate>Thu, 26 Dec 2024 08:21:05 GMT</pubDate>
            <atom:updated>2024-12-26T08:21:05.490Z</atom:updated>
            <content:encoded><![CDATA[<h3>Homelab Series: Secure Remote Desktop Access in Windows — A Comprehensive Guide</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OFRB4kXskXCiQodDBRvmvw.jpeg" /></figure><p>The purpose of this blogpost is to guide anyone that has need for configuring a remote desktop to securely access their PC from any remote location. The areas of focus under this blog in no order will be; Enabling RDP access on our target PC, evaluating the necessary security options and recommended settings provided by Microsoft for user and group access, static Ip address configuration, securing the communication between the two connected devices, and router configuration to obscure our target device’s IP address via a public network.</p><p>Our remote PC will run a windows 11 Home operating system whereas our target PC runs windows 11 pro edition. The Target PC basically stands for the computer inside our home network where we will be connecting to. Remote PC here will represent the PC that will be initiating the RDP connection, this could either be from a private network or a public network. In this blog, emphasis will be placed on remote connections from a public network as it is most likely to be your case.</p><h3>Setting Up Target PC to Allow Remote Connections</h3><p>From <strong>Control Panel\System and Security\ </strong>“<strong>Allow remote access</strong>”, ensure the red marked options from the dialogue box are selected as indicated in the image below</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*uK6NQs9gJRoDmL-R8FwPrg.png" /><figcaption>Remote Desktop Access dialogue</figcaption></figure><p>Under “select user” option in the dialogue box above, what you notice is the red marked caveat in the dialogue box below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/655/1*kWKqM7AlnA4kb4h45YYcZg.png" /><figcaption>System Properties for allowed RDA users</figcaption></figure><p>This is to say your current user can be accessed by a remote pc via RDP connection, however, although members of the administrator group aren’t listed here, they’re also accessible via the same connection. This poses a major security risk that implies, should you for example, set up an Admin account on your PC with a weak password and forget that you did, you’ll be exposed. Your PC would be open to anybody from outside who knows your IP Address. If you have a weak password on an Admin user account, then there’s a chance that with enough effort a hacker might be able to get in.</p><p>So, in the dialog below, we’re only going to keep the user or group that you want to allow access to the Target PC with Remote Desktop. And that user or users must have strong passwords (in my case; Battosai Himura which has access by default).</p><p>We first navigate to security policies by “<strong>windows key + R</strong>” and type ‘<strong>secpol.msc</strong>’ and simply hit enter to open the local security policy, if you get a message for Administrative Templates ignore it and click OK. Expand Local Policies, click on User Rights Assignments and then find the Allow log on through Remote Desktop Services. Double-click it and you should be on a window as the image below;</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*hFviJGlg1nplHrJvCi6MSA.png" /><figcaption>Local Security Policy Editor</figcaption></figure><p>It’s really a good recommendation to remove both of the groups Administrators and Remote Desktop Users for security reasons. Remove all users including administrator groups and then Click Add User or Group and add to this list only the user account(s) that you want to allow access with Remote Desktop. Click OK to close this dialog and then close the Local Security Policy dialog.</p><h3>Allowing Traffic for Remote Desktop Access Via Private and Public Network Through Firewall</h3><p>The next step is to allow traffic for the remote desktop application through windows firewall for private and public networks from <strong>Control Panel\System and Security\Windows Defender Firewall\Allowed apps</strong>. Click the “<strong>change settings</strong>” and ensure that both private and public network are enabled by checking the mark. Click Ok close the window.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*Vu0qoUcKgBNF5ARerjLD-Q.png" /><figcaption>Windows Defender Firewall</figcaption></figure><h3>Changing the Default RDP Port From 3389 To A Custom Port</h3><p>Now this is an optional step, but I really recommend doing this. You should obscure the RDP port on the PC itself. It would prevent an internal hacker in your network or perhaps an external hacker that happens to have a hold of your public facing IP address or DDNS address from accessing your PC with port <strong>3389</strong>. Again, it’s not necessary, but if you want to have your PC respond to anything other than the default port <strong>3389 </strong>for any reason this is how you do it.</p><p>Press the Windows key and R simultaneously to open the Run dialog. Type “regedit” and hit Enter to launch the Registry Editor. Navigate through the following path: <strong>HKEY_LOCAL_MACHINE, SYSTEM, CurrentControlSet, Control, Terminal Server, Winstations, RDP-Tcp</strong>. You’ll notice the full path displayed in the status bar of the Registry Editor as you progress. Once you arrive, locate the key labeled “<strong>PortNumber</strong>.” Double-click on it to open the settings. Change the Base to Decimal and enter a custom value for the port number you want to use. For example, I’ll use <strong>40022</strong> here, but I strongly advise against choosing the same port. Select something unique and known only to you. Once done, click OK, and close the Registry Editor.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/893/1*_zx1uCJFX3Dt9dmLqPV7xw.png" /><figcaption>Registry Editor for RDP-Tcp Port modification</figcaption></figure><p>Now when you go to <strong>Settings &gt;&gt; System &gt;&gt; Remote Desktop</strong>, you should see ‘Remote Desktop’ enabled on port <strong>40022 </strong>as shown in the image below, else enable if disabled.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/900/1*GMrXnjUO5k86NApuUdGUmw.png" /><figcaption>Remote Desktop Settings</figcaption></figure><h3>Allowing the Custom RDP port through Firewall</h3><p>Whether or not you change the default RDP port, you must allow the RDP port through the Windows Firewall. To do this, click the Start button, type “Windows Firewall,” and press Enter to open the Firewall settings. From there, click on Advanced Settings to open the Windows Firewall with Advanced Security window.</p><p>In the left pane, select Inbound Rules, then right-click on it and choose New Rule. When the wizard appears, select Port and click Next. Ensure that TCP is selected, then enter the port number. For example, if you changed the default port in the Registry, such as using port <strong>40022 </strong>as I demonstrated earlier, you’ll need to input that number here. If you kept the default port <strong>3389</strong>, enter <strong>3389 </strong>instead.</p><p>Once you’ve specified the port, click Next. The default option, Allow the connection, is fine, so proceed by clicking Next again. On the “When does this rule apply?” window, leave both Private and Public checked, then click Next. Finally, give the rule a name, such as “<strong>CustomRDPPort</strong>” or any name of your choosing, and click Finish to save the rule.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*mpwfuiYpJ5vI52IbvwxGjQ.png" /><figcaption>Firewall Inbound rule control settings</figcaption></figure><blockquote>Restart the Target PC to make those settings take effect.</blockquote><p>We test to see if we can login on the same network. Since we’re connecting from the same network, we can simply use the PC’s name displayed in ‘About’ from ‘System’ in settings. However, instead of using the PC name we can also initiate a connection from the remote device using the target PC’s internal IP address. We can check the IP address by running ‘ipconfig’ from the terminal and look for the IP addressed assigned to the Network Adapter in use (it could be an ethernet or Wi-Fi adapter; it is the ethernet adapter in my case).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/888/1*1ppNM0ADDQgMW1M2dHGkjQ.png" /><figcaption>ipconfig from gitbash terminal</figcaption></figure><h3>Configuring Static Ip Address for Our Target PC</h3><p>Now you realize anytime we reboot our computer or boot it after being off for a while, our internal IP address changes so we have to configure our server to have a fixed address. There are two ways of doing that; by configuring it from the Network Adapter settings, or through the Router Device settings. While this can be done on the router, it’s outside the scope of this blogpost.</p><h4>Getting Started …</h4><p>First, we navigate to <strong>Control Panel\Network and Internet\Network and Sharing Center</strong>, in the left pane, select ‘<strong>Change Adapter Settings</strong>’. You may have a wireless adapter only, or a wired Ethernet adapter, or both. The main thing is to pick the one that your PC is likely to be connected to when you’re away. We’re going to document the IP addresses of the DNS Servers and the default gateway that already exists on the network adapter’s dynamically assigned IP Address.</p><p>Under network and adapter settings we find our desired adapter and we go ahead to check the status by right clicking the Local Area Connection and clicking Status. Click Details. This dialog has all the information we need.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/896/1*UM41Ji3OBhmG7cL3iz-5KA.png" /><figcaption>Windows Network Adapter Settings</figcaption></figure><p>The connection details are provided in a small dialogue box. You may want to write down a few details; the IP address, the subnet Mask, Default gateway, and DNS Server.</p><blockquote><strong>PS:</strong> The router assigns IP addresses to all connected devices using a protocol called DHCP (Dynamic Host Configuration Protocol), which dynamically distributes addresses from a predefined pool. Based on our subnet mask, 255.255.255.0, we can determine that our IP range can accommodate up to 254 hosts (excluding the network address and broadcast address). This means devices can be assigned addresses within the range of 192.168.0.2 to 192.168.0.255. However, most routers allow us to manually define the range of IP addresses that can be assigned dynamically. This range can be adjusted depending on the size and needs of your network. In my case, I accessed my router’s web interface (your router’s interface may look different, but the process is generally similar) and navigated to the DHCP settings. There, I set the DHCP range to 192.168.0.100 to 192.168.0.200. This means that any device requiring dynamically assigned IP addresses will receive one from within this range. The IP addresses outside this range are now free to be used for other purposes, such as assigning static IP addresses to devices that require them.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/477/1*xOabeO8Fp8n5boNu7UI-Nw.png" /><figcaption>Router login page</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/455/1*oOjYDjaFGzTNKBqLiTfgXQ.png" /><figcaption>Router DHCP web configurator</figcaption></figure><blockquote><strong>PS</strong>: It is important to note that your router’s web interface might differ from mine, the idea however is the same. Find your router’s default gateway often 192.168.0.1 or 192.168.1.1, you should find such information on your physical router device. Similarly, locate DHCP setting from your router settings to make the said configurations.</blockquote><p>So here, I’ll choose 192.168.0.222 which is out my DHCP IP Pool and assign it as a static address to my server. That way I don’t have to worry about my IP address changing any time after reboot.</p><p>On our Ethernet adapter settings where we initially checked the status of our connection, we will head for “properties” in the drop down&gt;&gt; ipv4 address &gt;&gt; properties just as illustrated in the picture below. So, we’ll go ahead and populate the columns with the information from the adapter ‘status’ as I have done in the image below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/830/1*TNRNwikZGj0KMRTAgeDCOg.png" /><figcaption>Ethernet adapter Settings</figcaption></figure><blockquote><strong>PS</strong>: Use your own router status information not mine.</blockquote><p>Ok and we’re done assigning a static IP to our server. You test the internet connection from your browser to be sure it is working.</p><h3>Securing Communications Between the Remote and Target PC.</h3><p>Securing communications between the remote and target PC is essential to protect data and prevent unauthorized access. Just like with any form of digital communication, implementing robust measures such as encryption and Network Level Authentication (NLA) for Remote Desktop Protocol (RDP) connections is critical. These measures ensure that data transmitted during remote desktop sessions remains secure and unintelligible to attackers who might intercept or probe the connection.</p><h4>Getting started…</h4><p>Again, use the Windows Key + R to open the Run dialog. Type <strong>gpedit.msc</strong> and press Enter to launch the Local Group Policy Editor. If an Administrative Templates dialog appears, dismiss it by clicking OK.</p><p>Once the Local Group Policy Editor is open, navigate to the appropriate section in the left-hand pane by expanding the following path: <strong>Administrative Templates → Windows Components → Remote Desktop Services → Remote Desktop Session Host → Security</strong>. This section contains the key settings required to enhance the security of your remote desktop connections.</p><p>The first step is to configure the Set client connection encryption level policy. Double-click on this setting, enable it, and select High Level as the encryption level. This ensures that all RDP sessions use 128-bit encryption, providing robust protection for the data being transmitted. Click OK to save the changes.</p><p>Next, enable the Require secure RPC communication setting. This configuration secures Remote Procedure Call (RPC) communications, which are used as part of the RDP connection process. By enabling this setting, you add another layer of security, reducing vulnerabilities in the communication process. Again, click OK to apply this change.</p><p>The third step involves setting a specific security layer for RDP connections. Double-click on the Require use of specific security layer for remote (RDP) connections setting and enable it. Select SSL as the security layer, as it provides strong encryption and helps safeguard the connection against interception and eavesdropping. Once configured, click OK to save the changes.</p><p>Finally, enforce Network Level Authentication (NLA) by enabling the Require user authentication for remote connections by using Network Level Authentication setting. Enabling NLA ensures that users must authenticate before a remote session is established, reducing the risk of unauthorized access to the system. Click OK to finalize this setting.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/900/1*UQuQt_hsVo3AOTE1FVPleA.png" /><figcaption>Local Group Policy Editor</figcaption></figure><h3>How to Access Remote Desktop Via a Public Network with Port Forwarding.</h3><p>The first thing to do is to find out the external, or Public Facing IP Address of the router. We do not want the IP address of the PC inside your network. You want to use the IP Address that would reach your router from somewhere outside your network. To do this, open your browser and go to Google and type in What is my IP Address and Google will tell you what your Public Facing IP Address is. You’ll want to write that down because you’ll need it later.</p><p>To begin configuring your router, open a web browser and type http:// followed by the default gateway address that you identified during your IPv4 configuration. For instance, if your default gateway is 192.168.0.1, you would enter <a href="http://192.168.0.1/">http://192.168.0.1</a> into the address bar and press Enter. This will take you to your router’s login screen.</p><blockquote><strong>NB</strong>: Before proceeding, it is important to note that this tutorial assumes you are familiar with accessing your router’s configuration settings. If you are not, it may be best to pause here and learn more about router configuration basics. If you can access your router, ensure that you have changed the default password to a secure, unique password to protect your network.</blockquote><p>Routers vary significantly in their interfaces, so your configuration screen may look different from what is described here. For example, on the router used in this tutorial, the port forwarding settings are located under Device Settings → Firewall → Port Forwarding. On another router I own, these settings are found under Gateway Settings. While the naming conventions may differ (e.g., “<strong>Port Forwarding</strong>” versus “<strong>Single Port Forwarding</strong>”), all routers generally have a port forwarding section. It may take a little exploration to find it on your device.</p><p>Once you locate the port forwarding settings, create a new rule for Remote Desktop Protocol (RDP). You may have the option to name this rule, so feel free to call it something like RDA (Remote Desktop Access). For the External Port, enter the port you want to expose to the internet. In this example, we’ll use <strong>56789</strong>. For the Internal Port, enter the RDP port, which is 40022 in my case. This configuration obscures the default RDP port by mapping an external port (<strong>56789</strong>) to the internal port (<strong>40022</strong>). This way, anyone attempting to exploit the well-known RDP port (<strong>3389</strong>) will be blocked, as only requests made to port <strong>56789</strong> will be forwarded by the router. Next, specify the IP Address of the target PC you want to access remotely. For this example, the target PC’s IP address is <strong>192.168.0.222</strong>, but you will need to replace this with the IP address of your own target PC. This step programs the router to forward any requests sent to port <strong>56789</strong> to port <strong>40022 </strong>on the target machine at the specified IP address. Once the details are configured, save or apply the settings to finalize the port forwarding rule.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/900/1*L6xRVR0nlVhg9znNXsbttQ.png" /><figcaption>Router’s Port Forwarding Configurator</figcaption></figure><p>With the router configuration complete, it’s time to test the connection. From the Remote PC, open the Remote Desktop Connection application. Enter your public-facing IP address (the one assigned by your ISP, which you noted earlier) followed by a colon (:) and the external port number you just configured (e.g., <strong>123.45.67.89:5689</strong>). It is crucial to use the public-facing IP address rather than the internal IP of the target PC, as you will be connecting through the internet. Click Connect and, when prompted, enter the username and password for the target PC. If you receive a warning about the identity of the remote PC, you can safely ignore it, as you know you are connecting to the correct device. Confirm the connection by clicking Yes, and within a few moments, the desktop of the target PC should appear on your screen.</p><h3>Additional Security Measure for Securing and Managing Public Facing IP Address</h3><p>Now, unless you have a fixed public facing IP address from your ISP, that IP address can change. Particularly, it can change when you reboot your router. It doesn’t happen very often but it’s probably a good idea to check it every now and then after you set this up. Because when you’re at work and you go to connect to your home PC, for example, if the Public IP Address at home changed, it’s not going to work. If you don’t want to constantly have to check your IP Address, you may want to check out DYNDNS.org, or NOIP.com. Dynamic DNS (DDNS) services automatically track your IP address, and many routers offer their own free DDNS options.</p><p>To begin, you to create a No-IP account and hostname. Start by signing up for a free account on the No-IP website. Once you’ve registered and logged in, navigate to the “My Hostnames” section and add a new hostname. Choose a name that is easy to remember, such as <strong>myrdp.no-ip.org,</strong> and associate it with your current public IP address, <em>which No-IP automatically detects.</em> This hostname will act as the dynamic address that links to your router, even when your public IP changes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/900/1*W1Zgq8mQAsgN3bNnRQTIJg.png" /><figcaption>No-IP admin Panel</figcaption></figure><p>Next, you need to enable and configure DDNS on your router. Begin by logging into your router’s admin panel, which is typically accessible through a web browser using the IP address 192.168.1.1 or 192.168.0.1. Once inside, look for the Dynamic DNS (DDNS) settings. These are often located under advanced settings, WAN settings, or within a dedicated DDNS menu. Select No-IP as your DDNS provider (most modern routers include built-in support for No-IP). Input the necessary details, including the hostname you created earlier (myrdp.no-ip.org), your No-IP account username or email, and your password. Save these settings, and the router will automatically update your No-IP hostname whenever your public IP address changes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/900/1*aHwR0WNUeinY5Jrd1hSN5g.png" /><figcaption>Router’s DDNS Configurator</figcaption></figure><p>With these configurations complete, it’s essential to test the setup. First, ensure Remote Desktop is enabled on the computer you want to access. On a Windows machine, this can be done by navigating to System Properties, selecting the “Remote Desktop” tab, and enabling the option to allow remote connections.</p><p>To test your connection, we ensure our remote PC is outside our local network, such as one connected via a mobile hotspot. Open the Remote Desktop client and enter your No-IP hostname (myrdp.no-ip.org) followed by :56789 (e.g., myrdp.no-ip.org:56789). If everything is configured correctly, you should be able to connect to your computer remotely.</p><blockquote>I know this is a long read and I appreciate you for making it to this point. I hope you enjoyed this post! Kindly leave a like and share your thoughts and questions in the comment section.</blockquote><p><strong><em>References</em></strong></p><p>1. <em>Anywhere &amp; Change Secure RDP Port Access (Your PC over the Internet)</em> [Video recording]. <a href="https://www.youtube.com/watch?v=olSlqjIhfZM">https://www.youtube.com/watch?v=olSlqjIhfZM</a></p><p>2. Maven, C. (2023, May 8). How to Setup Remote Desktop Protocol in Active Directory. <em>Medium</em>. <a href="https://medium.com/@jbtechmaven/how-to-setup-remote-desktop-protocol-in-active-directory-2abac9200748">https://medium.com/@jbtechmaven/how-to-setup-remote-desktop-protocol-in-active-directory-2abac9200748</a></p><p>3. robinharwood. (2024, November 1). <em>Enable Remote Desktop on your PC</em>. <a href="https://learn.microsoft.com/en-us/windows-server/remote/remote-desktop-services/clients/remote-desktop-allow-access">https://learn.microsoft.com/en-us/windows-server/remote/remote-desktop-services/clients/remote-desktop-allow-access</a></p><p>4. <em>[VIDEO] How To Configure a Static IP Address on a Windows PC</em>. (2014, November 13). Psychodelectric Media. <a href="https://jerryboutot.com/how-to-configure-a-static-ip-address-on-a-windows-pc/">https://jerryboutot.com/how-to-configure-a-static-ip-address-on-a-windows-pc/</a></p><p>5. <em>[VIDEO] The Ultimate Guide to Secure Remote Desktop Connections To Safely Access Your PC over the Internet</em>. (2019, November 8). Psychodelectric Media. <a href="https://jerryboutot.com/video-the-ultimate-guide-to-secure-remote-desktop-connections-to-safely-access-your-pc-over-the-internet/">https://jerryboutot.com/video-the-ultimate-guide-to-secure-remote-desktop-connections-to-safely-access-your-pc-over-the-internet/</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=952f31e3f8f3" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Building A Resilient RedTeam Homelab for Cybersecurity]]></title>
            <link>https://medium.com/@Gharnie/building-a-resilient-redteam-homelab-for-cybersecurity-07c5e19e4e0e?source=rss-b3b2358485d2------2</link>
            <guid isPermaLink="false">https://medium.com/p/07c5e19e4e0e</guid>
            <category><![CDATA[ethical-hacking]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[homelab]]></category>
            <category><![CDATA[pentesting]]></category>
            <category><![CDATA[red-team]]></category>
            <dc:creator><![CDATA[Gharnie]]></dc:creator>
            <pubDate>Sat, 14 Dec 2024 10:18:38 GMT</pubDate>
            <atom:updated>2024-12-26T08:26:23.261Z</atom:updated>
            <content:encoded><![CDATA[<h3>Homelab <strong>Series: </strong>Building A Resilient RedTeam Homelab for Cybersecurity</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XrXZjJizGi8csxoetQC1_A.jpeg" /></figure><p>Many of you reading this post must be familiar with the concept of a Homelab. A significant portion of greenhorns, on the other hand, do not really know what the fuss about Cybersec labs is all about. And so, in this write -up I’ll demystify the core constituents of a cyber security lab and its prominence. This write-up should explain the commonly used jargons and foundational concept that backbone a small to medium sized practice lab.</p><p>When professionals repeatedly highlight the essence of a lab particularly for entrants that have just started out their journey or probably veered from a different tech field or perhaps without any tech background into the domain of cyber-security, what should simply be made of it is an environment where one can simulate components of IT infrastructure, equipment, and configurations similar to a business or enterprise network primarily to gain hands-on experience and develop skills that can be applied to managing real-world business or enterprise networks.</p><p>Cyber-security labs differ in sophistication; some setups are entirely virtualized, relying on software to simulate servers, networks, and other infrastructure components, whereas more advanced Homelabs integrate physical hardware; servers, network switches, and storage devices, to replicate enterprise environment. This setup is supposed to be a single robust workstation that runs all environments including an Active Directory lab, SIEM and forensic lab and most importantly an offensive security lab virtually using VMWare Work station Pro 17.</p><p>As to why I prefer a standalone server for simulating enterprise environment to a laptop or perhaps any portable pc has everything to do with cost and resource constraint. This blogpost should somewhat be a beginners guide and so most individuals on here are most likely starting out their journey in cyber-security, hence minimal cost whilst maximizing the potential and efficiency of your lab resource is crucial and indispensable. Laptops of very high computing resources tend to be significantly expensive relative to a workstation of similar performance. An average laptop of core i7 cpu with a decent clockspeed (2.85 and above), with over 32gb of RAM space and more than a terabyte of persistent storage (SSD) and possibly a decent performing gpu can cost over a $ 1000. With less than half of that cost one can build their own server to host all your different labs.</p><h3>Why Choose the HP Z640 for Your Homelab?</h3><p>This section of my post will be a walk through the physical build of my small server and the reasons for my build choices. Listed are the hardware component; peripheral and not, that constitute my physical lab.</p><blockquote><em>Router</em></blockquote><blockquote><em>Universal Power Supply</em></blockquote><blockquote><em>Hp Z640 Workstation :</em></blockquote><blockquote><em>(</em>2TB M.2 Nvme SSD, 2TB HDD, 64 gigabyte ECC Memory, Nvidia Quadro K2000, Dual Processor (Xeon E5–2643 V4) 3.2 base Speed 3.6 Turbo boost with hyperthreading, Dual band WIFI and Bluetooth adapter (I only use the LAN cable for direct access though)</blockquote><p>A router is imperative for a steady supply of internet connection to our workstation server. It offers a pool of Ip addresses for both DHCP and Static Ip address configuration which will be indispensable as the blogpost series progresses.</p><figure><img alt="Figure 1. MTN Router with CAT 6 support and Power Bank" src="https://cdn-images-1.medium.com/max/519/1*NYJ0Pz2dLefX1573LJYo2w.jpeg" /><figcaption>MTN Router with CAT 6. Support and a Power Bank</figcaption></figure><p>Why I chose the Hp Z640 solely owes to the capacity for upgrades and customization. The Hp Z640 comes with a CPU riser that has it own board allowing for an extra processing unit and 4 extra memory slots that allows for over 256 gigabytes of RAM space. With the cpu riser, the Hp z640 has two replaceable dual processors and 8 RAM slots combined, with 8 PCIE slots that allows for fast hardware processing and communication apt for virtualization as resource performance requirement increases.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/961/1*lGFNa_LG1fnXUdytlOm_0A.jpeg" /><figcaption>Hp z640 Workstation</figcaption></figure><p>Intel’s 670p series is the exact brand and model for my M.2 2TB. The Hp Z640 has no Nvme ssd slot so I got a pci express adapter for the M.2 Nvme. With pci interfaces I am able to leverage the high-speed bandwidth and communication (read and write operations) for my VMs.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QPyUiBDsn-LUfu7cVM-NHA.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BIaBed4qsb9asBB9xUcByg.jpeg" /><figcaption>M.2 NVME to PCIe 3.0 x4 Adapter &amp; Intel 670p Series M.2 2280 2TB PCIe NVMe 3.0 x4 3D2, QLC Internal Solid State Drive (SSD)</figcaption></figure><p>The Hard disk drive (HDD) is purposed for redundant storage and also to store logs generated from SIEM.</p><p>To me when it comes to virtualization for Homelab, albeit the essence of all hardware resource, RAM requirement seems to standout. Without enough RAM, you can only run limited number of VMs at a time which will stifle the kind of practice you intend on doing. 32 gb to 64 gb RAM should suffice most Homelabs as it can accommodate 8–12 VMs running at maximum capacity concurrently.</p><p>CPU plays a significant role in virtualization. Unlike a gaming setup where I recommend High base and turbo boost clock speed, emphasis and priority is placed on the number cores and support for hyperthreading technology in virtualization. You would want to have enough cores/logical processors to accommodate all your VMs. Although higher clock speed will give you an edge in performance, it is second to core provision in virtualization. Intel’s Xeon dual E5–2643 V4 processors gives me a combined core of 12 with 24 logical processors enough to run about 9 VMs at the same time.</p><p>Universal Power supply plays such an important role in a server environment as you must have at least 2 power distribution path for redundancy. This will increase the uptime of the sever, keeping it active and always ready to go when there’s a power cut from your direct power source.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*clZDU1lVZU8nmzdlwHNolw.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Pj4UQfvc3ypzyNkp7O-seQ.jpeg" /><figcaption>CyberPower CP1500AVRLCD3 Intelligent LCD UPS System, 1500VA/900W, 12 Outlets, 2 USB Ports, AVR, Mini Tower, Black</figcaption></figure><p>I do not have much use for a very powerful gpu in the purview of red teaming beyond password cracking, and so I opted for the Nvidia Quadro K2000 which comes prebuilt in the Z640 for display. When it comes to gpu intensive task including password cracking and machine learning, I’ll always recommend leveraging cloud computing solutions.</p><p>Additionally, Dual band WIFI and Bluetooth adapter was essential for internet access redundancy and Bluetooth peripheral connections respectively, as most servers and workstation require additional hardware to enable the said communications.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pxRIY4Dg7EsnLXAhV_XuYg.jpeg" /><figcaption>Fenvi PCIe Network Card 1200Mbps Desktop Wireless-AC PCI-E Dual Band Gigabit Wi-Fi Adapter 802.11ac 5GHz 867Mbps 2.4GHz 300Mbps BT4.0 for PC Windows</figcaption></figure><h3>Network Topology of My Lab Environment</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HIh-BBMnPD8RYdWH0cwmyw.jpeg" /><figcaption>Homelab Topology designed with Draw.io</figcaption></figure><p>The router acts as a gateway that interfaces the internet and connected devices — in my case, the server. The server connects to the router through a LAN or ethernet (CAT 5 or CAT 6 preferably). The server is intended to act as an RDP server that allows connections via a secure 128-bit encrypted channel from any remote location outside of my home or basically from outside my network. There are several occasions when I am at a remote location and need to do something in my Homelab.</p><p>There are three virtualized lab environments relevant to my RedTeam Homelab; an external penetration testing lab, and active directory lab and an event monitoring lab. What each virtual lab represents and the role each play will sum up this write-up until my next series.</p><h3>External Penetration Testing Lab</h3><p>I have the external penetration testing lab made up of three independent virtual machines, each connected in bridge mode to replicate the physical network through the virtual ethernet adapter. Each of the VMs obtain their randomly assigned Ip addresses through DHCP directly from the router each time the system reboots. The primary role of this virtual lab is to firstly act as an offensive play ground to practice some Tactics, Techniques, and Procedures adopted by threat actors. The primary VM for this role will be the Kali VM, as it comes preinstalled with most of the tools required for the intended operation. You can substitute Kali for any offensive operating system of your choice; Parrot OS is such a great alternative; I just happen to prefer Kali Linux. In this lab I happen to also have Commando VM which is a customizable, Windows-based security distribution for penetration testing and Red Teaming by Mandiant. This VM in particular is supposed to be my development environment for malware and its accompaniment targeted at windows environment. Lastly, the Ubuntu server or VM is intended for peripheral use including web server, phishing and C2 redirections and other operational security aid.</p><h3>Active Directory Lab (Internal Network)</h3><p>The purpose of Red Teaming is to simulate adversary TTPs, and so as part of your lab practice, there’s absolute necessity for a replica enterprise environment where you can attack or simply put, hack into and also move laterally across the network. This strengthens the practitioner with different methodologies for the different constraints or security developments that are likely to be encountered in a real enterprise environment. On the other hand, individuals can gain deeper insight into industry-standard practices for securing enterprise environments. This is especially important for the Purple Team, which is expected to provide technical assistance to securing company infrastructure and assets.</p><p>In the Active Directory Lab, all devices are protected by a PfSense firewall. The firewall has two interfaces; the WAN and LAN interface. With the WAN interface, the firewall communicates with devices outside the LAN network on behalf of any of the internal devices through that adapter or interface based on the specific rules set. Typically, inbound traffic will be set to ‘Deny’ for all internal devices whereas outbound rules might be allowed for less critical or sensitive servers that have need for external communication; however, the PfSense firewall WAN connection will interface such communications, almost similar to how the NAT network mode operates. This lab is expected to at least integrate the minimal security requirement of an enterprise environment.</p><h3>Event Monitoring Lab</h3><p>The Security Event and Information Management presents a management platform for collecting, aggregating, and analyzing security-related data from various sources (host machines, servers, end-user devices, networking hardware, and applications) within an organization’s IT infrastructure through security alerts and event logs from EDRs, ETW, AMSI, etc. This ensures security compliance and real-time monitoring to identify and detect security threat and anomalies, enabling faster incident response and improved threat detection capabilities.</p><p>The SIEM Lab in this topology is designed to be accessible only within its internal network or VLAN. However, outbound traffic only to the SIEM on the log ingestion port will be allowed, while all other outbound traffic to the SIEM lab denied by default. On the other hand, inbound traffic from monitored hosts on the specific log ingestion port will be allowed, whereas all other inbound traffic to the SIEM lab denied by default. The SIEM is deemed a very critical system to have its own LAN segment; pivoting into internal networks and its consequential lateral movement can be foiled by this measure. Can you imagine what a catastrophe it will be if your SIEM system goes down even for a couple of hours to a few minutes?</p><p>Organizational security extends beyond just firewalls. By incorporating EDRs and monitoring integrations, organizations can adopt a more proactive approach to monitoring networks, hosts, client devices, users, groups, and network hardware, making it easier to detect anomalies.</p><p><strong>Hypervisor?</strong> VMware Workstation Pro is the most commonly-used, and lets you use the host for other things as well!</p><p>I know this is a long read and I appreciate you for making it to this point. I will appreciate it more if you share your thoughts and ask questions in the comments, let’s get interactive.</p><p>In my next post, I look forward to sharing the details of how I <a href="https://medium.com/@Gharnie/homelab-series-secure-remote-desktop-access-in-windows-a-comprehensive-guide-952f31e3f8f3"><strong>setup a secure remote desktop connection to safely access my server via the internet.</strong></a></p><h3>References</h3><p>1. TESRTECK (Director). (2024, October 13). <em>Upgrading the HP Z640 in 2024</em> [Video recording]. <a href="https://www.youtube.com/watch?v=e2znJgDiQ-Q">https://www.youtube.com/watch?v=e2znJgDiQ-Q</a></p><p>2. Radiator Papi (Director). (2024, May 11). <em>THE RETURN OF THE XEON — HP Z640 BUILD LOG PART. 1</em> [Video recording]. <a href="https://www.youtube.com/watch?v=YbqLbyxsneI">https://www.youtube.com/watch?v=YbqLbyxsneI</a></p><p>3. alvinashcraft. (2019, August 23). <em>Antimalware Scan Interface (AMSI) — Win32 apps</em>. <a href="https://learn.microsoft.com/en-us/windows/win32/amsi/antimalware-scan-interface-portal">https://learn.microsoft.com/en-us/windows/win32/amsi/antimalware-scan-interface-portal</a></p><p>4. <em>Building Your Own Kickass Home Lab</em>. (n.d.). Retrieved December 14, 2024, from <a href="https://docs.google.com/presentation/d/1V-mWiyaJ3I6HhXRxH1M5ityWYRqb5PoNHwvWSZaOr_E">https://docs.google.com/presentation/d/1V-mWiyaJ3I6HhXRxH1M5ityWYRqb5PoNHwvWSZaOr_E</a></p><p>5. <em>Cybersecurity Lab Project</em>. (n.d.). Google Docs. Retrieved December 14, 2024, from <a href="https://docs.google.com/document/d/1-sJcs06BeRXghh7F9X0gvF_UobT70liDky8761RbhuI/edit?tab=t.0&amp;usp=embed_facebook">https://docs.google.com/document/d/1-sJcs06BeRXghh7F9X0gvF_UobT70liDky8761RbhuI/edit?tab=t.0&amp;usp=embed_facebook</a></p><p>6. <em>Cybersecurity-Homelab-Project-Typology.png (1920×1080)</em>. (n.d.). Retrieved December 14, 2024, from <a href="https://cybercademy.org/wp-content/uploads/2020/04/Cybersecurity-Homelab-Project-Typology.png">https://cybercademy.org/wp-content/uploads/2020/04/Cybersecurity-Homelab-Project-Typology.png</a></p><p>7. DOMARS. (2024, December 13). <em>Event Tracing for Windows (ETW) — Windows drivers</em>. <a href="https://learn.microsoft.com/en-us/windows-hardware/drivers/devtest/event-tracing-for-windows--etw-">https://learn.microsoft.com/en-us/windows-hardware/drivers/devtest/event-tracing-for-windows--etw-</a></p><p>8. iainfoulds. (2024, November 1). <em>Active Directory Domain Services Overview</em>. <a href="https://learn.microsoft.com/en-us/windows-server/identity/ad-ds/get-started/virtual-dc/active-directory-domain-services-overview">https://learn.microsoft.com/en-us/windows-server/identity/ad-ds/get-started/virtual-dc/active-directory-domain-services-overview</a></p><p>9. <em>What Is Endpoint Detection and Response? | EDR Security | Trellix</em>. (n.d.). Retrieved December 14, 2024, from <a href="https://www.trellix.com/security-awareness/endpoint/what-is-endpoint-detection-and-response/">https://www.trellix.com/security-awareness/endpoint/what-is-endpoint-detection-and-response/</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=07c5e19e4e0e" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>