Results 1 to 17 of 17
  1. #1

    How to determine what type of encoding/encryption has been used?

    Is there a way to find what type of encryption/encoding is being used? For example, I am testing a web application which stores the password in the database in an encrypted format.

    *58357A4A22F0804B5877A533EE9A75271FBE9F16
    How do i determine what hashing or encryption is being used? Or is there a way? Or if there isn't any way to decode - how to find type of encoding - as i can encode it at first and manually replace it in database.

    thank you
    Your Health Encyclopedia
    Medical and health consumer information resources containing comprehensive and unbiased information in patient-friendly language

  2. #2
    Join Date
    May 2004
    Location
    Pflugerville, TX
    Posts
    11,231
    Is this an off-the-shelf application? Sometimes encrypting information can be found in documentation. Is the actual application encrypted too (do you need Zend or IonCube to run it)? If not, you can generally figure out how a password is created by reading through the code in whatever file/function is used to create your password.

    What's the app?
    Studio1337___̴ı̴̴̡̡̡ ̡͌l̡̡̡ ̡͌l̡*̡̡ ̴̡ı̴̴̡ ̡̡͡|̲̲̲͡͡͡ ̲▫̲͡ ̲̲̲͡͡π̲̲͡͡ ̲̲͡▫̲̲͡͡ ̲|̡̡̡ ̡ ̴̡ı̴̡̡ ̡͌l̡̡̡̡.__Web Design

  3. #3
    Join Date
    Jul 2009
    Location
    UK
    Posts
    1,312
    Generally no is the answer.

    Its not normally possible to see what has been used to encrypt something.

    However,
    Some ciphers and algorithms have telltale signs like the amount of characters used in the output. If a certain char appears in the same place or sameplace often..
    Live Chat Support Software for your Business website - IMsupporting.com

  4. #4
    Quote Originally Posted by the_pm View Post
    Is this an off-the-shelf application? Sometimes encrypting information can be found in documentation. Is the actual application encrypted too (do you need Zend or IonCube to run it)? If not, you can generally figure out how a password is created by reading through the code in whatever file/function is used to create your password.

    What's the app?
    No, unfortunately there isn't any documentation. It's handmade product.
    Actual application isn't ecrypted, but it's too large (~100mb .sql file) to find (especially if you don't know which keywords to use). I have access to db - it's *.sql file, but i don't know which keywords to use.

    thank you
    Your Health Encyclopedia
    Medical and health consumer information resources containing comprehensive and unbiased information in patient-friendly language

  5. #5
    Join Date
    Jul 2009
    Location
    UK
    Posts
    1,312
    Why not locate the .php file that actually stores the password. ( assuming php )

    That will say what its using to do it.
    Also.. What format is the password field? ( ie: Text, varchar, md5.. )

    I would expect a password to be "hashed" and not encrypted.

    A hashed password cannot be decrypted.
    Live Chat Support Software for your Business website - IMsupporting.com

  6. #6
    Why not locate the .php file that actually stores the password.
    paswords are stored in .sql file
    Also.. What format is the password field? ( ie: Text, varchar, md5.. )
    In sql file my(user) password is this - "*58357A4A22F0804B5877A533EE9A75271FBE9F16 "

    I would expect a password to be "hashed" and not encrypted.
    Any difference. Unfortunately i'm not expert in this area. So is there any way to reset, change it - if i have access to this db ?
    Your Health Encyclopedia
    Medical and health consumer information resources containing comprehensive and unbiased information in patient-friendly language

  7. #7
    Join Date
    May 2004
    Location
    Pflugerville, TX
    Posts
    11,231
    The passwords are stored as sql, but they are placed there and looked up using .php, and there will be a .php page that corresponds to this. This is what I meant by reading the code/function that sets the password. SQL just stores information - a command has to originate from somewhere, and assuming the application is written in PHP, you'll find what you need within the code somewhere.

    What page handles logging in? You can probably trace the encryption mechanism from there.
    Studio1337___̴ı̴̴̡̡̡ ̡͌l̡̡̡ ̡͌l̡*̡̡ ̴̡ı̴̴̡ ̡̡͡|̲̲̲͡͡͡ ̲▫̲͡ ̲̲̲͡͡π̲̲͡͡ ̲̲͡▫̲̲͡͡ ̲|̡̡̡ ̡ ̴̡ı̴̡̡ ̡͌l̡̡̡̡.__Web Design

  8. #8
    Join Date
    Jul 2009
    Location
    UK
    Posts
    1,312
    Quote Originally Posted by 3-rx View Post
    paswords are stored in .sql file

    In sql file my(user) password is this - "*58357A4A22F0804B5877A533EE9A75271FBE9F16 "


    Any difference. Unfortunately i'm not expert in this area. So is there any way to reset, change it - if i have access to this db ?
    Im aware they are stored in SQL.. Im more interested in what put in there... The file that actually connected to the DB and put the password there..
    Find that file. ( register.php maybe? )

    If that fails.. Find the login file. That will say how its checking the password and will help you understand how its been stored.
    Live Chat Support Software for your Business website - IMsupporting.com

  9. #9
    Yes, i find "login" file - but there isn't nothing except standart html form. Also i try to encrypte any simplet password (MD5 crypt) and to set this result in db, but unfortunately it doesn't work.
    Find the login file. That will say how its checking the password and will help you understand how its been stored.
    Your Health Encyclopedia
    Medical and health consumer information resources containing comprehensive and unbiased information in patient-friendly language

  10. #10
    Join Date
    Jul 2009
    Location
    UK
    Posts
    1,312
    Quote Originally Posted by 3-rx View Post
    Yes, i find "login" file - but there isn't nothing except standart html form. Also i try to encrypte any simplet password (MD5 crypt) and to set this result in db, but unfortunately it doesn't work.
    Paste the source code here..

    Open the file in something like notepad.. Not in a webbrowser.
    Last edited by lynxus; 09-25-2011 at 05:41 PM.
    Live Chat Support Software for your Business website - IMsupporting.com

  11. #11
    PHP Code:
    <?php if (!CheckPermissions()) Redirect("/" $LANGUAGE);

    if (
    $SESSION["USER_NAME"] == __GUEST_USER__) {
    ?>
    <form method="post" action="/<?= $LANGUAGE ?>/" name="login" style="margin-top: 0; margin-bottom: 0;">
        <table width="95%" cellspacing=0 cellpadding=0 border=0>
            <tr>
                <td><input type="text" name="f_login" size=25 class="FormInput"></td>
                <td><input type="hidden" name="form_action" value="login"></td>
            </tr>
            <tr>
                <td><input type="password" name="f_password" size=25 class="FormInput"><input type="hidden" name="form_submit" value="YES"></td>
                <td><img src="<?= $LAYOUT_IMAGES ?>/search_button.gif" border=0 align=right onclick="document.login.submit();return true;""></td>
            </tr>
        </table>
    </form>
    <?php } else { ?>
    <form method="post" action="/<?= $LANGUAGE ?>/" name="logout" style="margin-top: 0; margin-bottom: 0;">
        <input type="hidden" name="form_action" value="logout"><input type="hidden" name="form_submit" value="YES">
        <img src="<?= $LAYOUT_IMAGES ?>/search_button.gif" border=0 onclick="document.logout.submit();return true;"">
    </form>
    <?php
    }

    ?>
    Your Health Encyclopedia
    Medical and health consumer information resources containing comprehensive and unbiased information in patient-friendly language

  12. #12
    Join Date
    Jul 2009
    Location
    UK
    Posts
    1,312
    Cool,
    Open the page in a browser and see what this shows:
    <form method="post" action="/<?= $LANGUAGE ?>/" name="login"

    Im interested in action="/<?= $LANGUAGE ?>/"

    Then have a look at the file in the action="" section..

    You will then be looking for a var created using something like
    $password = $_POST['f_password'];

    Follow that trail and it should help...

    Or post the code to the file that appears in the action="" section and Ill have a peep.
    Live Chat Support Software for your Business website - IMsupporting.com

  13. #13
    Lynxus,

    As i said there isn't nothing interesting in this part. Here is output

    PHP Code:
                <tr>
                    <
    td colspan=2 bgcolor="#a9a9a9" class="ColumnHeader">LOGIN</td>
                </
    tr>

                <
    tr bgcolor="#F2F2F2">
                    <
    td><form method="post" action="/en/" name="login" style="margin-top: 0; margin-bottom: 0;">
        <
    table width="95%" cellspacing=0 cellpadding=0 border=0>
            <
    tr>
                <
    td><input type="text" name="f_login" size=25 class="FormInput"></td>
                <
    td><input type="hidden" name="form_action" value="login"></td>
            </
    tr>
            <
    tr>
                <
    td><input type="password" name="f_password" size=25 class="FormInput"><input type="hidden" name="form_submit" value="YES"></td>

                <
    td><img src="/skins/default/images/search_button.gif" border=0 align=right onclick="document.login.submit();return true;""></td>
            </tr>
        </table>
    </form>
    </td>
                </tr> 
    Unfortunately "action" it's just mention the language file (system determnie in which language to display Login form ) -> "LOGIN" text.
    Your Health Encyclopedia
    Medical and health consumer information resources containing comprehensive and unbiased information in patient-friendly language

  14. #14
    Join Date
    Jul 2009
    Location
    UK
    Posts
    1,312
    there will be a file its calling inside the /en/ directory.

    Probably /en/index.php

    It cannot be some kind of hidden file because the end users browser will request the directory /en/ and the webserver will return the default file ( probably index.php ? )
    Live Chat Support Software for your Business website - IMsupporting.com

  15. #15
    Don't keep your attention on language file.

    Also i find interesting (i hope) code in index.php file


    PHP Code:
    ///// Login Default User ///////////////////////////////////////////////////////

    //echo $SESSION["USER_NAME"] . "<br><hr>";

    if ((!isset($SESSION["USER_NAME"])) || (!$SESSION["USER_NAME"])) {
       
    //    echo "<br>Login As Guest [1].<br><hr>";
        
    Login(__GUEST_USER__);
    }

    if ((isset(
    $_REQUEST["form_submit"])) && (trim($_REQUEST["form_submit"]) == "YES") &&
            (isset(
    $_REQUEST["form_action"])) && (trim($_REQUEST["form_action"]))) {
        switch (
    trim($_REQUEST["form_action"]))    {
            case 
    "login":
                if ((
    $SESSION["USER_NAME"] != __GUEST_USER__) || (!CheckRequest("f_login","",$l_user)) ||
                        (!
    CheckRequest("f_password","",$l_pass)))
                    break;
                
    Login($l_user,$l_pass);
                
    //echo "<br>Login As $l_user [2].<br><hr>";
                
    break;
            case 
    "logout":
                if (
    $SESSION["USER_NAME"] == __GUEST_USER__)
                    break;
                
    Login(__GUEST_USER__);
                
    //echo "<br>Login As Guest [3].<br><hr>";
                
    break;
            case 
    "lastissue":
                
    $SESSION["VIEWDATE"] = $SESSION["CURDATE"];
                
    $_SESSION['SESSION'] = serialize($SESSION);
                break;
        }
    }

    ####

    $ENABLE_LOGIN 0;
    $ENABLE_LOGIN 1;

    HTML_Start($SITE_NAME,$SITE_DESCRIPTION,"/skins/$LAYOUT/style.css",implode(",",$REQ_JSLIBS),$SITEGLOBALS["encoding"]); 
    is there any useful part
    Your Health Encyclopedia
    Medical and health consumer information resources containing comprehensive and unbiased information in patient-friendly language

  16. #16
    looks like it's this what we need :-)

    PHP Code:
    ///// Rendering Site Layout ////////////////////////////////////////////////////
    if($_POST['login'] && $_POST['pass'] && $_POST['btn_login']){
        
    setcookie('login'$_POST['login'], time()+1209600'/''');
        
    setcookie('pass'md5($_POST['pass']), time()+1209600'/''');
         
    header("Location: ".$_SERVER['HTTP_REFERER']); // right?!
    }
    if(
    $_POST['logout']){
        
    setcookie('login'''time()+1209600'/''');
        
    setcookie('pass'''time()+1209600'/''');
         
    header("Location: ".$_SERVER['HTTP_REFERER']); // right?!

    Can anyone advice how will be changed a simple password "password" after such hashing <'pass', md5($_POST['pass']), time()+1209600,>

    thank you
    Your Health Encyclopedia
    Medical and health consumer information resources containing comprehensive and unbiased information in patient-friendly language

  17. #17
    Join Date
    Jul 2009
    Location
    UK
    Posts
    1,312
    Quote Originally Posted by 3-rx View Post
    looks like it's this what we need :-)

    PHP Code:
    ///// Rendering Site Layout ////////////////////////////////////////////////////
    if($_POST['login'] && $_POST['pass'] && $_POST['btn_login']){
        
    setcookie('login'$_POST['login'], time()+1209600'/''');
        
    setcookie('pass'md5($_POST['pass']), time()+1209600'/''');
         
    header("Location: ".$_SERVER['HTTP_REFERER']); // right?!
    }
    if(
    $_POST['logout']){
        
    setcookie('login'''time()+1209600'/''');
        
    setcookie('pass'''time()+1209600'/''');
         
    header("Location: ".$_SERVER['HTTP_REFERER']); // right?!

    Can anyone advice how will be changed a simple password "password" after such hashing <'pass', md5($_POST['pass']), time()+1209600,>

    thank you
    OK,
    Simply looks like an MD5 hash..
    What do you mean by 'change' ?

    Id still be interested in the file that actually INSERTS the password into the database.
    Last edited by lynxus; 09-27-2011 at 03:55 PM.
    Live Chat Support Software for your Business website - IMsupporting.com

Similar Threads

  1. What type of "cipher" to use for OpenVPN encryption?
    By mrzippy in forum Hosting Security and Technology
    Replies: 4
    Last Post: 11-13-2013, 11:26 PM
  2. Some Type Of Encryption
    By Arber in forum Programming Discussion
    Replies: 1
    Last Post: 12-04-2009, 09:12 PM
  3. Php Encryption/ Encoding
    By Tlc in forum Programming Discussion
    Replies: 13
    Last Post: 04-30-2006, 06:28 AM
  4. determine MIME type
    By okok in forum Programming Discussion
    Replies: 0
    Last Post: 05-09-2004, 02:25 AM
  5. Remotely determine RAM type from Linux?
    By MattF in forum Hosting Security and Technology
    Replies: 3
    Last Post: 09-26-2003, 04:48 AM

Posting Permissions

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