Advice

Discussion in 'PHP' started by antwigan, Jan 21, 2008.

  1. #1
    Hi all could i have some advice about this please?

    I recently gave someone ftp access for my hosting.
    He asked if he could use a couple of MB of space just to store a few files.

    After messing around today i found a file that contained this:

    <?PHP

    function KeyIsInFile($key)
    {
    $KeyFile = file("Keys.txt");

    foreach($KeyFile AS $KeyFileLine)
    {
    $KeyFileLine = str_replace(array("\r", "\n"), "", $KeyFileLine);

    if(strpos($key, $KeyFileLine) !== FALSE)
    return true;

    echo "//$KeyFileLine//$key//";
    }

    return false;
    }

    if(empty($_GET['key']))
    die("INVALID");

    if(KeyIsInFile($_GET['key']))
    die("VALID_PASSWORD_FOUND");

    die("INVALID");
    ?>

    I dont know about php but just looking at this makes me worried. Could someone reply asap plz and tell me if im just being paranoid or not?
    thx..
     
    antwigan, Jan 21, 2008 IP
  2. wisdomtool

    wisdomtool Moderator Staff

    Messages:
    15,826
    Likes Received:
    1,367
    Best Answers:
    1
    Trophy Points:
    455
    #2
    Just change the password, disallow his access and deleted away his files, check your files for any newly updated materials.
     
    wisdomtool, Jan 21, 2008 IP
  3. antwigan

    antwigan Member

    Messages:
    3
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    36
    #3
    Can you tell me exactly what this is plz?
     
    antwigan, Jan 21, 2008 IP
  4. SmallPotatoes

    SmallPotatoes Peon

    Messages:
    1,321
    Likes Received:
    41
    Best Answers:
    0
    Trophy Points:
    0
    #4
    It's a poorly-implemented login/password system, intended to allow him to keep random strangers out of one or more of the PHP programs he's got on there. On its own this is nothing to worry about. But I suggest that you kick him out anyway since you evidently don't trust him; everyone would be better off if he found a different arrangement.
     
    SmallPotatoes, Jan 21, 2008 IP
  5. HuggyStudios

    HuggyStudios Well-Known Member

    Messages:
    724
    Likes Received:
    20
    Best Answers:
    26
    Trophy Points:
    165
    #5
    Pretty poor login script aswell lol. Must be for multi users or he would of hard coded the keys in the script.
     
    HuggyStudios, Jan 21, 2008 IP
  6. antwigan

    antwigan Member

    Messages:
    3
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    36
    #6
    Thx for the info guys..
     
    antwigan, Jan 22, 2008 IP