FofaMap v2.0 是一款基于 Python3 开发的全网首个 AI 驱动红队资产测绘智能体。在延续原有 FOFA 数据采集、存活检测、统计聚合、图标 Hash 及批量查询等核心功能的基础上,2.0 版本原生支持 MCP 协议,可无缝接入 Cursor、Claude 等 AI 平台。其核心内置了 AI 自我反思机制,能根据查询结果自动调优语法,并智能联动 Nuclei 推荐精准扫描策略,实现从“被动采集”到“主动智能决策”的红队作业进化。
$git clone https://github.com/asaotomo/fofamapInstalls into the current project.
Install fofamap by running `git clone https://github.com/asaotomo/fofamap`, then use it for the current task and follow its documentation at https://github.com/asaotomo/fofamap.
| 1 | **FofaMap_V1.0.1** |
| 2 | |
| 3 |  |
| 4 | |
| 5 | **FofaMap是一款基于Python3开发的跨平台FOFA数据采集器。用户可以通过修改配置文件,定制化的采集FOFA数据,并导出生成对应的Excel表格。** |
| 6 | |
| 7 | **一.安装说明** |
| 8 | |
| 9 | 1.工具使用**Python3**开发,请确保您的电脑上已经安装了**Python3**环境。 |
| 10 | |
| 11 | 2.首次使用请使用 **python3 -m pip install -r requirements.txt** 命令,来安装必要的外部依赖包。 |
| 12 | |
| 13 | 3.**fofa.ini**为Fofamap的配置文件,可以通过修改配置文件内容来定制化采集FOFA数据。 |
| 14 | |
| 15 | 4.在使用该工具前,请先填写用户信息**[userinfo]**中的**email**和**key**,**fofa.ini**配置文件说明如下: |
| 16 | |
| 17 | ``` |
| 18 | [userinfo]#用户信息 |
| 19 | #注册和登录时填写的email |
| 20 | email = xxxxx@qq.com |
| 21 | #会员到个人资料可得到key,为32位的hash值 |
| 22 | key = 001xxxxxxxxxxxxxxxxxxxxx8b2dc5 |
| 23 | |
| 24 | [fields]#查询内容选项 |
| 25 | #默认查询内容为:ip、端口、网站标题、国家和城市 |
| 26 | fields = ip,port,title,country,city |
| 27 | |
| 28 | #fields可选项有:['host', 'title', 'ip', 'domain', 'port', 'country', 'province', 'city', 'country_name', 'header', 'server', 'protocol', 'banner', 'cert', 'isp', 'as_number', 'as_organization', 'latitude', 'longitude', 'structinfo','icp', 'fid', 'cname'] |
| 29 | |
| 30 | |
| 31 | [page]#查询页数 |
| 32 | #查询启始页数 |
| 33 | start_page = 1 |
| 34 | #查询结束页数 |
| 35 | end_page = 2 |
| 36 | ``` |
| 37 | |
| 38 | 5.不同用户使用**Fofamap**调用FOFA全网资产收集与检索系统API查询次数如下: |
| 39 | |
| 40 | 企业会员 免费前100,000条/次 |
| 41 | |
| 42 | 高级会员 免费前10000条/次 |
| 43 | |
| 44 | 普通会员 免费前100条/次 |
| 45 | |
| 46 | 注册用户 1F币(最多10,000条)/次 |
| 47 | |
| 48 | 用户可以根据自己的账号类型设置对应的查询页数。 |
| 49 | |
| 50 | 6.项目文件结构: |
| 51 | |
| 52 | ``` |
| 53 | ├── README.md ##使用说明 |
| 54 | ├── fofa.ini ##fofa配置文件 |
| 55 | ├── fofa.py ##fofa api调用类 |
| 56 | ├── fofamap.py ##fofamap主程序 |
| 57 | └── requirements.txt ##依赖包要求 |
| 58 | ``` |
| 59 | |
| 60 | **二.使用方法** |
| 61 | |
| 62 | **1.-q 使用FOFA查询语句查询数据** |
| 63 | |
| 64 | **关于命令说明:** |
| 65 | |
| 66 | 如果用户想要使用fofa联合查询语句,例如:app="grafana" && country="US"。 |
| 67 | |
| 68 | Linux和macOS用户直接使用python3 fofamap.py -q 'app="grafana" && country="US"'即可成功查询。 |
| 69 | |
| 70 | Windows用户因为系统原因,需要使用python3 fofamap.py -q "app=\\"grafana\\" && country=\\"US\\""系统才可成功识别,即Windows用户需要对查询命令内部的"使用\进行转义,否则系统识别错误。 |
| 71 | |
| 72 | ``` |
| 73 | $ python3 fofamap.py -q 'title="Apache APISIX Dashboard"' |
| 74 | ``` |
| 75 | <img width="1007" alt="image" src="https://user-images.githubusercontent.com/67818638/149065065-205e1f0f-35e1-4c65-a80b-1c632f1f0f58.png"> |
| 76 | |
| 77 | |
| 78 | |
| 79 | **2.-o 自定义输出文件名[默认为fofa.xlsx]** |
| 80 | |
| 81 | ``` |
| 82 | $ python3 fofamap.py -q 'title="Apache APISIX Dashboard"' -o 结果.xlsx |
| 83 | ``` |
| 84 | <img width="1073" alt="image" src="https://user-images.githubusercontent.com/67818638/149065219-ebaf0649-c756-44d9-a61e-c2b3414311b2.png"> |
| 85 | |
| 86 | |
| 87 | **输出的结果.xlsx内容如下:** |
| 88 | |
| 89 | <img width="1088" alt="image" src="https://user-images.githubusercontent.com/67818638/149065268-d7306a51-10f0-4df8-b132-94012e07d73d.png"> |
| 90 | |
| 91 | |
| 92 | |
| 93 | |
| 94 | **3.-s 输出扫描格式** |
| 95 | |
| 96 | 使用输出扫描格式功能时,系统只会获取目标ip地址和端口号两个字段,并自动做去重处理,输出结果同时会自动保存为txt文件,方便大家导出到扫描器进行扫描。 |
| 97 | |
| 98 | ``` |
| 99 | $ python3 fofamap.py -q 'title="Apache APISIX Dashboard"' -s |
| 100 | ``` |
| 101 | <img width="1147" alt="image" src="https://user-images.githubusercontent.com/67818638/149065853-aa8a6739-0cce-489a-a081-e3862c8f8eea.png"> |
| 102 | |
| 103 | |
| 104 | |
| 105 | |
| 106 | **4.通过修改配置文件,控制输出内容** |
| 107 | |
| 108 | 我们可以通过修改**fofa.ini**配置文件中的fields值来控制工具输出的顺序与字段。 |
| 109 | 例如:我们将**fields = ip,port,title,country,city**改为**fields = protocol,ip,port,title,icp**。 |
| 110 | <img width="989" alt="image" src="https://user-images.githubusercontent.com/67818638/149067409-df7ca188-c06b-4ef3-89a3-95f8460a7aef.png"> |
| 111 | |
| 112 | 接着执行以下命令 |
| 113 | |
| 114 | ``` |
| 115 | $ python3 fofamap.py -q 'app="discuz"' |
| 116 | ``` |
| 117 | 输出内容就会变为协议、IP地址、端口、网站标题、ICP备案号。 |
| 118 | <img width="1126" alt="image" src="https://user-images.githubusercontent.com/67818638/149067474-acfdfa54-d55a-4350-b531-607d41584b0e.png"> |
| 119 | |
| 120 | |
| 121 | |
| 122 | |
| 123 | |
| 124 | **************************** |
| 125 | |
| 126 | **本工具仅提供给安全测试人员进行安全自查使用** |
| 127 | **用户滥用造成的一切后果与作者无关** |
| 128 | **使用者请务必遵守当地法律** |
| 129 | **本程序不得用于商业用途,仅限学习交流** |
| 130 | |
| 131 | ********* |
| 132 | |
| 133 | **FofaMap由Hx0战队开发维护** |
| 134 | |
| 135 | <img width="318" alt="image" src="https://user-images.githubusercontent.com/67818638/147641794-82f32969-4214-48da-9df2-764318225589.png"> |
| 136 | |
| 137 | --- |
| 138 | |
| 139 | **更新日志 1.0.1** |
| 140 | |
| 141 | [+] 优化代码逻辑,修复已经BUG。 |
| 142 | |
| 143 | [+] 优化输出样式,命令行输出结果将以表格形式展示。 |
| 144 | |
| 145 | [+] 扫描模式输出结果将自动进行去重处理,并会自动将结果保存为txt文档。 |