<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Ganesh hari</title>
    <description>The latest articles on DEV Community by Ganesh hari (@ganesh_hari_18).</description>
    <link>https://dev.to/ganesh_hari_18</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3761162%2F3f0a1c35-8c06-4c3e-aef0-4c4e824f676a.png</url>
      <title>DEV Community: Ganesh hari</title>
      <link>https://dev.to/ganesh_hari_18</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/ganesh_hari_18"/>
    <language>en</language>
    <item>
      <title>Turning Security Scripts into a Web App: Why Flask Was My Framework of Choice</title>
      <dc:creator>Ganesh hari</dc:creator>
      <pubDate>Wed, 15 Apr 2026 09:26:23 +0000</pubDate>
      <link>https://dev.to/ganesh_hari_18/turning-security-scripts-into-a-web-app-why-flask-was-my-framework-of-choice-2ge9</link>
      <guid>https://dev.to/ganesh_hari_18/turning-security-scripts-into-a-web-app-why-flask-was-my-framework-of-choice-2ge9</guid>
      <description>&lt;p&gt;When building a web-based security automation platform, one of the most important decisions is selecting the right backend framework. Since my project focuses on integrating multiple Linux-based security tools like Nmap, Nikto, and WhatWeb into a unified interface, I needed something that was both flexible and easy to work with.&lt;/p&gt;

&lt;p&gt;That’s where Flask became the ideal choice.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Role of Flask in My Project
&lt;/h2&gt;

&lt;p&gt;At its core, Flask acts as the backend engine of my application. It connects the user interface with the underlying Python logic that executes security scans.&lt;/p&gt;

&lt;p&gt;Instead of running tools manually in a terminal, Flask allows users to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Log in securely&lt;/li&gt;
&lt;li&gt;Enter a target website&lt;/li&gt;
&lt;li&gt;Trigger automated scans&lt;/li&gt;
&lt;li&gt;View results directly in a browser&lt;/li&gt;
&lt;li&gt;Access scan history&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In simple terms, Flask transforms a command-line based security workflow into a &lt;strong&gt;user-friendly web application.&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Why Flask Was the Right Choice ?
&lt;/h2&gt;

&lt;p&gt;&lt;u&gt;&lt;strong&gt;1. Lightweight and Flexible&lt;/strong&gt;&lt;/u&gt;&lt;/p&gt;

&lt;p&gt;Flask is known for its minimalistic design. It doesn’t impose strict rules, which makes it perfect for projects that require custom logic—like executing external tools using Python’s subprocess module.&lt;/p&gt;

&lt;p&gt;This flexibility allowed me to directly integrate tools such as Nmap and Nikto without unnecessary complexity.&lt;/p&gt;

&lt;p&gt;&lt;u&gt;&lt;strong&gt;2. Seamless Integration with Python Tools&lt;/strong&gt;&lt;/u&gt;&lt;/p&gt;

&lt;p&gt;Since my project heavily relies on Python for automation, Flask naturally fits into the ecosystem. It enables smooth communication between:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Web requests (from users)&lt;/li&gt;
&lt;li&gt;Python scripts (scanner logic)&lt;/li&gt;
&lt;li&gt;External tools (Linux security utilities)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This made the development process much more efficient.&lt;/p&gt;

&lt;p&gt;&lt;u&gt;&lt;strong&gt;3. Rapid Development&lt;/strong&gt;&lt;/u&gt;&lt;/p&gt;

&lt;p&gt;One of the biggest advantages of Flask is how quickly you can build a working prototype. With minimal setup, I was able to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Create routes for scanning&lt;/li&gt;
&lt;li&gt;Design a basic dashboard&lt;/li&gt;
&lt;li&gt;Implement user authentication&lt;/li&gt;
&lt;li&gt;Display scan results dynamically&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This speed is crucial, especially for academic projects and hackathons.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;u&gt;4. Full Control Over Architecture&lt;/u&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Unlike larger frameworks, Flask gives developers complete control over how the application is structured. This was particularly useful for designing a custom workflow that includes:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Scan execution pipeline&lt;/li&gt;
&lt;li&gt;Result parsing logic&lt;/li&gt;
&lt;li&gt;JSON report generation&lt;/li&gt;
&lt;li&gt;User-based scan history&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;&lt;u&gt;Limitations I Considered&lt;/u&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;While Flask worked perfectly for my current needs, it’s important to acknowledge its limitations.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;It does not include built-in authentication systems&lt;/li&gt;
&lt;li&gt;Database handling requires additional setup&lt;/li&gt;
&lt;li&gt;Scaling to large applications requires careful design&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Because of this, Flask is best suited for small to medium-sized applications or prototypes.&lt;/p&gt;

&lt;p&gt;Alternative Frameworks I Explored&lt;/p&gt;

&lt;p&gt;During development, I also explored other frameworks that could be used depending on the project’s scale and requirements.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Django&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;A full-stack framework with built-in features like authentication, admin panel, and database management. Ideal for large-scale applications.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;FastAPI&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;A modern, high-performance framework designed for building APIs. It supports asynchronous execution and is highly scalable.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Streamlit&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;A simple framework for quickly building data-driven applications, though not suitable for complex authentication systems.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;u&gt;Final Thoughts&lt;/u&gt;
&lt;/h2&gt;

&lt;p&gt;Choosing Flask allowed me to strike the right balance between simplicity, flexibility, and functionality. It enabled me to rapidly develop a working prototype while maintaining full control over how different security tools are integrated and executed.&lt;/p&gt;

&lt;p&gt;As the project evolves, there is potential to migrate to more scalable frameworks like FastAPI or Django. However, for building a practical and efficient web security automation tool, Flask proved to be the perfect starting point.&lt;/p&gt;

</description>
      <category>flask</category>
      <category>python</category>
      <category>security</category>
      <category>development</category>
    </item>
    <item>
      <title>Building a Fast Automated Web Security Scanner Using Python and Open-Source Linux Tools</title>
      <dc:creator>Ganesh hari</dc:creator>
      <pubDate>Sat, 28 Mar 2026 07:52:10 +0000</pubDate>
      <link>https://dev.to/ganesh_hari_18/building-a-fast-automated-web-security-scanner-using-python-and-open-source-linux-tools-n7m</link>
      <guid>https://dev.to/ganesh_hari_18/building-a-fast-automated-web-security-scanner-using-python-and-open-source-linux-tools-n7m</guid>
      <description>&lt;h2&gt;
  
  
  Building a Fast Automated Web Security Scanner Using Python and Linux Tools
&lt;/h2&gt;

&lt;p&gt;In modern web security testing, automation plays a critical role in quickly identifying potential vulnerabilities and misconfigurations. Instead of manually running multiple tools one by one, I built a Python-based automated scanner that integrates widely used Linux security tools into a single workflow.&lt;/p&gt;

&lt;p&gt;This project combines the capabilities of Nmap, WhatWeb, and Nikto to analyze a target website efficiently and present results in both technical and human-readable formats.&lt;/p&gt;

&lt;h2&gt;
  
  
  Objective of the Project
&lt;/h2&gt;

&lt;p&gt;The goal of this project is to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Automate web security reconnaissance&lt;/li&gt;
&lt;li&gt;Reduce manual effort in running multiple tools&lt;/li&gt;
&lt;li&gt;Provide a simplified explanation of technical results&lt;/li&gt;
&lt;li&gt;Generate structured output for further analysis&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This approach is particularly useful for beginners, students, and developers who want to understand web security without getting overwhelmed by raw command-line outputs.&lt;/p&gt;

&lt;h2&gt;
  
  
  How the Scanner Works
&lt;/h2&gt;

&lt;p&gt;The system is designed using Python as the orchestration layer. It interacts with external security tools using the subprocess module and processes their outputs programmatically.&lt;/p&gt;

&lt;p&gt;Workflow Overview&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;User inputs a target URL&lt;/li&gt;
&lt;li&gt;Python resolves the domain to an IP address&lt;/li&gt;
&lt;li&gt;Multiple tools are executed sequentially&lt;/li&gt;
&lt;li&gt;Outputs are parsed using regex&lt;/li&gt;
&lt;li&gt;Results are summarized and explained&lt;/li&gt;
&lt;li&gt;Optional JSON report is generated&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Tool Integration and Use Cases
&lt;/h2&gt;

&lt;p&gt;*&lt;em&gt;1. Nmap – Port and Service Discovery *&lt;/em&gt;&lt;br&gt;
Nmap is used to identify open ports and exposed services on the target system.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Purpose:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Detect open TCP ports&lt;/li&gt;
&lt;li&gt;Identify network exposure&lt;/li&gt;
&lt;li&gt;Determine HTTPS availability&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Implementation Highlights:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Fast scan mode (-F)&lt;/li&gt;
&lt;li&gt;Aggressive timing (-T4)&lt;/li&gt;
&lt;li&gt;Filters only open ports (--open)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This ensures faster execution while still providing meaningful results.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. WhatWeb – Technology Detection&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;WhatWeb helps identify the technologies used by a website.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Purpose:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Detect web server (Apache, Nginx, etc.)&lt;/li&gt;
&lt;li&gt;Identify programming languages (PHP)&lt;/li&gt;
&lt;li&gt;Detect CMS platforms like WordPress&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Parsing Strategy:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The output is analyzed using regular expressions to extract:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Server type&lt;/li&gt;
&lt;li&gt;PHP version&lt;/li&gt;
&lt;li&gt;CMS presence&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This enables structured reporting instead of raw text analysis.&lt;/p&gt;
&lt;h2&gt;
  
  
  3. Nikto – Vulnerability Scanning
&lt;/h2&gt;

&lt;p&gt;Nikto is used to detect common web server vulnerabilities and misconfigurations.&lt;/p&gt;

&lt;p&gt;Purpose:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Identify outdated software&lt;/li&gt;
&lt;li&gt;Detect exposed files&lt;/li&gt;
&lt;li&gt;Highlight security issues&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Optimization:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Limited scan scope using -Tuning&lt;/li&gt;
&lt;li&gt;Maximum execution time capped at 120 seconds&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This balances speed and effectiveness.&lt;/p&gt;
&lt;h2&gt;
  
  
  Intelligent Result Processing
&lt;/h2&gt;

&lt;p&gt;One of the key features of this project is not just running scans, but making the results understandable.&lt;/p&gt;
&lt;h2&gt;
  
  
  Example Enhancements:
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Open ports are interpreted as “network access points”&lt;/li&gt;
&lt;li&gt;HTTPS detection is explained in terms of user data protection&lt;/li&gt;
&lt;li&gt;CMS detection includes security advice
Vulnerability count is converted into a risk level:&lt;/li&gt;
&lt;/ul&gt;

&lt;ol&gt;
&lt;li&gt;Low&lt;/li&gt;
&lt;li&gt;Medium&lt;/li&gt;
&lt;li&gt;High&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;This transforms technical output into meaningful insights.&lt;/p&gt;
&lt;h2&gt;
  
  
  Human-Friendly Report Generation
&lt;/h2&gt;

&lt;p&gt;Instead of overwhelming users with raw logs, the scanner produces a structured explanation:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Web server details&lt;/li&gt;
&lt;li&gt;Programming language usage&lt;/li&gt;
&lt;li&gt;CMS detection&lt;/li&gt;
&lt;li&gt;Open ports and their significance&lt;/li&gt;
&lt;li&gt;Security findings and risk level&lt;/li&gt;
&lt;li&gt;Practical security recommendations&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;This makes the tool useful not only for professionals but also for learners.&lt;/p&gt;
&lt;h2&gt;
  
  
  JSON Export Feature
&lt;/h2&gt;

&lt;p&gt;The scanner includes an optional feature to export results in JSON format.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Benefits:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Easy storage of scan results&lt;/li&gt;
&lt;li&gt;Integration with other systems&lt;/li&gt;
&lt;li&gt;Future dashboard visualization&lt;/li&gt;
&lt;li&gt;API-based extensions&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Each scan is saved with:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Target details&lt;/li&gt;
&lt;li&gt;Detected technologies&lt;/li&gt;
&lt;li&gt;Open ports&lt;/li&gt;
&lt;li&gt;Risk level&lt;/li&gt;
&lt;li&gt;Timestamp&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
  
  
  Performance Considerations
&lt;/h2&gt;

&lt;p&gt;To improve efficiency, the following optimizations were implemented:&lt;/p&gt;

&lt;p&gt;Fast scanning modes for all tools&lt;br&gt;
Limited scan scope where possible&lt;br&gt;
Reduced unnecessary checks&lt;br&gt;
Silent subprocess execution&lt;/p&gt;

&lt;p&gt;Despite using multiple tools, the scanner maintains a balance between speed and accuracy.&lt;/p&gt;
&lt;h2&gt;
  
  
  Challenges Faced
&lt;/h2&gt;

&lt;p&gt;During development, several practical challenges were encountered:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Parsing unstructured CLI output&lt;/li&gt;
&lt;li&gt;Managing scan execution time&lt;/li&gt;
&lt;li&gt;Handling tool dependencies in Linux&lt;/li&gt;
&lt;li&gt;Ensuring stable subprocess execution&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These challenges were addressed through controlled command execution and output parsing strategies.&lt;/p&gt;
&lt;h2&gt;
  
  
  Future Improvements
&lt;/h2&gt;

&lt;p&gt;This project can be extended into a full-scale security platform by adding:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Parallel execution using threading or multiprocessing&lt;/li&gt;
&lt;li&gt;Integration with tools like Gobuster and OWASP ZAP&lt;/li&gt;
&lt;li&gt;Web-based dashboard using Flask&lt;/li&gt;
&lt;li&gt;Database storage for scan history&lt;/li&gt;
&lt;li&gt;Authentication system for multiple users&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;This project demonstrates how traditional command-line security tools can be transformed into a programmable and automated security solution using Python.&lt;/p&gt;

&lt;p&gt;By combining tools like Nmap, WhatWeb, and Nikto, and adding intelligent parsing and reporting, we can build a system that is both technically powerful and user-friendly.&lt;/p&gt;

&lt;p&gt;Automation in cybersecurity is not just about speed—it’s about making complex data accessible, actionable, and scalable.&lt;/p&gt;
&lt;h2&gt;
  
  
  Final Note
&lt;/h2&gt;

&lt;p&gt;This blog presents the concept, workflow, and output of my automated scanner. The implementation includes Python-based subprocess execution, result parsing, and structured reporting.&lt;/p&gt;

&lt;p&gt;In the next step, I will extend this project by comparing:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Manual Nmap execution&lt;/li&gt;
&lt;li&gt;Python subprocess-based execution&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;to further improve automation and performance.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;subprocess&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;socket&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;re&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;json&lt;/span&gt;
&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;datetime&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;datetime&lt;/span&gt;


&lt;span class="c1"&gt;# --------------------------------------------------
# RUN COMMAND (FAST + SILENT)
# --------------------------------------------------
&lt;/span&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;run&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;cmd&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="k"&gt;try&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="n"&gt;result&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;subprocess&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;run&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
            &lt;span class="n"&gt;cmd&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="n"&gt;capture_output&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="bp"&gt;True&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="n"&gt;text&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="bp"&gt;True&lt;/span&gt;
        &lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;result&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;stdout&lt;/span&gt;
    &lt;span class="k"&gt;except&lt;/span&gt; &lt;span class="nb"&gt;Exception&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="n"&gt;e&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nf"&gt;str&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;e&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;


&lt;span class="c1"&gt;# --------------------------------------------------
# PARSE WHATWEB OUTPUT
# --------------------------------------------------
&lt;/span&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;parse_whatweb&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;output&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;

    &lt;span class="n"&gt;server&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;re&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;search&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sa"&gt;r&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;HTTPServer\[(.*?)\]&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;output&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;php&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;re&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;search&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sa"&gt;r&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;PHP\[(.*?)\]&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;output&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;wordpress&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;WordPress&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;output&lt;/span&gt;

    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;server&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;server&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;group&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;server&lt;/span&gt; &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Unknown&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;php&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;php&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;group&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;php&lt;/span&gt; &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Unknown&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;wordpress&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;wordpress&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;


&lt;span class="c1"&gt;# --------------------------------------------------
# PARSE NMAP OUTPUT
# --------------------------------------------------
&lt;/span&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;parse_nmap&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;output&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="n"&gt;ports&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;re&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;findall&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sa"&gt;r&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;(\d+)/tcp\s+open&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;output&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;ports&lt;/span&gt;


&lt;span class="c1"&gt;# --------------------------------------------------
# PARSE NIKTO OUTPUT
# --------------------------------------------------
&lt;/span&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;parse_nikto&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;output&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="n"&gt;issues&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;len&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;re&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;findall&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sa"&gt;r&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;\+&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;output&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;issues&lt;/span&gt;


&lt;span class="c1"&gt;# --------------------------------------------------
# HUMAN FRIENDLY EXPLANATION
# --------------------------------------------------
&lt;/span&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;explain_results&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;tech&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;ports&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;issues&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;

    &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s"&gt;==============================&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;   EASY EXPLANATION REPORT&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;==============================&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="c1"&gt;# SERVER
&lt;/span&gt;    &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;🌐 Website Server&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;------------------&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;The website runs on &lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;tech&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;server&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt; server software.&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;A web server is responsible for sending webpages to visitors.&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;This is normal for all websites.&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="c1"&gt;# PHP
&lt;/span&gt;    &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;⚙️ Website Programming Language&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;--------------------------------&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;tech&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;php&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;!=&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Unknown&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;The website uses PHP version &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;tech&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;php&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s"&gt;.&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;PHP helps websites handle logins, forms, and dynamic content.&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;If not updated regularly, older versions may have risks.&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;else&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Programming language could not be detected.&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="c1"&gt;# CMS
&lt;/span&gt;    &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;🧩 Website Platform (CMS)&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;--------------------------&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;tech&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;wordpress&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;]:&lt;/span&gt;
        &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;The website is built using WordPress.&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;WordPress is popular and easy to manage.&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Plugins and themes must be updated for security.&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;else&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;No common CMS platform detected.&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="c1"&gt;# PORTS
&lt;/span&gt;    &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;🔌 Network Access (Open Doors)&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;-------------------------------&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Open ports detected: &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;, &lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;join&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;ports&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Ports are like doors allowing communication with the server.&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;443&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;ports&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;✅ Secure HTTPS encryption is enabled.&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;This protects user data while browsing.&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;else&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;⚠️ Secure HTTPS was NOT detected.&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="c1"&gt;# SECURITY LEVEL
&lt;/span&gt;    &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;🛡️ Security Findings&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;--------------------&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;issues&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="n"&gt;level&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;LOW 🟢&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;
        &lt;span class="n"&gt;message&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Only minor observations were found.&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;
    &lt;span class="k"&gt;elif&lt;/span&gt; &lt;span class="n"&gt;issues&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="mi"&gt;15&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="n"&gt;level&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;MEDIUM 🟡&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;
        &lt;span class="n"&gt;message&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Some improvements are recommended.&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;
    &lt;span class="k"&gt;else&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="n"&gt;level&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;HIGH 🔴&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;
        &lt;span class="n"&gt;message&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Multiple potential risks detected.&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;

    &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Risk Level: &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;level&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;message&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s"&gt;This does NOT mean the website is hacked.&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;It only shows possible improvements.&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="c1"&gt;# ADVICE
&lt;/span&gt;    &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;✅ Simple Advice&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;----------------&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;• Keep website software updated&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;• Hide version information&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;• Always use HTTPS&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;• Perform regular security scans&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s"&gt;==============================&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;


&lt;span class="c1"&gt;# --------------------------------------------------
# MAIN PROGRAM
# --------------------------------------------------
&lt;/span&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;main&lt;/span&gt;&lt;span class="p"&gt;():&lt;/span&gt;

    &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s"&gt;===================================&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;      FAST AUTOMATED WEB SCANNER&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;      Nmap | WhatWeb | Nikto&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;===================================&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="n"&gt;url&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;input&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Enter target URL (www.*): &lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;strip&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;

    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="ow"&gt;not&lt;/span&gt; &lt;span class="n"&gt;url&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;startswith&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;www.&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;❌ URL must start with www.&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt;

    &lt;span class="n"&gt;domain&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;url&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;replace&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;www.&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;""&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="c1"&gt;# Resolve IP
&lt;/span&gt;    &lt;span class="k"&gt;try&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="n"&gt;ip&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;socket&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;gethostbyname&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;domain&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s"&gt;Target IP Address: &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;ip&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;except&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;❌ Could not resolve domain.&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt;

    &lt;span class="c1"&gt;# ---------------- WHATWEB ----------------
&lt;/span&gt;    &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s"&gt;[+] Detecting website technology...&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;whatweb_output&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;run&lt;/span&gt;&lt;span class="p"&gt;([&lt;/span&gt;
        &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;whatweb&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;-a&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;1&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="n"&gt;url&lt;/span&gt;
    &lt;span class="p"&gt;])&lt;/span&gt;

    &lt;span class="n"&gt;tech&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;parse_whatweb&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;whatweb_output&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="c1"&gt;# ---------------- NMAP ----------------
&lt;/span&gt;    &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;[+] Performing fast port scan...&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;nmap_output&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;run&lt;/span&gt;&lt;span class="p"&gt;([&lt;/span&gt;
        &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;nmap&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;-F&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;--open&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;-T4&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="n"&gt;domain&lt;/span&gt;
    &lt;span class="p"&gt;])&lt;/span&gt;

    &lt;span class="n"&gt;ports&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;parse_nmap&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;nmap_output&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="c1"&gt;# ---------------- NIKTO ----------------
&lt;/span&gt;    &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;[+] Running quick vulnerability scan (max 120 sec)...&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="n"&gt;protocol&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;https&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;443&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;ports&lt;/span&gt; &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;http&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;

    &lt;span class="n"&gt;nikto_output&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;run&lt;/span&gt;&lt;span class="p"&gt;([&lt;/span&gt;
        &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;nikto&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;-h&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;protocol&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s"&gt;://&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;url&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;-Tuning&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;123bde&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;-maxtime&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;120&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;
    &lt;span class="p"&gt;])&lt;/span&gt;

    &lt;span class="n"&gt;issues&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;parse_nikto&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;nikto_output&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="c1"&gt;# ---------------- SUMMARY ----------------
&lt;/span&gt;    &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s"&gt;==============================&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;        SCAN SUMMARY&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;==============================&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Target Website : &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;url&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;IP Address     : &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;ip&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Web Server     : &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;tech&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;server&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;PHP Version    : &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;tech&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;php&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;CMS Detected   : &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;WordPress&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;tech&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;wordpress&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;Not Detected&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Open Ports     : &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;, &lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;join&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;ports&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;ports&lt;/span&gt; &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;None&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;443&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;ports&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;HTTPS Status   : Enabled ✅&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;else&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;HTTPS Status   : Not Enabled ⚠️&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Findings Count : &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;issues&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="c1"&gt;# HUMAN REPORT
&lt;/span&gt;    &lt;span class="nf"&gt;explain_results&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;tech&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;ports&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;issues&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;✅ Scan Completed Successfully&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="c1"&gt;# ---------------- JSON EXPORT ----------------
&lt;/span&gt;    &lt;span class="n"&gt;save_choice&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;input&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Do you want to download the results in JSON locally? (y/n): &lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;strip&lt;/span&gt;&lt;span class="p"&gt;().&lt;/span&gt;&lt;span class="nf"&gt;lower&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;save_choice&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;y&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="n"&gt;now&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;datetime&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;now&lt;/span&gt;&lt;span class="p"&gt;().&lt;/span&gt;&lt;span class="nf"&gt;strftime&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;%Y%m%d_%H%M%S&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="n"&gt;safe_target&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;re&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;sub&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sa"&gt;r&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;[^a-zA-Z0-9_-]&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;_&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;url&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="n"&gt;filename&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;scan_result_&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;safe_target&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s"&gt;_&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;now&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s"&gt;.json&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;

        &lt;span class="n"&gt;result_data&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;target&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;url&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;domain&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;domain&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;ip&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;ip&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;server&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;tech&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;server&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;
            &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;php&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;tech&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;php&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;
            &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;wordpress&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;tech&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;wordpress&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;
            &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;ports&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;ports&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;https&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;443&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;ports&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;findings_count&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;issues&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;risk_level&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;LOW&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;issues&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt; &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;MEDIUM&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;issues&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="mi"&gt;15&lt;/span&gt; &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;HIGH&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;timestamp&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;now&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;

        &lt;span class="k"&gt;try&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
            &lt;span class="k"&gt;with&lt;/span&gt; &lt;span class="nf"&gt;open&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;filename&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;w&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;encoding&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;utf-8&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
                &lt;span class="n"&gt;json&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;dump&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;result_data&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;indent&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
            &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;📄 JSON result saved: &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;filename&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="k"&gt;except&lt;/span&gt; &lt;span class="nb"&gt;Exception&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="n"&gt;e&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
            &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;❌ Could not save JSON file: &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;e&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;else&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;ℹ️ JSON export skipped by user.&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;


&lt;span class="c1"&gt;# --------------------------------------------------
&lt;/span&gt;&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;__name__&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;__main__&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="nf"&gt;main&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>webdev</category>
      <category>cybersecurity</category>
      <category>development</category>
      <category>linux</category>
    </item>
    <item>
      <title>Essential Free Web Penetration Testing Tools and Their Practical Use Cases</title>
      <dc:creator>Ganesh hari</dc:creator>
      <pubDate>Mon, 09 Mar 2026 16:50:10 +0000</pubDate>
      <link>https://dev.to/ganesh_hari_18/essential-free-web-penetration-testing-tools-and-their-practical-use-cases-3n2i</link>
      <guid>https://dev.to/ganesh_hari_18/essential-free-web-penetration-testing-tools-and-their-practical-use-cases-3n2i</guid>
      <description>&lt;p&gt;Web application security is no longer optional. As organizations increasingly rely on web-based platforms, identifying vulnerabilities before attackers do has become a critical responsibility.&lt;/p&gt;

&lt;p&gt;Fortunately, the open-source security ecosystem provides powerful, free tools that enable structured and effective web penetration testing. This article explores five widely used Linux-based tools, their core functionality, and real-world use cases in web security assessments.&lt;/p&gt;

&lt;p&gt;&lt;u&gt;The tools covered include:&lt;/u&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Nmap&lt;/li&gt;
&lt;li&gt;WhatWeb&lt;/li&gt;
&lt;li&gt;Nikto&lt;/li&gt;
&lt;li&gt;Gobuster&lt;/li&gt;
&lt;li&gt;Wapiti&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Together, they form a strong foundation for web security testing workflows.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Nmap – Open Ports and Service Discovery
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Purpose&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Network Mapper (Nmap) is primarily a network scanning tool, but it plays a crucial role in web penetration testing.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Core Functionality&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Identifies open TCP/UDP ports&lt;/li&gt;
&lt;li&gt;Detects running services&lt;/li&gt;
&lt;li&gt;Performs version detection&lt;/li&gt;
&lt;li&gt;Supports scripting via NSE (Nmap Scripting Engine)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Web Security Use Case&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Before assessing a web application, it is important to understand the exposed attack surface. Nmap helps determine:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Whether ports 80, 443, or 8080 are open&lt;/li&gt;
&lt;li&gt;If additional services like SSH (22) or FTP (21) are accessible&lt;/li&gt;
&lt;li&gt;The version of the web server (Apache, Nginx, IIS)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This information helps security analysts identify potential entry points and outdated services that may contain vulnerabilities.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Example Scenario&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;If a web server exposes an outdated Apache version, it may be vulnerable to known CVEs. Nmap enables early detection of such exposure.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. WhatWeb – Technology Fingerprinting
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Purpose&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;WhatWeb identifies technologies used by a website.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Core Functionality&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Detects CMS platforms (WordPress, Joomla, Drupal)&lt;/li&gt;
&lt;li&gt;Identifies server technologies&lt;/li&gt;
&lt;li&gt;Discovers frameworks (Laravel, Django, ASP.NET)&lt;/li&gt;
&lt;li&gt;Recognizes analytics and plugins&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Web Security Use Case&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Understanding the technology stack of a web application is essential for targeted testing. Different technologies have different attack surfaces.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;For example:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;WordPress sites may require plugin vulnerability checks&lt;/li&gt;
&lt;li&gt;PHP-based applications may need input validation testing&lt;/li&gt;
&lt;li&gt;ASP.NET apps may require specific configuration review&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Technology fingerprinting enables a more focused and efficient assessment.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Example Scenario&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;If WhatWeb detects WordPress, the tester may proceed with WordPress-specific vulnerability scanning tools such as WPScan.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Nikto – Web Server Vulnerability Scanner
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Purpose&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Nikto performs web server configuration and vulnerability checks.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Core Functionality&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Detects outdated server software&lt;/li&gt;
&lt;li&gt;Identifies dangerous files and scripts&lt;/li&gt;
&lt;li&gt;Finds default credentials&lt;/li&gt;
&lt;li&gt;Checks misconfigurations&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Web Security Use Case&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Nikto is particularly useful during initial reconnaissance. It quickly identifies common security weaknesses such as:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Directory indexing enabled&lt;/li&gt;
&lt;li&gt;Backup files exposed&lt;/li&gt;
&lt;li&gt;Test scripts left accessible&lt;/li&gt;
&lt;li&gt;Deprecated server versions&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Nikto does not exploit vulnerabilities but flags potential issues for further investigation.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Example Scenario&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;If a backup file such as config.bak is publicly accessible, it may expose sensitive information like database credentials.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. Gobuster – Hidden Directory and File Discovery
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Purpose&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Gobuster is used for directory and file brute-forcing.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Core Functionality&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Discovers hidden directories&lt;/li&gt;
&lt;li&gt;Identifies unlinked admin panels&lt;/li&gt;
&lt;li&gt;Finds backup or development folders&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Web Security Use Case&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Many sensitive resources are not linked directly on a website but remain accessible if the path is known. Gobuster helps uncover:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;/admin panels&lt;/li&gt;
&lt;li&gt;/backup folders&lt;/li&gt;
&lt;li&gt;/dev environments&lt;/li&gt;
&lt;li&gt;Hidden APIs&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This expands visibility into potentially sensitive areas.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Example Scenario&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;An exposed /admin panel without proper authentication could allow unauthorized access attempts.&lt;/p&gt;

&lt;h2&gt;
  
  
  5. Wapiti – Web Application Vulnerability Scanner
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Purpose&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Wapiti is a dynamic web application vulnerability scanner.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Core Functionality&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Detects SQL Injection&lt;/li&gt;
&lt;li&gt;Identifies Cross-Site Scripting (XSS)&lt;/li&gt;
&lt;li&gt;Finds file disclosure vulnerabilities&lt;/li&gt;
&lt;li&gt;Tests command injection&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Web Security Use Case&lt;/p&gt;

&lt;p&gt;Unlike Nmap or Nikto, Wapiti interacts directly with web application inputs and parameters. It simulates attack payloads to detect:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Improper input validation&lt;/li&gt;
&lt;li&gt;Weak filtering mechanisms&lt;/li&gt;
&lt;li&gt;Vulnerable URL parameters
This makes it suitable for identifying application-layer vulnerabilities.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Example Scenario&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;If a URL parameter such as ?id=1 is vulnerable to SQL injection, Wapiti can detect this through automated payload testing.&lt;/p&gt;

&lt;h2&gt;
  
  
  Recommended Web Penetration Testing Workflow
&lt;/h2&gt;

&lt;p&gt;In practice, these tools are often used in a layered approach:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Nmap – Identify open ports and services&lt;/li&gt;
&lt;li&gt;WhatWeb – Determine technology stack&lt;/li&gt;
&lt;li&gt;Gobuster – Discover hidden directories&lt;/li&gt;
&lt;li&gt;Nikto – Check server-level vulnerabilities&lt;/li&gt;
&lt;li&gt;Wapiti – Scan application-level vulnerabilities&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;This structured workflow ensures comprehensive coverage across:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Network layer&lt;/li&gt;
&lt;li&gt;Server configuration layer&lt;/li&gt;
&lt;li&gt;Application logic layer&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Key Advantages of Using Free Open-Source Tools
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Cost-effective for startups and researchers&lt;/li&gt;
&lt;li&gt;Community-supported and regularly updated&lt;/li&gt;
&lt;li&gt;Flexible integration into automation pipelines&lt;/li&gt;
&lt;li&gt;Suitable for Linux-based deployment environments&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These tools can also be integrated into custom Python automation platforms, enabling centralized reporting and scalable security assessments.&lt;/p&gt;

&lt;h2&gt;
  
  
  Important Ethical Consideration
&lt;/h2&gt;

&lt;p&gt;Web penetration testing must always be conducted:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;On systems you own&lt;/li&gt;
&lt;li&gt;In authorized environments&lt;/li&gt;
&lt;li&gt;With explicit written permission&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Unauthorized scanning may violate legal regulations and ethical standards.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;Web penetration testing requires a structured and layered approach. Tools like Nmap, WhatWeb, Nikto, Gobuster, and Wapiti provide comprehensive visibility into web infrastructure, configuration weaknesses, hidden resources, and application-level vulnerabilities.&lt;/p&gt;

&lt;p&gt;Individually, each tool serves a specific purpose. Together, they form a powerful open-source toolkit for professional web security assessment.&lt;/p&gt;

&lt;p&gt;For security professionals, students, and developers, mastering these tools is a critical step toward understanding real-world attack surfaces and building secure web systems.&lt;/p&gt;

</description>
      <category>cybersecurity</category>
      <category>linux</category>
      <category>ethicalhacking</category>
      <category>webtesting</category>
    </item>
    <item>
      <title>Comparison Between Local Nmap Execution and Python Subprocess Execution</title>
      <dc:creator>Ganesh hari</dc:creator>
      <pubDate>Sun, 01 Mar 2026 05:49:09 +0000</pubDate>
      <link>https://dev.to/ganesh_hari_18/comparison-between-local-nmap-execution-and-python-subprocess-execution-pnp</link>
      <guid>https://dev.to/ganesh_hari_18/comparison-between-local-nmap-execution-and-python-subprocess-execution-pnp</guid>
      <description>&lt;h2&gt;
  
  
  Automation is becoming a core skill in cybersecurity. While tools like Nmap are powerful on their own, integrating them into programmable workflows unlocks a completely new level of flexibility and scalability.
&lt;/h2&gt;

&lt;p&gt;In this article, I compare two approaches to running Nmap:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Executing Nmap manually via Windows Command Prompt&lt;/li&gt;
&lt;li&gt;Executing Nmap programmatically using Python’s subprocess module&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The goal of this experiment is simple: understand how traditional command-line security tools can evolve into automation-ready components.&lt;/p&gt;

&lt;h2&gt;
  
  
  Objective
&lt;/h2&gt;

&lt;p&gt;The objective of this experiment was to analyze and compare the output and behavior of Nmap when executed:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Directly through the Windows Command Prompt (Manual Method)&lt;/li&gt;
&lt;li&gt;Programmatically using Python’s subprocess module (Automated Method)&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;By comparing both methods, we can better understand the benefits of automation and structured output handling.&lt;/p&gt;

&lt;h2&gt;
  
  
  Environment Details :
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Operating System: Windows 10&lt;/li&gt;
&lt;li&gt;Nmap Version: 7.97&lt;/li&gt;
&lt;li&gt;Python Version: 3.x&lt;/li&gt;
&lt;li&gt;Execution Method 1: Command Prompt (Manual)&lt;/li&gt;
&lt;li&gt;Execution Method 2: Python Script using subprocess&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Method 1: Manual Nmap Execution (Local CMD)
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;nmap www.google.com&lt;/code&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Observed Output Summary
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Host: &lt;a href="http://www.google.com" rel="noopener noreferrer"&gt;www.google.com&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;IP Address: 142.250.67.4 / 142.250.67.196&lt;/li&gt;
&lt;li&gt;Host Status: Up&lt;/li&gt;
&lt;li&gt;Latency: ~0.17 seconds&lt;/li&gt;
&lt;li&gt;Ports Scanned: 1000 default TCP ports&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Open Ports Identified&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Port    State   Service
80  Open    HTTP
443 Open    HTTPS
2222    Open    EtherNetIP
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Total Scan Time
&lt;/h2&gt;

&lt;p&gt;Approximately 25.39 seconds&lt;/p&gt;

&lt;h2&gt;
  
  
  Observations
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;997 ports were filtered (no response)&lt;/li&gt;
&lt;li&gt;Default Nmap scans the top 1000 TCP ports&lt;/li&gt;
&lt;li&gt;Output is displayed directly in the terminal&lt;/li&gt;
&lt;li&gt;The result format is plain text with no structured data&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;This method is straightforward and effective for quick, manual inspections.&lt;/p&gt;

&lt;h2&gt;
  
  
  Method 2: Python Subprocess Execution
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Approach&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;In this method, Python’s subprocess.run() was used to execute the same Nmap command programmatically.&lt;/p&gt;

&lt;h2&gt;
  
  
  Observed Output Summary
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Host: WWW.GOOGLE.COM&lt;/li&gt;
&lt;li&gt;IP Address: 142.250.67.196&lt;/li&gt;
&lt;li&gt;Host Status: Up&lt;/li&gt;
&lt;li&gt;Latency: ~0.018 seconds&lt;/li&gt;
&lt;li&gt;Ports Scanned: 1000 default TCP ports&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Open Ports Identified
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Port    State   Service
80  Open    HTTP
443 Open    HTTPS
2222    Open    EtherNetIP

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Total Scan Time
&lt;/h2&gt;

&lt;p&gt;Approximately 15.34 seconds&lt;/p&gt;

&lt;h2&gt;
  
  
  Observations :
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;996 filtered ports + 1 net-unreachable&lt;/li&gt;
&lt;li&gt;Output was captured programmatically inside Python&lt;/li&gt;
&lt;li&gt;Results can be stored, parsed, logged, or processed&lt;/li&gt;
&lt;li&gt;Enables automation and integration into larger systems
This approach transforms Nmap from a standalone tool into part of a programmable workflow.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Comparative Analysis :
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2kaw48eixivojw57p0f1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2kaw48eixivojw57p0f1.png" alt=" " width="609" height="601"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Key Differences Observed :
&lt;/h2&gt;

&lt;p&gt;Both methods produced identical open port results.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;The subprocess method allows capturing output into variables.&lt;/li&gt;
&lt;li&gt;Python execution enables structured processing.&lt;/li&gt;
&lt;li&gt;Automation significantly reduces manual effort.&lt;/li&gt;
&lt;li&gt;Subprocess execution enables integration with larger cybersecurity systems.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  The variation in scan time may be influenced by:
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Network latency differences&lt;/li&gt;
&lt;li&gt;DNS resolution timing&lt;/li&gt;
&lt;li&gt;System load during execution&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Conclusion :
&lt;/h2&gt;

&lt;p&gt;Both manual and subprocess-based executions produce equivalent scanning results when using identical Nmap commands.&lt;/p&gt;

&lt;p&gt;However, the subprocess method provides major advantages:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Automation&lt;/li&gt;
&lt;li&gt;Output handling&lt;/li&gt;
&lt;li&gt;Structured parsing&lt;/li&gt;
&lt;li&gt;Scalability&lt;/li&gt;
&lt;li&gt;Integration into security applications&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This experiment demonstrates how traditional command-line tools like Nmap can be transformed into programmable and scalable cybersecurity automation solutions using Python.&lt;/p&gt;

&lt;p&gt;Moving forward, this approach can serve as a foundation for building more advanced security tools such as automated vulnerability scanners, logging systems, or security dashboards&lt;/p&gt;

</description>
      <category>cybersecurity</category>
      <category>python</category>
    </item>
    <item>
      <title>Automating Nmap Scans Using Python: From Command Line to Structured Data</title>
      <dc:creator>Ganesh hari</dc:creator>
      <pubDate>Wed, 25 Feb 2026 10:46:54 +0000</pubDate>
      <link>https://dev.to/ganesh_hari_18/automating-nmap-scans-using-python-from-command-line-to-structured-data-2f8k</link>
      <guid>https://dev.to/ganesh_hari_18/automating-nmap-scans-using-python-from-command-line-to-structured-data-2f8k</guid>
      <description>&lt;h2&gt;
  
  
  In cybersecurity, automation is not optional — it’s essential.
&lt;/h2&gt;

&lt;p&gt;While working on a small security automation project, I wanted to bridge the gap between traditional command-line tools and programmable workflows. Nmap is one of the most powerful and widely used network scanning tools, but running it manually every time limits scalability. That’s when I decided to integrate Nmap with Python using the &lt;strong&gt;subprocess&lt;/strong&gt; module.&lt;br&gt;
This small experiment turned into a practical lesson in automation, debugging, and understanding how system-level tools interact with application-level code.&lt;/p&gt;
&lt;h2&gt;
  
  
  Why Automate Nmap?
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Nmap&lt;/strong&gt; is incredibly powerful on its own. However, when integrated with Python, it becomes part of a larger ecosystem. Automation allows us to:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Execute scans programmatically&lt;/li&gt;
&lt;li&gt;Capture and process results automatically&lt;/li&gt;
&lt;li&gt;Integrate scanning into web applications or dashboards&lt;/li&gt;
&lt;li&gt;Store scan data in databases&lt;/li&gt;
&lt;li&gt;Build security monitoring systems&lt;/li&gt;
&lt;/ol&gt;
&lt;h2&gt;
  
  
  The Core Idea
&lt;/h2&gt;

&lt;p&gt;The approach is simple in theory:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Use Python’s subprocess module to execute the Nmap command.&lt;/li&gt;
&lt;li&gt;Generate structured output (such as XML).&lt;/li&gt;
&lt;li&gt;Parse the structured data using Python.&lt;/li&gt;
&lt;li&gt;Extract useful information like:&lt;/li&gt;
&lt;/ol&gt;

&lt;ul&gt;
&lt;li&gt;Open ports&lt;/li&gt;
&lt;li&gt;Service names&lt;/li&gt;
&lt;li&gt;Port states&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
  
  
  Performance Considerations
&lt;/h2&gt;

&lt;p&gt;Another learning point was scan speed.&lt;/p&gt;

&lt;p&gt;By default, Nmap performs thorough scanning, which can take time depending on the network and target. For development or testing purposes, faster scan modes can significantly improve workflow efficiency.&lt;/p&gt;

&lt;p&gt;Understanding scan intensity versus performance is crucial, especially when building scalable automation tools.&lt;/p&gt;
&lt;h2&gt;
  
  
  What This Project Taught Me
&lt;/h2&gt;

&lt;p&gt;This simple integration reinforced several key lessons:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;System tools can be programmatically controlled with Python.&lt;/li&gt;
&lt;li&gt;Structured output formats like XML are powerful for automation.&lt;/li&gt;
&lt;li&gt;Error handling is as important as functionality.&lt;/li&gt;
&lt;li&gt;Debugging is part of the learning process.&lt;/li&gt;
&lt;li&gt;Small automation scripts can evolve into full security platforms.&lt;/li&gt;
&lt;/ol&gt;
&lt;h2&gt;
  
  
  Future Scope
&lt;/h2&gt;

&lt;p&gt;This automation can be extended further:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Building a web-based scanning interface&lt;/li&gt;
&lt;li&gt;Adding vulnerability detection logic&lt;/li&gt;
&lt;li&gt;Creating scan comparison reports&lt;/li&gt;
&lt;li&gt;Integrating with a database for historical tracking&lt;/li&gt;
&lt;li&gt;Designing a lightweight security dashboard&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
  
  
  Final Thoughts
&lt;/h2&gt;

&lt;p&gt;Cybersecurity is not just about using tools — it’s about understanding how they work and integrating them into scalable systems.&lt;br&gt;
Automating Nmap using Python is a small step, but it represents a powerful concept: transforming manual processes into intelligent workflows.&lt;br&gt;
And sometimes, the most valuable part of the project isn’t the final output — it’s the debugging journey that sharpens your engineering mindset.&lt;/p&gt;

&lt;p&gt;&lt;u&gt;&lt;strong&gt;Code :&lt;/strong&gt;&lt;/u&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import subprocess
import xml.etree.ElementTree as ET
def run_nmap_scan(target):
try:
command = ["nmap", "-F", "-oX", "scan_result.xml", target]
print("Running Nmap Scan...")
result = subprocess.run(
command,
capture_output=True,
text=True
)
if result.returncode == 0:
print("Scan Completed. Parsing Results...\n")
tree = ET.parse("scan_result.xml")
root = tree.getroot()
for host in root.findall("host"):
for port in host.findall(".//port"):
port_id = port.get("portid")
state = port.find("state").get("state")
service = port.find("service")
service_name = service.get("name") if service is not None else "Unknown"
print(f"Port: {port_id} | State: {state} | Service: {service_name}")
else:
print("Scan failed:", result.stderr)
except Exception as e:
print("Error:", e)
if __name__ == "__main__":
target_input = input("Enter Target IP or Domain: ")
run_nmap_scan(target_input)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;u&gt;&lt;strong&gt;Result :&lt;/strong&gt;&lt;/u&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F866x0j8etwlz9m7j2sf4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F866x0j8etwlz9m7j2sf4.png" alt=" " width="497" height="132"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;In this blog, I demonstrated how to automate Nmap scans using Python’s subprocess module, generate structured output, and parse the results effectively. The complete implementation, along with the working code and sample scan results, is included to provide a clear and practical understanding of the process.&lt;br&gt;
This project represents a step toward building intelligent security automation systems rather than relying solely on manual command-line execution.&lt;/p&gt;
&lt;/blockquote&gt;

</description>
      <category>python</category>
      <category>cybersecurity</category>
      <category>networking</category>
      <category>programming</category>
    </item>
    <item>
      <title>Features of Integrating Nmap with Python Using subprocess.</title>
      <dc:creator>Ganesh hari</dc:creator>
      <pubDate>Sun, 22 Feb 2026 17:12:49 +0000</pubDate>
      <link>https://dev.to/ganesh_hari_18/features-of-integrating-nmap-with-python-using-subprocess-df</link>
      <guid>https://dev.to/ganesh_hari_18/features-of-integrating-nmap-with-python-using-subprocess-df</guid>
      <description>&lt;h2&gt;
  
  
  &lt;u&gt;Features of Integrating Nmap with Python Using subprocess&lt;/u&gt;
&lt;/h2&gt;

&lt;p&gt;When building a custom network scanning tool in Python, one of the most practical approaches is integrating the Nmap engine using Python’s built-in subprocess module.&lt;br&gt;
Instead of rewriting low-level packet crafting logic, we let Nmap handle scanning while Python acts as the orchestration layer. This approach mirrors how real-world security tools are engineered: a controller layer managing a powerful scanning backend.&lt;br&gt;
In this article, we’ll look at what features you get when integrating Nmap via subprocess, and why this method is both flexible and production-ready.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;u&gt;Why Use subprocess with Nmap?
&lt;/u&gt;
&lt;/h2&gt;



&lt;p&gt;Nmap is a system-level binary application. It runs in the terminal. Python cannot directly access its internal scanning engine unless it executes it as an external process.&lt;/p&gt;

&lt;p&gt;That’s where subprocess comes in.&lt;/p&gt;

&lt;p&gt;The subprocess module allows Python to:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;- Execute external programs&lt;/li&gt;
&lt;li&gt;- Pass structured arguments&lt;/li&gt;
&lt;li&gt;- Capture output&lt;/li&gt;
&lt;li&gt;- Handle errors&lt;/li&gt;
&lt;li&gt;- Monitor execution status&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;em&gt;In simple terms, Python silently opens a system shell, runs Nmap, collects the results, and returns them to your application.&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;u&gt;Full Access to Nmap Capabilities&lt;/u&gt;
&lt;/h2&gt;

&lt;p&gt;One major advantage of using subprocess is that it does not restrict Nmap functionality.&lt;/p&gt;

&lt;p&gt;Anything you can execute in the terminal can be executed programmatically.&lt;/p&gt;

&lt;p&gt;&lt;u&gt;This includes:&lt;br&gt;
&lt;/u&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Basic port scanning
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Service and version detection (-&lt;strong&gt;sV&lt;/strong&gt;)&lt;/li&gt;
&lt;li&gt;Operating system detection (-&lt;strong&gt;O&lt;/strong&gt;)&lt;/li&gt;
&lt;li&gt;Aggressive scanning (-&lt;strong&gt;A&lt;/strong&gt;)&lt;/li&gt;
&lt;li&gt;Custom port range scanning (-&lt;strong&gt;p&lt;/strong&gt;)&lt;/li&gt;
&lt;li&gt;NSE script execution (--&lt;strong&gt;script&lt;/strong&gt;)&lt;/li&gt;
&lt;li&gt;XML output generation (-&lt;strong&gt;oX&lt;/strong&gt;)&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  &lt;u&gt;Secure Command Execution&lt;/u&gt;
&lt;/h2&gt;

&lt;p&gt;Security is critical when building scanning tools, especially web-based ones. The subprocess module allows arguments to be passed as structured lists instead of raw strings. This prevents command injection vulnerabilities.&lt;br&gt;
   For example, instead of building dynamic command strings from user input, arguments can be defined explicitly. This ensures:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Only approved scan options are executed&lt;/li&gt;
&lt;li&gt;Malicious shell injections are prevented&lt;/li&gt;
&lt;li&gt;The scanning engine cannot be misused
In real-world security applications, safe argument handling is mandatory.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;u&gt;&lt;/u&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Capturing and Processing Scan Output
&lt;/h2&gt;

&lt;p&gt;&lt;br&gt;
Another key feature of &lt;strong&gt;subprocess&lt;/strong&gt; is output capture.&lt;/p&gt;

&lt;p&gt;When Nmap finishes execution, Python can retrieve:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Standard output (scan results)&lt;/li&gt;
&lt;li&gt;Standard error (execution errors)&lt;/li&gt;
&lt;li&gt;Return codes (success or failure)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;u&gt;This allows the application to:&lt;/u&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Parse open and closed ports&lt;/li&gt;
&lt;li&gt;Extract detected services&lt;/li&gt;
&lt;li&gt;Identify service versions&lt;/li&gt;
&lt;li&gt;Process OS fingerprint results&lt;/li&gt;
&lt;li&gt;Handle invalid targets gracefully&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Process Control and Error Handling
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;subprocess&lt;/strong&gt; also provides strong execution control mechanisms.&lt;/p&gt;

&lt;p&gt;&lt;u&gt;Developers can:&lt;/u&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Wait for scan completion&lt;/li&gt;
&lt;li&gt;Check execution status codes&lt;/li&gt;
&lt;li&gt;Capture runtime errors&lt;/li&gt;
&lt;li&gt;Implement timeouts&lt;/li&gt;
&lt;li&gt;Log execution results&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Architectural Benefits
&lt;/h2&gt;

&lt;p&gt;When using &lt;strong&gt;Nmap&lt;/strong&gt; with &lt;strong&gt;subprocess&lt;/strong&gt;, the architecture becomes clean and modular:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The frontend handles user interaction.&lt;/li&gt;
&lt;li&gt;Python validates input and orchestrates execution.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;subprocess&lt;/strong&gt; executes Nmap.&lt;/li&gt;
&lt;li&gt;Nmap performs the actual network scanning.&lt;/li&gt;
&lt;li&gt;Python parses results and renders structured output.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This separation of responsibilities makes the system easier to maintain, extend, and secure.&lt;/p&gt;

&lt;h2&gt;
  
  
  Scalability and Enterprise Use
&lt;/h2&gt;

&lt;p&gt;When extended further, this integration can support:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;User authentication and role-based access&lt;/li&gt;
&lt;li&gt;Scan history storage in databases&lt;/li&gt;
&lt;li&gt;Scheduled scans&lt;/li&gt;
&lt;li&gt;Background task execution&lt;/li&gt;
&lt;li&gt;Structured reporting dashboards&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Final Thoughts
&lt;/h2&gt;

&lt;p&gt;Using Python’s subprocess module to integrate Nmap provides:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Full access to Nmap’s scanning capabilities&lt;/li&gt;
&lt;li&gt;Secure and controlled execution&lt;/li&gt;
&lt;li&gt;Structured output handling&lt;/li&gt;
&lt;li&gt;Error and process management&lt;/li&gt;
&lt;li&gt;Clean architectural separation&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;It’s a straightforward yet powerful approach that bridges scripting flexibility with enterprise-grade scanning capability.&lt;/p&gt;
&lt;/blockquote&gt;

</description>
      <category>cybersecurity</category>
      <category>python</category>
      <category>nmap</category>
      <category>networksecurity</category>
    </item>
    <item>
      <title>Building a Python-Based Network Scanning Tool with Nmap as the Backend Engine</title>
      <dc:creator>Ganesh hari</dc:creator>
      <pubDate>Wed, 11 Feb 2026 13:53:57 +0000</pubDate>
      <link>https://dev.to/ganesh_hari_18/building-a-python-based-network-scanning-tool-with-nmap-as-the-backend-engine-1bel</link>
      <guid>https://dev.to/ganesh_hari_18/building-a-python-based-network-scanning-tool-with-nmap-as-the-backend-engine-1bel</guid>
      <description>&lt;p&gt;When developing a network scanning application, one of the most efficient approaches is to use Python as the control layer and Nmap as the scanning engine. Instead of recreating packet crafting logic from scratch, we integrate Python with Nmap and build a structured interface around it.&lt;br&gt;
This architecture mirrors how many internal corporate security tools operate. The application layer handles user interaction and processing, while the scanning engine performs the actual network probing.&lt;br&gt;
In this article, we will walk through the complete technical workflow — from frontend input to backend execution and back to result presentation.&lt;br&gt;
Architecture Overview&lt;br&gt;
In this design:&lt;br&gt;
The frontend collects user input (GUI or Web interface).&lt;br&gt;
The Python application layer processes and validates the input.&lt;br&gt;
The Nmap binary executes the scan at the system level.&lt;br&gt;
Results are returned to Python, parsed, structured, and displayed.&lt;br&gt;
The data flow looks like this:&lt;br&gt;
Copy code&lt;/p&gt;

&lt;p&gt;User Interface&lt;br&gt;
        ↓&lt;br&gt;
Python Controller Layer&lt;br&gt;
        ↓&lt;br&gt;
Nmap Engine (System Binary)&lt;br&gt;
        ↓&lt;br&gt;
Target Host&lt;br&gt;
        ↓&lt;br&gt;
Scan Results&lt;br&gt;
        ↓&lt;br&gt;
Python Parsing Layer&lt;br&gt;
        ↓&lt;br&gt;
Frontend Display&lt;br&gt;
Python acts as the orchestrator. Nmap performs the actual scanning.&lt;br&gt;
Step 1: Collecting Input from the Frontend&lt;br&gt;
The process begins when the user submits scanning parameters such as:&lt;br&gt;
Target IP address or domain&lt;br&gt;
Port range&lt;br&gt;
Scan type (e.g., SYN scan, service detection, OS detection)&lt;br&gt;
If you are building a GUI application using Tkinter or PyQt, input is retrieved from form components. If you are building a web-based application using Flask or FastAPI, input arrives through HTTP requests.&lt;br&gt;
Before proceeding, Python must validate:&lt;br&gt;
IP/domain format&lt;br&gt;
Allowed port ranges&lt;br&gt;
Permitted scan options&lt;br&gt;
Potential injection patterns&lt;br&gt;
Input validation is critical, especially in web-based scanning applications.&lt;br&gt;
Step 2: Executing Nmap from Python&lt;br&gt;
Once input is validated, Python communicates with Nmap.&lt;br&gt;
There are two common approaches.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Using the subprocess Module
Python can execute system-level commands using the subprocess module. Instead of passing raw command strings, arguments should be passed as a list to prevent command injection.
Workflow:
Python builds command arguments safely.
The operating system runs the Nmap binary.
Standard output is captured.
Results are returned to Python.
This method provides direct control over execution.&lt;/li&gt;
&lt;li&gt;Using the python-nmap Library
The python-nmap library is a wrapper around Nmap. It internally executes Nmap and returns structured Python dictionaries instead of raw text output.
This simplifies result handling and reduces manual parsing.
Step 3: What Nmap Does Internally
Once triggered, Nmap performs independent network operations.
The internal scanning process typically includes:
Host discovery (ICMP, ARP, TCP probes)
Port scanning (SYN, TCP connect, UDP)
Service and version detection
Operating system fingerprinting (optional)
NSE script execution (optional)
Nmap sends crafted packets to the target and analyzes the responses. Based on packet behavior, it determines whether ports are:
Open
Closed
Filtered
After the scan completes, Nmap generates output in text, XML, or structured formats.
Step 4: Parsing and Structuring the Output
Once Nmap finishes execution, Python receives the results.
If using subprocess:
Output arrives as raw text.
Python must parse it manually.
If using XML output (-oX option):
Python parses structured XML data.
This method is more reliable and scalable.
If using python-nmap:
Output is already structured as dictionaries.
You can directly access host, port, and service information.
At this stage, Python extracts:
Host status
Open ports
Protocol type
Service names
Version details
OS detection results
The data is converted into structured formats such as JSON or dictionaries for frontend rendering.
Step 5: Returning Results to the Frontend
After processing, Python passes the structured data back to the frontend.
For GUI applications:
Results are displayed in tables or text panels.
For web applications:
Data is returned as JSON.
Templates render the information dynamically.
The user sees:
Target reachability
Open ports
Running services
Service versions
OS details (if enabled)
The scan cycle is now complete.
End-to-End Workflow Summary
The full workflow can be summarized as:
User submits scan request.
Python validates and sanitizes input.
Python constructs secure Nmap command.
Nmap executes the scan.
Nmap probes the network target.
Nmap generates output.
Python parses and structures results.
Frontend displays formatted scan data.
This separation of responsibilities ensures clean architecture and maintainability.
Security Considerations
When building a scanning tool, security must be prioritized.
Key measures include:
Strict input validation
Avoiding raw command execution
Restricting advanced Nmap flags
Implementing authentication and authorization
Logging scan activities
Limiting target scope
Without these controls, the application could be misused or exploited.
How This Relates to Enterprise Systems
Enterprise vulnerability management platforms follow the same core principle:
A controller layer schedules scans.
A scanning engine performs network probing.
Results are stored in centralized databases.
Dashboards present structured risk analysis.
Although enterprise platforms add automation, compliance reporting, and risk scoring, the fundamental concept remains similar to integrating Python with Nmap.
Understanding this workflow provides a solid foundation for building professional-grade cybersecurity tools.
Conclusion
Integrating Python with Nmap allows developers to build structured, scalable network scanning applications without reimplementing low-level network logic.
Python handles:
User interaction
Validation
Command execution
Output parsing
Result presentation
Nmap handles:
Packet crafting
Port scanning
Service detection
OS fingerprinting
This clear separation of responsibilities reflects real-world security tool design and provides practical experience in building industry-relevant cybersecurity applications.
#CyberSecurity #Python #Nmap #NetworkSecurity #RedTeam #DevCommunity #ApplicationSecurity #SecurityEngineering&lt;/li&gt;
&lt;/ol&gt;

</description>
      <category>security</category>
      <category>python</category>
      <category>cybersecurity</category>
      <category>development</category>
    </item>
    <item>
      <title>How Companies Scan Their Own Networks: A Practical Red Team View with Nmap</title>
      <dc:creator>Ganesh hari</dc:creator>
      <pubDate>Tue, 10 Feb 2026 13:59:25 +0000</pubDate>
      <link>https://dev.to/ganesh_hari_18/how-companies-scan-their-own-networks-a-practical-red-team-view-with-nmap-58el</link>
      <guid>https://dev.to/ganesh_hari_18/how-companies-scan-their-own-networks-a-practical-red-team-view-with-nmap-58el</guid>
      <description>&lt;p&gt;In modern corporate environments, internal red teams rely on structured and controlled security scanning processes to assess the exposure of their own websites and infrastructure. Unlike public online scanning tools, organizations deploy enterprise-grade solutions that operate within internal networks, VPNs, and segmented environments to ensure confidentiality, accuracy, and compliance. The primary objective of internal scanning is to identify open ports, detect running services, discover misconfigurations, and reduce the overall attack surface while meeting regulatory requirements such as ISO 27001, PCI-DSS, and SOC compliance.&lt;/p&gt;

&lt;p&gt;Industry-standard tools commonly used by corporate internal security teams include Nmap, Nessus, Qualys VMDR, Rapid7 InsightVM, and OpenVAS/Greenbone. Among these, Nmap serves as the foundational discovery and port scanning engine. It is widely utilized across internal networks, DMZ zones, and cloud infrastructures for host discovery and service enumeration. Enterprise platforms such as Nessus and Qualys extend this capability by correlating port scanning results with vulnerability databases, performing authenticated scans, and generating compliance-focused reports. Rapid7 InsightVM enhances visibility through risk prioritization and integration with security operation centers, while OpenVAS provides an open-source alternative suitable for on-premise deployments and mid-scale organizational environments. Supporting tools like Burp Suite, Lynis, and Metasploit are often used alongside scanning tools to perform application testing, system hardening assessments, and controlled exploitation validation.&lt;/p&gt;

&lt;p&gt;Nmap operates through a structured workflow that begins with user-defined target input, including IP addresses, domain names, port ranges, and scan techniques. The first stage involves host discovery, where the tool verifies whether a system is active using ICMP requests, ARP scanning within local networks, or TCP probe techniques. Once a host is confirmed as active, the port scanning engine sends crafted packets to targeted ports and analyzes the responses to determine whether ports are open, closed, or filtered by firewalls or intrusion prevention systems. For ports identified as open, Nmap performs service and version detection by sending protocol-specific probes and matching the responses against an extensive service signature database. Optionally, Nmap attempts operating system fingerprinting by analyzing TCP/IP stack characteristics such as time-to-live values, TCP window sizes, and packet response patterns. The final stage involves generating output in structured formats such as text, XML, or JSON, enabling integration with dashboards, automation scripts, vulnerability management platforms, and reporting systems.&lt;/p&gt;

&lt;p&gt;Despite the evolution of enterprise vulnerability management solutions, the fundamental methodology remains rooted in the principles established by Nmap. Modern security platforms build upon these principles by adding automation, risk scoring, compliance mapping, and centralized monitoring. Understanding how Nmap performs host discovery, port scanning, and service fingerprinting provides essential insight into how real-world corporate security scanning operates and why it continues to remain a cornerstone of cybersecurity assessment strategies.&lt;/p&gt;

&lt;h1&gt;
  
  
  CyberSecurity #Nmap #RedTeam #NetworkSecurity #VulnerabilityManagement #DevCommunity #InformationSecurity #EthicalHacking #SecurityTools #PythonProjects #ApplicationSecurity
&lt;/h1&gt;

</description>
      <category>cybersecurity</category>
      <category>infosec</category>
      <category>networking</category>
      <category>security</category>
    </item>
    <item>
      <title>What This Blog Is About</title>
      <dc:creator>Ganesh hari</dc:creator>
      <pubDate>Mon, 09 Feb 2026 06:40:07 +0000</pubDate>
      <link>https://dev.to/ganesh_hari_18/what-this-blog-is-about-5d65</link>
      <guid>https://dev.to/ganesh_hari_18/what-this-blog-is-about-5d65</guid>
      <description>&lt;p&gt;Welcome to my tech vlog. I share my daily routine, work in networking and development, project updates, and code notes. This space also includes tech news and personal observations from what I see, learn, and build in public.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>programming</category>
      <category>security</category>
      <category>cybersecurity</category>
    </item>
  </channel>
</rss>
