Skip to content

Instantly share code, notes, and snippets.

@yuanchuan
Created September 21, 2011 03:29
Show Gist options
  • Save yuanchuan/1231163 to your computer and use it in GitHub Desktop.
Save yuanchuan/1231163 to your computer and use it in GitHub Desktop.
login
#!/usr/bin/env node
var md5 = require('./md5.js').md5
, exec = require('child_process').exec
, username = process.argv[2] || ''
, password = process.argv[3] || ''
, getUrl = function(u, p) {
var href = '"http://xxx.xxx/xxx.php';
return href + '?uid=1&username=' + u + '&passwd=' + p + '&time=100192&flag=1"';
}
, url = getUrl(username, md5(password));
exec("wget -qO- " + url + " | awk 'END{print NR}'",
function(err, stdout) {
if (stdout != 210) {
exec('firefox ' + url, function(){});
} else {
console.log('unmatch!');
}
}
);
/*
./login username password
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment