Jump to content


block spammers, block many ip's


12 replies to this topic

#1 Annihilator

    Young Padawan

  • Members
  • Pip
  • 34 posts

Posted 14 May 2006 - 07:43 AM

202.134.34.0 - 202.134.34.255

let's say a guy have this ip from 0 to 255, how do i block them all?

It should be a way instead for typing 0 to 255, that would like lots of resource and load time on a website

#2 Chaos King

    Senior Programmer

  • P2L Staff
  • PipPipPip
  • 676 posts
  • Gender:Male
  • Location:Florida

Posted 14 May 2006 - 07:47 AM

Simple search against the database comes up with alot of results :love:

http://www.pixel2life.com/tutorials/All/Al...cess%20ip%20ban

I am not sure about ranges with .htaccess but I am sure it still uses the regex system. So you could do like:

deny from 000.000.000.(0-9+)

I am not sure if that would work, but it is worth a try.

Also, pelase don't post people's ip address on the forum, you are opening them to attacks!

Edited by Chaos King, 14 May 2006 - 07:50 AM.


#3 Annihilator

    Young Padawan

  • Members
  • Pip
  • 34 posts

Posted 14 May 2006 - 08:08 AM

it's fake ip

# -FrontPage-

IndexIgnore .htaccess */.??* *~ *# */HEADER* */README* */_vti*

<Limit GET POST>
order deny,allow
deny from all
allow from all
</Limit>
<Limit PUT DELETE>
order deny,allow
deny from all
</Limit>


this is my .htaccess

found this site

http://www.clockwatc...cess_block.html


You can also block an entire IP block/range. Here we will not specify the last octet in the .htaccess file.

deny from 127.0.0

where do i add this? just simply replace after

order deny,allow
deny from all
?

Edited by Annihilator, 14 May 2006 - 08:21 AM.


#4 Annihilator

    Young Padawan

  • Members
  • Pip
  • 34 posts

Posted 14 May 2006 - 09:27 AM

solved

but how to ban whole country? or ISP

#5 Matthew.

    Official Spammer .Matt

  • Members
  • PipPipPipPip
  • 2,749 posts
  • Gender:Male
  • Location:England

Posted 14 May 2006 - 10:02 AM

To ban a whole country you could use something called IP2location. Its a long time since i read about it but im sure a quick gooling should get ya somewhere ;) :google:

#6 Donna

    Retired P2L Queen!

  • P2L Staff
  • PipPipPipPip
  • 12,330 posts
  • Gender:Female
  • Location:B.C Canada

Posted 14 May 2006 - 10:19 AM

View PostAnnihilator, on May 15 2006, 02:27 AM, said:

solved

but how to ban whole country? or ISP

You would need the full IP range and you have to becareful doing it as some IP ranges can be in 4-5 countries

re: australia, new zealand, thailand and vietnam are all within the same IP range, even if you do manage to get a country blocked they can still access your site via proxy and with new proxies released daily it's almost impossible.

#7 Matthew.

    Official Spammer .Matt

  • Members
  • PipPipPipPip
  • 2,749 posts
  • Gender:Male
  • Location:England

Posted 14 May 2006 - 10:48 AM

Perhaps try this as well :google:

http://www.phpclasse...ckage/2363.html

I agree with what donna says as well. Some proxys can be caught though however any type of creditable proxy will hide the users real IP. Its almost not worth bothering about it.

#8 Annihilator

    Young Padawan

  • Members
  • Pip
  • 34 posts

Posted 14 May 2006 - 11:53 AM

omg... ok, thanks anyway.

how about block ISP?

Edited by Annihilator, 14 May 2006 - 12:02 PM.


#9 rc69

    PHP Master PD

  • P2L Staff
  • PipPipPipPip
  • 3,827 posts
  • Gender:Male
  • Location:Here
  • Interests:Web Development

Posted 14 May 2006 - 12:24 PM

With the amount of dynamic IP's out there, i don't think that's possible. In fact, i can't think of a single way for a web app to get the ISP of a user, unless that user is using their browser (i.e. the MSN/AOL browsers vs. IE/FF).

I know when ever i reset my modem i get a completely different IP each time, and i've yet to find any kind of pattern to any of the IP's i've had.

#10 Matthew.

    Official Spammer .Matt

  • Members
  • PipPipPipPip
  • 2,749 posts
  • Gender:Male
  • Location:England

Posted 14 May 2006 - 01:24 PM

Hi there, i would check this out for a bit of reading material ;)

http://www.experts-exchange.com/Web/Web_La...Q_21810715.html

(scroll down to the code)

Edited by .Matt, 14 May 2006 - 01:24 PM.


#11 Jynxis

    Young Padawan

  • Members
  • Pip
  • 132 posts
  • Location:The Shadows

Posted 14 May 2006 - 09:15 PM

100WebSpace.Com <-- They seem to be able to detect proxies.

#12 Av-

    I Feel Left Out

  • Members
  • PipPipPipPip
  • 1,971 posts
  • Gender:Male
  • Location:10 ft. below sea level

Posted 15 May 2006 - 07:12 AM

View Post.Matt, on May 14 2006, 06:23 PM, said:

Hi there, i would check this out for a bit of reading material :blink:

http://www.experts-exchange.com/Web/Web_La...Q_21810715.html

(scroll down to the code)

"You Need to Subscribe to View This Solution"

#13 Matthew.

    Official Spammer .Matt

  • Members
  • PipPipPipPip
  • 2,749 posts
  • Gender:Male
  • Location:England

Posted 15 May 2006 - 12:04 PM

Aploagies.

Note i didnt write this code, if i did i would go burry my head in the sand as its poor lol.

<?php

$ip_address = $_SERVER["REMOTE_ADDR"];

$content = file_get_contents("http://ws.arin.net/cgi-bin/whois.pl?queryinput=$ip_address");

$pos = strpos($content, "<pre") + 4;
$content = substr($content,$pos);

$pos = strpos($content, "OrgName:") + 8;
$content = substr($content,$pos);
$pos = strpos($content, "\n");
$isp_name = trim(substr($content,0,$pos));
$content = substr($content,$pos);

$pos = strpos($content, "City:") + 5;
$content = substr($content,$pos);
$pos = strpos($content, "\n");
$city = trim(substr($content,0,$pos));
$content = substr($content,$pos);

$pos = strpos($content, "StateProv:") + 10;
$content = substr($content,$pos);
$pos = strpos($content, "\n");
$state = trim(substr($content,0,$pos));
$content = substr($content,$pos);

echo "ISP: $isp_name\n";
echo "City: $city\n";
echo "State: $state\n";

?>


I would also suggest checking this out for a better soloution. http://thejunglebugs...ace.com/CIPATC/

Edited by .Matt, 15 May 2006 - 12:06 PM.






1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users