Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Snitz Forums 2000 MOD-Group
 MOD Add-On Forum (W/Code)
 Very simple anti-bot
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

kyodai
New Member

Azerbaijan
74 Posts

Posted - 04 February 2011 :  16:24:43  Show Profile  Reply with Quote
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.

Edited by - kyodai on 04 February 2011 16:32:29

Carefree
Advanced Member

Philippines
4207 Posts

Posted - 04 February 2011 :  21:41:45  Show Profile  Reply with Quote
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

Edited by - Carefree on 04 February 2011 21:42:37
Go to Top of Page

kyodai
New Member

Azerbaijan
74 Posts

Posted - 05 February 2011 :  20:48:48  Show Profile  Reply with Quote
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!!!
Go to Top of Page

Carefree
Advanced Member

Philippines
4207 Posts

Posted - 06 February 2011 :  05:05:58  Show Profile  Reply with Quote
You're welcome
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.22 seconds. Powered By: Snitz Forums 2000 Version 3.4.07