Модератор


Зарегистрирован: Sep 2001
Место проживания: BloodyVostok
Публикаций: 565
Статус:  |
привожу оригинал ip_ban10.zip файло зовется.
IP BAN HACK
by Ahnteis Corazon
Ahnteis@Mindless.com
This script may be redistributed, etc as long as credit is given for original
work.
*** STEP 1 ***
SAVE the following to "ipban.pl" in the same directory as your scripts.
You WILL have to change the first line to point to your banned text file.
----------------------------------------------------------------------------
###########################################
# IP BAN HACK 1.0 #
# By Ahnteis Corazon #
# Ahnteis@Mindless.com #
# #
# YOU MUST LEAVE THIS COMMENT IN! #
###########################################
$IP_BAN_FILE = "the.full.path.to.the.file\banned.cgi";
$badIP = 0;
if (open(IP_BAN_FILE, "$IP_BAN_FILE") )
{
while ($thisIP = <IP_BAN_FILE> )
{
# Try to skip blank lines
if (length($thisIP) > 2)
{
# Remove newline and carriage returns characters.
$thisIP =~ s/\n//g;
$thisIP =~ s/\r//g;
$_ = $ENV{'REMOTE_ADDR'};
if (m/$thisIP/)
{
$badIP = 1;
}
}
}
}
else # If can't find the file, fail.
{
print "Content-type:text/html\n\n";
print "<BODY BGCOLOR=FFFFFF><FONT SIZE=+5 COLOR=FF0000>";
print "Could not open IP ban list file.";
print "</font></body>";
exit (1);
}
if ($badIP == 1) # If they're banned.
{
print "Content-type:text/html\n\n";
print "<BODY BGCOLOR=FFFFFF><FONT SIZE=+5 COLOR=FF0000>";
print "Permission to this week script is <B>denied</b>.<BR><BR>";
print "If you have questions about this error, please ";
print "contact the site administrator.";
print "</font></body>";
exit (1);
}
1;
-----------------------------------------------------------------------------
*** STEP 2 ***
CREATE a file called "banned.cgi" (or other as specified in the path variable)
in the file location that you specified.
In the file, ADD the IP's (full or partial) that you want banned. (1 per line)
It is important that there aren't any extra spaces in the file (although I did
check for blank lines).
Example banned.cgi
-----------------------------------------------------------------------------
34.23.12.
123.49.23.251
-----------------------------------------------------------------------------
*** STEP 3 ***
Any script you wish to enable IP banning on, you simply need to add the line
require ipban.pl;
For example, in ikonboard.pl near the start, find
-----------------------------------------------------------------------------
eval {
($0 =~ m,(.*)/[^/]+,) and unshift (@INC, "$1");
($0 =~ m,(.*)\\[^\\]+,) and unshift (@INC, "$1");
require "ikon.lib"; # Require ikonboard ()
require "data/progs.pl"; # Require prog names
require "data/boardinfo.pl";# Require board info
require "data/styles.pl"; # Require styles info
};
-----------------------------------------------------------------------------
ADD in the line above so that it reads
-----------------------------------------------------------------------------
eval {
($0 =~ m,(.*)/[^/]+,) and unshift (@INC, "$1");
($0 =~ m,(.*)\\[^\\]+,) and unshift (@INC, "$1");
require "ipban.pl";
require "ikon.lib"; # Require ikonboard ()
require "data/progs.pl"; # Require prog names
require "data/boardinfo.pl";# Require board info
require "data/styles.pl"; # Require styles info
};
-----------------------------------------------------------------------------
NOTICE that the ipban require is the FIRST of the require statements.
The most important ones to add the above line to are (in my opinion)
announcements.cgi
forums.cgi
ikonboard.cgi
messanger.cgi
post.cgi
printpage.cgi
register.cgi
topic.cgi
........
........
That should pretty much keep the person from browsing your forum or signing up
etc etc. You may include this with almost any script, and if it doesn't work,
simply remove the "require" line.
__________________
"Gott weiss, ich will kein Engel sein!"
Сообщить модератору об этом сообщении | Предупреждение | IP: определен
|