-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathhint.js
58 lines (50 loc) · 1.74 KB
/
hint.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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
const sleep = time => new Promise(resolve => setTimeout(resolve, time));
// not the actual admin bot script
// but basically the same :>
// npm install puppeteer
const puppeteer = require("puppeteer");
const SITE = "https://msgme.be.ax";
const ADMIN_PASSWORD = "REDACTED";
const visit = (url) => {
let browser, page;
return new Promise(async (resolve, reject) => {
try {
browser = await puppeteer.launch({
headless: true,
pipe: true,
args: [
'--no-sandbox',
'--disable-setuid-sandbox',
'--js-flags=--noexpose_wasm'
],
dumpio: true
});
page = await browser.newPage();
// yeah this is wack but idrc :))
await page.evaluate((password, site) => {
document.write(`
<form method="POST" action="${site}/chat/admin_login">
<input type="text" name="password" />
<input type="submit" />
</form>
`);
document.querySelector("input[name=password]").value = password;
document.querySelector("input[type=submit]").click();
}, ADMIN_PASSWORD, SITE);
await sleep(3000);
await page.goto(url);
await sleep(14000);
await page.close();
page = null;
await browser.close();
browser = null;
} catch (err) {
console.log(err);
} finally {
if (page) await page.close();
if (browser) await browser.close();
resolve();
}
});
};
visit("some url");