-
Notifications
You must be signed in to change notification settings - Fork 1
/
admin-bot.js
34 lines (26 loc) · 957 Bytes
/
admin-bot.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
import flag from './flag.txt';
import crypto from 'crypto';
function sleep(time) {
return new Promise(resolve => {
setTimeout(resolve, time);
});
}
export default {
id: 'complainer',
name: 'complainer',
urlRegex: /^https:\/\/complainer\.tjc\.tf\//,
timeout: 30000,
handler: async (url, ctx) => {
const page = await ctx.newPage();
await page.goto('https://complainer.tjc.tf/register', { waitUntil: 'domcontentloaded' });
await page.type('#username', crypto.randomBytes(16).toString('hex'));
await page.type('#password', crypto.randomBytes(16).toString('hex'));
await page.click('button[type="submit"]');
await sleep(1000);
await page.type('#body', flag.trim());
await page.click('button[type="submit"]');
await sleep(1000);
await page.goto(url, { timeout: 10000, waitUntil: 'domcontentloaded' });
await sleep(30000);
}
};