FofaMap v2.0: AI Self-Reflection + MCP Protocol-Driven Red Team Asset Mapping Agent

FofaMap v2.0 is an AI-driven red team asset mapping agent with self-reflection and MCP protocol support.
FofaMap v2.0 is an open-source red team asset mapping tool built on Python3. Its core innovation is an AI self-reflection mechanism that automatically evaluates query results and iteratively optimizes FOFA search syntax. It natively supports MCP protocol for integration with AI platforms like Claude, enabling natural language-driven operations, and intelligently integrates with Nuclei vulnerability scanner to complete the workflow from asset discovery to vulnerability verification — marking a paradigm shift from passive collection to proactive intelligent decision-making.
Overview
FofaMap v2.0 is an AI-driven red team asset mapping agent built on Python3, open-sourced on GitHub by developer asaotomo. As a major version upgrade, v2.0 retains all core functionality while introducing an AI self-reflection mechanism and MCP protocol support, marking a paradigm shift in red team asset mapping tools from "passive collection" to "proactive intelligent decision-making."
A Red Team is a specialized group in cybersecurity that simulates real-world attackers, with the core mission of testing an organization's security defenses through simulated attacks. Asset mapping is the first and most critical step in red team operations — before launching any attack, the red team needs a comprehensive understanding of all assets the target organization exposes on the internet, including servers, domains, IP addresses, open ports, web applications, API endpoints, and more. This process is known in the security industry as "Attack Surface Discovery." Traditional asset mapping is heavily dependent on manual expertise, requiring security professionals to master query syntax for various search engines and continuously adjust strategies based on results — a time-consuming process that demands high operator skill levels. FofaMap v2.0 was created to break through this bottleneck with AI capabilities.
The project has currently earned 657 Stars on GitHub with 85 Forks, attracting widespread attention in the red team tool ecosystem.

Core Feature Analysis
Continuation and Strengthening of Traditional Asset Mapping
FofaMap's foundational capabilities stem from its deep integration with the FOFA search engine. FOFA (Fingerprinting Organizations with Advanced Tools) is a cyberspace asset search engine developed by Huashun Xin'an, competing in the same space as international products like Shodan, Censys, and ZoomEye. These search engines continuously scan global internet space, probing all reachable IP addresses and ports to collect service fingerprints, certificate information, HTTP response headers, webpage content, and other data, building indexes for user queries. FOFA has its own query syntax system (operators like domain=, host=, title=, body=, etc.), supports Boolean logic combinations, and enables highly granular asset filtering. Its data covers billions of asset nodes globally, making it one of the most widely used cyberspace mapping platforms among Chinese security researchers.
Building on this foundation, FofaMap provides the following core capabilities:
- FOFA Data Collection: Automated FOFA API calls for bulk target asset information retrieval
- Liveness Detection: Real-time validation of collected assets' availability status, filtering out invalid targets
- Statistical Aggregation: Multi-dimensional statistical analysis of asset data, helping security professionals quickly grasp the target attack surface
- Icon Hash Queries: Asset correlation discovery through website favicon hash values — a fingerprinting technique commonly used in red team reconnaissance. A favicon is the small icon displayed in browser tabs. Multiple instances deployed by the same organization or the same system often share identical favicons. By calculating the favicon file's hash value (typically using the MurmurHash3 algorithm), one can search for all assets with the same hash value in search engines like FOFA, thereby discovering hidden assets, associated infrastructure, or even identifying deployment instances of specific commercial products or open-source frameworks. For example, if an enterprise's internal management system uses a custom favicon, its hash value could reveal all similar system instances deployed by that enterprise worldwide — offering extremely high tactical value in red team reconnaissance.
- Batch Queries: Support for parallel query processing of large-scale targets, improving operational efficiency
These capabilities form FofaMap's foundation as an asset mapping tool and the basis for its recognition in the security community.
AI Self-Reflection Mechanism: From Manual Queries to Intelligent Optimization
The most groundbreaking feature of version 2.0 is its built-in AI Self-Reflection mechanism. Self-reflection is an important design pattern in large language model (LLM) applications, first systematically articulated in academia by Shinn et al. in their 2023 Reflexion framework. The core idea is to have the AI critically evaluate its own output after completing a task, identify shortcomings, and then generate improvement plans for re-execution based on the evaluation. This is similar to human "metacognition" — not just completing the task, but thinking about "how well did I do" and "how can I do better."
Traditional asset mapping tools rely on users manually writing and adjusting FOFA query syntax, which demands considerable experience and skill. FofaMap v2.0 fundamentally changes this paradigm:
After a user initiates a query, the AI automatically analyzes the quality and relevance of returned results. If results aren't precise enough or lack sufficient coverage, the system automatically optimizes the FOFA query syntax, iteratively refining the search strategy. In FofaMap's specific implementation, the AI analyzes multiple quality indicators of returned data (such as result count, relevance, asset type distribution, etc.) to determine whether the query scope needs narrowing or expanding, or whether filter conditions should be added or modified, achieving multi-round iterative optimization. This "query-evaluate-optimize" closed-loop mechanism essentially simulates the thought process of experienced red team operators during actual operations, dramatically lowering the tool's usage barrier.
For example, when searching for a specific type of asset, the traditional approach requires repeatedly modifying query conditions manually. FofaMap v2.0's AI reflection mechanism automatically determines "whether these results meet expectations" and autonomously iterates the query strategy when conditions aren't met, until high-quality asset data is obtained.
Intelligent Integration with Nuclei Vulnerability Scanning
Another noteworthy capability is FofaMap v2.0's intelligent integration with the Nuclei vulnerability scanner. Nuclei is an open-source vulnerability scanning framework developed by the ProjectDiscovery team, renowned for its YAML template-based vulnerability detection mechanism. Unlike traditional vulnerability scanners (such as Nessus or OpenVAS), Nuclei adopts a highly modular design — each vulnerability detection logic is encapsulated as an independent YAML template file, allowing the community to easily contribute and share detection templates. To date, Nuclei's official template repository (nuclei-templates) contains over 8,000 detection templates covering CVE vulnerabilities, default credentials, misconfigurations, information disclosure, and more. Nuclei scans at extremely high speed with support for massive concurrency, making it one of the most commonly used scanning tools for red teams and bug bounty hunters.
After FofaMap completes asset discovery, the AI intelligently recommends the most appropriate Nuclei scanning templates and strategies based on target asset characteristics (such as service type, technology stack, version information, etc.). Nuclei's template-based architecture allows the AI to intelligently select the most relevant template subsets based on target asset features, avoiding the efficiency waste and noise interference of blind full-scale scanning. This means the entire red team workflow — from asset discovery to vulnerability verification — is connected into an automated intelligent workflow, rather than fragmented independent steps.
MCP Protocol: The Key Bridge to the AI Ecosystem
What is MCP Protocol
MCP (Model Context Protocol) is an open protocol officially released by Anthropic in late 2024, designed to standardize interactions between AI models and external tools. Its architecture adopts the classic client-server model, built on the JSON-RPC 2.0 communication protocol: AI applications (such as Claude Desktop, Cursor IDE) serve as MCP clients, while external tools (like FofaMap) serve as MCP servers. The protocol defines three core primitives — Tools (tool invocation), Resources (resource access), and Prompts (prompt templates) — enabling AI models to discover, understand, and invoke external tool capabilities in a standardized manner.
Think of MCP as "the USB port of the AI world" — it allows different tools to be invoked by AI in a unified way. MCP solves the previous N×M problem in AI tool integration where "every tool requires custom adaptation," simplifying it to standardized N+M connectivity. Currently, the MCP ecosystem is expanding rapidly, with mainstream services like GitHub, Slack, PostgreSQL, and Brave Search all releasing official MCP servers, while MCP adoption in the security tools space is also accelerating.
FofaMap's MCP Integration in Practice
FofaMap v2.0 natively supports the MCP protocol, meaning it can seamlessly connect to AI platforms that support MCP, such as Cursor and Claude. Security researchers can directly describe their asset mapping needs in natural language through the AI conversation interface, and the AI assistant will automatically invoke FofaMap's various capabilities to complete the task.
For example, a user can directly tell Claude: "Help me find assets in China using the Apache Struts2 framework, and detect potential remote code execution vulnerabilities." The AI will automatically handle FOFA syntax construction, data collection, liveness detection, Nuclei scanning strategy recommendations, and other operations.
This interaction model elevates the red team tool user experience to a new level and represents an important direction for the fusion of security tools with AI.
Industry Significance and Future Outlook
The release of FofaMap v2.0 reflects several important trends in the cybersecurity tools space:
First, AI Agent-ification is becoming the mainstream evolution direction for security tools. An AI Agent refers to an AI system capable of autonomously perceiving its environment, formulating plans, executing actions, and adjusting strategies based on feedback. In cybersecurity, AI Agent evolution has progressed through several stages: initially simple rule-based automation (such as SOAR platform playbook orchestration), then machine learning-based anomaly detection (such as UEBA user behavior analytics), and now autonomous decision-making agents based on large language models. Between 2024-2025, AI Agents in the security domain have seen explosive growth — from automated penetration testing on the offensive side (such as PentestGPT) to automated incident response on the defensive side. AI Agents are reshaping every aspect of security operations. Traditional security tools emphasized feature richness and performance, while next-generation tools are beginning to emphasize intelligent decision-making capabilities. AI is no longer just an auxiliary feature — it's becoming the core driving force of the tool.
Second, the MCP protocol is becoming a new standard for security tool integration. As more tools support MCP, security professionals can orchestrate complex security workflows through a unified AI interface, significantly improving operational efficiency for both red and blue teams.
Third, self-reflection mechanisms herald the arrival of autonomous security agents. When tools can autonomously evaluate result quality and optimize strategies, we're one step closer to fully autonomous security AI Agents. The "asset mapping agent" represented by FofaMap v2.0 is a concrete implementation of this trend in the attack surface discovery domain. Its self-reflection mechanism provides preliminary autonomous decision-making capability, rather than simple instruction execution.
Of course, the development of such tools also comes with ethical and compliance considerations. AI-driven automated attack capabilities lower the barrier to attacks, and the security community needs to find a balance between tool development and responsible use.
Conclusion
By integrating AI self-reflection, MCP protocol support, and intelligent Nuclei integration into a traditional asset mapping tool, FofaMap v2.0 achieves a leap in red team operations from manual operation to intelligent decision-making. For security practitioners, this isn't just a tool upgrade — it's a paradigm shift in how work is done, from "humans driving tools" to "AI driving tools, humans supervising decisions."
If you're looking for a red team asset mapping tool that can lower the FOFA query barrier, automatically optimize search strategies, and seamlessly integrate with mainstream AI platforms, FofaMap v2.0 is worth exploring in depth.
Key Takeaways
- FofaMap v2.0 features a built-in AI self-reflection mechanism that automatically optimizes FOFA search syntax based on query results, simulating the iterative optimization mindset of experienced red team operators
- Native MCP protocol support enables seamless integration with AI platforms like Cursor and Claude, enabling natural language-driven asset mapping operations
- Intelligent integration with the Nuclei vulnerability scanner automatically recommends precise scanning strategies based on asset characteristics, completing the workflow from asset discovery to vulnerability verification
- Marks a paradigm shift in security tools from passive collection to proactive intelligent decision-making, with AI Agent-ification becoming a key evolution direction for security tools
- Built on Python3 and earning 657 Stars on GitHub, the project commands significant attention in the red team tool ecosystem
Related articles
Product ReviewsThe Programmer's Desk Setup Guide: Building a Workspace That Feels Like Home
Discover how programmers build productive, comfortable workspaces. From multi-monitor setups to ergonomic design, explore the desk philosophy that drives focus and flow.
Product ReviewsQoder vs Cursor Real-World Comparison: Which $20/Month AI IDE Is Better?
Hands-on comparison of Qoder vs Cursor AI IDEs: Agent autonomy, human interaction count, and architecture decisions. Qoder needed only 2 interactions vs Cursor's 8.
Product ReviewsCursor Cloud Agent Demo: Eliminating Bottlenecks Across the Entire Software Development Lifecycle
Deep analysis of Cursor's Cloud Agent demo showing how cloud VMs, automated test artifacts, and a full-chain control plane systematically eliminate human bottlenecks across the software development lifecycle.