PDA

View Full Version : 404 error ban.


Brad
02-07-2003, 10:00 PM
Hack: 404 error ban

By: Anime-loo

This hack provides you with a new way of banning people from your forum, i wrote this for a client awhile back and never released it, well i saw the blank page ban released so I decided to release mine ;).

This basicly dose what the thread title says, if a user is in the 404 banned usergourp they will get a "HTTP 404 - File not found" on any page powered by vBulletin.

Simple i know, but its been useful for me. :)

Download: Here (https://vborg.vbsupport.ru/attachment.php?s=&postid=352305)

Version 2

Version two is now out, remove the the loo_404 template and do the new code edit for global.php to upgrade. do not run the query in the install file if you already have version 1 installed!!

Velocd
02-08-2003, 09:39 PM
Heh, I've been doing this for the last 4 months on my vBulletin, but I failed at emulating the 404-error page in HTML, so instead I simply copy+pasted an image of the 404-error page into Adobe, saved it as a really light-weight GIF, then edited the ban-template in the ACP and set the image using CSS as a background of the page, but so it does not repeat. It works well, but if the user simply tried to highlight any of the 404-error text, they would find out it would not be possible.. though, that doesn't mean they'd figure out what I had done to ban them ;)

Anyway, your method wins over mine, so I guess it's time for upgrade :p

* Velocd clicks install

N9ne
02-08-2003, 09:40 PM
My hack lets people use whatever :p

nice hack though, but I prefer mysql errors :p

Velocd
02-08-2003, 09:42 PM
You forgot to include the images in the 404 also Anime-loo ;)
And I'm fairly sure this 404 is just the internet-explorer version, so let's hope Netscape/Mozilla users don't catch on ^_^

Brad
02-08-2003, 09:44 PM
Yea, im very lazy. ill zip the images up sometime tonight.

Slynderdale
02-08-2003, 09:45 PM
hmm would this also work?

if ($bbuserinfo['usergroupid']==333) {
@header("HTTP/1.0 404 Not Found");
@header("Status: 404 Not Found");
}


I use index.php to hide important folders by adding this to them

<?php
@header("HTTP/1.0 404 Not Found");
@header("Status: 404 Not Found");
?>


and was wondering if this would also work.

N9ne
02-08-2003, 09:45 PM
What you could do is create a custom 404 page for your server, and then just call it somehow (I think it is possible somehow). That way it's the same in all browser windows :).

N9ne
02-08-2003, 09:49 PM
Originally posted by Slynderdale
hmm would this also work?

if ($bbuserinfo['usergroupid']==333) {
@header("HTTP/1.0 404 Not Found");
@header("Status: 404 Not Found");
}


I use index.php to hide important folders by adding this to them

<?php
@header("HTTP/1.0 404 Not Found");
@header("Status: 404 Not Found");
?>


and was wondering if this would also work.


What does the @header mean/do ?

Slynderdale
02-08-2003, 09:51 PM
Originally posted by N9ne



What does the @header mean/do ?

It sends the user's browser info, like the page status and so on, it can also be used to tell when to update the page in the cace, if it should cache the page and the filetype and so on, with the example I gave above, it tells your browser that this page is 404 (missing) and then the browser shows a 404 file mssing page.

More info here:
http://php.net/header

Martin64
02-08-2003, 10:02 PM
Smart and simple, I like it. :)
Great idea :D

TalkHardRandy
02-09-2003, 04:09 AM
Hmmm... too bad I already did this with the blank page ban...

blackice912
02-09-2003, 04:13 AM
Originally posted by Slynderdale
hmm would this also work?

if ($bbuserinfo['usergroupid']==333) {
@header("HTTP/1.0 404 Not Found");
@header("Status: 404 Not Found");
}


I use index.php to hide important folders by adding this to them

<?php
@header("HTTP/1.0 404 Not Found");
@header("Status: 404 Not Found");
?>


and was wondering if this would also work.

I think that would be the best way to make a 404 error ban hack, since then the browser would call up its internal 404 error page like IE does.

Neo
02-09-2003, 05:00 AM
Thanks yo. I needed this.

Make more hacks.

Erwin
02-09-2003, 05:29 AM
Originally posted by blackice912
I think that would be the best way to make a 404 error ban hack, since then the browser would call up its internal 404 error page like IE does.

Exactly. I've been doing that for 1 year now, by adding a small piece of code in my forum/global.php - the 404 error is based on the browser templates, so it's browser-specific.

Chris M
02-09-2003, 09:39 AM
Nice one:)

Satan

Dean C
02-09-2003, 10:09 AM
Very nice indeed Anime :)

- miSt

Brad
02-09-2003, 03:53 PM
I updated the hack for this. If anyone has installed it they sould download the new txt in the frist post and re-install. Also remove the loo_404 template.

Originally posted by Slynderdale
hmm would this also work?

if ($bbuserinfo['usergroupid']==333) {
@header("HTTP/1.0 404 Not Found");
@header("Status: 404 Not Found");
}


I use index.php to hide important folders by adding this to them

<?php
@header("HTTP/1.0 404 Not Found");
@header("Status: 404 Not Found");
?>


and was wondering if this would also work.

Chris M
02-09-2003, 04:23 PM
@Anime - I can't download the new file - IE says it is corrupt:confused:

Satan

Brad
02-09-2003, 05:03 PM
Heres the file.

Chris M
02-09-2003, 05:44 PM
Thanks:)

Satan

Kars10
02-09-2003, 06:40 PM
Cool! installed... :)

Dynamic One
02-09-2003, 07:56 PM
Thanks For this nice Hack m8.

Link14716
02-10-2003, 01:30 AM
Nice hack, but I decided to use vBStealth with a little bit of code from the HellBan hack to torture the user with Internal Server Errors every 3rd page. I'll click install becuase this hack is still cool. :)

Erwin
02-10-2003, 11:45 PM
I'll tell you how I do it. You can achieve the same result without hacking by doing this:

Open phpinclude template, add to the bottom:


if ($bbuserinfo[usergroupid] == 8) {
header("HTTP/1.0 404 Not Found");
header("Status: 404 Not Found");
exit;
}


Change 8 to the banned usergroupid you use. Done! :)

Link14716
02-11-2003, 12:04 AM
You could, but what's the fun in that? :)

Talisman
02-12-2003, 04:55 AM
Thanks, Erwin. Will use your suggestion.

WouterW
02-18-2003, 06:51 PM
Great hack, man! Works brilliant!

But now another question raises:
How can I hide the banned users from the memberslist on the forum?

Erwin
02-19-2003, 05:06 AM
Open memberlist.php and find the code below:


$userscount=$DB_site->query_first("SELECT COUNT(*) AS users
FROM user,userfield
WHERE $condition AND
user.userid = userfield.userid
".iif($memberAllGood, " AND usergroupid NOT IN (1,3,4) ", "")."
");


Add more usergroups to exclude in (1,3,4) in the code.

:)

Brianna
02-24-2003, 07:00 PM
I have no use for this really (at least at the moment) but I just gotta say what a great idea! Nice job! :)

John
02-25-2003, 10:21 AM
The query doesn't work for me - I get:
Column count doesn't match value count at row 1
On vB 2.2.9

Erwin
02-25-2003, 10:44 PM
[removed because of confusion]

Boofo
02-26-2003, 12:29 AM
Don't you mean this section?

$users=$DB_site->query("SELECT *
FROM user,userfield
WHERE $condition AND
user.userid = userfield.userid
".iif($memberAllGood, " AND usergroupid NOT IN (1,3,4,8) ", "")."

This is what will keep the names off of the memberlist. The code below will just show how many users, won't it? If I missed something, I apologize, Erwin. :)

Originally posted by Erwin
Open memberlist.php and replaced this section with the below:


$userscount=$DB_site->query_first("SELECT COUNT(*) AS users
FROM user,userfield,usergroupid
WHERE $condition AND
user.userid = userfield.userid
".iif($memberAllGood, " AND usergroupid NOT IN (1,3,4) ", "")."
");


Add more usergroups to exclude in (1,3,4) in the code.

:)

Erwin
02-26-2003, 12:38 AM
Boofo, you're right - my memory is getting to me and I got confused by john's post - I've reverted back to my original post.

You don't add anything - just find that code section, and add usergroupids to exclude. :)

Boofo
02-26-2003, 12:47 AM
You need to add the usergroupid to hide in both pieces of code, one for the count (your code) and one for the actual name (the $users code) below that. :)

VeoMorphine
03-02-2003, 05:46 PM
Is there a way this can be done for IP/E-mail banned users as well? I dont like users coming back on proxys.

Erwin
03-02-2003, 06:22 PM
Originally posted by VeoMorphine
Is there a way this can be done for IP/E-mail banned users as well? I dont like users coming back on proxys.

After you ban the member's IP and/or Email, just change their usergroupid to the one for 404 error ban.

007
03-05-2003, 10:52 PM
I tried this and it still brings up the Sorry the administrator has banned your IP address... I was looking around in the files for the place that actually calls the template error_banip but I couldn't find it. Would there be anything I could do there to have IP banned users also get the 404 ban?

Brad
04-29-2003, 12:36 AM
03-05-03 at 08:52 PM 006 said this in Post #37 (https://vborg.vbsupport.ru/showthread.php?postid=361743#post361743)
I tried this and it still brings up the Sorry the administrator has banned your IP address... I was looking around in the files for the place that actually calls the template error_banip but I couldn't find it. Would there be anything I could do there to have IP banned users also get the 404 ban?


Open /admin/functions.php, find:

eval("standarderror(\"".gettemplate("error_banip")."\");");

Replace with:

header("HTTP/1.0 404 Not Found");
header("Status: 404 Not Found");
exit;

007
04-29-2003, 03:59 AM
Oh yeah I figured that out a while ago. Thanks though. If anyone else is wondering that then you just got your answer! :)

lol

lasto
08-23-2003, 01:35 PM
cant run the query for some reason :

SQL-query :

INSERT INTO usergroup
VALUES (

"333", "Banned", "", "0", "1", "1", "1", "1", "0", "1", "0", "0", "0", "1", "1", "1", "1", "0", "0", "1", "1", "1", "0", "0", "1", "0", "0", "0", "0", "0", "0", "0", "0", "1"
)

MySQL said:

#1136 - Column count doesn't match value count at row 1

MaDCaT75
08-24-2003, 05:03 AM
I put one of my members into the banned group and they were still able to get around in the forum? :ermm:

lucky64
07-19-2004, 10:28 PM
Does this work with 3.0? Or is there a 3.0 release?

Brad
07-20-2004, 02:09 AM
Does this work with 3.0? Or is there a 3.0 release?
This is not designed for vB3, but it would be an easy port if anyone is intrested.

lucky64
07-20-2004, 02:34 AM
This is not designed for vB3, but it would be an easy port if anyone is intrested.

I know I am :) Btw, who is that in your sig?

Brad
07-20-2004, 03:03 AM
vB3 beta version can be found here: https://vborg.vbsupport.ru/showthread.php?p=535033#post535033

Destroyed Soul
04-14-2005, 08:41 PM
So all we have to do is run the queerie and then put that code in and we are done? Does it autimatically make a group or do wwe need to make a group to use?

TurXaliM
05-13-2006, 10:44 AM
Thank you Maaann :)

Marco van Herwaarden
05-13-2006, 02:25 PM
Thank you Maaann :)I hope you realize that this hack is for vB version 2, i would advise against using this on any other version.