Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Snitz Forums 2000 MOD-Group
 MOD Add-On Forum (W/Code)
 Very simple anti-bot

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!
Before posting, make sure you have read this topic!

Screensize:
UserName:
Password:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkInsert EmailInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
kyodai Posted - 04 February 2011 : 16:24:43
This is a very simply anti-bot modification but as it's quite custom it works against like 99% of all bots, even most dynamic ones.

The trick is just to add a "Are you a bot question" dropdown box in the registration page and make "YES" default, so even the dynamic bots stumble over it. I know there are better anti-bot mods available (Mikes seems to be awesome), but i was looking for a leightweight solution that doesnt produce much more traffic and SQL requests, so this is what i came up with.


here's how to implement it:


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


1. Open your inc_profile.asp and search for this block:
(Just search for <select name=""ReceiveEMail, as i deleted unnecessary spaces and tabs in my snitz)




if strMode = "Register" then
Response.Write	"<td bgColor=""" & strPopUpTableColor & """ valign=""middle""><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """>" & vbNewLine & _
"<select name=""ReceiveEMail"">" & vbNewLine & _
"<option value=""1"" selected>Yes</option>" & vbNewLine & _
"<option value=""0"">No</option>" & vbNewLine & _
"</select></font></td>" & vbNewLine



BELOW add the following:


'#############Kyodai bot check
Response.Write	"<tr valign=""middle"">" & vbNewLine & _
"<td bgColor=""" & strPopUpTableColor & """ align=""right"" valign=""middle"" width=""10%"" nowrap><b><font face=""" & strDefaultFontFace & """ size=""" & strFooterFontSize & """>Are you a bot: </font></b></td>" & vbNewLine
Response.Write	"<td bgColor=""" & strPopUpTableColor & """ valign=""middle""><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """>" & vbNewLine & _
"<select name=""IsBot"">" & vbNewLine & _
"<option value=""1"" selected>Yes</option>" & vbNewLine & _
"<option value=""5"">No</option>" & vbNewLine & _
"</select></font></td>" & vbNewLine			
'##############Kyodai bot check




Open register.asp and search for the following block of code:
(Again just search for "UserName already in Use, Please Choose " as i got rid of unnecassary spaces and tabs)



Err_Msg = Err_Msg & "<li>UserName already in Use, Please Choose Another</li>"
end if

rs.close
set rs = nothing


AFTER add the following:



'##############Kyodai bot check
if Request.Form("IsBot") = "5" then
'nothing, everything fine
else
Response.write "<br><br>You have stated that you are a bot. However, bots may not register. Please check your info and try again.<br><br>"
response.end
end if
'##############Kyodai bot check




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


That's it. No additional SQL queries and just a few more bytes on loading the register.asp due to the additional dropbox. I know it sounds to simple to be true but it really works against all bots so far on my forums. Maybe there's really intelligent dynamic page loading and parsing bots, but so far i haven't run into one.
3   L A T E S T    R E P L I E S    (Newest First)
Carefree Posted - 06 February 2011 : 05:05:58
You're welcome
kyodai Posted - 05 February 2011 : 20:48:48
Good call! Now that i look at it considering your comments i am surprised it even works the way i distributed it. Thanks for the improvement!!!
Carefree Posted - 04 February 2011 : 21:41:45
quote:
1. Open your inc_profile.asp and search for this block:
(Just search for <select name=""ReceiveEMail, as i deleted unnecessary spaces and tabs in my snitz)




if strMode = "Register" then
Response.Write	"<td bgColor=""" & strPopUpTableColor & """ valign=""middle""><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """>" & vbNewLine & _
"<select name=""ReceiveEMail"">" & vbNewLine & _
"<option value=""1"" selected>Yes</option>" & vbNewLine & _
"<option value=""0"">No</option>" & vbNewLine & _
"</select></font></td>" & vbNewLine



BELOW add the following:


'#############Kyodai bot check
Response.Write	"<tr valign=""middle"">" & vbNewLine & _
"<td bgColor=""" & strPopUpTableColor & """ align=""right"" valign=""middle"" width=""10%"" nowrap><b><font face=""" & strDefaultFontFace & """ size=""" & strFooterFontSize & """>Are you a bot: </font></b></td>" & vbNewLine
Response.Write	"<td bgColor=""" & strPopUpTableColor & """ valign=""middle""><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """>" & vbNewLine & _
"<select name=""IsBot"">" & vbNewLine & _
"<option value=""1"" selected>Yes</option>" & vbNewLine & _
"<option value=""5"">No</option>" & vbNewLine & _
"</select></font></td>" & vbNewLine			
'##############Kyodai bot check




Kyodai, you're opening a new row (see bit in red above) in the table (which subsequently isn't closed) before closing the previous one. Instead, I'd recommend this:


Look for the following lines (appx 101-110):

		if strMode = "goModify" then
			Response.Write	"                    <tr>" & vbNewLine & _
					"                      <td bgColor=""" & strPopUpTableColor & """ align=""right"" valign=""middle"" nowrap><b><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """>Initial IP: </font></b></td>" & vbNewLine & _
					"                      <td bgColor=""" & strPopUpTableColor & """><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """><a href=""" & strIPLookup & ChkString(rs("M_IP"), "display") & """ target=""_blank"">" & ChkString(rs("M_IP"), "display") & "</a></font></td>" & vbNewLine & _
					"                    </tr>" & vbNewLine & _
					"                    <tr>" & vbNewLine & _
					"                      <td bgColor=""" & strPopUpTableColor & """ align=""right"" valign=""middle"" nowrap><b><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """>Last IP: </font></b></td>" & vbNewLine & _
					"                      <td bgColor=""" & strPopUpTableColor & """><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """><a href=""" & strIPLookup & ChkString(rs("M_LAST_IP"), "display") & """ target=""_blank"">" & ChkString(rs("M_LAST_IP"), "display") & "</a></font></td>" & vbNewLine & _
					"                    </tr>" & vbNewLine
		end if


Above those, insert the following:

		Response.Write	"                    <tr valign=""middle"">" & vbNewLine & _
				"                    	 <td bgColor=""" & strPopUpTableColor & """ align=""right"" valign=""middle"" width=""10%"" nowrap><b><font face=""" & strDefaultFontFace & """ size=""" & strFooterFontSize & """>Are you a bot? </font></b></td>" & vbNewLine & _
				"                    	 <td bgColor=""" & strPopUpTableColor & """ valign=""middle""><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """>" & vbNewLine & _
				"                    	 	 <select name=""IsBot"">" & vbNewLine & _
				"                    	 		 <option value=""1"" selected>Yes</option>" & vbNewLine & _
				"                    	 		 <option value=""5"">No</option>" & vbNewLine & _
				"                    	 	 </select></font></td>" & vbNewLine & _
				"                    </tr>" & vbNewLine


Another recommendation that provides a back link that doesn't destroy data & closes bottom of page:

"register.asp"


Look for the following lines (appx 337-344:)

		if rs.BOF and rs.EOF then
			'## Do Nothing
		else
			Err_Msg = Err_Msg & "<li>UserName already in Use, Please Choose Another</li>"
		end if

		rs.close
		set rs = nothing

Below those, insert the following:

		if Request.Form("IsBot") <> "5" then
			Response.Write	"<br><br>You have stated that you are a bot. However, bots may not register. Please check your info and try again." & vbNewLine & _
				"      <p align=""center""><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """><a href=""JavaScript:history.go(-1)"">Go Back To Edit Data</a></font></p>" & vbNewLine
			WriteFooter
			Response.End
		end if

Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.06 seconds. Powered By: Snitz Forums 2000 Version 3.4.07