NoPaste Service
DOWNLOAD
Language: PHP
Author: Matrix86
Description: Psi client password decrypter
Date: 13/01/10 19:12
  1. <?php
  2. /*
  3.  *      Psi client password decrypter
  4.  *      
  5.  *      Copyright (C) 2010 Matrix86
  6.  *      matrix86 [_AT_] tuxmealux [_DOT_] net
  7.  *      http://www.tuxmealux.net
  8.  *      
  9.  *      This program is free software: you can redistribute it and/or modify
  10.  *      it under the terms of the GNU General Public License as published by
  11.  *      the Free Software Foundation, either version 3 of the License, or
  12.  *      (at your option) any later version.
  13.  *      
  14.  *      This program is distributed in the hope that it will be useful,
  15.  *      but WITHOUT ANY WARRANTY; without even the implied warranty of
  16.  *      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  17.  *      GNU General Public License for more details.
  18.  *      
  19.  *      You should have received a copy of the GNU General Public License
  20.  *      along with this program.  If not, see <http://www.gnu.org/licenses/>.
  21.  */
  22.  
  23. define( "XMLFILE", "/home/".get_current_user()."/.psi/profiles/default/accounts.xml" );
  24.  
  25. banner();
  26.  
  27. if(!file_exists( XMLFILE )) die( "[ERROR] File not found. Exit.\n" );
  28. $xml = simplexml_load_file( XMLFILE );
  29.  
  30. $i=0;
  31. $a = "a".$i++;
  32. $jid = (string) $xml->accounts->$a->jid;
  33. $pwd = (string) $xml->accounts->$a->password;
  34. while(!empty($jid) && !empty($pwd)) {
  35.         echo "[#] 1 Account Found.\n";
  36.         echo "\t[!] Username: $jid\n";
  37.         echo "\t[!] Password: ".decrypt_psi( $jid, $pwd )."\n\n";
  38.        
  39.         $a = "a".$i++;
  40.         $jid = (string) $xml->accounts->$a->jid;
  41.         $pwd = (string) $xml->accounts->$a->password;
  42. }
  43.  
  44. function banner(){
  45.         echo "\n *****************************************************\n";
  46.         echo " *    Psi (Jabber client) password decrypter         *\n";
  47.         echo " *****************************************************\n";
  48.         echo " * Author: Matrix86                                  *\n";
  49.         echo " * Site:   http://www.tuxmealux.net                  *\n";
  50.         echo " *                                                   *\n";
  51.         echo " *****************************************************\n\n";
  52. }
  53.  
  54. function decrypt_psi($jid, $passwd) {
  55.   $i=0;
  56.   $plain="";
  57.  
  58.   for($p=0; $p < strlen($passwd); $p+=4) {
  59.     $jidascii = ord($jid[$i++]);
  60.     $hex = "0x".substr($passwd,$p,4);
  61.     $dec = hexdec($hex);
  62.     $plain .= chr($jidascii ^ $dec);
  63.   }
  64.  
  65.   return $plain;
  66. }
  67.  
  68. ?>
  69.