-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Handle low-digit username as FP url masquerading
- Loading branch information
Showing
2 changed files
with
20 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,7 +10,7 @@ def test_unicode_characters(): | |
url = "https://hello:world@écoute.com/" | ||
res_section, network_iocs = url_analysis(url) | ||
assert network_iocs == {"uri": ["https://écoute.com/"], "domain": ["écoute.com"], "ip": []} | ||
assert '"OBFUSCATION": "Embedded credentials"' in res_section.body | ||
assert "embedded_credentials" in res_section.heuristic.signatures | ||
|
||
|
||
def test_embedded_base64(): | ||
|
@@ -67,40 +67,46 @@ def test_phishing(): | |
# Should reveal the true target URL for reputation checking | ||
assert network_iocs["uri"] == ["https://bad.com/malicious.zip?evil=true"] | ||
assert network_iocs["domain"] == ["bad.com"] | ||
assert '"OBFUSCATION": "URL masquerade"' in res_section.body | ||
assert "url_masquerade" in res_section.heuristic.signatures | ||
|
||
url = "https://[email protected]@bad.com/malicious.zip" | ||
res_section, network_iocs = url_analysis(url) | ||
# Should reveal the true target URL for reputation checking | ||
assert network_iocs["uri"] == ["https://bad.com/malicious.zip"] | ||
assert network_iocs["domain"] == ["bad.com"] | ||
assert '"OBFUSCATION": "URL masquerade"' in res_section.body | ||
assert "url_masquerade" in res_section.heuristic.signatures | ||
|
||
url = "https://[email protected]/malicious.zip" | ||
res_section, network_iocs = url_analysis(url) | ||
# Should reveal the true target URL for reputation checking | ||
assert network_iocs["uri"] == ["https://bad.com/malicious.zip"] | ||
assert network_iocs["domain"] == ["bad.com"] | ||
assert '"OBFUSCATION": "URL masquerade"' in res_section.body | ||
assert "url_masquerade" in res_section.heuristic.signatures | ||
|
||
url = "https://something@[email protected]/malicious.zip" | ||
res_section, network_iocs = url_analysis(url) | ||
# Should reveal the true target URL for reputation checking | ||
assert network_iocs["uri"] == ["https://bad.com/malicious.zip"] | ||
assert network_iocs["domain"] == ["bad.com"] | ||
assert '"OBFUSCATION": "URL masquerade"' not in res_section.body | ||
assert "url_masquerade" not in res_section.heuristic.signatures | ||
|
||
url = "https://[email protected]/" | ||
res_section, network_iocs = url_analysis(url) | ||
assert network_iocs["uri"] == ["https://bad.com/"] | ||
assert network_iocs["domain"] == ["bad.com"] | ||
assert '"OBFUSCATION": "Embedded username"' in res_section.body | ||
assert "embedded_username" in res_section.heuristic.signatures | ||
|
||
url = "https://username:[email protected]/" | ||
res_section, network_iocs = url_analysis(url) | ||
assert network_iocs["uri"] == ["https://bad.com/"] | ||
assert network_iocs["domain"] == ["bad.com"] | ||
assert '"OBFUSCATION": "Embedded credentials"' in res_section.body | ||
assert "embedded_credentials" in res_section.heuristic.signatures | ||
|
||
url = "https://123:[email protected]/" | ||
res_section, network_iocs = url_analysis(url) | ||
assert network_iocs["uri"] == ["https://example.com/"] | ||
assert network_iocs["domain"] == ["example.com"] | ||
assert "url_masquerade" not in res_section.heuristic.signatures | ||
|
||
|
||
def test_ascii_decode_handling(): | ||
|
@@ -126,21 +132,21 @@ def lookup_safelist(qhash): | |
# Should reveal the true target URL for reputation checking | ||
assert network_iocs["uri"] == ["https://bad.com/malicious.zip"] | ||
assert network_iocs["domain"] == ["bad.com"] | ||
assert '"OBFUSCATION": "URL masquerade"' in res_section.body | ||
assert "url_masquerade" in res_section.heuristic.signatures | ||
assert res_section.heuristic.score == 500 | ||
|
||
url = "https://[email protected]/malicious.zip" | ||
res_section, network_iocs = network_url_analysis(url, lookup_safelist) | ||
# Should reveal the true target URL for reputation checking | ||
assert network_iocs["uri"] == ["https://safelistedenabled.com/malicious.zip"] | ||
assert network_iocs["domain"] == ["safelistedenabled.com"] | ||
assert '"OBFUSCATION": "URL masquerade"' in res_section.body | ||
assert "url_masquerade" in res_section.heuristic.signatures | ||
assert res_section.heuristic.score == 0 | ||
|
||
url = "https://[email protected]/malicious.zip" | ||
res_section, network_iocs = network_url_analysis(url, lookup_safelist) | ||
# Should reveal the true target URL for reputation checking | ||
assert network_iocs["uri"] == ["https://safelisteddisabled.com/malicious.zip"] | ||
assert network_iocs["domain"] == ["safelisteddisabled.com"] | ||
assert '"OBFUSCATION": "URL masquerade"' in res_section.body | ||
assert "url_masquerade" in res_section.heuristic.signatures | ||
assert res_section.heuristic.score == 500 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters