| 1 |
*** Settings *** |
| 2 |
Library ${RSPAMD_TESTDIR}/lib/rspamd.py |
| 3 |
Resource ${RSPAMD_TESTDIR}/lib/rspamd.robot |
| 4 |
Variables ${RSPAMD_TESTDIR}/lib/vars.py |
| 5 |
|
| 6 |
*** Test Cases *** |
| 7 |
|
| 8 |
URL Suspect - Issue 5731 - Long User Field |
| 9 |
# Test that URLs with oversized user fields are parsed and scored |
| 10 |
Scan File ${RSPAMD_TESTDIR}/messages/url_suspect_long_user.eml |
| 11 |
... Settings={symbols_enabled = [URL_SUSPECT_CHECK, URL_USER_LONG, URL_USER_VERY_LONG, URL_USER_PASSWORD]} |
| 12 |
Expect Symbol With Exact Options URL_USER_LONG 129 |
| 13 |
Do Not Expect Symbol URL_USER_VERY_LONG |
| 14 |
|
| 15 |
URL Suspect - Very Long User Field |
| 16 |
# Test that very long user fields get appropriate symbol |
| 17 |
Scan File ${RSPAMD_TESTDIR}/messages/url_suspect_very_long_user.eml |
| 18 |
... Settings={symbols_enabled = [URL_SUSPECT_CHECK, URL_USER_LONG, URL_USER_VERY_LONG, URL_USER_PASSWORD]} |
| 19 |
Expect Symbol With Exact Options URL_USER_VERY_LONG 300 |
| 20 |
|
| 21 |
URL Suspect - Numeric IP |
| 22 |
# Test numeric IP detection |
| 23 |
Scan File ${RSPAMD_TESTDIR}/messages/url_suspect_numeric_ip.eml |
| 24 |
... Settings={symbols_enabled = [URL_SUSPECT_CHECK, URL_NUMERIC_IP, URL_NUMERIC_IP_USER, URL_NUMERIC_PRIVATE_IP]} |
| 25 |
Expect Symbol URL_NUMERIC_IP |
| 26 |
Do Not Expect Symbol URL_NUMERIC_IP_USER |
| 27 |
|
| 28 |
URL Suspect - Numeric IP with User |
| 29 |
# Test numeric IP with user field (more suspicious) |
| 30 |
Scan File ${RSPAMD_TESTDIR}/messages/url_suspect_numeric_ip_user.eml |
| 31 |
... Settings={symbols_enabled = [URL_SUSPECT_CHECK, URL_NUMERIC_IP, URL_NUMERIC_IP_USER, URL_NUMERIC_PRIVATE_IP]} |
| 32 |
Expect Symbol URL_NUMERIC_IP_USER |
| 33 |
|
| 34 |
URL Suspect - Suspicious TLD |
| 35 |
# Test suspicious TLD detection |
| 36 |
Scan File ${RSPAMD_TESTDIR}/messages/url_suspect_bad_tld.eml |
| 37 |
... Settings={symbols_enabled = [URL_SUSPECT_CHECK, URL_SUSPICIOUS_TLD, URL_NO_TLD]} |
| 38 |
Expect Symbol URL_SUSPICIOUS_TLD |
| 39 |
|
| 40 |
URL Suspect - Multiple At Signs |
| 41 |
# Test multiple @ sign detection |
| 42 |
Scan File ${RSPAMD_TESTDIR}/messages/url_suspect_multiple_at.eml |
| 43 |
... Settings={symbols_enabled = [URL_SUSPECT_CHECK, URL_MULTIPLE_AT_SIGNS]} |
| 44 |
Expect Symbol URL_MULTIPLE_AT_SIGNS |
| 45 |
|
| 46 |
URL Suspect - Normal URL |
| 47 |
# Test that normal URLs don't trigger symbols |
| 48 |
Scan File ${RSPAMD_TESTDIR}/messages/url_suspect_normal.eml |
| 49 |
... Settings={symbols_enabled = [URL_SUSPECT_CHECK, URL_USER_PASSWORD, URL_NUMERIC_IP, URL_SUSPICIOUS_TLD]} |
| 50 |
Do Not Expect Symbol URL_USER_PASSWORD |
| 51 |
Do Not Expect Symbol URL_NUMERIC_IP |
| 52 |
Do Not Expect Symbol URL_SUSPICIOUS_TLD |
| 53 |
|
| 54 |
URL Suspect - Obfuscated hxxp |
| 55 |
# Test hxxp:// obfuscation detection |
| 56 |
Scan File ${RSPAMD_TESTDIR}/messages/url_obfuscated_hxxp.eml |
| 57 |
... Settings={symbols_enabled = [URL_OBFUSCATED_TEXT]} |
| 58 |
Expect Symbol URL_OBFUSCATED_TEXT |
| 59 |
|
| 60 |
URL Suspect - Obfuscated Bracket Dots |
| 61 |
# Test bracket dots obfuscation detection: example[.]com |
| 62 |
Scan File ${RSPAMD_TESTDIR}/messages/url_obfuscated_bracket_dots.eml |
| 63 |
... Settings={symbols_enabled = [URL_OBFUSCATED_TEXT]} |
| 64 |
Expect Symbol URL_OBFUSCATED_TEXT |
| 65 |
|
| 66 |
URL Suspect - Obfuscated Word Dot |
| 67 |
# Test word dot obfuscation detection: example dot com |
| 68 |
Scan File ${RSPAMD_TESTDIR}/messages/url_obfuscated_word_dot.eml |
| 69 |
... Settings={symbols_enabled = [URL_OBFUSCATED_TEXT]} |
| 70 |
Expect Symbol URL_OBFUSCATED_TEXT |
| 71 |
|
| 72 |
URL Suspect - Obfuscated Spaced Protocol |
| 73 |
# Test spaced protocol obfuscation: h t t p s : / / |
| 74 |
Scan File ${RSPAMD_TESTDIR}/messages/url_obfuscated_spaced.eml |
| 75 |
... Settings={symbols_enabled = [URL_OBFUSCATED_TEXT]} |
| 76 |
Expect Symbol URL_OBFUSCATED_TEXT |