Last active
December 20, 2015 23:28
-
-
Save JamoCA/6212334 to your computer and use it in GitHub Desktop.
ColdFusion UDF to generate randomized Honey Pot HTML Code. For use with ProjectHoneyPot.org. (NOTE: You can test this at CFLive.net)
This file contains hidden or 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
<cfscript> | |
function makeHoneyPotLink(HoneyPotPath){ | |
var a = RandRange(1, 9, 'SHA1PRNG'); | |
var str = ''; | |
var randomWords = "closed-vestpocket,digitate,microwave,integrate,ultra-round,semester,volume"; | |
var serverName = CGI.Server_Name; | |
if (arrayLen(arguments) gte 2 AND len(trim(arguments[2]))) serverName = trim(arguments[2]); //Pass server name (optional) | |
if (arrayLen(arguments) gte 3 AND len(trim(arguments[3]))) randomWords = trim(arguments[2]); // Pass random words (optional) | |
randomWords = trim(listGetAt(randomWords, RandRange(1, ListLen(randomWords), 'SHA1PRNG'))); | |
HoneyPotPath = trim(HoneyPotPath); | |
if (left(HoneyPotPath,1) NEQ "/") { | |
HoneyPotPath = "/" & HoneyPotPath; | |
} | |
switch(a) { | |
case 9: str = '<a href="http://#Server_name##HoneyPotPath#"><div style="height:0px; width:0px;"></div></a>'; break; | |
case 8: str = '<a href="http://#Server_name##HoneyPotPath#"><span style="display:none;">#randomWords#</span></a>'; | |
case 7: str = '<div style="position:absolute; top:-250px; left:-250px;"><a href="http://#Server_name##HoneyPotPath#">#randomWords#</a></div>'; break; | |
case 6: str = '<!-- <a href="http://#Server_name##HoneyPotPath#">#randomWords#</a> -->'; break; | |
case 5: str = '<a href="http://#Server_name##HoneyPotPath#"></a>'; break; | |
case 4: str = '<div style="display:none;"><a href="http://#Server_name##HoneyPotPath#">#randomWords#</a></div>'; break; | |
case 3: str = '<a href="http://#Server_name##HoneyPotPath#" style="display: none;">#randomWords#</a>'; break; | |
case 2: str = '<a href="http://#Server_name##HoneyPotPath#"><img src="#randomWords#.gif" height="1" width="1" alt="#HTMLEditFormat(randomWords)#" border="0"></a>'; break; | |
default: str = '<a href="http://#Server_name##HoneyPotPath#"><!-- #randomWords# --></a>'; break; | |
} | |
if (LEN(HoneyPotPath) LTE 1) str = ''; | |
return str; | |
} | |
</cfscript> | |
<CFOUTPUT> | |
<h2>makeHoneyPotLink()</h2> | |
#HTMLEditFormat(makeHoneyPotLink("funkydinosaur.cfm"))# | |
</CFOUTPUT> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment