-
Full IP protection (for hackers ect.)
I am creating my Habbo CMS from scratch, and my PHP is great.
But this isn't done, you can do javascript headers to redirect them to their site back(IP)
PHP Code:
$ip = $_SERVER['REMOTE_ADDR'];
if($ip == 'FILL IN IP HERE')
{
echo"SUM TEXT HERE Ā© DjInTrouble Protections 2010 - 2011.";
}
Dunot remove copyright.
For example, if you know my ip and you hate me, you can do this:
$ip = $_SERVER['REMOTE_ADDR'];
if($ip == '5.93.78.28')
{
echo"Sorry DjInTrouble, no permission for you.";
}
But don't remove copyright,please/
Like me if I helped:)
-
Re: Full IP protection (for hackers ect.)
Why not more, etc.
PHP Code:
$ip = $_SERVER['REMOTE_ADDR'];
if($ip == 'FILL IN IP HERE' || $ip == 'FILL IN IP HERE' || $ip == 'FILL IN IP HERE')
{
echo "Your ip is banned.";
}
-
Re: Full IP protection (for hackers ect.)
Yeah, that for example does work too.
-
Re: Full IP protection (for hackers ect.)
After the echo, why not put exit;
to stop loading more of the page? :P
-
Re: Full IP protection (for hackers ect.)
Hmm.. Tweeney I never thinked about that.
Thanks.
-
Re: Full IP protection (for hackers ect.)
uh, well done for mastering PHP. Even though I doubt this is your actual work. Problem is, is that IP bans aren't affective. They simply do not work or scale in the long run. Also, in the event of an emergency. I'd think it painstakingly slow and inefficient to have to SSH/FTP (whatever you do) to your 'ipban' file, add the IP address ect.
You should consider doing it in MySQL.
-
Re: Full IP protection (for hackers ect.)
Easier method:
PHP Code:
<?php
Define("BANNED", ""); // This could be changed to be MySQL results etc
Define("DO", 0); // edit this
If(in_array($_SERVER['REMOTE_ADDR'], explode(",", BANNED))):
switch(DO):
default:
echo "Permission denied.";
exit();
break;
case 1:
header("Location: http://127.0.0.1");
break;
endswitch;
endif;
?>
Sloppy PHP coding ftw
-
Re: Full IP protection (for hackers ect.)
And what's new with this? xD
- Martin
-
Re: Full IP protection (for hackers ect.)
why dont u use htaccess?
deny from 127.0.0.1
deny from 127.0.0
etc..
-
Re: Full IP protection (for hackers ect.)
-
Re: Full IP protection (for hackers ect.)
Hmm.. yeah but I hate it because I enabled it a time and emu doesn't work anymore. soo...
-
Re: Full IP protection (for hackers ect.)
What the fuck does the site have to do with the firewall blocking emulator, dumb ass. Yes, what Martin said "What's new with this".
-
Re: Full IP protection (for hackers ect.)
The standard Windows Firewall is a no-go. The "extended" one is much better. If you install the Routing and Remote Access service i think you get it. It can block subnets, block ip's, open ports, close all ports exept blahblah.
Edit: Thanks for this anyways, going to use it on my clan's homepage.
-
Re: Full IP protection (for hackers ect.)
Do you can make something that's blocking VPN connections?
-
Re: Full IP protection (for hackers ect.)
PHP Code:
<?php
$ip = $_SERVER['REMOTE_ADDR'];
if(mysql_num_rows("SELECT * FROM ip_bans WHERE ip = '".$ip."'");
{
die('Blocked');
}
?>
table ip_bans, field ip.
simple shit.
edit: o btw, in your first post, die(); it or it will load the page.
-
Re: Full IP protection (for hackers ect.)
For the VPN connections use a Safe@Office box. It costs, but its worth it.
-
Re: Full IP protection (for hackers ect.)
Quote:
Originally Posted by
Milw0rm
The standard Windows Firewall is a no-go. The "extended" one is much better. If you install the Routing and Remote Access service i think you get it. It can block subnets, block ip's, open ports, close all ports exept blahblah.
Edit: Thanks for this anyways, going to use it on my clan's homepage.
i mean the one in windows server 2008 r2 :P
-
Re: Full IP protection (for hackers ect.)
Yes, so do I. There is a firewall in windows called something like RRaS or something like it. It allows alot of shit, google it.
-
Re: Full IP protection (for hackers ect.)
lol, this was just a lame release xD A basic coder come with "fixes" xDD
-
Re: Full IP protection (for hackers ect.)
oh shit, so many codes dont know which on is best ^^
-
Re: Full IP protection (for hackers ect.)
Quote:
Originally Posted by
Jontycat
PHP Code:
<?php
$ip = $_SERVER['REMOTE_ADDR'];
if(mysql_num_rows("SELECT * FROM ip_bans WHERE ip = '".$ip."'");
{
die('Blocked');
}
?>
table ip_bans, field ip.
simple shit.
edit: o btw, in your first post, die(); it or it will load the page.
I think that's the better option.... add a custom msg for each ip for example.... or a custom redirect page / site....
possibilities are endless.
not a bad idea to add this to the hoesekeeping.... :0)
-
Re: Full IP protection (for hackers ect.)
Quote:
Originally Posted by
leenster
I think that's the better option.... add a custom msg for each ip for example.... or a custom redirect page / site....
possibilities are endless.
not a bad idea to add this to the hoesekeeping.... :0)
This is why we have IP bans.
-
Re: Full IP protection (for hackers ect.)
This don't work at all, is this for PHP? Because I tried this, and it does not work ;o
-
Re: Full IP protection (for hackers ect.)
Quote:
Originally Posted by
iPixelHotel
This don't work at all, is this for PHP? Because I tried this, and it does not work ;o
You call yourself a PHP Programmer and you can't even tell what language its in.
Pathetic excuse for a programmer.
-
Re: Full IP protection (for hackers ect.)
Dude, I was joking. I knew it was for PHP. I met it in the terms of sarcasm. Because the coded did not work as PHP, that's all ;l
-
Re: Full IP protection (for hackers ect.)
Quote:
Originally Posted by
iPixelHotel
Dude, I was joking. I knew it was for PHP. I met it in the terms of sarcasm. Because the coded did not work as PHP, that's all ;l
The fuck you talking about?
-
Re: Full IP protection (for hackers ect.)
Quote:
Originally Posted by
iPixelHotel
Dude, I was joking. I knew it was for PHP. I met it in the terms of sarcasm. Because the coded did not work as PHP, that's all ;l
Yeah, of course did you joke, idiot. -.-
-
Re: Full IP protection (for hackers ect.)
-
Re: Full IP protection (for hackers ect.)
Thanks.
I should have added this on my past hotel..