Browse Source

[Test] Phishing

tags/1.6.0
Andrew Lewis 7 years ago
parent
commit
e7c48b947f

+ 33
- 0
test/functional/cases/114_phishing.robot View File

@@ -0,0 +1,33 @@
*** Settings ***
Suite Setup Phishing Setup
Suite Teardown Simple Teardown
Library ${TESTDIR}/lib/rspamd.py
Resource ${TESTDIR}/lib/rspamd.robot
Variables ${TESTDIR}/lib/vars.py

*** Variables ***
${CONFIG} ${TESTDIR}/configs/plugins.conf
${MESSAGE1} ${TESTDIR}/messages/phishing1.eml
${MESSAGE2} ${TESTDIR}/messages/phishing2.eml
${MESSAGE3} ${TESTDIR}/messages/phishing3.eml
${RSPAMD_SCOPE} Suite
${URL_TLD} ${TESTDIR}/../../contrib/publicsuffix/effective_tld_names.dat

*** Test Cases ***
TEST PHISHING
${result} = Scan Message With Rspamc ${MESSAGE1}
Check Rspamc ${result} ${SPACE}PHISHING

TEST PHISHING STRICT ONE
${result} = Scan Message With Rspamc ${MESSAGE2}
Check Rspamc ${result} STRICT_PHISHING

TEST PHISHING STRICT TWO
${result} = Scan Message With Rspamc ${MESSAGE3}
Check Rspamc ${result} STRICTER_PHISHING

*** Keywords ***
Phishing Setup
${PLUGIN_CONFIG} = Get File ${TESTDIR}/configs/phishing.conf
Set Suite Variable ${PLUGIN_CONFIG}
Generic Setup PLUGIN_CONFIG

+ 1
- 0
test/functional/configs/maps/strict.phishing View File

@@ -0,0 +1 @@
myspace.com

+ 1
- 0
test/functional/configs/maps/stricter.phishing View File

@@ -0,0 +1 @@
bank.com

+ 7
- 0
test/functional/configs/phishing.conf View File

@@ -0,0 +1,7 @@
phishing {
symbol = "PHISHING";
strict_domains = [
"${TESTDIR}/configs/maps/strict.phishing:STRICT_PHISHING",
"${TESTDIR}/configs/maps/stricter.phishing:STRICTER_PHISHING"
];
}

+ 3
- 0
test/functional/messages/phishing1.eml View File

@@ -0,0 +1,3 @@
Content-type: text/html

lol <a href="http://www.example.net">http://www.cnn.com</a>

+ 3
- 0
test/functional/messages/phishing2.eml View File

@@ -0,0 +1,3 @@
Content-type: text/html

lol <a href="http://www.example.net">http://www.myspace.com</a>

+ 3
- 0
test/functional/messages/phishing3.eml View File

@@ -0,0 +1,3 @@
Content-type: text/html

lol <a href="http://www.example.net">http://www.bank.com</a>

Loading…
Cancel
Save