mirror of
https://github.com/SickleSec/SnowEyes.git
synced 2026-10-28 19:30:50 +00:00
v0.2.1.9
This commit is contained in:
1 parent
6b67692d42
commit
bdf89aa0eb
3 files changed
+41
-3
No files matched your search
@@ -20,9 +20,26 @@ const SCANNER_CONFIG = {
|
||||
|
||||
// API 相关配置
|
||||
API: {
|
||||
PATTERN: /['"](?:\/|\.\.\/|\.\/)[^\/\&\>\< \)\(\{\}\,\'\"\\]([^\>\< \)\(\{\}\,\'\"\\])*?[\'"]/g,
|
||||
PATTERN: /['"`](?:\/|\.\.\/|\.\/)[^\/\>\< \)\(\}\,\'\"\\](?:[^\^\>\< \)\(\{\}\,\'\"\\])*?['"`]|['"`][a-zA_Z0-9]+(?<!text|application)\/(?:[^\^\>\< \)\(\{\}\,\'\"\\])*?["'`]/g,
|
||||
// 静态文件后缀 - 增强匹配规则
|
||||
STATIC_FILE_PATTERN: /\.(js|css|ico|png|webp|jpg|jpeg|gif|svg|woff|woff2|ttf|eot|map|json|jsonp)(?:\?[^'"]*)?$/i
|
||||
STATIC_FILE_PATTERN: /\.(js|css|ico|png|webp|jpg|jpeg|gif|svg|woff|woff2|ttf|eot|map|json|jsonp)(?:\?[^'"]*)?$/i,
|
||||
// 需要过滤的内容类型
|
||||
FILTERED_CONTENT_TYPES: [
|
||||
// 图片类型
|
||||
'image/jpeg',
|
||||
'image/gif',
|
||||
'image/bmp',
|
||||
'image/png',
|
||||
'image/x-png',
|
||||
'image/webp',
|
||||
'image/svg+xml',
|
||||
'image/x-emf',
|
||||
'image/x-wmf',
|
||||
'image/x-icon',
|
||||
'image/tiff',
|
||||
|
||||
'multipart/form-data',
|
||||
]
|
||||
},
|
||||
|
||||
// 域名相关配置
|
||||
|
||||
@@ -9,9 +9,29 @@ const SCANNER_FILTER = {
|
||||
// 检查是否是静态文件
|
||||
if (SCANNER_CONFIG.API.STATIC_FILE_PATTERN.test(match)) {
|
||||
resultsSet?.staticFiles?.add(match);
|
||||
return true;
|
||||
}
|
||||
|
||||
// 尝试获取文件扩展名或内容类型标识
|
||||
let contentType = '';
|
||||
try {
|
||||
// 从URL中提取可能的内容类型标识
|
||||
const lcMatch = match.toLowerCase();
|
||||
contentType = SCANNER_CONFIG.API.FILTERED_CONTENT_TYPES.find(type =>
|
||||
lcMatch.includes(type.toLowerCase()) ||
|
||||
lcMatch.includes(type.split('/')[1]) // 匹配类型的后缀部分
|
||||
) || '';
|
||||
} catch (e) {
|
||||
console.error('Error extracting content type:', e);
|
||||
}
|
||||
|
||||
// 如果URL暗示这是一个被过滤的内容类型,将其添加到静态文件中
|
||||
if (contentType) {
|
||||
resultsSet?.staticFiles?.add(match);
|
||||
} else {
|
||||
resultsSet?.apis?.add(match);
|
||||
}
|
||||
|
||||
return true;
|
||||
};
|
||||
})(),
|
||||
|
||||
Reference in new issue
Block a user