-
Notifications
You must be signed in to change notification settings - Fork 2
/
index.js
37 lines (29 loc) · 1.13 KB
/
index.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
(async()=>{
"use strict";
// Dependencies
const { runJobs } = require("parallel-park")
const request = require("request-async")
const { JSDOM } = require("jsdom")
const fs = require("fs")
// Variables
const args = process.argv.slice(2)
// Main
if(!args.length) return console.log("usage: node index.js <url> <concurrency(Default: 20)>")
const paths = fs.readFileSync("./paths.txt", "utf8").replace(/\r/g, "").split("\n")
console.log("Admin panels finding has started.")
await runJobs(
paths,
async(path, index, max)=>{
if(!path.match(/^\//)) path = `/${path}`
try{
var response = await request(`${args[0]}${path}`, { timeout: 5000 })
const dom = new JSDOM(response.body)
if(dom.window.document.querySelector("input") && response.body.indexOf("Login") !== -1) response.statusCode === 200 ? console.log("Admin panel found:", path) : console.log("Unsure admin panel found:", path)
}catch{}
},
{
concurrency: args[1] ?? 20
}
)
console.log("Finished.")
})()