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)
 IPBlock (another IP blocking/banning utility)
 New Topic  Topic Locked
 Printer Friendly
Previous Page
Author Previous Topic Topic Next Topic
Page: of 4

hsng
New Member

84 Posts

Posted - 20 December 2003 :  02:43:14  Show Profile
Are you putting it on a line by itself and not after any ohter ip's?
Go to Top of Page

NiteOwl
Junior Member

Canada
403 Posts

Posted - 20 December 2003 :  03:17:11  Show Profile  Visit NiteOwl's Homepage
ya-hoo, it works now, must have been a corrupted IPblock from my end

-=NiteOwl=-

Edited by - NiteOwl on 20 December 2003 12:40:52
Go to Top of Page

NiteOwl
Junior Member

Canada
403 Posts

Posted - 20 December 2003 :  12:34:28  Show Profile  Visit NiteOwl's Homepage
BUT my system is now running soooo slow.

I only have one range of ips to block, is it possible to hard code it into IPban to speed the process up? Maybe a completely scaled down file?
my range is 142.36.0.0-142.36.255.255


-=NiteOwl=-

Edited by - NiteOwl on 20 December 2003 12:42:29
Go to Top of Page

hsng
New Member

84 Posts

Posted - 20 December 2003 :  12:34:53  Show Profile
Glad its working now.
Go to Top of Page

hsng
New Member

84 Posts

Posted - 20 December 2003 :  12:36:23  Show Profile
AWD_ENVY I would like the code for the username. The way I use the the ban is to not piss them off but think of cleaver ways to make them think the site is not working or just not there.
Go to Top of Page

master of puppets
Junior Member

Canada
117 Posts

Posted - 31 December 2003 :  02:38:16  Show Profile  Visit master of puppets's Homepage  Send master of puppets an AOL message  Send master of puppets an ICQ Message  Send master of puppets a Yahoo! Message
The links don't seem to be working right now, and I"m very interested in this mod.

Thanks.

"It's not how far you go, it's how go you far"
- Guy in Ski School
Go to Top of Page

drirene
Junior Member

USA
129 Posts

Posted - 17 February 2004 :  22:23:32  Show Profile  Visit drirene's Homepage
Still not fixed :(

*Trubble* the Cat & Dr. Irene
http://drirene.com

Edited by - drirene on 17 February 2004 22:24:14
Go to Top of Page

Webbo
Average Member

United Kingdom
982 Posts

Posted - 22 February 2004 :  10:01:01  Show Profile  Visit Webbo's Homepage
Here is the code and the files that you need to create:

Create a file called: IPblock.asp

and in it add the following:

<% 
'#############################################################################
'NAME: IPBlock.asp
'Description: IPBlock IP banning script.
'Dependancies: ipbanlist.inc
'
'************** MOD Log ************************
'Name					Date           Mod/Reason
'------------------------------------------------
'Jeremy Mann			04/02/03		Inital Release
'#############################################################################

  ' Detects a cookie from this script ifthis user has been banned before
   IF Request.Cookies(strCookieURL & "banned") = "yes" THEN
     ' Cookie has been detected, so this user was previously banned
		' Where you want to send the banned user
		 Response.Redirect "http://www.ImportOutfitters.com/****off.asp"
   ELSE
   ' Cookie has NOT been detected, so this user was NOT previously banned	
   	   dim bannedipcount
	   dim IPbanRecord(45,45)
	   IPtoCheck=split(request.ServerVariables("remote_addr"),".")   

		' Path to the textfile of banned IP's
	   Banned_IP_File_Path=server.MapPath("include/ipbanlist.inc")
	
	   set IPBanlistObject = server.CreateObject("scripting.filesystemobject")
	   set myfile = IPBanlistObject.OpenTextFile(Banned_IP_File_Path)
	   
	   i=1
	   bannedipcount = 0
	   ' Begin to readin the file containing the band IP's
	   while not myfile.atendofstream
		   line=myfile.readline     
		   tempvar=split(line,"-")
		   IPbanRecord(i,1)=tempvar(0)   
		   IPbanRecord(i,2)=tempvar(1)
		   ' When finished "bannedipcount" will retun how many banned IP's there are, to later load in an array
		   bannedipcount = myfile.line
		   i=i+1
	   wend
	   myfile.close
	   
	   flag=false
	   j=1

	   while j<= bannedipcount

			   LowerboundIP=split(IPbanRecord(j,1),".")
			   UpperboundIP=split(IPbanRecord(j,2),".")
			   
			   if IPtoCheck(0) >= LowerboundIP(0) and IPtoCheck(0) <= UpperboundIP(0) then
				  if IPtoCheck(1) >= LowerboundIP(1) and IPtoCheck(1) <= UpperboundIP(1) then    
					 if IPtoCheck(2) >= LowerboundIP(2) and IPtoCheck(2) <= UpperboundIP(2) then
						if IPtoCheck(3) >= LowerboundIP(3) and IPtoCheck(3) <= UpperboundIP(3) then
						   flag=true		    		
						end if		     
					end if		  
				 end if	
			   end if		
			   if flag=true then
'			   ###### Users IP is in the ban list
'			   	 'set a cookie(incase user tries to later use a proxy box to bypass the IP banning)
				 Response.Cookies(strCookieURL & "banned") = "yes"
'				 Redirect the banned user
				 Response.Redirect "http://www.blackbeatle.com/****off.asp"
				 flag=false
			   end if
	   j=j+1
	   wend
    END IF
%>



NEXT
Create a folder called: include
Within this create a txt file called: ipbanlist.inc

and in it add the following:

1.2.3.4-1.2.3.8
123.123.123.123-789.789.789.789
1.123.2.123-2.456.7.890
1.1.1.1-1.1.1.1




NEXT
Instructions for adding it to your forum files are as follows:

quote:

######################################### NOTES ##########################################################
Currently there is no niffty interface for adding IP's to a table in the DB, because I'm to lazy to create it....
So if someone would like to develop it and help the community, please do so.


######################################### Directions ######################################################
1. Copy the "IPblock.asp" file to the main forum directory
2. Copy "ipbanlist.inc" to the "Include" directory just off the main forum directory.
3. In the "inc_header.asp" file add the following 1 line near the top.


******************* THIS *************************


<!--#INCLUDE FILE="inc_func_common.asp" -->



************** To Look Like THIS *****************



<!--#INCLUDE FILE="inc_func_common.asp" -->
<!--#INCLUDE FILE="IPblock.asp" -->



4. Modify the ipbanlist.inc file to include the IP's that you wish to ban. The document can not contain any blank lines and must be in "x.x.x.x-x.x.x.x" style format on each line.

EXAMPLES:
This would ban any ip between 123.123.2.789 and 123.123.2.795 ----> 123.123.2.789-123.123.2.795
This would ban the single 123.123.456.789 IP ----> 123.123.456.789-123.123.456.789


Thats It !
Sorry it's so plain, and has no interfaces, but it's worked wonderfuly and easliy for me.


I hope this helps

Dave
Go to Top of Page
Page: of 4 Previous Topic Topic Next Topic  
Previous Page
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.21 seconds. Powered By: Snitz Forums 2000 Version 3.4.07