Was ist das für ne Verschlüsselung ?

Dieses Thema im Forum "Sicherheit & Datenschutz" wurde erstellt von J1Lock, 30. Oktober 2008 .

Schlagworte:
Status des Themas:
Es sind keine weiteren Antworten möglich.
  1. 30. Oktober 2008
    Moin Moin !
    Ich soll ab nun die Webpräsenz unsrer Freiwilligen Feuerwehr betreuen, aber der alte Webmaster ist nicht mehr nach Daten fragbar.
    Zugangsdaten zu FTP, phpmyadmin und Serverwebinterface hab ich alles, aber es gibt da ein Gästebuch, und da komm ich nicht als Admin rein.
    Er speichert die Passwörter irgendwie verschlüsselt in der DB, aber kA was das ist.
    Beim CMS wars md5, da hab ich mir zu meinem Wunschpasswort n MD5 generiert und in der DB einfach den alten Hash überschrieben, aber jetzt weiß ich nicht was das sein soll.

    Ein zufällig gesetztes Passwort per PW-Vergessen Funktion wurde so in die DB eingetragen:
    6819409c7cea7711

    Hat jmd ne Ahnung wonach das aussieht oder was ich nu machen kann ?
    Oder kann ich in den PHP Dateien iwie erkennen wie das gemacht wird ?
     
  2. 31. Oktober 2008
    AW: Was ist das für ne Verschlüsselung ?

    Hi
    Also im Source steht auf jedenfall welche Verschlüsselung das ist.
    Du solltest dir dafür mal die php Dateien zur Registrierung anschauen.
     
  3. 31. Oktober 2008
    AW: Was ist das für ne Verschlüsselung ?

    ist ein MySQL_64bit hash wies aussieht
     
  4. 31. Oktober 2008
    AW: Was ist das für ne Verschlüsselung ?

    Ja wenn du den Source hast, kannst du es einfach in der Datei nachlesen, wie er es verschlüsselt.

    Du kannst auch die Datei womit man sich registriert (z.b. registrieren.php) auf xup laden und ih schau mir das mal an.
     
  5. 31. Oktober 2008
    AW: Was ist das für ne Verschlüsselung ?

    Jo hier mal die Datei create_admin.php :
    Das einzige was ich da finde is bei dem INSERT n password($password)
    Spoiler
    PHP:
    <? php
    ///////////////////////////////////////////////////////////////////////////////
    // File: create_admin.php
    // Purpose: allows creation of another admin account
    // Remarks: requires common.php
    ///////////////////////////////////////////////////////////////////////////////
    // Functions:
    //        void display_form(array)
    //        array check_form()
    //        void add_admin()
    ///////////////////////////////////////////////////////////////////////////////

    require( "./common.php" );

    session_start ();

    ///////////////////////////////////////////////////////////////////////////////
    // Function: void display_form(array $err)
    // Purpose: displays form for admin account creation
    // Parameters:
    //        $err - array containing erroroneous fields and error messages
    // Returns: nothing
    // Global references:
    //        $PHP_SELF
    //        $HTTP_POST_VARS
    //        $HTTP_SESSION_VARS
    ///////////////////////////////////////////////////////////////////////////////
    function  display_form ( $err =array())
    {
        global 
    $PHP_SELF ;
        global 
    $HTTP_POST_VARS ;
        global 
    $HTTP_SESSION_VARS ;

        
    $sitename = $GLOBALS [ 'sitename' ];
        
    $admin_table = $GLOBALS [ 'admin_table' ];

        
    pageheader ( " $sitename  - Create another admin account" , "onLoad=\"document.forms['add_admin_form'].elements['new_userid'].focus()\"" );
    ?>
    <div align="center">
    <h1>Create another admin account</h1>
    <?php
    if( count ( $err ))
    // error in previous submission
    {
        echo 
    "<span class=\"error\">There was an error in your previous submission. Please re-enter the fields highlighted in red.</span>\n" ;
    }
    ?>

    <form name="add_admin_form" method="post" action="<?=$PHP_SELF?>">
    <input name="action" type="hidden" value="add_admin">

    <!-- form table -->
    <table width="<?=$GLOBALS [ 'OB_table_width' ] ?>" cellspacing="1" cellpadding="5">
        <tr>
            <th align="right"><?php  if( in_array ( "new_userid" , $err )) echo  "<span class=\"error\">" ?>New account User ID:<?php  if( in_array ( "new_userid" , $err )) echo  "</span>" ?></th>
            <td>
                <input name="new_userid" type="text" value="<?php  if(isset( $HTTP_POST_VARS [ 'new_userid' ])) echo  $HTTP_POST_VARS [ 'new_userid' ]; ?>" size="12" maxlength="12">
                <br />4-12 alphanumeric characters (no duplicate User IDs allowed)
            </td>
        </tr>
        <tr>
            <th align="right"><?php  if( in_array ( "new_email" , $err )) echo  "<span class=\"error\">" ?>Email address:<?php  if( in_array ( "new_email" , $err )) echo  "</span>" ?></th>
            <td><input name="new_email" type="text" value="<?php  if(isset( $HTTP_POST_VARS [ 'new_email' ])) echo  $HTTP_POST_VARS [ 'new_email' ]; ?>" size="30" maxlength="40"><br />Enter a valid email to receive notification when guestbook is signed</td>
        </tr>
        <tr>
            <th align="right"><?php  if( in_array ( "new_password1" , $err )) echo  "<span class=\"error\">" ?>Password:<?php  if( in_array ( "new_password1" , $err )) echo  "</span>" ?></th>
            <td>
                <input name="new_password1" type="password" size="12" maxlength="12">
                <br />4-12 alphanumeric characters
            </td>
        </tr>
        <tr>
            <th align="right"><?php  if( in_array ( "new_password2" , $err )) echo  "<span class=\"error\">" ?>Re-enter Password:<?php  if( in_array ( "new_password2" , $err )) echo  "</span>" ?></th>
            <td><input name="new_password2" type="password" size="12" maxlength="12"></td>
        </tr>
        <tr>
            <td class="buttons" colspan="2" align="right"><input type="submit" value="Create admin account"> <input type="reset" value="Reset"></td>
        </tr>
        <tr>
            <td class="links" colspan="2" align="right">
                Back to <a href="./index.php">Guestbook</a> | <a href="./admin.php">Admin Panel</a>
            </td>
        </tr>
    </table>
    <!-- END form table -->

    </form>
    <?php
        db_connect
    ();

        
    $query = "SELECT userid,email FROM  $admin_table " ;
        
    $result = mysql_query ( $query );
        
    $num_admin = mysql_num_rows ( $result );         // number of admin accounts

        
    echo  "There " ;
        if(
    $num_admin  > 1 ) echo  "are" ; else echo  "is" ;
        echo 
    " currently <b>" . $num_admin . "</b> existing admin account" ;
        if(
    $num_admin  1 ) echo  "s." ; else echo  "." ;
        echo 
    "<br />\n" ;

        while(
    $row = mysql_fetch_array ( $result ))
        {
            if(
    $row [ 'userid' ]== $HTTP_SESSION_VARS [ 'admin_name' ])
            {
                echo 
    "<b>" . $row [ 'userid' ]. " - " . $row [ 'email' ]. "</b><br />\n" ;
            }
            else
            {
                echo 
    $row [ 'userid' ]. " - " . $row [ 'email' ].  "<br />\n" ;

            }
        }
    ?>
    </div>
    <?php
    } // end display_form()

    ///////////////////////////////////////////////////////////////////////////////
    // Function: array check_form()
    // Purpose: checks form fields for errors; returns array containing errorneous fields
    // Parameters: none
    // Returns: nothing
    // Global references:
    //        $HTTP_POST_VARS
    ///////////////////////////////////////////////////////////////////////////////
    function  check_form ()
    {
        global 
    $HTTP_POST_VARS ;

        
    $err =array();         //  array for storing erroroneous fields and error messages

        
    if(empty( $HTTP_POST_VARS [ 'new_userid' ]) || ! ereg ( '^[0-9A-Za-z]{4,12}$' , $HTTP_POST_VARS [ 'new_userid' ]))
        
    // userid cannot be empty and must be between 4-12 characters
        
    {
            
    $err []= "new_userid" ;
        }
        else
        
    // check if userid already exists in database
        
    {
            
    db_connect ();
            
    $query = "SELECT userid FROM  { $GLOBALS [ 'admin_table' ]} " ;
            
    $result = mysql_query ( $query );
            while(
    $row = mysql_fetch_array ( $result ))
            {
                if(
    $HTTP_POST_VARS [ 'new_userid' ] ==  $row [ 'userid' ])
                {
                    
    $err []= "new_userid" ;
                    break;
                }
            }
        }
        if(empty(
    $HTTP_POST_VARS [ 'new_email' ]) || ! ereg ( '^[0-9A-Za-z]+[\._0-9A-Za-z]*@([0-9A-Za-z-]+\.)+([0-9A-Za-z]){2,6}$' , $HTTP_POST_VARS [ 'new_email' ]))
        
    // check email field format
        
    {
            
    $err []= "new_email" ;
        }
        if(empty(
    $HTTP_POST_VARS [ 'new_password1' ]))
        {
            
    $err []= "new_password1" ;
        }
        if(empty(
    $HTTP_POST_VARS [ 'new_password2' ]))
        {
            
    $err []= "new_password2" ;
        }
        if(!(
    $HTTP_POST_VARS [ 'new_password1' ] ==  $HTTP_POST_VARS [ 'new_password2' ]) || ! ereg ( '^[0-9A-Za-z]{4,12}$' , $HTTP_POST_VARS [ 'new_password1' ]))
        
    // both password fields do not match match OR 
        // format of password is not alphanumeric and 4-12 characters
        
    {
            
    $err []= "new_password1" ;
            
    $err []= "new_password2" ;
        }

        return 
    $err ;
    }
    // end check_form()

    ///////////////////////////////////////////////////////////////////////////////
    // Function: void add_admin()
    // Purpose: attempts creation of admin account
    // Parameters: none
    // Returns: nothing
    // Global references:
    //        $PHP_SELF
    //        $HTTP_POST_VARS
    ///////////////////////////////////////////////////////////////////////////////
    function  add_admin ()
    {
        global 
    $PHP_SELF ;
        global 
    $HTTP_POST_VARS ;

        
    $sitename = $GLOBALS [ 'sitename' ];
        
    $admin_table = $GLOBALS [ 'admin_table' ];

        
    $post = $HTTP_POST_VARS ;     // alias for $HTTP_POST_VARS

        
    $err =array();         // array for storing erroroneous fields and error messages

        
    $err = check_form ();     // check form inputs for errors

        
    if( count ( $err ))
        
    // display form again together with error messages
        
    {
            
    pageheader ( " $sitename  - Error in form..." );

            
    display_form ( $err );
        }
        else
        {
            
    db_connect ();

            
    $query = "INSERT INTO  $admin_table  VALUES(' $post [ new_userid ] ',password(' $post [ new_password1 ] '),' $post [ new_email ] ')" ;
            
    $result = mysql_query ( $query );

            
    // display success/failure of creation of new record
            
    if(! $result )
            {
                
    pageheader ( " $sitename  - Error processing your entry..." );
                die(
    "There has been an error creating the new admin account.<br />If this error persists, please contact the developers at the <a href=\"http:\\openbook.sourceforge.net\">OpenBook website</a>." );
            }
            else
            {
                
    pageheader ( " $sitename  - Admin Account Created" );
    ?>
    <div align="center">
    <h1>New Account Created</h1>
    A new admin account has been created.
    <br />
    A comfirmation email containing the password has also been emailed to the new account.
    <br /><br />
    <table width="<?=$GLOBALS [ OB_table_width ] ?>" cellspacing="1" cellpadding="5">
        <tr>
            <th align="right" width="30%">User ID:</th>
            <td><?=$post [ 'new_userid' ] ?></td>
        </tr>
        </tr>
            <th align="right" width="30%">Email address:</th>
            <td><?=$post [ 'new_email' ] ?></td>
        </tr>
        <tr>
            <td class="links" colspan="2" align="right">
                Back to <a href="./index.php">Guestbook</a> | <a href="./admin.php">Admin Panel</a>
            </td>
        </tr>
    </table>
    </div>
    <?php
                
    // mail confirmation of creation to email accounts of creator and new account
                
    $mail_to = " $post [ new_email ] " ;
                
    $mail_subject = "Your account has been created!" ;
                
    $mail_body = "Your OpenBook administration account has been successfully created.\n\n" ;
                
    $mail_body .= "User ID:  $post [ new_userid ] \n" ;
                
    $mail_body .= "Password:  $post [ new_password1 ] \n\n" ;
                
    $mail_body .= "From the OpenBook auto-mailer" ;
                
    $mail_headers = "From: OpenBook Mailer <no-reply@openbook.mailer>\n" ;
                
    $mail_headers .= "X-Mailer: OpenBook Mailer" ;

                
    // send comfirmation email to new account
                
    mail ( $mail_to $mail_subject $mail_body $mail_headers );
            }
        }
    }
    // end add_admin()


    ///////////////////////////////////////////////////////////////////////////////
    // script main
    ///////////////////////////////////////////////////////////////////////////////
    if(isset( $HTTP_SESSION_VARS [ 'admin_name' ]))
    // IMPT: check if user is administrator first
    {
        if(isset(
    $HTTP_POST_VARS [ 'action' ]) &&  $HTTP_POST_VARS [ 'action' ] ==  "add_admin" )
        
    // process confirmation of admin account creation
        
    {
            
    add_admin ();
        }
        else if(isset(
    $HTTP_GET_VARS [ 'action' ]) &&  $HTTP_POST_VARS [ 'action' ] ==  "delete" )
        {
            
    delete_admin ();
        }
        else
        
    // $action not 'add_admin'; display form for admin account creation
        
    {
            
    display_form ();
        }
    }
    else
    // user is NOT logged in as administrator
    {
        
    not_logged_error ();
    }

    pagefooter ();
    ?>
    Bis dahin ersmal, J1Lock !
     
  6. 31. Oktober 2008
    AW: Was ist das für ne Verschlüsselung ?

    Die passwort Funktion ist wahrscheinlich in der common.php also poste die mal.
     
  7. 31. Oktober 2008
    AW: Was ist das für ne Verschlüsselung ?

    In der common.php ist soweit nichts, hier is der Inhalt, die Funktionen pageheader und pagefooder hab ich mal rausgenommen, da waren nur Menü Links und Meta Daten und so drin, nix was mit Password zu tun hat. Aber auch sonst hab ich da nix entdeckt
    Spoiler
    PHP:
    <? php
    ///////////////////////////////////////////////////////////////////////////////
    // File: common.php
    // Purpose: contains common variables and functions
    // Remarks: make configuration changes to this file to suit your tastes
    ///////////////////////////////////////////////////////////////////////////////
    // Functions:
    //        void pageheader(string $title="OpenBook", string $body_attr="")
    //        void redirectheader(string $url="./index.php", int $delay="2")
    //        void pagefooter()
    //        mysql_link_id db_connect()
    //        void error_msg(string $msg)
    ///////////////////////////////////////////////////////////////////////////////

    ///////////////////////////////////////////////////////////////////////////////
    // Variables
    ///////////////////////////////////////////////////////////////////////////////
    // database settings
    $dbhost = "entfernt" ;         // database host address
    $dbuser = "entfernt" ;                 // database user name
    $dbpassword = "entfernt" ;                 // database password
    $default_db = "entfernt" ;         // name of database

    // table names
    $posts_table = "entfernt" ;     // name of table to store posts
    $admin_table = "entfernt" ;     // name of table for admin authentication

    // global variables
    $sitename = "G&auml;stebuch" ;         // default title of pages
    $OB_version = "1.2.2" ;         // version of OpenBook
    $DOMAIN_URL = "../" ;             // fully qualified URL of homepage; defaults to 1 level above guestbook directory

    // guestbook settings
    $OB_entries_per_page = "5" ;     // number of entries to display per page
    $OB_table_width = "55%" ;         // width of tables
    $OB_display_type = "openbook" ;     // type of display structure for entries: "conventional" or "openbook"
    $OB_css = "style.css" ;         // CSS file to use
    $OB_mail_to_admin = true ;         // set to true to enable email notification to administrator; requires proper PHP email configuration (eg. sendmail)


    ///////////////////////////////////////////////////////////////////////////////
    // Function: void pageheader(string $title="OpenBook", string $body_attr="")
    // Purpose: echoes html page header
    // Parameters:
    //        $title - title of page (default: OpenBook)
    //        $body-attr - additional body attributes (default: empty string)
    // Returns: nothing
    // Global references: none
    ///////////////////////////////////////////////////////////////////////////////
    entfernt

    ///////////////////////////////////////////////////////////////////////////////
    // Function: void redirectheader(string $url="./index.php", int $delay=2)
    // Purpose: html page header for redirection
    // Parameters:
    //        $url - URL to redirect to (default: ./index.php)
    //        $delay - time in seconds to wait before redirection (default: 2)
    // Returns: nothing
    // Global references:
    //        $sitename - name of site
    ///////////////////////////////////////////////////////////////////////////////
    entfernt

    ///////////////////////////////////////////////////////////////////////////////
    // Function: void pagefooter()
    // Purpose: html page footer
    // Parameters: none
    // Returns: nothing
    // Global references:
    //        $OB_version - version of OpenBook
    ///////////////////////////////////////////////////////////////////////////////
    entfernt

    ///////////////////////////////////////////////////////////////////////////////
    // Function: mysql_link_id db_connect()
    // Purpose: connects to db server and selects $default_db
    // Parameters: none
    // Returns: MySQL link identifier upon success; dies upon error
    // Global references:
    //        $dbhost - database host address
    //        $dbuser - database user name
    //        $dbpassword - database password
    //        $default_db - name of database
    ///////////////////////////////////////////////////////////////////////////////
    function  db_connect ()
    {
        global 
    $dbhost $dbuser $dbpassword $default_db ;

        
    $link_id =@ mysql_connect ( $dbhost , $dbuser , $dbpassword );
        if(!
    $link_id )
        
    // connection to server failed
        
    {
            die(
    "Connection failed to  $dbhost ." );
        }
        if(!@
    mysql_select_db ( $default_db , $link_id ))
        
    // select db to use
        
    {
            die(
    "Couldn't select database  $default_db ." );
        }
        return 
    $link_id ;
    }
    // end db_connect()

    ///////////////////////////////////////////////////////////////////////////////
    // Function: void not_logged_error()
    // Purpose: displays page to indicate not logged in
    // Parameters: none
    // Returns: nothing
    // Global references: none
    ///////////////////////////////////////////////////////////////////////////////
    function  not_logged_error ()
    {
        
    pageheader ( $GLOBALS [ 'sitename' ]);
    ?>
    <h1>Permission denied</h1>
    <span class="error">You're not logged in!</span>
    <br />
    <a href="./admin.php">[Login]</a> | <a href="./index.php">[Back to guestbook]</a>
    <?php
    } // end not_logged_error()

    ///////////////////////////////////////////////////////////////////////////////
    // Function: double get_microtime()
    // Purpose: gets the current time in microseconds
    // Parameters: none
    // Returns: current time in microseconds
    // Global references: none
    ///////////////////////////////////////////////////////////////////////////////
    function  get_microtime ()
    {
        
    $time = microtime ();
        
    $time = explode ( " " , $time );         // microtime() returns seconds and microseconds in
                                                                // a string separated by a space
        
    $time = doubleval ( $time [ 1 ]) +  doubleval ( $time [ 0 ]);

        return 
    $time ;
    }
    // end get_microtime()

    ///////////////////////////////////////////////////////////////////////////////
    // Function: void error_msg(string $msg)
    // Purpose: prints error msg in error style
    // Parameters:
    //        $msg - error message to display
    // Returns: nothing
    // Global references: none
    ///////////////////////////////////////////////////////////////////////////////
    function  error_msg ( $msg )
    {
         echo 
    "<span class=\"error\"> $msg </span><br />" ;
    }
    // end error_msg()
     
  8. 31. Oktober 2008
    AW: Was ist das für ne Verschlüsselung ?

    Was ist denn das für ein Gästebuch?
    Ist einfacher als jede Datei zu uppen.



    Oder such mal die funktion password()
     
  9. 31. Oktober 2008
    AW: Was ist das für ne Verschlüsselung ?

    Die Zeile "$OB_version="1.2.2"; // version of OpenBook" lässt auf OpenBook (kenne ich nicht) schließen und lässt sich hier downloaden: Download OpenBook 1.2.2 - OpenBook is a simple PHP/MySQL guestbook application which is fast and lightweight.
    kann sich ja mal jemand anschaun. meine php künste sind nicht so der bringer aber evt schau ich nacher auch mal drüber
    edit: ok der Link oben geht nicht. Der hier sollte funktionieren: OpenBook | Free software downloads at SourceForge.net
     
  10. 31. Oktober 2008
    AW: Was ist das für ne Verschlüsselung ?

    Oh man jetzt hab ich mir mal den Source angeschaut.

    In der create_admin.php findet man folgende stelle
    PHP:
    $query = "INSERT INTO  $admin_table  VALUES(' $post [ new_userid ] ',password(' $post [ new_password1 ] '),' $post [ new_email ] ')" ;
    new_password1 ist dabei die Eingabe.

    Also müsste die Funktion password() die von MySQL sein(?!)

    Die verschlüsselt aber nach folgendem Muster:
    Code:
    mysql> SELECT PASSWORD('badpwd');
     -> '*AAB3E285149C0135D51A520E1940DD3263DC008C'
    
     
  11. 31. Oktober 2008
    AW: Was ist das für ne Verschlüsselung ?

    hast du die abfrage aufm gleichen mysql-server ausgeführt? der hash-modus is nämlich von server zu server verschieden..
     
  12. 1. November 2008
    AW: Was ist das für ne Verschlüsselung ?

    Welche Abfrage ? ^^
    Irgendwie hab ich deine Antwort nicht ganz verstanden ^^
     
  13. 1. November 2008
    AW: Was ist das für ne Verschlüsselung ?

    Ah sry, hab dich mit scriptkiddy verwechselt.

    Du hast ja sicher phpMyAdmin o.ä. womit du auf die Datenbank zugreifen kannst.

    Für mal das aus:
    Code:
    UPDATE usertabelle SET password=PASSWORD('meinneuespw') WHERE id=123
    natürlich musst du den Tabellen und spaltennamen sowie die ID anpassen (wenn keine ID verwended wird, dann WHERE name='name' o.ä. verwenden)
     
  14. 1. November 2008
    AW: Was ist das für ne Verschlüsselung ?

    Kannte die Funktion noch nicht und bin nach kurzer Suche auf diese Website gestoßen. Wird die SQL-Verschlüsselung sein.

    Dass bei dir ein anderer Hash rauskommt kann daran liegen, dass diese Funktion vlt. bei Updates von SQL etwas geändert wurde.

    Mit dem Wissen kannst du ja jetzt getrost deine eigenen Passwörter generieren Oder ändere einfach alle Passagen, wo password() steht in md5 oder sha1 um.
     
  15. 2. November 2008
    AW: Was ist das für ne Verschlüsselung ?

    Suuper danke, das hat funktioniert, BW is raus an dich und an alle sinnvollen Beiträge auch.

    Jetzt hab ich n Adminaccount, aber ich will jetzt auch das alte PW vom USer "admin" rausfinden.
    Is das anhand der Verschlüsselung iwie möglich ? Wenn nicht, is nicht so schlimm, dann mach ich da eben auch n neues rein, einfacher für mich wäre es aber wenn ichs iwei rausbekommen könnte.
    Mfg J1Lock
     
  16. 2. November 2008
    AW: Was ist das für ne Verschlüsselung ?

    brute-force z.b. mit dem programm PasswordsPro oder John the Ripper password cracker


    Thema ist dann wohl erledigt.


    closed
     
  17. Video Script

    Videos zum Themenbereich

    * gefundene Videos auf YouTube, anhand der Überschrift.