This repository has been archived by the owner on Jul 12, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
/
cffpTest.cfm
124 lines (120 loc) · 3.78 KB
/
cffpTest.cfm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
<cfset cffp = createObject("component", "cfformprotect.CFFPVerify").init()>
<html>
<head><title>test</title></head>
<body onload="document.frmAwesome.Submit.focus()">
<div style="border:1px solid black;padding:20px;margin:20px;">
<form action="<cfoutput>#cgi.script_name#</cfoutput>" method="post" name="frmAwesome">
<div>Name:<input type="text" name="FullName" id="FullName" value="<cftry><cfoutput>#form.FullName#</cfoutput><cfcatch/></cftry>"></div>
<div><textarea name="Comment" style="height:100px;width:400px;"><cftry><cfoutput>#form.Comment#</cfoutput><cfcatch/></cftry></textarea></div>
<div><input name="Submit" id="Submit" type="submit" value="submit"></div>
<cfoutput>#cffp.renderCFFP()#</cfoutput>
</form>
</div>
<cfif structKeyExists(form, "FieldNames")>
<div style="border:1px solid black;padding:20px;margin:20px;">
<cfoutput>
Overall Results:
<cfif cffp.testSubmission(form)>
Form submission was not spam.
<cfelse>
Form submission was spam.
</cfif>
<br><br>
Individual test results:<br>
<ol>
<li><strong>Mouse Movement test</strong>:
<cfif cffpConfig.mouseMovement>
<cfif cffp.testMouseMovement(form)>
<em>pass</em>, movement was detected.
<cfelse>
<em>fail</em>, movement was not detected.
</cfif></li>
<cfelse>
not enabled.</li>
</cfif>
<li><strong>Keyboard Usage test</strong>:
<cfif cffpConfig.usedKeyboard>
<cfif cffp.testUsedKeyboard(form)>
<em>pass</em>, keystrokes were detected.
<cfelse>
<em>fail</em>, keystrokes were not detected.
</cfif></li>
<cfelse>
not enabled.</li>
</cfif>
<li><strong>Timed Form test</strong>:
<cfif cffpConfig.timedFormSubmission>
<cfif cffp.testTimedFormSubmission(form).pass>
<em>pass</em>, the form submission time was within the allowed time span.
<cfelse>
<em>fail</em>, the form submission time was not within the allowed time span.
</cfif></li>
<cfelse>
<li>not enabled.</li>
</cfif>
<li><strong>Hidden Field test</strong>:
<cfif cffpConfig.hiddenFormField>
<cfif cffp.testHiddenFormField(form)>
<em>pass</em>, the hidden field was empty as expected.
<cfelse>
<em>fail</em>, the hidden field was not empty.
</cfif></li>
<cfelse>
not enabled.</li>
</cfif>
<li><strong>Akismet test</strong>:
<cfif cffpConfig.akismet>
<cfif cffp.testAkismet(form).pass>
<em>pass</em>, Akismet doesn't think this is spam.
<cfelse>
<em>fail</em>, Akismet thinks this is spam.
</cfif></li>
<cfelse>
not enabled.</li>
</cfif>
<li><strong>LinkSleeve test</strong>:
<cfif cffpConfig.linkSleeve>
<cfif cffp.testLinkSleeve(form)>
<em>pass</em>, LinkSleeve doesn't think this is spam.
<cfelse>
<em>fail</em>, LinkSleeve thinks this is spam.
</cfif></li>
<cfelse>
not enabled.</li>
</cfif>
<li><strong>Too Many Urls test</strong>:
<cfif cffpConfig.tooManyUrls>
<cfif cffp.TestTooManyUrls(form)>
<em>pass</em>, there were not too many URLs in the form contents.
<cfelse>
<em>fail</em>, there were too many URLs in the form contents.
</cfif></li>
<cfelse>
not enabled.</li>
</cfif>
<li><strong>Spam Strings test</strong>:
<cfif cffpConfig.teststrings>
<cfif cffp.testSpamStrings(form)>
<em>pass</em>, the form contents did not contain too many spam strings from your list.
<cfelse>
<em>fail</em>, the form contents contained too many spam strings from your list.
</cfif></li>
<cfelse>
not enabled.</li>
</cfif>
<li><strong>Project Honeypot test</strong>:
<cfif cffpConfig.projectHoneyPot>
<cfif cffp.testProjHoneyPot(form)>
<em>pass</em>, Project Honeypot did not identify this as spam.
<cfelse>
<em>fail</em>, Project Honeypot identified this as spam.
</cfif></li>
<cfelse>
not enabled.</li>
</cfif>
</ol>
</cfoutput>
</div>
</cfif>
</body>
</html>