Web Design & SEO Company

Web Design & SEO Company (http://www.tareeinternet.com/forum/)
-   Knowledgebase (http://www.tareeinternet.com/forum/knowledgebase/)
-   -   Print or Save Firefox Passwords (http://www.tareeinternet.com/forum/knowledgebase/3746-print-save-firefox-passwords.html)

Admin 07-07-2009 06:13 PM

Print or Save Firefox Passwords
 
Mainly posting this for my own reference so i don't lose it, but this enables you to Print or Save Firefox passwords to a formatted .html page for safe storage.

In Firefox if you go to Tools > Options > Security Tab > Saved Passwords you can view all your Passwords, Usernames and Login URL's but you can't highlight and save them as a backup. If you are like me and have ~1,000 passwords and logins then keeping separate backups or printed copies is important.

This info is encrypted in your Firefox profile, and is stored in signons.sqlite and the decryptor file is key3.db for Firefox 3.5 and neither can be opened and read.

Anyhow Copy the following code:

Code:

(function(){
function twodigits(string) {return (string.length < 2) ? "0" + string : string ;}
function fourdigits(number){return (number < 1000) ? number + 1900 : number;}

var now = new Date();
var hours = twodigits(now.getHours() + "") ;
var minutes = twodigits(now.getMinutes() + "") ;
var seconds = twodigits(now.getSeconds() + "") ;

var timeValue = " | At  " + hours + ":" + minutes + ":" + seconds;
var days = new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday");
var months = new Array("January","February","March","April","May","June","July","August","September","October","November","December");
var date = ((now.getDate()<10) ? "0" : "")+ now.getDate();

var today =  "On " + days[now.getDay()] + ", " + date + " " + months[now.getMonth()] + " " +    (fourdigits(now.getYear())) + timeValue ;

var Cc = Components.classes;
var Ci = Components.interfaces;

netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");

var tokendb = Cc["@mozilla.org/security/pk11tokendb;1"]
                .createInstance(Ci.nsIPK11TokenDB);
var token = tokendb.getInternalKeyToken();

try { token.login(true);} catch (e) {}

if (token.isLoggedIn()) {
 var passwordmanager = Cc["@mozilla.org/login-manager;1"]
                      .getService(Ci.nsILoginManager);
 var names="",signons = passwordmanager.getAllLogins({});

 for (i=0;i<signons.length;i++) {
  try {
  var host = signons[i].hostname;
  var realm = signons[i].httpRealm;
  var user = signons[i].username;
  var userf = signons[i].usernameField;
  var password = signons[i].password;
  var passwordf = signons[i].passwordField;
  var submiturl = signons[i].formSubmitURL;
  if (user == ""){ user = "<br>"; }
  names+="  <tr>\n    <td> " + host + " </td>\n    <td> " + user + " </td>\n    <td> " + password + "  </td>\n    <td> " + submiturl + " </td>\n  </tr>\n";
  } catch(e) {}
 }

 void(window.open('data:text/html,
<html><head>
<meta http-equiv=content-type" content="text/html; charset=ISO-8859-1">

<title>Exported Mozilla Passwords</title>
<style type="text/css">
 td {
  font-family: "Trebuchet MS", Arial, Helvetica, Geneva, Verdana, Sans-Serif;
  font-size: 85%;
  padding: 1px 2px 1px 2px;
}
</style>
</head><body style="margin: 1em 3em; background-color: rgb(0, 126, 255);">
<b>MOZILLA PASSWORD INFORMATION</b>
<p>Produced by <i>Pasting Code in the "Tools > Error Console: Code field"</i> '+today+
'</p><p>
<table style="empty-cells: show; background-color: rgb(231, 240, 249);" border="1" cellspacing="0">
<tbody><tr style="background-color: rgb(77, 138, 212);">
<td>
<b>Host</b>
</td>
<td>
<b>User name</b>
</td>
<td>
<b>Password</b>
</td>
<td>
<b>Submit URL</b>
</td>
</tr>'+names+'</tbody></table>
</p></body></html>',"","menubar=yes,resizable=yes,scrollbars=yes,width=1000,height:600"));
}
})();

Go to: Tools >> Error Console

Paste the above code in the "Code" box, and click "Evaluate"

http://www.tareeinternet.com/forum/i...or-console.png

A new window will pop-up with a .html page containing all your stored Firefox Usernames, Passwords and Login URL's in a formatted table.

This is the output:

http://www.tareeinternet.com/forum/i...dom/output.png

You can print this, or just Right Click > Save As and save it as whatever.html like a regular web page.

I couldn't find an importer from Firefox 3.5 to Keypass and didn't feel like typing +1,000 entries manually, now they are dumped out of Firefox i can import them easier.

The above code could be simplified by removing all the var functions relating to the time/date however it's useful to include so your password list has the time and date it was produced printed on it.

The other thing also is running random tools off the net that interact with critical information such as your passwords poses a big security risk. As you can see the code above does not connect with TareeInternet.com in any way (nor with any other site) and the information does not leave your computer.

Everything it does is clearly visible, and you can modify the code however you wish.

Tekim 07-25-2009 01:11 PM

Thanks admin

learntofixyourcomputer 10-14-2009 03:16 AM

Cool tip for Firefox. I might use this someday. Thanks


Forum time zone is GMT. Currently it's 11:37 AM.

Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.