Skip to content

Commit ecaf4a7

Browse files
committed
fix: 收紧后端运行时识别规则
移除前端构建路径对 Node.js 后端运行时的推断,补充 Rust Web 框架响应头识别。
1 parent fb40acb commit ecaf4a7

6 files changed

Lines changed: 87 additions & 4 deletions

File tree

docs/guide/results.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,8 @@
6363

6464
插件可能只能识别出很少内容,甚至识别不出来。这通常不是规则漏了,而是页面没有向浏览器暴露足够线索。
6565

66+
前端构建线索也不等于后端运行时。比如页面有 `/_next/``/_nuxt/` 或 Vite 产物,只能说明前端构建链路,不应该直接推断服务端就是 Node.js。后端语言通常要靠 `Server``X-Powered-By`、Cookie 名称或框架特有响应头来判断。
67+
6668
## 纠正按钮
6769

6870
每条卡片的「识别不准确,点击纠正」按钮会打开 GitHub Issue,自动填好以下信息:

public/rules/headers/header-patterns.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,13 @@
9797
"patterns": ["gorilla\\.csrf|go-http-client|golang"],
9898
"evidence": "响应头、Cookie 名称或 URL 包含后端框架线索"
9999
},
100+
{
101+
"name": "Rust",
102+
"patterns": [
103+
"(?:^|\\n)(?:server|x-powered-by):.*(?:rust|actix(?:-web)?|rocket(?:\\s*(?:rs|framework)|/\\d|\\s|$)|axum|warp|poem|salvo|tide|ntex|\\bhyper\\b)"
104+
],
105+
"evidence": "响应头包含 Rust 或 Rust Web 框架线索"
106+
},
100107
{
101108
"name": "GraphQL",
102109
"patterns": ["graphql"],

public/rules/headers/languages.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,10 @@
7575
},
7676
{
7777
"name": "Rust",
78-
"patterns": ["x-powered-by:.*(?:actix|rocket|axum|warp)"]
78+
"patterns": [
79+
"x-powered-by:.*(?:rust|actix(?:-web)?|rocket(?:\\s*(?:rs|framework)|/\\d|\\s|$)|axum|warp|poem|salvo|tide|ntex|\\bhyper\\b)",
80+
"server:.*(?:actix(?:-web)?|rocket(?:\\s*(?:rs|framework)|/\\d|\\s|$)|axum|warp|poem|salvo|tide|ntex|\\bhyper\\b)"
81+
]
7982
},
8083
{
8184
"name": "Elixir",

public/rules/headers/powered-by-products.json

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,11 +198,37 @@
198198
},
199199
{
200200
"name": "Rust Rocket",
201-
"patterns": ["rocket"]
201+
"patterns": ["rocket(?:\\s*(?:rs|framework)|/\\d|\\s|$)"]
202202
},
203203
{
204204
"name": "Rust Axum",
205205
"patterns": ["axum"]
206+
},
207+
{
208+
"name": "Rust Warp",
209+
"patterns": ["\\bwarp\\b"]
210+
},
211+
{
212+
"name": "Rust Poem",
213+
"patterns": ["\\bpoem\\b"]
214+
},
215+
{
216+
"name": "Rust Salvo",
217+
"patterns": ["\\bsalvo\\b"]
218+
},
219+
{
220+
"name": "Rust Tide",
221+
"patterns": ["\\btide\\b"]
222+
},
223+
{
224+
"name": "Rust Hyper",
225+
"confidence": "",
226+
"patterns": ["\\bhyper\\b"]
227+
},
228+
{
229+
"name": "Rust",
230+
"confidence": "",
231+
"patterns": ["\\brust\\b|rustlang"]
206232
}
207233
]
208234
}

public/rules/headers/server-products.json

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,39 @@
128128
{
129129
"name": "Bun",
130130
"patterns": ["\\bbun\\b"]
131+
},
132+
{
133+
"name": "Rust Actix",
134+
"patterns": ["actix(?:-web)?"]
135+
},
136+
{
137+
"name": "Rust Rocket",
138+
"patterns": ["rocket(?:\\s*(?:rs|framework)|/\\d|\\s|$)"]
139+
},
140+
{
141+
"name": "Rust Axum",
142+
"patterns": ["\\baxum\\b"]
143+
},
144+
{
145+
"name": "Rust Warp",
146+
"patterns": ["\\bwarp\\b"]
147+
},
148+
{
149+
"name": "Rust Poem",
150+
"patterns": ["\\bpoem\\b"]
151+
},
152+
{
153+
"name": "Rust Salvo",
154+
"patterns": ["\\bsalvo\\b"]
155+
},
156+
{
157+
"name": "Rust Tide",
158+
"patterns": ["\\btide\\b"]
159+
},
160+
{
161+
"name": "Rust Hyper",
162+
"confidence": "",
163+
"patterns": ["\\bhyper\\b"]
131164
}
132165
]
133166
},

public/rules/page/languages.json

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@
1616
{
1717
"name": "Node.js",
1818
"kind": "后端运行时",
19-
"patterns": ["node_modules", "express-session", "connect.sid", "/_next/", "/_nuxt/", "sveltekit", "nestjs"]
19+
"confidence": "",
20+
"patterns": ["express-session", "connect.sid", "nestjs"]
2021
},
2122
{
2223
"defaults": {
@@ -113,7 +114,18 @@
113114
},
114115
{
115116
"name": "Rust",
116-
"patterns": ["actix", "rocket", "axum", "warp"]
117+
"confidence": "",
118+
"patterns": [
119+
"powered by (?:actix(?:-web)?|axum|warp|poem|salvo|tide)",
120+
"powered by rocket(?:\\s*(?:rs|framework)|/\\d|\\s|<|$)",
121+
"\\bactix-web\\b",
122+
"\\bactix_web\\b",
123+
"\\baxum\\b",
124+
"\\bwarp\\b",
125+
"\\bpoem\\b",
126+
"\\bsalvo\\b",
127+
"\\btide\\b"
128+
]
117129
},
118130
{
119131
"name": "Elixir",

0 commit comments

Comments
 (0)