htaccess HELP!

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Jace
    FBOP Class Of 2013
    • Jan 2004
    • 35562

    #1

    htaccess HELP!

    I have a site/directory that I only want myself and my partner to be able to load up

    I was going to use a deny all ip's but ours, but the issue is that we have other sites that pull images from this domain

    so, how can I restrict anyone but us two from that domain, but allow images to be pulled from ANY domain from there?
  • Jace
    FBOP Class Of 2013
    • Jan 2004
    • 35562

    #2
    basically, the issues is, we have an important control panel on that domain, and I want only us to access that control panel...it is already password protected to get into the control panel....but I still want that extra level of htaccess control to only allow our ip's

    Comment

    • fris
      Too lazy to set a custom title
      • Aug 2002
      • 55696

      #3
      restrict the main url and let images directory be readable from all
      Since 1999: 69 Adult Industry awards for Best Hosting Company and professional excellence.

      Comment

      • mortenb
        Confirmed User
        • Jul 2004
        • 2203

        #4
        Ignore me. I misread your post
        Last edited by mortenb; 07-12-2007, 08:19 PM.

        Comment

        • V_RocKs
          Damn Right I Kiss Ass!
          • Nov 2003
          • 32449

          #5
          Or... put the control panel in a directory like,
          58ju4Tg
          and then restrict access in that directory.

          Comment

          • Jace
            FBOP Class Of 2013
            • Jan 2004
            • 35562

            #6
            Originally posted by V_RocKs
            Or... put the control panel in a directory like,
            58ju4Tg
            and then restrict access in that directory.
            well, the control panel is in a directory, but I want to block access to the entire domain

            the images folder is WITHIN the control panel directory though

            Comment

            • BV
              wtf
              • Sep 2001
              • 10914

              #7
              maybe do a symbolic link of the images dir or move the control panel to another dir

              Comment

              • Beaver Bob
                Confirmed User
                • Aug 2005
                • 1099

                #8
                why can't you just store the images somewhere else?
                Spunky Dollars | Need Content?
                Paysite Owners: Protect Your Members Area with Strongbox

                361-574-229

                Comment

                • V_RocKs
                  Damn Right I Kiss Ass!
                  • Nov 2003
                  • 32449

                  #9
                  What types of images?

                  Comment

                  • Jace
                    FBOP Class Of 2013
                    • Jan 2004
                    • 35562

                    #10
                    Originally posted by Beaver Bob
                    why can't you just store the images somewhere else?
                    it is part of the control panel software and the software is zend encoded with no option to place them elsewhere

                    Comment

                    • V_RocKs
                      Damn Right I Kiss Ass!
                      • Nov 2003
                      • 32449

                      #11
                      ie, just gif, jpg?

                      Comment

                      • Jace
                        FBOP Class Of 2013
                        • Jan 2004
                        • 35562

                        #12
                        Originally posted by V_RocKs
                        What types of images?
                        all types

                        Comment

                        • Evil E
                          Confirmed User
                          • Apr 2005
                          • 3201

                          #13
                          slkfjaldika;ie';1190-9


                          A girl once told me "Give me 8 inches and make it HURT".

                          So, I fucked her twice and hit her with a brick.

                          Comment

                          • BV
                            wtf
                            • Sep 2001
                            • 10914

                            #14
                            Originally posted by Jace
                            it is part of the control panel software and the software is zend encoded with no option to place them elsewhere
                            u can with a symbolic link of that directory

                            Comment

                            • Jace
                              FBOP Class Of 2013
                              • Jan 2004
                              • 35562

                              #15
                              Originally posted by BV
                              u can with a symbolic link of that directory
                              no, i can't...I wish I could though

                              it HAS to be the way I am saying

                              I need something in htaccess that blocks EVERYONE out of that domain except our 2 ip's, but allows external sites to access the images in domain.com/cp/images/

                              Comment

                              • dissipate
                                The Dirty Frenchman
                                • Nov 2005
                                • 8904

                                #16
                                Hire a midget to protect it.

                                Comment

                                • V_RocKs
                                  Damn Right I Kiss Ass!
                                  • Nov 2003
                                  • 32449

                                  #17
                                  Code:
                                  SetEnvIf Request_URI "\.gif$" imaginer
                                  SetEnvIf Request_URI "\.jpg$" imaginer
                                  
                                  
                                  Order deny,allow
                                  Allow from env=imaginer
                                  Allow from 71.254.148.228
                                  Deny from all

                                  Comment

                                  • V_RocKs
                                    Damn Right I Kiss Ass!
                                    • Nov 2003
                                    • 32449

                                    #18
                                    You can add your own image types and IP's...

                                    And send a hooker to my door.

                                    Comment

                                    • Jace
                                      FBOP Class Of 2013
                                      • Jan 2004
                                      • 35562

                                      #19
                                      Originally posted by V_RocKs
                                      Code:
                                      SetEnvIf Request_URI "\.gif$" imaginer
                                      SetEnvIf Request_URI "\.jpg$" imaginer
                                      
                                      
                                      Order deny,allow
                                      Allow from env=imaginer
                                      Allow from 71.254.148.228
                                      Deny from all
                                      trying it now

                                      will you take a midget hooker?

                                      Comment

                                      • V_RocKs
                                        Damn Right I Kiss Ass!
                                        • Nov 2003
                                        • 32449

                                        #20
                                        Or leave my IP in it so I can hax0r your shit for you...

                                        Comment

                                        • V_RocKs
                                          Damn Right I Kiss Ass!
                                          • Nov 2003
                                          • 32449

                                          #21
                                          Originally posted by Jace
                                          trying it now

                                          will you take a midget hooker?
                                          No, but I will take a midget Doberman Pinscher.

                                          Comment

                                          • darksoul
                                            Confirmed User
                                            • Apr 2002
                                            • 4997

                                            #22
                                            Code:
                                            RewriteEngine On
                                            RewriteCond %{HTTP_REFERER} !^$
                                            RewriteCond %{HTTP_REFERER} !^http://(.*)?mysite1.com.*$ [NC,OR]
                                            RewriteCond %{HTTP_REFERER} !^http://(.*)?mysite2.com.*$ [NC]
                                            RewriteRule .*\.(gif|jpg|png) - [F]
                                            
                                            RewriteEngine On
                                            RewriteCond %{REQUEST_FILENAME} !.*\(gif|jpg|png) [NC]
                                            RewriteCond %{REMOTE_ADDR} !^127.126.125.1$ [OR]
                                            RewriteCond %{REMOTE_ADDR} !^122.122.122.12$ 
                                            RewriteRule .* - [F]
                                            I haven't tested it but should be close to the working version
                                            1337 5y54|)m1n: 157717888
                                            BM-2cUBw4B2fgiYAfjkE7JvWaJMiUXD96n9tN
                                            Cambooth

                                            Comment

                                            • Jace
                                              FBOP Class Of 2013
                                              • Jan 2004
                                              • 35562

                                              #23
                                              Originally posted by V_RocKs
                                              Code:
                                              SetEnvIf Request_URI "\.gif$" imaginer
                                              SetEnvIf Request_URI "\.jpg$" imaginer
                                              
                                              
                                              Order deny,allow
                                              Allow from env=imaginer
                                              Allow from 71.254.148.228
                                              Deny from all
                                              WORKED!!!!

                                              thanks so much man, I owe ya one

                                              Comment

                                              • V_RocKs
                                                Damn Right I Kiss Ass!
                                                • Nov 2003
                                                • 32449

                                                #24
                                                Now one thing you MIGHT have a problem with is if someone knows what you set the environment variable to, they can just set it themselves in the request... Which is why darksoul did his the correct way...

                                                I just don't know that shit that well...

                                                Comment

                                                • V_RocKs
                                                  Damn Right I Kiss Ass!
                                                  • Nov 2003
                                                  • 32449

                                                  #25
                                                  Of course if they know the word you chose, they already have enough access to fuck you over...

                                                  Comment

                                                  • Jace
                                                    FBOP Class Of 2013
                                                    • Jan 2004
                                                    • 35562

                                                    #26
                                                    Originally posted by V_RocKs
                                                    Of course if they know the word you chose, they already have enough access to fuck you over...
                                                    i can just change that word to something else? "imaginer"

                                                    Comment

                                                    • V_RocKs
                                                      Damn Right I Kiss Ass!
                                                      • Nov 2003
                                                      • 32449

                                                      #27
                                                      ImagineThat.... ;)

                                                      Comment

                                                      • raymor
                                                        Confirmed User
                                                        • Oct 2002
                                                        • 3745

                                                        #28
                                                        Be aware that the crackers can and probably will at some point just spoof the referer
                                                        with a bit of JavaScript. Checking the referer will stop the casual user who doesn't
                                                        know anything, but it's not any kind of real security.

                                                        I know you said you can't do this, but I bet you can, so I'd take another look at what
                                                        other people suggested.
                                                        first symlink domain.com/cp/images/ to domain.com/public/images/ or better eachsite.com/members/images/
                                                        then protect domain.com/cp/
                                                        then search and replace the links from domain.com/cp/images/ to just /members/images/

                                                        I can't think of any possible scenario where a symlink wouldn't do the job.
                                                        The only thing I can think of is you had a $15 / month hosting account with no shell
                                                        access and and no customer support, making it hard to actually create the symlink.
                                                        Somehow I don't think that what you have, though. Still even then it takes 45 seconds
                                                        to write a script that creates the symlink.

                                                        If you symlink from each members' site it also has the enormous advantage of avoiding
                                                        all kinds of other problems you are going to have down the road if the URLs used for the
                                                        pics don't match their logical locations, ie. as part of each site.

                                                        If you can;t use a symlink to another domain or at least another directory I'm really
                                                        currious why that could possibly be. I'm also curious about what kind of POS CMS
                                                        you bought that caused all these problems.
                                                        Last edited by raymor; 07-13-2007, 11:25 AM.
                                                        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

                                                        • darksoul
                                                          Confirmed User
                                                          • Apr 2002
                                                          • 4997

                                                          #29
                                                          Originally posted by raymor
                                                          2much2quote
                                                          you would've spared yourself the shame if you read/understood the thread.

                                                          The referer is checked only if the file type is an image for anything else
                                                          the access is allowed only from two ips.
                                                          they can spoof all they want.
                                                          1337 5y54|)m1n: 157717888
                                                          BM-2cUBw4B2fgiYAfjkE7JvWaJMiUXD96n9tN
                                                          Cambooth

                                                          Comment

                                                          • munki
                                                            Do Fun Shit.
                                                            • Dec 2004
                                                            • 13393

                                                            #30
                                                            The answer is 42

                                                            I have the simplest tastes. I am always satisfied with the best.” -Oscar Wilde

                                                            Comment

                                                            • V_RocKs
                                                              Damn Right I Kiss Ass!
                                                              • Nov 2003
                                                              • 32449

                                                              #31
                                                              Originally posted by raymor
                                                              Be aware that the crackers can and probably will at some point just spoof the referer
                                                              with a bit of JavaScript. Checking the referer will stop the casual user who doesn't
                                                              know anything, but it's not any kind of real security.

                                                              I know you said you can't do this, but I bet you can, so I'd take another look at what
                                                              other people suggested.
                                                              first symlink domain.com/cp/images/ to domain.com/public/images/ or better eachsite.com/members/images/
                                                              then protect domain.com/cp/
                                                              then search and replace the links from domain.com/cp/images/ to just /members/images/

                                                              I can't think of any possible scenario where a symlink wouldn't do the job.
                                                              The only thing I can think of is you had a $15 / month hosting account with no shell
                                                              access and and no customer support, making it hard to actually create the symlink.
                                                              Somehow I don't think that what you have, though. Still even then it takes 45 seconds
                                                              to write a script that creates the symlink.

                                                              If you symlink from each members' site it also has the enormous advantage of avoiding
                                                              all kinds of other problems you are going to have down the road if the URLs used for the
                                                              pics don't match their logical locations, ie. as part of each site.

                                                              If you can;t use a symlink to another domain or at least another directory I'm really
                                                              currious why that could possibly be. I'm also curious about what kind of POS CMS
                                                              you bought that caused all these problems.
                                                              You = Tool...

                                                              The referrer is NEVER checked... The requested URI is... You can't spoof that or the spoof is what you are asking for... Kind of like asking for coke and getting a coke... But if you spoof and ask for pepsi, well fine then, you get a pepsi (if it isn't denied to your IP address)...

                                                              Comment

                                                              • raymor
                                                                Confirmed User
                                                                • Oct 2002
                                                                • 3745

                                                                #32
                                                                Originally posted by V_RocKs
                                                                You = Tool...

                                                                The referrer is NEVER checked... The requested URI is.
                                                                You = can't read. Or do you think that the three lines that say "HTTP_REFERER" are
                                                                checking soemthing other than the referer?

                                                                RewriteEngine On
                                                                RewriteCond %{HTTP_REFERER} !^$
                                                                RewriteCond %{HTTP_REFERER} !^http://(.*)?mysite1.com.*$ [NC,OR]
                                                                RewriteCond %{HTTP_REFERER} !^http://(.*)?mysite2.com.*$ [NC]
                                                                RewriteRule .*\.(gif|jpg|png) - [F]
                                                                Be careful ridiculing the guys who invented this shit, you are likely to make a fool of yourslf.
                                                                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

                                                                • raymor
                                                                  Confirmed User
                                                                  • Oct 2002
                                                                  • 3745

                                                                  #33
                                                                  Originally posted by V_RocKs
                                                                  You = Tool...

                                                                  The referrer is NEVER checked... The requested URI is.
                                                                  You = can't read. Or do you think that the three lines that say "HTTP_REFERER" are
                                                                  checking something other than the referer?

                                                                  RewriteEngine On
                                                                  RewriteCond %{HTTP_REFERER} !^$
                                                                  RewriteCond %{HTTP_REFERER} !^http://(.*)?mysite1.com.*$ [NC,OR]
                                                                  RewriteCond %{HTTP_REFERER} !^http://(.*)?mysite2.com.*$ [NC]
                                                                  RewriteRule .*\.(gif|jpg|png) - [F]
                                                                  Be careful ridiculing the guys who invented this shit, you are likely to make a fool of yourself.
                                                                  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

                                                                  • Jace
                                                                    FBOP Class Of 2013
                                                                    • Jan 2004
                                                                    • 35562

                                                                    #34
                                                                    jesus you all

                                                                    this is on a domain that is not public, not searched, not indexed, etc...it is a domain that ONLY has this control panel

                                                                    and it isn't even in a typical folder, it is in something like domain.com/beegdjmf

                                                                    so, what was brought up first, was perfect, my tech at nationalnet even said so ;)

                                                                    Comment

                                                                    • raymor
                                                                      Confirmed User
                                                                      • Oct 2002
                                                                      • 3745

                                                                      #35
                                                                      Originally posted by darksoul
                                                                      you would've spared yourself the shame if you read/understood the thread.

                                                                      The referer is checked only if the file type is an image for anything else
                                                                      the access is allowed only from two ips.
                                                                      they can spoof all they want.
                                                                      So you don't mind if I hotlink all of your images? Thanks!
                                                                      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

                                                                      • just a punk
                                                                        So fuckin' bored
                                                                        • Jun 2003
                                                                        • 32393

                                                                        #36
                                                                        BTW http://www.htaccesstools.com/ is a great resource for almost every .htaccess-related task. Must be bookmarked by everyone IMHO.
                                                                        Obey the Cowgod

                                                                        Comment

                                                                        Working...