侦查守卫(ObserverWard)的指纹库
郑重声明:文中所涉及的技术、思路和工具仅供以安全为目的的学习交流使用,任何人不得将其用于非法用途以及盈利等目的,否则后果自行承担。
| 类别 | 说明 |
|---|---|
| 作者 | 三米前有蕉皮 |
| 团队 | 0x727 未来一段时间将陆续开源工具 |
| 定位 | 社区化指纹库,让管理和使用指纹规则更加简单。 |
| 语言 | Yaml |
| 功能 | 可自定义请求,使用github actions 自动更新指纹库。 |
…
id: thinkphp
info:
name: thinkphp
author: cn-kali-team
tags: detect,tech,thinkphp
severity: info
metadata:
product: thinkphp
vendor: thinkphp
verified: true
| 字段 | 数据类型 | 描述 |
|---|---|---|
| id | String | 规则ID,命中指纹会在终端打印该字段,不支持中文 |
| name | String | 规则名称,一般和id一样,或者是它众所周知的别名,支持中文 |
| author | String | 作者列表,一个以逗号隔开的字符串列表 |
| tags | String | 标签列表,一个以逗号隔开的字符串列表 |
| severity | Enum | 严重程度:unknown,info,low,medium,high,critical |
| metadata | HashMap<String,String> | 元数据,一个字典,可以存放任意类型数据 |
| description | Option<String> | (可选)描述 |
| reference | Option<Vec<String>> | (可选)引用参考链接 |
其中的metadata内置有意义的字段
vendor,产品信息product和是否已经经过验证verified,作用:关联nuclei漏洞验证插件info中的metadata十分重要,它是指纹和漏洞关联的依据。要明白如何进行漏洞关联首先要了解什么是CPE:
Common Platform Enumeration (CPE) 是由MITRE公司开发的一种标准化格式,用于表示网络设备、软件应用和其他IT资产的身份。在国家漏洞数据库(National Vulnerability Database, NVD)中,CPE用于精确描述每个漏洞影响的具体产品和版本。
CPE命名规范包括以下部分:
核心部分:cpe:/a:vendor:product:version:update:edition:language:sw_edition:target_sw:target_hw:other
a: 表示应用程序(application)
vendor 是供应商或制造商的名字
product 是产品的名称
version 是主要版本号
update 是次要版本号或更新版本
edition 是特定版本(如企业版、标准版等)
language 是语言环境
sw_edition 是软件版本(如专业版、家庭版等)
target_sw 是目标操作系统或其他软件平台
target_hw 是目标硬件平台
other 是其他任何相关的信息
通配符:如果某项未知或不重要,可以使用通配符*代替具体值。
例如,一个CPE字符串可能如下所示:cpe:/a:microsoft:windows_10:1903
NVD中的每个漏洞记录都包含受影响的CPE列表,帮助用户确定其系统是否受到特定漏洞的影响。这使得组织能够更准确地评估风险并采取相应的缓解措施。
例如:CVE-2016-4437这个漏洞
可以看到受到影响的产品为cpe:2.3:a:apache:shiro:*:*:*:*:*:*:*:*,对这个cpe进行解析后得到类型为应用,厂商为apache
,产品为shiro,就可以编写以下规则:
id: shiro
info:
name: shiro
author: cn-kali-team
tags: detect,tech,shiro
severity: info
metadata:
product: shiro
vendor: apache
verified: true
info中的metadatacpe信息就可以反向查询到CVE-2016-4437
和其他关联了这个cpe的漏洞probe,在nuclei称request,但是我更喜欢probe探针http和tcp两种http:
- method: GET
path:
- '{{BaseURL}}/'
headers:
Cookie: rememberMe=admin;rememberMe-K=admin
- method: GET
path:
- '{{BaseURL}}/'
- '{{BaseURL}}/nacos/'
| 字段 | 数据类型 | 描述 |
|---|---|---|
| method | Enum | http请求方式:OPTIONS,GET,POST,PUT,DELETE,HEAD,TRACE,CONNECT,PATCH |
| path | Vec<String> | 路径列表,一般只为{{BaseURL}}/,代表首页请求,不建议填写特殊路径,除非首页没有任何特征 |
| headers | Option<HashMap<String,String>> | (可选)请求头,一个键值对 |
| body | Option<String> | (可选)请求体 |
tcp:
- name: "null"
inputs:
- data: ""
read: 16
host:
- "{{Hostname}}"
| 字段 | 数据类型 | 描述 |
|---|---|---|
| name | Option<String> | 探针名称,对应nmap中的probe_name |
| inputs.data | String | 写入数据,会自动反转义,例如:HTTP/1.0\r\n\r\n |
| inputs.read | Option<usize> | (可选)读取多少数据长度,默认读取完全部,最多不超过2048字节 |
| host | Option<String> | (可选)主机 |
matchers:
- type: favicon
hash:
- f49c4a4bde1eec6c0b80c2277c76e3db
- type: word
words:
- href="http://www.thinkphp.cn">thinkphp</a>
- thinkphp_show_page_trace
case-insensitive: true
- type: word
words:
- 'x-powered-by: thinkphp'
part: header
case-insensitive: true
| 字段 | 数据类型 | 描述 |
|---|---|---|
| name | Option<String> | 匹配名称,如果不为空并且匹配到结果会返回 |
| type | Enum | 匹配类型:word,favicon,regex |
| part | Enum | 匹配位置:header,body,默认:body |
| favicon.hash | Vec<String> | 如果是favicon类型:hash为图标hash列表,支持md5和mmh3 |
| word.words | Vec<String> | 关键词 |
| case-insensitive | bool | 是否忽略大小写,默认为false |
| negative | bool | 是否将匹配结果取反,默认为false |
| condition | Enum | 匹配关系:or,and,当为or时匹配到就立即返回,为and时要全部匹配到才返回结果,默认为or |
<title>httpbin.org</title>关键词,并且忽略大小写matchers:
- type: word
words:
- <title>httpbin.org</title>
case-insensitive: true
matchers:
- type: word
words:
- /manager/html
- /manager/status
condition: and
matchers:
- type: favicon
hash:
- 4644f2d45601037b8423d45e13194c93
- 其他哈希,支持md5和mmh3
id: ssh
info:
name: OpenSSH
author: cn-kali-team
tags: detect,tech,ssh,service
severity: info
metadata:
info: protocol $1
version: $2
tcp:
- name: "null"
inputs:
- data: ""
host:
- "{{Hostname}}"
extractors:
- name: ssh
type: regex
regex:
- (?x)^SSH-([\d.]+)-OpenSSH[_-]([\w.]+)\s*\r?\n
metadata,从上面的ssh指纹中可以看到metadata有两个键值对,并且存在$1和$2
。这里的$后面的数字就是提取器正则对应的提取组| 字段 | 数据类型 | 描述 |
|---|---|---|
| product_name | Option<String> | (可选)产品名称 |
| version | Option<String> | (可选)版本号 |
| info | Option<String> | (可选)信息 |
| hostname | Option<String> | (可选)主机名 |
| operating_system | Option<String> | (可选)操作系统 |
| device_type | Option<String> | (可选)设备类型 |
| cpe | Vec<String> | (可选)通用枚举 |
2.0和9.7会对应替换到上面metadata的值,在结果中就会返回version:[9.7]
和info:[protocol 2.0]origin的值可以使用下面的提取器{
"origin": "1.1.1.1"
}
ip:["1.1.1.1"]extractors:
- type: json
name: ip
json:
- '.origin'
-p参数指定要验证的yaml文件,-t
指定测试目标对指纹进行验证,并且使用--debug参数开启调试输出更多信息。…
git clone [email protected]:你的个人github用户名/FingerprintHub.git
cd FingerprintHub
git remote add upstream [email protected]:0x727/FingerprintHub.git
git fetch upstream
git config --global user.name "$GITHUB_USERNAME"
git config --global user.email "$GITHUB_EMAIL"
git config --global github.user "$GITHUB_USERNAME"
git fetch --all
git fetch upstream
main分支上修改,例如我想添加一个thinkphp的指纹,创建一个新的分支并切换到新的分支。git checkout -b thinkphp
name字段为添加的组件名,添加或者修改规则。git add 你添加或者修改的文件名
git commit -m "添加的组件名或者你的描述"
git push origin thinkphp
FingerprintHub,我感到非常的荣幸,欢迎补充列表,当项目有破坏性更新时可以及时通知到你。| observer_ward |
|---|
| nuclei |
| nemo_go |
| afrog |
| ShuiZe |
| z0scan |
| fingers |
No open issues yet, or sync has not completed.