Skip to content

Instantly share code, notes, and snippets.

@mustofa-id
Created March 17, 2024 09:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mustofa-id/0a2a035dc8dee6d197050c27c9ffb59e to your computer and use it in GitHub Desktop.
Save mustofa-id/0a2a035dc8dee6d197050c27c9ffb59e to your computer and use it in GitHub Desktop.
const total = 1_000;
const limit = 40;
const messages = [];
let ok = 0;
let fail = 0;
async function send() {
try {
// copy from chrome dev-tools
const res = await fetch("https://dgety-ld.jxh.my.id/ast/req/2f68d4e0d386ee468cd061afc288d287.php", {
"headers": { "content-type": "application/x-www-form-urlencoded" },
"body": "pin1=I&pin2=D&pin3=I&pin4=O&pin5=T&pin6=T",
"method": "POST"
});
if (res.ok) { ok++ } else {
throw new Error(`(${res.status}) ${res.statusText}`)
};
} catch (e) {
fail++;
messages.push(e.message)
}
process.stdout.write(` 🚀 ok: ${ok} | fail: ${fail} | last fail message: "${messages.at(-1)}"\r`);
}
async function breathe() {
process.stdout.write(` ⏳\r`);
await new Promise((r) => setTimeout(r, 5_000));
}
console.log(`sending ${total} requests in ${total/limit} batches...`);
for (let i = 0; i < total/limit; i++) {
if (i !== 0) await breathe();
await Promise.all(Array.from({ length: limit }).map(send));
}
console.log('\ndone');
@mustofa-id
Copy link
Author

bun boom_phising_site.js

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment