fix broken login forms with greasemonkey

Not without pain, this evening I’ve learned how to write a small client side script with greasemonkey [1] . Even if conceptually very easy, I discovered (the hard way) that the firefox security model changed quite drastically with firefox 3.0 introducing XPCNativeWrappers. This page [2] explains the problem in details.

Anyway below it is a small js script to replace http with https in all forms on a page. It can be handy to force login using https on website that do not offer this option by default. And it was funny to learn.

// ==UserScript==
// @name              Fix broken forms
// @description    Forces known sites to use a secure connection
// @include        https://example.com/*
// @copyright      Pietro
// ==/UserScript==

//fix broken forms
var forms = document.getElementsByTagName('form');
for (var i = 0; i < forms.length; i++) {
    var form = forms[i].wrappedJSObject || forms[i];
    if (form.action) {
        form.action = form.action.replace(/^http:/, 'https:');
    }
}

[1] https://addons.mozilla.org/en-US/firefox/addon/748

[2] http://www.oreillynet.com/pub/a/network/2005/11/01/avoid-common-greasemonkey-pitfalls.html


openssl vulnerability

Here I come. Following from the DSA announcement I’ve regenerated the ssh/openssl keys for cduce.org.

apt-get update
apt-get upgrade
rm /etc/ssh/*
dpkg-reconfigure -plow openssh-server

One the user side:

first ssh to the remote machine and remove the for ~/.ssh/authorized_keys . This will lock you out if you don’t remember the passowrd for that machine !

Then, you should remove your ssh keys (from you local machine), and regenerate them with:

ssh-keygen
ssh-copy-id <host>

At this point you should be able to login back on your remote host using the new ssh key.