Questions: Access Denied and Auto IP ban?

Modo

blame it on my asd
May 27, 2013
137
42
I've seen on a hotel where you attempt to access a file for example /app/management/config, it automatically IP bans you from the hotel. This is quite a good feature and I feel that it would get people with malicious intentions off guard and then protect the hotel. Does anyone know how to do this?

Also if that is not possible... Error 403 Permission Denied: anyway of having a personal permission denied page?
 

BIOS

ಠ‿ಠ
Apr 25, 2012
906
247
You could probably just make a PHP script with SQL that inserts a new ban into the bans table for the current session user and implement it into the pages through a config or something?

If you wanted to just prevent them accessing certain directories you could use die(); however .htaccess/web.config would be a lot more flexible at doing this.
 

Modo

blame it on my asd
May 27, 2013
137
42
You could probably just make a PHP script with SQL that inserts a new ban into the bans table for the current session user and implement it into the pages through a config or something?

If you wanted to just prevent them accessing certain directories you could use die(); however .htaccess/web.config would be a lot more flexible at doing this.
I might give that a go, I already use die(). ust thought the auto ban thing was cool :) Thanks
 

BIOS

ಠ‿ಠ
Apr 25, 2012
906
247
I might give that a go, I already use die(). ust thought the auto ban thing was cool :) Thanks
I can give you an example script of the auto ban if you wanted me to?

Although you'd have to adjust it to your needs and improve on it since it'd just be a basic version of the script.

Edit: Here's an example, sorry if I made a mistake anywhere I just did a quick example to show you how.
You would add this to the top of each page you want the user to be banned when they access, note this would ban the user providing that you have the same database structure as the query.
PHP:
<?php
    if(isset($_SESSION['id'])){
        mysql_query("
        INSERT INTO bans (id, bantype, value, reason, expire, added_by, added_date)
        VALUES ('', 'user', '" .$_SESSION['username']. "', 'Unauthorized access', '31333392000', 'System', '" .time(). "')
        ") or die(mysql_error());
      
    }else{
        die('You don\'t have access to view this area');
    }
?>
 
Last edited:

Users who are viewing this thread

Top