Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (function () {
- if (document.getElementById("scannerHUD")) return;
- // --- HUD UI ---
- const hud = document.createElement("div");
- hud.id = "scannerHUD";
- hud.style.cssText = `
- position: fixed;
- top: 20px;
- right: 20px;
- width: 320px;
- background: rgba(20,20,20,0.95);
- color: #0f0;
- font-family: monospace;
- font-size: 12px;
- border: 1px solid #0f0;
- border-radius: 10px;
- z-index: 999999;
- box-shadow: 0 0 15px #0f0;
- `;
- hud.innerHTML = `
- <div id="hudHeader" style="padding:8px; cursor:move; border-bottom:1px solid #0f0;">
- 🔍 Hidden Scanner
- <button id="closeHUD" style="float:right;">X</button>
- </div>
- <div style="padding:8px;">
- <button id="startScan">Start</button>
- <button id="stopScan">Stop</button>
- <div id="progress">Idle</div>
- <div id="results" style="margin-top:8px; max-height:200px; overflow:auto;"></div>
- </div>
- `;
- document.body.appendChild(hud);
- // --- Dragging ---
- const header = document.getElementById("hudHeader");
- let isDragging = false, offsetX, offsetY;
- header.onmousedown = (e) => {
- isDragging = true;
- offsetX = e.clientX - hud.offsetLeft;
- offsetY = e.clientY - hud.offsetTop;
- };
- document.onmousemove = (e) => {
- if (isDragging) {
- hud.style.left = (e.clientX - offsetX) + "px";
- hud.style.top = (e.clientY - offsetY) + "px";
- hud.style.right = "auto";
- }
- };
- document.onmouseup = () => isDragging = false;
- // --- Logic ---
- const resultsDiv = document.getElementById("results");
- const progressDiv = document.getElementById("progress");
- let running = false;
- const delay = ms => new Promise(r => setTimeout(r, ms));
- const baseWords = [
- "admin","login","dashboard","panel",
- "api","private","hidden",
- "test","dev","staging",
- "backup","old","temp",
- "config","settings","internal"
- ];
- const generatePaths = () => {
- const set = new Set();
- baseWords.forEach(w => {
- set.add(w);
- set.add(w+"1");
- set.add(w+"-old");
- set.add(w+"_backup");
- set.add(w+"/v1");
- });
- return [...set];
- };
- const isRealPage = (text) => {
- const t = text.toLowerCase();
- return !(t.includes("not found") || t.includes("404") || t.length < 50);
- };
- const addResult = (text) => {
- const div = document.createElement("div");
- div.textContent = text;
- resultsDiv.appendChild(div);
- resultsDiv.scrollTop = resultsDiv.scrollHeight;
- };
- async function scan() {
- const paths = generatePaths();
- let count = 0;
- for (const path of paths) {
- if (!running) break;
- progressDiv.textContent = `Checking: ${path}`;
- try {
- const res = await fetch("/" + path);
- const text = await res.text();
- if (res.status === 200 && isRealPage(text)) {
- addResult("FOUND: /" + path);
- }
- } catch {}
- count++;
- await delay(120);
- }
- progressDiv.textContent = "Done";
- running = false;
- }
- // --- Controls ---
- document.getElementById("startScan").onclick = () => {
- if (!running) {
- running = true;
- resultsDiv.innerHTML = "";
- scan();
- }
- };
- document.getElementById("stopScan").onclick = () => {
- running = false;
- progressDiv.textContent = "Stopped";
- };
- document.getElementById("closeHUD").onclick = () => {
- running = false;
- hud.remove();
- };
- })();
Advertisement
Add Comment
Please, Sign In to add comment