Skip to content

建议新增simhash去噪功能 #136

@Herbert-555

Description

@Herbert-555

对于#61
中出现 springboot错误页面中存在时间这个随机值。导致扫描结果过滤失效。
可能的随机值:
● uuid
● timestamp
● token
● jwt
● md5/sha
● sessionid
建议:
1、通过正则的方式进行过滤
"timestamp":"20\d{2}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}.\d{3}+\d{2}:\d{2}"
"timestamp":"20\d{2}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}"
将spring这种时间替换为空,或者正则直接是将任意时间替换为空
还有一些hash类的
# ===== 常见变化值正则 =====
# UUID: 8-4-4-4-12
_UUID_RE = re.compile(r"\b[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}\b")

# HEX(md5/sha/traceId 等)
_HEX128_RE = re.compile(r"\b[0-9a-fA-F]{128}\b")  # sha512
_HEX64_RE  = re.compile(r"\b[0-9a-fA-F]{64}\b")   # sha256
_HEX40_RE  = re.compile(r"\b[0-9a-fA-F]{40}\b")   # sha1
_HEX32_RE  = re.compile(r"\b[0-9a-fA-F]{32}\b")   # md5 / traceId

# 时间戳:10位秒 / 13位毫秒;以及常见 ISO / yyyy-mm-dd HH:MM:SS
_TS13_RE = re.compile(r"\b1\d{12}\b")  # 13位毫秒(示例里是 1772...)
_TS10_RE = re.compile(r"\b1\d{9}\b")   # 10位秒
_ISO_DT_RE = re.compile(r"\b\d{4}-\d{2}-\d{2}[ T]\d{2}:\d{2}:\d{2}(?:\.\d{1,6})?(?:Z|[+-]\d{2}:\d{2})?\b")

可以内置一些,或者直接加一个参数让用户指定正则yaml自行决定

2、增加simhash,大规模扫描不太适用,可能漏结果

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions