+ Reply to Thread
Results 1 to 15 of 45
Page 1 of 3
FirstFirst 1 2 3 ... LastLast

Thread: Security RISK/WARNING for you folks with shared providers..

  1. #1
    Member tomk is on a distinguished road
    Join Date
    Jan 2002
    Age
    40
    Posts
    62

    Security RISK/WARNING for you folks with shared providers..

    Folks,

    This is such a simple security issue, I'm surprised it even exist.

    There is, in my mind, a huge security issue for folks running forum software such as vB or phpbb on these shared servers. It has to do with the config.php file and your host not knowing what the heck they are doing.

    They have the permissions configured improperly, where they allow "all" read and eXecute permission on this file.

    So, what does this mean to you? It means you can do a "locate config.php" and see all the copies across everyone's home directory. At that point, you can cd to that directory and READ the config.php file.

    Of course, once you have read it, your able to get the dbname and dbpassword that is configured for MySQL.

    Once you have this data, feel free to use mysqldump to dump the data base, change it, etc.

    Check with your host, your config.php file SHOULD NOT be world/all readable. It should be RWX for you, and R for whatever user runs apache (on RedHat, it is the apache user). No reason to have world/all permissions on this file. At least none that I am aware of! ;-)

    Perhaps someone with more security experience can figure out how to better protect this file then having it chown user:apache and chmod 750.

    Two LARGE shared providers are vulnerable to this, to check if yours is, do a:

    [cara@s1 cara]$ locate config.php
    /www/html/fn/vb/admin/config.php
    [cara@s1 cara]$

    <note user Cara can read that directory, which isn't hers>

    [cara@s1 cara]$ ls -l /www/html/fn/vb/admin/config.php
    -rwxr-xr-x 1 tjk tjk 1017 Jan 24 21:50 /www/html/fn/vb/admin/config.php
    [cara@s1 cara]$

    <ok, the file is user/group tjk, but has RX permissions for All>

    [cara@s1 cara]$ cat /www/html/fn/vb/admin/config.php
    <?php
    /////////////////////////////////////////////////////////////
    // Please note that if you get any errors when connecting, //
    // that you will need to email your host as we cannot tell //
    // you what your specific values are supposed to be //
    /////////////////////////////////////////////////////////////

    // type of database running
    // (only mysql is supported at the moment)
    $dbservertype="mysql";

    // hostname or ip of server
    $servername="localhost";

    // username and password to log onto db server
    $dbusername="vb";
    $dbpassword="vb";

    // name of database
    $dbname="vb";

    // technical email address - any error messages will be emailed here
    $technicalemail = "blah blah blah to protect the innocent";

    // use persistant connections to the database
    // 0 = don't use
    // 1 = use
    $usepconnect = 0;

    // which users are allowed to view the admin log
    // separate each userid with a comma
    $canviewadminlog = "1";

    // which users are allowed to prune the admin log
    // separate each userid with a comma
    $canpruneadminlog = "";

    ?>
    [cara@s1 cara]$

    <great, cara now has my db name and my db password! what can they do with it? Hopefully I'm smart enough to not use my dbpassword as my admin login, etc>


    [cara@s1 cara]$ mysql dump -uvb -pvb vb > test.dump
    [cara@s1 cara]$ ls -l test.dump
    -rw-rw-r-- 1 cara cara 4587 Jan 28 13:09 test.dump
    [cara@s1 cara]$

    <hmm, they were able to dump it...not good>

    You get the point from here.

    Check your server/configuration!

    Tom

  2. #2
    Senior Member The Prohacker has disabled reputation The Prohacker's Avatar
    Join Date
    Apr 2001
    Location
    Dayton, Ohio
    Age
    25
    Posts
    1,208
    Its a known risk, and one that you cannot get around, for apache to read it, everyone else must be able to also.... Once Apache 2.x becomes final, this will be fixed, everything will be run as the users UID, and so globaly readable and writeable files will be no more.....
    Later,
    The Prohacker

    My Blog | My Work
    One by one, the penquins steal my sanity......

  3. #3
    Member tomk is on a distinguished road
    Join Date
    Jan 2002
    Age
    40
    Posts
    62

    Actually..

    That's not true.

    I solved it be making the file:

    chown jdoe:apache and chmod 750.

    This lets the apache user read it when it needs to, and the user has rwx access to it.

    Any other user can't read the file...

    I have it set that way, tested it, and it works, what am I missing?

    Tom

  4. #4
    Senior Member Joshua Clinard is on a distinguished road
    Join Date
    Oct 2001
    Location
    Texas
    Age
    30
    Posts
    554
    Shhh! There might be hackers reading these boards. We don't want to give them any ideas.

  5. #5
    Senior Member The Prohacker has disabled reputation The Prohacker's Avatar
    Join Date
    Apr 2001
    Location
    Dayton, Ohio
    Age
    25
    Posts
    1,208
    [prohack@www]:~$ chown nobody.prohack index.html
    chown: changing ownership of `index.html': Operation not permitted
    [prohack@www]:~$ chown prohack.nobody index.html
    chown: changing ownership of `index.html': Operation not permitted
    [prohack@www]:~$
    One problem with your changing ownership, root would have to do it, and when you have 500+ customers thats a real big hassle..

    Like I said, no real easy answer...
    Later,
    The Prohacker

    My Blog | My Work
    One by one, the penquins steal my sanity......

  6. #6
    Member tomk is on a distinguished road
    Join Date
    Jan 2002
    Age
    40
    Posts
    62

    True...

    BUT if it was done right the first time...

    You know the rest of that story.

    Tom

  7. #7
    Senior Member The Prohacker has disabled reputation The Prohacker's Avatar
    Join Date
    Apr 2001
    Location
    Dayton, Ohio
    Age
    25
    Posts
    1,208

    Re: True...

    Originally posted by tomk
    BUT if it was done right the first time...

    You know the rest of that story.

    Tom
    We are running Cpanel, there is nothing done right with it..
    Later,
    The Prohacker

    My Blog | My Work
    One by one, the penquins steal my sanity......

  8. #8
    Member tomk is on a distinguished road
    Join Date
    Jan 2002
    Age
    40
    Posts
    62

    Are you...

    Are you a service provider/hosting firm or an end user?

    Care to take the dialogue to email? I'd like to discuss more with you.

    tom@kiblin.com

    Tom

  9. #9
    Senior Member The Prohacker has disabled reputation The Prohacker's Avatar
    Join Date
    Apr 2001
    Location
    Dayton, Ohio
    Age
    25
    Posts
    1,208
    I'm a webhost....

    Sure I guess....
    Later,
    The Prohacker

    My Blog | My Work
    One by one, the penquins steal my sanity......

  10. #10
    Member Karl is on a distinguished road Karl's Avatar
    Join Date
    Nov 2000
    Location
    UK
    Posts
    62
    TomK, with all respect, it is not up to the host to check every site for a copy of config.php on vBulletin and secure it, besides which, if you do your solution all I have to do is write a script that runs in the web server to read the file and get the contents. This is a known risk with shared hosting and effects all sorts of scripts not just vBulletin. Like has been said, Apache 2 is going to help solve this problem.
    Karl Austin
    UK Web Hosting and Servers :: KDA Web Services Ltd.
    Specialists in Custom Solutions

  11. #11
    Member tomk is on a distinguished road
    Join Date
    Jan 2002
    Age
    40
    Posts
    62
    Originally posted by Karl
    TomK, with all respect, it is not up to the host to check every site for a copy of config.php on vBulletin and secure it, besides which, if you do your solution all I have to do is write a script that runs in the web server to read the file and get the contents. This is a known risk with shared hosting and effects all sorts of scripts not just vBulletin. Like has been said, Apache 2 is going to help solve this problem.
    Karl,

    You are correct. Sad but true that this exist.

    Oh well, I'm surprised more folks haven't been affected by this...considering how easy it is to destroy someone's database.

    tjk

  12. #12
    Member Karl is on a distinguished road Karl's Avatar
    Join Date
    Nov 2000
    Location
    UK
    Posts
    62
    Yes, me too. It's a trade off, run Apache with SuExec and put PHP in as a CGI and it's slow and a waste of resources, or make better use of resources and run PHP as a module but run the risk of things being less secure.
    Karl Austin
    UK Web Hosting and Servers :: KDA Web Services Ltd.
    Specialists in Custom Solutions

  13. #13
    Senior Member JTMON is on a distinguished road
    Join Date
    Oct 2001
    Posts
    571
    Originally posted by Karl
    Yes, me too. It's a trade off, run Apache with SuExec and put PHP in as a CGI and it's slow and a waste of resources, or make better use of resources and run PHP as a module but run the risk of things being less secure.
    Those are the choices?! Oh shi*!
    JTMON

  14. #14
    Member Karl is on a distinguished road Karl's Avatar
    Join Date
    Nov 2000
    Location
    UK
    Posts
    62
    Yes those are the choices and they aren't as clear cut as they sound.
    Karl Austin
    UK Web Hosting and Servers :: KDA Web Services Ltd.
    Specialists in Custom Solutions

  15. #15
    Senior Member JTMON is on a distinguished road
    Join Date
    Oct 2001
    Posts
    571
    Well I know my host runs apache with SUexec but it seems fast. I've even had compliments on the speed. Never mind the site going down once a week

    Good info to know though, thanks for the headsup!
    JTMON

+ Reply to Thread
Page 1 of 3
FirstFirst 1 2 3 ... LastLast

Similar Threads

  1. Security Risk?
    By IDN in forum vBulletin 2 'How Do I' and Troubleshooting
    Replies: 3
    Last Post: Wed 7th May '03, 12:12pm
  2. Security Risk?
    By tucklis in forum Chit Chat
    Replies: 4
    Last Post: Thu 6th Mar '03, 12:34pm
  3. Security Risk
    By refertech in forum vBulletin 2 'How Do I' and Troubleshooting
    Replies: 4
    Last Post: Sun 25th Aug '02, 10:27am
  4. Security Risk?
    By leadZERO in forum PHP & HTML Questions
    Replies: 1
    Last Post: Wed 30th May '01, 1:29am

Bookmarks

Posting Permissions

Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts