Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion bin/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,11 @@ def looks_like_email(value: str) -> bool:


def looks_like_asn(value: str) -> bool:
return bool(re.match(r"^(AS)?\d{1,10}$", value, re.IGNORECASE))
return bool(re.match(r"^AS\d{1,10}$", value, re.IGNORECASE))


def looks_like_bare_asn_digits(value: str) -> bool:
return bool(re.match(r"^\d{1,10}$", value))


def looks_like_cve(value: str) -> bool:
Expand Down Expand Up @@ -286,6 +290,8 @@ def add(t: str, reason: str, score: int) -> None:

if looks_like_asn(v):
add("AS", "matches ASN syntax", 90)
elif looks_like_bare_asn_digits(v):
add("AS", "bare digits could be an ASN without the 'AS' prefix", 20)

if looks_like_domain(v):
add("domain", "looks like a domain name", 85)
Expand Down