Message Board

http:BL Use/Development

Older Posts ]   [ Newer Posts ]
 http:BL CFC for Coldfusion
Author: A.Z4   (6 Jun 07 7:31pm)
HERE IS THE CFC
-------------------------------------------------------------------------------
<cfcomponent displayname="hpot">
<cffunction name="is_ip_in_honeypot" access="public" returntype="struct" output="true">
<cfargument name="ip_in" type="string" required="yes">
<cfargument name="access_key" type="string" required="yes">
<cfargument name="httpbl_host" type="string" required="yes">
<cfset is_PHP_Ip= StructNew()>
<cfset is_PHP_Ip.level=0>
<cfset is_PHP_Ip.level_msg= "">
<cftry>
<cfset reversed_ip = reverse_ip('#arguments.ip_in#')>
<cfset full_reverse_ip = arguments.access_key & '.' & reversed_ip & '.' & arguments.httpbl_host>
<cfoutput>#reversed_ip#</cfoutput>
<cfset java_look_up = createobject("java", "java.net.InetAddress")>
<cfset java_look_up_response = java_look_up.getByName(full_reverse_ip)>
<cfset boo =ListLast(java_look_up_response, "/")>
<cfset responce_len=ListLen(boo,'.')>
<cfif responce_len eq 4>
<cfswitch expression="#ListGetAt(boo,4,'.')#">
<cfcase value="1"><!--- ['Search_Engine'] ---></cfcase>
<cfcase value="2"><cfset is_PHP_Ip.level=2><cfset is_PHP_Ip.level_msg= "['Suspicious']"></cfcase>
<cfcase value="3"><cfset is_PHP_Ip.level=4><cfset is_PHP_Ip.level_msg= "['Harvester']"></cfcase>
<cfcase value="4"><cfset is_PHP_Ip.level=4><cfset is_PHP_Ip.level_msg= "['Comment Spammer']"></cfcase>
<cfcase value="5"><cfset is_PHP_Ip.level=5><cfset is_PHP_Ip.level_msg= "['Suspicious & Comment Spammer']"></cfcase>
<cfcase value="6"><cfset is_PHP_Ip.level=6><cfset is_PHP_Ip.level_msg= "['Harvester & Comment Spammer']"></cfcase>
<cfcase value="7"><cfset is_PHP_Ip.level=7><cfset is_PHP_Ip.level_msg= "['Suspicious & Harvester & Comment Spammer']"></cfcase>
</cfswitch>
</cfif>
<cfcatch></cfcatch>
</cftry>
<cfreturn is_PHP_Ip>
</cffunction>
<cffunction name="reverse_ip" access="public" returntype="string" output="false">
<cfargument name="ip_in" type="string" required="yes">
<cfset reversed_ip_string ="">
<cfloop from="#ListLen(arguments.ip_in,'.')#" to="1" step="-1" index="octet">
<cfset reversed_ip_string = ListAppend(reversed_ip_string, ListGetAt(arguments.ip_in,octet,'.'),'.')>
</cfloop>
<cfreturn reversed_ip_string>
</cffunction>
</cfcomponent>


HERE IS THE EXAMPLE:

------------------------------------------------------------------------------

<cfparam name="url.ip" default="">
<br />
<form method="get">
<input type="text" maxlength="15" name="ip" value="<cfoutput>#url.ip#</cfoutput>"><input type="submit" name="go" value="go">
</form>
<cfset foo="fgfg">
<cfinvoke component="hpot"
method="is_ip_in_honeypot"
ip_in ="#url.ip#"
access_key="your key goes here"
httpbl_host="dnsbl.httpbl.org"
returnvariable="foo">
<cfdump var="#foo#">



do not follow this link

Privacy Policy | Terms of Use | About Project Honey Pot | FAQ | Cloudflare Site Protection | Contact Us

Copyright © 2004–17, Unspam Technologies, Inc. All rights reserved.

contact | wiki | email