+ Reply to Thread
Results 1 to 4 of 4

Thread: How secure is this?

  1. #1
    Sheepoholics's Avatar
    Sheepoholics is offline x10 Sophmore Sheepoholics is an unknown quantity at this point
    Join Date
    Dec 2005
    Location
    Beaumont AB
    Posts
    133

    How secure is this?

    So basically I'm working with security in php and am right now testing some very basic stuff. I'm wondering if you (with a little hacking knowledge) be able to successfully get into a file. So basically this is what I have set up right now.

    An Html form like so
    Code:
    <form action="phpfile1.php" method="post">
     <p><input type="text" name="post" /></p>
     <p><input type="submit" /></p>
    </form>
    which connects to a
    php file that looks something like this.

    PHP Code:
    <?

    if ($name ==  seceretpassword)
    {
    echo 
    "Password Correct";
    } else {
    echo 
    'Wrong Password';
    }
    ?>
    Doing a security system like this seems to be
    farliy secure because when you view the source phpfile1.php
    all you see is the raw output of either
    "Password Correct"
    or
    "Wrong Password"
    even when you go to the page directly it will still display
    "Wrong
    Password"
    Are there any holes in this?

    http://www.sheepoholics.x10hosting.c...uff/stuuf.html
    is a test of it if you wanna look. (the password is not the same)

  2. #2
    Bryon is offline Administrator Bryon has disabled reputation
    Join Date
    Apr 2005
    Location
    Northfield, NH
    Posts
    7,582

    Re: How secure is this?

    Having a password stored in the actual file is one of the safest ways to keep it secure. With no database, basically the only way to find out what the password is would be to view the file's contents.

    The only problem I would see here would probably be with register globals. If you placed the password into a variable, and they checked the user-supplied password against that variable, the real password could possibly be 'over-written' with whatever the person supplied.

    Just a simple:

    PHP Code:
    if ($_POST['inputName'] == 'actualPassword']) 
    Is probably the most secure way to accomplish this, and I believe that is what your doing.

    So basically, your pretty secure and don't have to worry about someone gaining un-authorized access to whatever your password protecting; unless they view the file.

    -Bryon

  3. #3
    Sheepoholics's Avatar
    Sheepoholics is offline x10 Sophmore Sheepoholics is an unknown quantity at this point
    Join Date
    Dec 2005
    Location
    Beaumont AB
    Posts
    133

    Re: How secure is this?

    Alright I'll keep that in mind. Thanks

  4. #4
    Cynical's Avatar
    Cynical is offline Lord Of The Keys Cynical is an unknown quantity at this point
    Join Date
    Sep 2005
    Location
    Massachusetts, USA
    Posts
    1,744

    Re: How secure is this?

    Quote Originally Posted by Bryon
    So basically, your pretty secure and don't have to worry about someone gaining un-authorized access to whatever your password protecting; unless they view the file.
    To avoid people from seeing the password if they view the file, store it in a PHP document ("<?PHP $pw='abcdefg'; ?>"). If they view it then it will just be a blank page .
    Seven: This rule is so underrated, keep your family and business completely separated.

+ Reply to Thread

Similar Threads

  1. Don't Use Php Fusion!
    By swirly in forum Scripts & 3rd Party Apps
    Replies: 15
    Last Post: 01-14-2006, 01:04 PM
  2. Most Secure
    By trev in forum Off Topic
    Replies: 3
    Last Post: 10-10-2005, 05:08 AM
  3. mod_ssl enabled
    By bin_asc in forum Free Hosting
    Replies: 7
    Last Post: 08-11-2005, 06:10 AM
  4. Microsoft promises secure Windows PCs
    By stealth_thunder in forum Scripts & 3rd Party Apps
    Replies: 8
    Last Post: 05-15-2005, 02:34 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers