<?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 Caleb Gicobi on Medium]]></title>
        <description><![CDATA[Stories by Caleb Gicobi on Medium]]></description>
        <link>https://medium.com/@calebgicobi?source=rss-e7c0baa3bed2------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*4cGZWt0gRy5MGnKKHP1EAA.png</url>
            <title>Stories by Caleb Gicobi on Medium</title>
            <link>https://medium.com/@calebgicobi?source=rss-e7c0baa3bed2------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 03 Dec 2026 07:57:10 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@calebgicobi/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[Project: Comprehensive Network Scan on an Authorized Network using Nmap]]></title>
            <link>https://calebgicobi.medium.com/project-comprehensive-nmap-scan-on-an-authorized-network-6e287ded7e3c?source=rss-e7c0baa3bed2------2</link>
            <guid isPermaLink="false">https://medium.com/p/6e287ded7e3c</guid>
            <category><![CDATA[network-scanning]]></category>
            <category><![CDATA[linux]]></category>
            <category><![CDATA[os-detection]]></category>
            <category><![CDATA[sports]]></category>
            <category><![CDATA[nmap]]></category>
            <dc:creator><![CDATA[Caleb Gicobi]]></dc:creator>
            <pubDate>Tue, 24 Sep 2024 09:06:10 GMT</pubDate>
            <atom:updated>2024-09-26T09:01:38.298Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>Introduction</strong></p><p>In this project, I conducted a thorough Nmap scan on an authorized live network to identify connected devices, assess their security posture, and understand potential vulnerabilities. This exercise aimed to enhance my skills in network security and demonstrate how Nmap can be utilized for effective network mapping and security assessments.</p><p><strong>Scope</strong></p><p>The scope defined was to scan the network without causing any downtime and identify a couple of devices to enumerate further for OS and service detection.</p><p><strong>Objectives</strong></p><p>1. Identify all devices connected to the network.</p><p>2. Determine the operating systems of the devices.</p><p>3. Scan for open ports and services running on discovered devices.</p><p>4. Evaluate the security implications of the findings.</p><p><strong>Tools Used</strong></p><p>Nmap: A powerful network scanning tool that provides insights into network devices, services, and security vulnerabilities.</p><p>Terminal: For executing Nmap commands and analyzing results.</p><p><strong>Methodology</strong></p><p><strong>Step 1: Preparation</strong></p><p>Network Information: Gather basic information about the network, such as the IP range (e.g., <em>192.168.1.0/24</em>).</p><p>Authorization: Confirm that I have written permission to scan this network.</p><p><strong>Step 2: Initial Nmap Scan</strong></p><p>Command Used:</p><p><em>nmap -sn 192.168.1.0/24</em></p><p>Description: This command performs a ping scan to discover all active devices in the <em>192.168.8.0/24</em> IP range.</p><p>The results were as follows whereby I got the alive hosts, some of which returned host names:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XGWVjV0PBgKh1avVuCzFNg.png" /><figcaption>nmap -sn 192.168.8.0/24</figcaption></figure><p><strong>Step 3: Detailed Scan of Identified Devices</strong></p><p>For each active device, I performed a detailed scan to gather more information.</p><p>I started exploring the IP Addresses which returned host-names and found some interesting information.</p><p>Here, we can see that among other ports the port <em>554</em> was open and it also indicated the vendor of the service using the <em>rtsp</em> port. This is interesting information since we got additional info we didn’t have, and it could be a possible path to vulnerability if we were pentesting.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3RIb-k_G11xx_U0heuCumA.png" /><figcaption>nmap -sCV -O 192.168.8.107</figcaption></figure><p><strong>Step 4: Analyzing the Results</strong></p><p>Connected Devices: There were <em>93</em> hosts. However, other hosts could be set to not respond to ping probe requests and hence there could be more. <em>192.168.8.</em>107 host was a camera<em>. </em>This conclusion was backed by finding the rtsp service open and the camera technology information on the HTTP header. The TTL was 68 hence further supporting this since most camera firmware is based on Linux.<em> 192.168.8.250 </em>host was a Windows machine as determined by the OS guess and backed up by presence of smb and the TTL for the ping being<em> 128</em>.</p><p>Open Ports and Services: The open ports for the two IP addresses used (<em>192.168.8.107, 192.168.8.250</em>) were:</p><p>· <strong>Port 80</strong>: HTTP — default port for web-servers using HTTP and serves as the communication gateway for HTTP requests and responses between client computers and servers.</p><p>· <strong>Port 554</strong>: rtsp — allows the transfer of audio and video over the internet (streaming media).</p><p>· Port 8000: http-alt — used as an alternative http port.</p><p>· <strong>Port 135</strong>: msrpc — used to facilitate remote communication between clients and servers in a Windows environment.</p><p>· <strong>Port 139</strong>: netbios-ssn — it is primarily used by the Server Message Block (SMB) protocol for file sharing in Windows networks.</p><p>· <strong>Port 445</strong>: microsoft-ds — It runs Server Message Block (SMB), which allows systems of the same network to share files and printers over TCP/IP.</p><p>· <strong>Port 5357</strong>: Microsoft HTTP API httpd — It is primarily used for device discovery and communication in local networks, particularly for devices such as printers and other peripherals.</p><p><strong>Summary of Findings</strong></p><p><strong>Possible Vulnerabilities and their Mitigation Strategies</strong></p><p><strong>192.168.8.107</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*V09DxHZOmKf6jUhPNDurmw.png" /><figcaption>nmap -sCV -O 192.168.8.107</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*fgy2pzl45DOVuMv_QPb8gA.png" /><figcaption>nmap -sCV -O 192.168.8.107</figcaption></figure><p>The open ports were <em>80, 554 and 8000</em>. The possible vulnerabilities for the services running on these ports are:</p><p><strong>Port 80:</strong></p><p>Vulnerabilities:</p><p>· <strong>Cross-site scripting.</strong> Attackers can inject malicious scripts into web pages and applications to steal cookies, tokens, or data.</p><p>· <strong>SQL injections</strong>. Attackers insert malicious SQL code into input fields to manipulate a database.</p><p>· <strong>Cross-site request forgers. </strong>An attacker exploits the trust between a user’s web browser and a web application to trick the user into performing actions on a website without their knowledge or consent.</p><p>Remedies:</p><p>· <strong>Use HTTPS</strong>:Implement SSL/TLS to encrypt communications, protecting against eavesdropping and MitM attacks.</p><p>· <strong>Input Validation</strong>: Validate and sanitize all user inputs to prevent XSS and SQL injection attacks.</p><p>· <strong>Security Headers</strong>: Implement HTTP security headers to enhance security (e.g., Content Security Policy, X-XSS-Protection).</p><p>· <strong>Keep Software Updated</strong>: Regularly update web servers, applications, and libraries to patch known vulnerabilities.</p><p>· <strong>Web Application Firewalls (WAF)</strong>:Use a WAF to filter and monitor HTTP traffic, providing an additional layer of security.</p><p>Port 554:</p><p>Vulnerabilities:</p><p>· <strong>Unauthenticated Access</strong>: Many devices do not require authentication for RTSP access, allowing unauthorized users to stream or manipulate media streams.</p><p>· <strong>Buffer Overflow Attacks</strong>: Improper handling of RTSP requests can lead to buffer overflow vulnerabilities, allowing attackers to execute arbitrary code.</p><p>· <strong>Denial of Service (DoS)</strong>:Attackers can flood the RTSP service with requests, leading to service disruption and making the device unresponsive.</p><p>· <strong>Information Disclosure</strong>: Inadequate access controls can expose sensitive information, such as stream URLs, user credentials, and device configurations.</p><p>· <strong>Weak Authentication</strong>: If authentication is used, weak passwords or default credentials can be exploited.</p><p>· <strong>Insecure Streaming</strong>’s streams may not be encrypted, making them susceptible to eavesdropping and interception.</p><p>Remedies:</p><p>· <strong>Authentication</strong>: Ensure that strong authentication mechanisms are implemented for accessing RTSP streams.</p><p>· <strong>Access Controls</strong>: Configure firewalls to restrict access to port 554 from untrusted networks.</p><p>· <strong>Update and Patch</strong>: Regularly update firmware and software on devices to patch known vulnerabilities.</p><p>· <strong>Network Segmentation</strong>: Place streaming devices on a separate network segment to limit exposure.</p><p>· <strong>Encryption</strong>: Use RTSP over Transport Layer Security (RTSPS) to encrypt streams.</p><p>Port 8000:</p><p>Vulnerabilities:</p><p>· <strong>Cross-Site Scripting (XSS)</strong>:Like other web ports, applications on port 8000 may be susceptible to XSS attacks, allowing attackers to inject malicious scripts into web pages.</p><p>· <strong>SQL Injection</strong>: Web applications not properly validating user inputs may be vulnerable to SQL injections, enabling attackers to manipulate database queries.</p><p>· <strong>Remote Code Execution (RCE)</strong>:Certain frameworks or applications running on port 8000 may have vulnerabilities that allow attackers to execute arbitrary code.</p><p>· <strong>Directory Traversal</strong>: Misconfigurations can allow access to sensitive files outside the web root by manipulating URLs.</p><p>· <strong>Insecure Direct Object References (IDOR)</strong>:Weak access controls may let users access resources they shouldn’t, compromising sensitive information.</p><p>· <strong>Information Disclosure</strong>: Misconfigured applications can unintentionally expose sensitive information, such as configuration files or error messages.</p><p>· <strong>Denial of Service (DoS)</strong>Attackers can target applications on port 8000 with excessive requests to overwhelm the server.</p><p>· <strong>Man-in-the-Middle (MitM) Attacks</strong>: If applications do not use HTTPS, data transmitted over port 8000 can be intercepted.</p><p>· <strong>Misconfigured Security Headers</strong>: Absence or improper configuration of security headers can expose applications to various attacks.</p><p>Remedies:</p><p>· <strong>Use HTTPS</strong>:Implement SSL/TLS to encrypt traffic and protect against interception and MitM attacks.</p><p>· <strong>Input Validation and Sanitization</strong>: Ensure all user inputs are validated and sanitized to prevent injection attacks.</p><p>· <strong>Implement Security Headers</strong>: Use HTTP security headers (e.g., Content Security Policy, X-Content-Type-Options) to enhance security.</p><p>· <strong>Regular Software Updates</strong>: Keep web servers and applications up to date to mitigate known vulnerabilities.</p><p>· <strong>Web Application Firewall (WAF)</strong>:Utilize a WAF to monitor and filter HTTP traffic to protect against common web vulnerabilities.</p><p>· <strong>Access Controls</strong>: Enforce strict access controls to limit user permissions and protect sensitive resources.</p><p>· <strong>Conduct Security Assessments</strong>: Regularly perform penetration testing and vulnerability assessments to identify and remediate weaknesses.</p><p><strong>192.168.8.250</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/849/1*JYOPHF9MJcEcvW9hbn8NyA.png" /><figcaption>sudo nmap -sCV -O 192.168.8.250</figcaption></figure><p>The open ports were <em>80, 135, 139, 445 and 8000</em>. The possible vulnerabilities for the services running on these ports are:</p><p>Port 135:</p><p>Vulnerabilities:</p><p>· <strong>Remote Code Execution (RCE)</strong>:Vulnerabilities in the RPC service can allow attackers to execute arbitrary code remotely. High-profile worms like <em>MSBlast</em> exploited such vulnerabilities.</p><p>· <strong>Denial of Service (DoS)</strong>:Attackers can flood the RPC service with requests, causing legitimate services to become unresponsive.</p><p>· <strong>Port Scanning and Fingerprinting</strong>: Port 135 is often targeted for reconnaissance, allowing attackers to identify services and their versions, which can then be exploited.</p><p>· <strong>Weak Authentication</strong>: In some configurations, the RPC service may not enforce strong authentication, allowing unauthorized access.</p><p>· <strong>Exposure of Sensitive Information</strong>: Improperly configured RPC services can leak sensitive information about the system and its users.</p><p>· <strong>WMI and DCOM Exploits</strong>: The Windows Management Instrumentation (WMI) and Distributed Component Object Model (DCOM) services that rely on RPC can also be exploited if not secured properly.</p><p>Mitigation Strategies:</p><p>· <strong>Firewall Configuration</strong>: Block inbound traffic to port 135 from untrusted networks to limit exposure.</p><p>· <strong>Patch and Update</strong>: Regularly apply security patches and updates to Windows systems to mitigate known vulnerabilities.</p><p>· <strong>Use Strong Authentication</strong>: Implement strong authentication mechanisms and enforce access controls for RPC services.</p><p>· <strong>Disable Unused Services</strong>: If RPC is not needed, consider disabling it to reduce the attack surface.</p><p>· <strong>Network Segmentation</strong>: Place critical systems behind firewalls and segment networks to limit exposure to RPC services.</p><p>· <strong>Intrusion Detection/Prevention Systems (IDS/IPS)</strong>:Use IDS/IPS solutions to monitor suspicious activity related to RPC services.</p><p>Port 139 and 445</p><p>Vulnerabilities:</p><p>· <strong>Unauthorized Access</strong>: Weak authentication mechanisms or misconfigurations can allow unauthorized users to access shared files and resources.</p><p>· <strong>Denial of Service (DoS)</strong>:Attackers can overwhelm SMB services with excessive requests, causing disruptions in availability.</p><p>· <strong>Buffer Overflow</strong>: Certain implementations of SMB may be vulnerable to buffer overflow attacks, which can allow remote code execution.</p><p>· <strong>Man-in-the-Middle (MitM) Attacks</strong>: If SMB traffic is not encrypted, attackers can intercept and manipulate the data being transmitted.</p><p>· <strong>WannaCry and Other Ransomware</strong>: Vulnerabilities in SMB, such as those exploited by the WannaCry ransomware attack, can lead to widespread infections and data loss.</p><p>· <strong>Information Disclosure</strong>: Misconfigured SMB shares may expose sensitive information to users who should not have access.</p><p>· <strong>Lack of Encryption</strong>: Older versions of SMB (e.g., SMB1) do not support encryption, making it easier for attackers to eavesdrop on traffic.</p><p>Mitigation Strategies:</p><p>· <strong>Use Strong Authentication</strong>: Implement strong password policies and disable anonymous access to SMB shares.</p><p>· <strong>Patch and Update</strong>: Regularly apply security updates and patches to Windows systems to address known vulnerabilities.</p><p>· <strong>Disable SMBv1</strong>:Disable the outdated SMBv1 protocol, which is known to have several vulnerabilities, in favor of SMBv2 or SMBv3.</p><p>· <strong>Firewall Configuration</strong>: Restrict access to port 139 through firewalls, allowing only trusted networks to connect.</p><p>· <strong>Implement Network Segmentation</strong>: Use network segmentation to limit exposure of SMB services to untrusted networks.</p><p>· <strong>Use Encryption</strong>: Enable SMB encryption for secure communication, especially when transmitting sensitive data.</p><p>Port 5357</p><p>Vulnerabilities:</p><p>· <strong>Unauthorized Access</strong>: Devices using WSD may not require strong authentication, allowing unauthorized users to access or control devices.</p><p>· <strong>Information Disclosure</strong>: Misconfigurations can lead to the exposure of sensitive information about the device or its services, such as model details and firmware versions.</p><p>· <strong>Denial of Service (DoS)</strong>:Attackers could potentially overwhelm WSD services with excessive requests, disrupting normal operations.</p><p>· <strong>Remote Code Execution (RCE)</strong>:Certain vulnerabilities in device firmware or the WSD implementation might allow attackers to execute arbitrary code, though this is less common.</p><p>· <strong>Eavesdropping</strong>: If communication over WSD is not encrypted, sensitive data could be intercepted by attackers on the network.</p><p>· <strong>Vulnerabilities in Dependent Services</strong>: Devices that rely on WSD may expose other services or ports that could be vulnerable (e.g., SMB), which attackers could exploit.</p><p>Mitigation Strategies</p><p>· <strong>Network Segmentation: </strong>Place WSD-enabled devices on a separate network segment to limit exposure to untrusted devices.</p><p>· <strong>Access Control</strong>: Use strong authentication mechanisms and configure devices to restrict access to trusted users or networks.</p><p>· <strong>Regular Updates</strong>: Keep device firmware up to date to patch any known vulnerabilities associated with WSD.</p><p>· <strong>Disable Unused Services</strong>: If WSD is not needed, consider disabling it on devices to reduce the attack surface.</p><p>· <strong>Encryption</strong>: Use encryption for data transmitted over WSD to protect against eavesdropping.</p><p>· <strong>Firewall Rules</strong>: Implement firewall rules to limit access to port 5357 from non trusted networks.</p><p><strong>Conclusion</strong></p><p>Conducting this Nmap scan provided valuable insights into the security of this network. Understanding connected devices and their vulnerabilities is crucial for maintaining a secure environment. This project not only enhanced my knowledge of network scanning techniques but also emphasized the importance of regular security assessments. I also learnt that that ports that must allow connection should be filtered, those that are running on outdated services updated and those that are not in use closed.</p><blockquote><em>Filter, Patch or Close.</em></blockquote><p><strong>Future Work</strong></p><p>Explore more advanced Nmap features, such as scripting with Nmap Scripting Engine (NSE).</p><p>Explore port filtering, closing and patching.</p><p><strong>References</strong></p><p>Nmap Official Documentation: <a href="https://nmap.org/docs.html">https://nmap.org/docs.html</a></p><p>Cybersecurity Best Practices: <a href="https://www.cyber.gov.au/acsc/view-all-content/publications/cyber-security-best-practices">https://www.cyber.gov.au/acsc/view-all-content/publications/cyber-security-best-practices</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6e287ded7e3c" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>