PLEASE! Need help with .htacess for Ip Redirection!

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • PostWhore
    Confirmed User
    • Jan 2003
    • 4720

    #1

    PLEASE! Need help with .htacess for Ip Redirection!

    On monday this week, i realised that there are about 300 Ips from Russia and Ukraine on my site, obviosly my memebers section had a vulnurability..i got strongbox right away and the problem was solved...however i wanna teach those pesky porkers a lesson, and redirect all russian and ukrainian traffic to something nasty, *******, goatse..maybe page full of exploits (anyone know any?)

    So here what i need... a code for htacess to redirect russian and ukrainian ips to somewhere else..anyone can help?

    would apreciate a lot!
    Ask me how to monetize with adult traffic!
  • PostWhore
    Confirmed User
    • Jan 2003
    • 4720

    #2
    bumppp

    SMOKEY WE NEED YOU!!!
    Ask me how to monetize with adult traffic!

    Comment

    • borked
      Totally Borked
      • Feb 2005
      • 6284

      #3
      get maxmind's GeoIP dbase and install the apache module (mod_geoip API), then in htaccess:

      GeoIPEnable On
      GeoIPDBFile /path/to/GeoIP.dat

      RewriteEngine on
      RewriteCond %{ENV:GEOIP_COUNTRY_CODE} ^RU$ ###RUSSIA
      RewriteCond %{ENV:GEOIP_COUNTRY_CODE} ^UA$ ###UKRAINE
      RewriteRule ^.*$ http://www.gofuckyourself.com/ [L]
      Last edited by borked; 03-15-2007, 10:36 PM.

      For coding work - hit me up on andy // borkedcoder // com
      (consider figuring out the email as test #1)



      All models are wrong, but some are useful. George E.P. Box. p202

      Comment

      • PostWhore
        Confirmed User
        • Jan 2003
        • 4720

        #4
        where do i get maxmind's GeoIP dbase ?
        Ask me how to monetize with adult traffic!

        Comment

        • borked
          Totally Borked
          • Feb 2005
          • 6284

          #5
          another way if you want to do fun things in PHP or some other script:

          in .htaccess

          SetEnvIfNoCase GEOIP_COUNTRY_CODE "^RU$" BadBoy=1
          SetEnvIfNoCase GEOIP_COUNTRY_CODE "^UA$" BadBoy=1
          ##add any other country code to ban

          then in a php script:
          if($_SERVER['BadBoy']==1) {
          //do something with the bad boy ruskies
          }else{
          //we're not banned
          }

          For coding work - hit me up on andy // borkedcoder // com
          (consider figuring out the email as test #1)



          All models are wrong, but some are useful. George E.P. Box. p202

          Comment

          • borked
            Totally Borked
            • Feb 2005
            • 6284

            #6
            Originally posted by PostWhore
            where do i get maxmind's GeoIP dbase ?
            http://www.maxmind.com/app/geoip_country

            For coding work - hit me up on andy // borkedcoder // com
            (consider figuring out the email as test #1)



            All models are wrong, but some are useful. George E.P. Box. p202

            Comment

            • borked
              Totally Borked
              • Feb 2005
              • 6284

              #7
              or hit me up if you want a javascript solution without installing anything

              For coding work - hit me up on andy // borkedcoder // com
              (consider figuring out the email as test #1)



              All models are wrong, but some are useful. George E.P. Box. p202

              Comment

              • raymor
                Confirmed User
                • Oct 2002
                • 3745

                #8
                Strongbox already gives you the country, so there's no need for MaxMind.

                On about line #73 on login.cgi put something like this:
                if ($remote_country m/^RU|UA$/) {
                print "Location: http://www.badhacks.com\n\n";
                exit;
                }

                Some versions of Strongbox have a list of banned countries included in config.pl already,
                but the above will work for any version. Remember to save a copy of the default login.cgi
                any time you modify it, in case you want to go back.
                For historical display only. This information is not current:
                support@bettercgi.com ICQ 7208627
                Strongbox - The next generation in site security
                Throttlebox - The next generation in bandwidth control
                Clonebox - Backup and disaster recovery on steroids

                Comment

                Working...