Log in

View Full Version : Cookie Ban ??


aveon
07-30-2006, 02:16 AM
hello mates

im looking for a mod well this mod will put a cookie on someones computer if they are banned via IP and try to access the forum. It then will check for that cookie every time they try to access the forum, and will block them. If there is something like this it would be most usefull for keeping people with dynamic IPs out.???????

it would be great if anyone can help me :(

aveon
07-31-2006, 02:55 AM
i figured ou something like this and i dont know how to install this to vbulletin...


<?php
$IP = $_SERVER['REMOTE_ADDR'];
if ($IP =="x.x.x.x")
setcookie(Ban, 'cookietest', time()+3600000000);
else if ($IP =="x.x.x.x")
setcookie(Ban, 'cookietest', time()+3600000000);
else if ($IP =="x.x.x.x")
setcookie(Ban, 'cookietest', time()+3600000000);
else if ($IP =="x.x.x.x")
setcookie(Ban, 'cookietest', time()+3600000000);
else if ($IP =="x.x.x.x")
setcookie(Ban, 'cookietest', time()+3600000000);
else if ($IP =="x.x.x.x")
setcookie(Ban, 'cookietest', time()+3600000000);
else if ($IP =="x.x.x.x")
setcookie(Ban, 'cookietest', time()+3600000000);
else echo "";
?>
<?php
if ($_COOKIE['Ban'])
die ('Sorry, you are banned from using this forum!');
else echo "";
?>

aveon
08-03-2006, 05:08 AM
this would be a great hack if you guys help me to finish this and i know it will be use full to other vb users

harmor19
08-03-2006, 06:02 AM
Why would you do it that way?
A better solution would giving the user a cookie then check if the user has the cookie

<?php
setcookie(Ban, 'cookietest', time()+3600000000);
?>

Then you'd just check if user has the cookie
<?php
if (isset($_COOKIE['Ban']))
{
die("You are banned from using this forum");
}
?>

aveon
08-03-2006, 09:07 AM
where do i add this codes how do i creae a coockie i dont have any idea can you help me out with that???

aveon
08-07-2006, 06:00 AM
anybody to help me any body good on cookies ?????

fxs158
08-07-2006, 12:04 PM
This is actually a good idea, but as the original poster said, the ideal thing would be to send two cookies. One with the forum name etc and the seccond with a name that we would choose.

That way if user tries to delete cookie, more than likelly he is not going to delete all becaue it is a pain in the rear, he would then look for the cookie and delete the one with the domain name and call it the day.

Not knowing that there is a seccond cookie.

Better yet, is there a way to set a cookie that would record the mac adress of the user?

I be willing to pay $$ for a good security hack like this.

aveon
08-07-2006, 02:20 PM
i just need to kno how to set cookies and send them to the users how do i do that my question is easy is that...???

Dilmah
08-07-2006, 03:20 PM
Mac addresses are useless.

aveon
08-08-2006, 02:37 AM
i found this on web and this hack is for invidionize boards but can we use it for vbulletin too??


2. Open up functions.php

3. Find:

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

if ($ibforums->vars['ban_ip'])

{

$ips = explode( "|", $ibforums->vars['ban_ip'] );



foreach ($ips as $ip)

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

4. Before add:

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

// Check to see if the banned cookie is set

if ($std->my_getcookie('banned')) {

$std->Error( array( 'LEVEL' => 1, 'MSG' => 'you_are_banned', 'INIT' => 1 ) );

}

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

5. Find:

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

$ip = preg_replace( "/\*/", '.*' , preg_quote($ip, "/") );



if ( preg_match( "/^$ip/", $ibforums->input['IP_ADDRESS'] ) )

{

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

6. Below add:

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

if(!$std->my_getcookie('banned')) {

$std->my_setcookie('banned', 'yes');

}

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

with all this information cant we figure out anything at all???

aveon
08-13-2006, 06:34 PM
man noone doesnt kno about cookies its bad guys really bad all the other boards can do it and vbulletin should be betteer but i see noone cares...

any body there to help guys come on it been 2 weeks anyoone cant figure it out hmmmm

aveon
08-16-2006, 03:27 AM
man we gave 160 for nothing no cosumer service nothing it been 2 weeks i gave to many cluee if i only knew anything about cookies i would figure it out but i cant...

Paul M
08-16-2006, 06:27 PM
Just to be clear - this is not a Jelsoft Customer Service forum, this is a voluntary site for people to release vb modifications. There is no guarentee you will get any answer to your question.

aveon
09-09-2006, 01:17 PM
anybody people this is so imporant please help me put with this
cant we improve ip bannning on vbulletin or how can we make ip banning process set a cookie on some ones computer from that ip and he will be blocked even if he reseta his ip come on friends

aveon
09-17-2006, 08:00 PM
any idea to put a cookie to functions.php on this line

/ ################################################## ###########################
/**
* Checks to see if the IP address of the visiting user is banned from visiting
*
* This function will show an error and halt execution if the IP is banned.
*/
function verify_ip_ban()
{
// make sure we can contact the admin
if (THIS_SCRIPT == 'sendmessage' AND (empty($_REQUEST['do']) OR $_REQUEST['do'] == 'contactus' OR $_REQUEST['do'] == 'docontactus'))
{
return;
}

global $vbulletin;

$user_ipaddress = IPADDRESS . '.';

if ($vbulletin->options['enablebanning'] == 1 AND $vbulletin->options['banip'] = trim($vbulletin->options['banip']))
{
$addresses = preg_split('#\s+#', $vbulletin->options['banip'], -1, PREG_SPLIT_NO_EMPTY);
foreach ($addresses AS $banned_ip)
{
if (strpos($banned_ip, '*') === false AND $banned_ip{strlen($banned_ip) - 1} != '.')
{
$banned_ip .= '.';
}

$banned_ip_regex = str_replace('\*', '(.*)', preg_quote($banned_ip, '#'));
if (preg_match('#^' . $banned_ip_regex . '#U', $user_ipaddress))
{
eval(standard_error(fetch_error('banip', $vbulletin->options['contactuslink'])));
}
}
}
}

// ################################################## ###########################
/**

aveon
09-30-2006, 02:25 PM
come on coders cat anybody figure anything out?? :(

aveon
10-29-2006, 08:42 PM
is there anybody out there that can help me with this im not good at coding any good coder can help me with this come on guys vb must be better than smf:ermm:

Mythotical
10-31-2006, 08:35 AM
aveon, got your PM, I will test a few things with your code as it will have to be placed in a plugin. I'll make a post within the next 12-18 hours to let you know.

aveon
10-31-2006, 10:30 AM
aveon, got your PM, I will test a few things with your code as it will have to be placed in a plugin. I'll make a post within the next 12-18 hours to let you know.


thnx bro

aveon
11-09-2006, 06:46 PM
it been 5 months since i requested this mod is it time that u guys help me on this??

fly
11-09-2006, 07:33 PM
This totally seems like a useless hack to me. When people usually clear cookies, they clear them all. Either way, if you want ensure this hack is done, offer to pay for it in the proper forum.

aveon
11-09-2006, 08:03 PM
This totally seems like a useless hack to me. When people usually clear cookies, they clear them all. Either way, if you want ensure this hack is done, offer to pay for it in the proper forum.



not everyone can think that way not every one knows what a cookie is soo if u guys can atleast do it usefull or useless will use it atleast im sure i will

Reeve of shinra
11-09-2006, 08:55 PM
There was a vb2 hack that did something similiar to this... we modded it and called it the token of death because were funny like that. It worked pretty well. If I can find time later, I'll see if I can recode it for 3.5/3.6.

aveon
11-11-2006, 01:56 AM
There was a vb2 hack that did something similiar to this... we modded it and called it the token of death because were funny like that. It worked pretty well. If I can find time later, I'll see if I can recode it for 3.5/3.6.

eweryone says that they are gunna help but they never help i hope u will thanx

aveon
11-12-2006, 03:34 AM
hmmm i think im gunna learn php and vbulletin to do it myself noones helpin me on this fo 6 months wow

G0F0RBR0KE
11-12-2006, 03:45 AM
Once again..this is not a Jelsoft Customer Services..I know you're desperate for this modification to be added...The more and more you keep bringing this subject...people will not do it..Either you google and find a way to learn how to develope your own or pay...coding isn't simple..we need to test them before it's even out to publics...how would you feel that someone makes it and gives it to you..you try it..the board gets mess up??

We also need to be pre-caution on what we do..One mistake can cause us to restart the community (if we forget to get a back up)..

aveon
11-12-2006, 04:00 AM
Once again..this is not a Jelsoft Customer Services..I know you're desperate for this modification to be added...The more and more you keep bringing this subject...people will not do it..Either you google and find a way to learn how to develope your own or pay...coding isn't simple..we need to test them before it's even out to publics...how would you feel that someone makes it and gives it to you..you try it..the board gets mess up??

We also need to be pre-caution on what we do..One mistake can cause us to restart the community (if we forget to get a back up)..


ok i undertand wat u mean but the more those guys messin with my site more i get upset i just wanna do altleast to keem them away for i while and for that back up thing just get a free domain like funpic kayyo whatever so ur own site will be safe anyways the ppl who said they r gunna help i think they couldnt come up with any mod i thanx to them for try to help meh i wish there is a way to ban dinamic ip's for good but there are not much we can do so im desparet about this hack but no luck smf invesion boards usin this mod but we cant anyways thats not the point im glad ppl try to help me thanx to u all :)

G0F0RBR0KE
11-12-2006, 04:21 AM
What version of vBulltin you're using??? You know there is a hack called "miserable" simply put him in there. He'll have difficult time logging out...

https://vborg.vbsupport.ru/showthread.php?t=121886&highlight=miserable+users that is for 3.6.x

aveon
11-12-2006, 04:26 AM
What version of vBulltin you're using??? You know there is a hack called "miserable" simply put him in there. He'll have difficult time logging out...

https://vborg.vbsupport.ru/showthread.php?t=121886&highlight=miserable+users that is for 3.6.x

i tried bro it doesnt even work on this guys they post adul pics and all that crap and other members stays away from the site

G0F0RBR0KE
11-12-2006, 04:31 AM
I've been there..try banning IP ranges..If he uses proxies...most likely all IP will start with the same digit...just the 2 or 3 last digit will be different..

Example

24.123.11.45* will block
24.123.11.1
24.123.11.43
etc...

aveon
11-12-2006, 04:35 AM
i kno bro but for couple of chump all the members from that region will be band its not fear to others and dinamic ips changes on every restart if the modem ill try to see if i can entegrate Invision Power Boards cookie ban mod for vbulletin i dnd ewen kno how

?dit (Aveon)

here is a code ifound on internet can we integrate this for vb

################################################## ############
## MOD Title: Ban_cookie
## MOD Author: Merlin Sythove < Merlin@silvercircle.org >
## MOD Description: Give banned users a cookie and check that too,
## in addition to the existing checks. Once the cookie is in place:
## if it matches the database, the user is banned, even if the user
## gets another IP or is not logged in so the user ID is unknown.
## MOD Version: 0.9
##
## Installation Level: (Easy/Intermediate/Advanced)
## Installation Time: 5 Minutes
## Files To Edit: includes/sessions.php
## Included Files: (N/A)
## License: http://opensource.org/licenses/gpl-license.php GNU General Public License v2
################################################## ############
## For security purposes, please check: http://www.phpbb.com/mods/
## for the latest version of this MOD. Although MODs are checked
## before being allowed in the MODs Database there is no guarantee
## that there are no security problems within the MOD. No support
## will be given for MODs not found within the MODs Database which
## can be found at http://www.phpbb.com/mods/
################################################## ############
## Author Notes:
##
################################################## ############
## MOD History:
##
## 2005-1101: Version 0.9
##
################################################## ############
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
################################################## ############

#
#-----[ OPEN ]------------------------------------------
#
includes/sessions.php

#
#-----[ FIND ]------------------------------------------
#
$sql = "SELECT ban_ip, ban_userid, ban_email
FROM " . BANLIST_TABLE . "
WHERE ban_ip IN ('" . $user_ip_parts[1] . $user_ip_parts[2] . $user_ip_parts[3] . $user_ip_parts[4] . "', '" . $user_ip_parts[1] . $user_ip_parts[2] . $user_ip_parts[3] . "ff', '" . $user_ip_parts[1] . $user_ip_parts[2] . "ffff', '" . $user_ip_parts[1] . "ffffff')
OR ban_userid = $user_id";
if ( $user_id != ANONYMOUS )
{
$sql .= " OR ban_email LIKE '" . str_replace("\'", "''", $userdata['user_email']) . "'
OR ban_email LIKE '" . substr(str_replace("\'", "''", $userdata['user_email']), strpos(str_replace("\'", "''", $userdata['user_email']), "@")) . "'";
}
if ( !($result = $db->sql_query($sql)) )
{
message_die(CRITICAL_ERROR, 'Could not obtain ban information', '', __LINE__, __FILE__, $sql);
}

if ( $ban_info = $db->sql_fetchrow($result) )
{
if ( $ban_info['ban_ip'] || $ban_info['ban_userid'] || $ban_info['ban_email'] )
{
message_die(CRITICAL_MESSAGE, 'You_been_banned');
}
}

#
#-----[ REPLACE WITH ]------------------------------------------
#
//START MOD Ban_cookie
//Give banned users a cookie and check that too, in addition to the existing checks.
//Once the cookie is in place: if it matches the database, the user is banned,
//even if the user gets another IP or is not logged in so the user ID is unknown.

//Get cookie ban settings.
$ban_cookie = '';
$banned_id = isset($HTTP_COOKIE_VARS[$board_config['cookie_name'].'_banned_id']) ? $HTTP_COOKIE_VARS[$board_config['cookie_name'].'_banned_id'] : '';
$banned_ip = isset($HTTP_COOKIE_VARS[$board_config['cookie_name'].'_banned_ip']) ? $HTTP_COOKIE_VARS[$board_config['cookie_name'].'_banned_ip'] : '';

//Yes, cookie ban settings were there. See if they match the database.
//If not, delete cookie.
if ($banned_ip || $banned_id)
{
$sql = "SELECT *
FROM " . BANLIST_TABLE . "
WHERE ";
$sql .= ($banned_ip) ? " ban_ip = '" . $banned_ip . "'" : '';
$sql .= ($banned_id) ? ($banned_ip ? ' OR ' : '') . ' ban_userid = ' . $banned_id : '';
if ( !($result = $db->sql_query($sql)) )
{
message_die(CRITICAL_ERROR, 'Could not obtain ban information', '', __LINE__, __FILE__, $sql);
}
if ( $ban_info = $db->sql_fetchrow($result) )
{
$ban_cookie = ( $ban_info['ban_ip'] || $ban_info['ban_userid']);
}
//There was a cookie but no match in the database, so the ban is lifted:
//delete the cookie by setting the expiry time 1 hour ago
if (! $ban_cookie)
{
if ($banned_ip) setcookie($board_config['cookie_name'].'_banned_ip',$banned_ip, time()-3600);
if ($banned_id) setcookie($board_config['cookie_name'].'_banned_id',$banned_id, time()-3600);
}
}
//Have $ban_cookie, if not empty, the user is banned via a cookie.
//If empty, then there was no cookie, or there was no LONGER a database match so the cookie was deleted

//Check if there is database ban info - this is roughly the original ban code
$ban_database = '';
$sql = "SELECT *
FROM " . BANLIST_TABLE . "
WHERE ban_ip IN ('" . $user_ip_parts[1] . $user_ip_parts[2] . $user_ip_parts[3] . $user_ip_parts[4] . "', '" . $user_ip_parts[1] . $user_ip_parts[2] . $user_ip_parts[3] . "ff', '" . $user_ip_parts[1] . $user_ip_parts[2] . "ffff', '" . $user_ip_parts[1] . "ffffff')
OR ban_userid = $user_id";
if ( $user_id != ANONYMOUS )
{
$sql .= " OR ban_email LIKE '" . str_replace("\'", "''", $userdata['user_email']) . "'
OR ban_email LIKE '" . substr(str_replace("\'", "''", $userdata['user_email']), strpos(str_replace("\'", "''", $userdata['user_email']), "@")) . "'";
}
if ( !($result = $db->sql_query($sql)) )
{
message_die(CRITICAL_ERROR, 'Could not obtain ban information', '', __LINE__, __FILE__, $sql);
}
if ( $ban_info = $db->sql_fetchrow($result) )
{
$ban_database = ( $ban_info['ban_ip'] || $ban_info['ban_userid'] || $ban_info['ban_email'] );
//Fill these variables from database if not filled from cookie yet
if (! $banned_ip) $banned_ip = $ban_info['ban_ip'];
if (! $banned_id) $banned_id = $ban_info['ban_userid'];
}

//User is banned in some way?
if ($ban_cookie || $ban_database)
{
//Set the ban_cookie, time it for 1 year. The time restarts every time the user comes here
if ($banned_ip) setcookie($board_config['cookie_name'].'_banned_ip',$banned_ip, time()+365*24*3600);
if ($banned_id) setcookie($board_config['cookie_name'].'_banned_id',$banned_id, time()+365*24*3600);
//Close the forum to this person
message_die(CRITICAL_MESSAGE, 'You_been_banned');
}
//END MOD Ban_cookie

#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
# EoM

G0F0RBR0KE
11-12-2006, 05:02 AM
Alrite...I'll see if I can get it transfer to vBulletin... I'll try my best...

aveon
11-12-2006, 05:04 AM
Alrite...I'll see if I can get it transfer to vBulletin... I'll try my best...


thnx bro if u want any type of style im here im professional on html but not on php thanx again

G0F0RBR0KE
11-12-2006, 05:20 AM
Before I decide to start on it..please tell me what version vB you're running...

aveon
11-12-2006, 05:26 AM
Before I decide to start on it..please tell me what version vB you're running...

3.6.1

G0F0RBR0KE
11-12-2006, 05:34 AM
not good >.> I'm on 3.5.4 and there is NO way for me to implement this till I upgrade my software (I have no attention in upgrading since they don't have ushop and ucash for that version)...Don't give up hope...I might see if my friend allows me to test stuff on his forum... :confused:

aveon
11-12-2006, 05:41 AM
not good >.> I'm on 3.5.4 and there is NO way for me to implement this till I upgrade my software (I have no attention in upgrading since they don't have ushop and ucash for that version)...Don't give up hope...I might see if my friend allows me to test stuff on his forum... :confused:


like i said before just get a free domain and install vbulletin to it and test ur staff on that free site its better and clear

G0F0RBR0KE
11-12-2006, 05:43 AM
You're running 3.6.x I'm running 3.5.x
You do realize I was planning to test it as a xml product...But i'll see if I can test it on my friends forum...I doubt he'll do it on a free domain..

aveon
11-12-2006, 05:46 AM
actuallt i do have a free domain you can install vbuletin on it for ur test site there you lo ill give you the login by pm

G0F0RBR0KE
11-12-2006, 05:51 AM
I dont have vB 3.6.x and my friend wont allow me to have his to test stuff

aveon
11-12-2006, 05:56 AM
information has een sent check you mailbox and i have to leave now gotta go to work soon i understand work on it whenever u want ok thnx for your helps bye

Reeve of shinra
11-13-2006, 04:41 AM
<a href="https://vborg.vbsupport.ru/showthread.php?t=131425" target="_blank">https://vborg.vbsupport.ru/showthread.php?t=131425</a>

Here is a 3.6 cookie ban script. If a user is in a specified usergroup, it will set a cookie and then add any existing or new aliases to a specified banned usergroup.

fly
11-13-2006, 11:42 AM
So these people are smart enough to use proxies, smart enough to go into their cookies folder and delete the proper cookie, but aren't smart enough to clear all cookies?

Why not just shut off registration for a while? Why not ban them posting images until they hit a certain amount of posts? There is certainly many things you can do, but this seems like it will fail.

Reeve of shinra
11-13-2006, 01:43 PM
Its another tool in the arsenal, thats all. Plus its fun :)

aveon
10-27-2007, 04:46 AM
anybody still wondering??

ChrisLM2001
10-27-2007, 07:38 AM
Its another tool in the arsenal, thats all. Plus its fun :)

Yet, it has little use for actually keeping someone from the site from coming back to post again. Worse, for reading access (especially competitors, as a simple and free workaround for that is possible, despite proxy bans).

Persistent trolls know the tricks of cookie based bans. And the ones that aren't, weren't expecting to be around for long anyway (making the hair pulling exercise of finding that "true blue" cookie based ban script worthless, as the troll made you work to keep him out -- he'll be the last one laughing).

For trolls registration moderation/private groups/forums with IP access only are the best way to keep them out. With the private route, they can't read that forum's content, either if you vett those requesters' access (something important for those who are worried about competition snooping, and having a "friend" leak content).

silvermerc
10-27-2007, 01:55 PM
Theirs a cookie ban already,Im using it on my VB atm its pretty good

aveon
10-27-2007, 02:08 PM
Theirs a cookie ban already,Im using it on my VB atm its pretty good

can u give me a link

mahakala
11-02-2008, 06:11 PM
ping ;) is this still active?