Announcement

Collapse
No announcement yet.

Porn Blocking CGI Proxy

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Porn Blocking CGI Proxy

    OK, so I am hosting a cgi proxy so people can bypass filters, but recently some have been using it to look a porn (Some being 650/19000 page requests). I was wondering if there was a way to put url keyword filtering into a cgi proxy. I know I can use a .pac auto configuration file with my browser to block keywords in a websites url, but is there a way to do something similar to that in my cgi proxy? I am trying to work out a way to do something similar to what the-cloak does by limiting bandwidth for pornography access.

    EDIT: Incase you think I am being a little of a hypocrite here, the purpose of the proxy is to allow access to Yahoo, Gmail, Slashdot, Jinx, etc, but NOT porn.
    Last edited by minihacker316; December 23, 2005, 22:33.

  • #2
    Originally posted by minihacker316
    OK, so I am hosting a cgi proxy so people can bypass filters, but recently some have been using it to look a porn (Some being 650/19000 page requests). I was wondering if there was a way to put url keyword filtering into a cgi proxy. I know I can use a .pac auto configuration file with my browser to block keywords in a websites url, but is there a way to do something similar to that in my cgi proxy? I am trying to work out a way to do something similar to what the-cloak does by limiting bandwidth for pornography access.

    EDIT: Incase you think I am being a little of a hypocrite here, the purpose of the proxy is to allow access to Yahoo, Gmail, Slashdot, Jinx, etc, but NOT porn.
    due to the increasing sneakiness of such sites, you may find it easier to do an "Allow Only" list and just enter URLS you DO want to allow one at a time such as Yahoo, Gmail, etc...


    Web Hosting --

    Comment


    • #3
      Good point, however alot of my visitors are from other countries, and I can only read english. I went and blocked as many websites as I could think of in the banned section. I was mostly wondering if it were possible to use the banned server section to ban any server containing a 'black-list' word in the URL.

      It is not really as much of a problem as I would have though. Most of the hits to my proxy are for people going to tibet independance -cough-peacefire-cough-, Yahoo, Hotmail, Gmail, Myspace, several stock trading websites, and some hits to monster. I have one or two people occasionally that come and look at porn, though. I don't want to screw everyone else just because of them. I'd ban there IP, except it changes alot. FOr the most part their IP stayes the same, and only the last section changes. If I blocked a range of IP's, that would get rid of them, except there are other people in the same school/isp that would be wrongfully blocked, also.

      Comment


      • #4
        Originally posted by minihacker316
        Good point, however alot of my visitors are from other countries, and I can only read english. I went and blocked as many websites as I could think of in the banned section. I was mostly wondering if it were possible to use the banned server section to ban any server containing a 'black-list' word in the URL.

        It is not really as much of a problem as I would have though. Most of the hits to my proxy are for people going to tibet independance -cough-peacefire-cough-, Yahoo, Hotmail, Gmail, Myspace, several stock trading websites, and some hits to monster. I have one or two people occasionally that come and look at porn, though. I don't want to screw everyone else just because of them. I'd ban there IP, except it changes alot. FOr the most part their IP stayes the same, and only the last section changes. If I blocked a range of IP's, that would get rid of them, except there are other people in the same school/isp that would be wrongfully blocked, also.

        EDIT: (other post too old to edit

        EDIT: ---------------------------------------------------------------------
        OK, so I was trying to modify the following code so that it checks the variable for a string, and if it is bad it changes the url it is trying to access to my 'block page', but I can't figure out how you search for a string in a variable. The code is below:

        Code:
        sub proxy_encode {
            my($URL)= @_ ;
            $URL=~ s#^([\w+.-]+)://#$1/# ;                 # http://xxx -> http/xxx
        #    $URL=~ s/(.)/ sprintf('%02x',ord($1)) /ge ;   # each char -> 2-hex
        #    $URL=~ tr/a-zA-Z/n-za-mN-ZA-M/ ;              # rot-13
            return $URL ;
        }
        
        sub proxy_decode {
            my($enc_URL)= @_ ;
        #    $enc_URL=~ tr/a-zA-Z/n-za-mN-ZA-M/ ;        # rot-13
        #    $enc_URL=~ s/([0-9A-Fa-f]{2})/ sprintf("%c",hex($1)) /ge ;
            $enc_URL=~ s#^([\w+.-]+)/#$1://# ;           # http/xxx -> http://xxx
            return $enc_URL ;
        }
        Anyway, I was thinking of putting the code between sub proxy_encode { and my($URL)= @_ ;. I was just wondering how I would go about doing this. I was trying to find a way to search $url for the string, at first with something simple like below, but it didn't work. I am still googleing..

        Code:
        sub proxy_encode {
            if ($URL =~ sex) {
              print 'eventually block this';
            } else {
              print 'It is fine';
            }
            my($URL)= @_ ;
            $URL=~ s#^([\w+.-]+)://#$1/# ;                 # http://xxx -> http/xxx
        #    $URL=~ s/(.)/ sprintf('%02x',ord($1)) /ge ;   # each char -> 2-hex
        #    $URL=~ tr/a-zA-Z/n-za-mN-ZA-M/ ;              # rot-13
            return $URL ;
        }
        
        sub proxy_decode {
            my($enc_URL)= @_ ;
        #    $enc_URL=~ tr/a-zA-Z/n-za-mN-ZA-M/ ;        # rot-13
        #    $enc_URL=~ s/([0-9A-Fa-f]{2})/ sprintf("%c",hex($1)) /ge ;
            $enc_URL=~ s#^([\w+.-]+)/#$1://# ;           # http/xxx -> http://xxx
            return $enc_URL ;
        }
        I also tried trying to block keywords in the URL by experimenting with

        Code:
        @BANNED_SERVERS= () ;
        I tried things like \sex\$, \*\sex$, etc.

        Comment

        Working...
        X