Download script.js from secutorpro/gdorks-web-generator-7cmse: direct link, hf CLI and curl.
- Browser
- Download file 24.2 kB
-
https://huggingface.co/spaces/secutorpro/gdorks-web-generator-7cmse/resolve/main/script.js
- Command line
-
hf download hf://spaces/secutorpro/gdorks-web-generator-7cmse/script.js
-
curl -L -o script.js https://huggingface.co/spaces/secutorpro/gdorks-web-generator-7cmse/resolve/main/script.js
24.2 kB
| // Google Dorks Database | |
| const dorks = [ | |
| // Sensitive Files | |
| { | |
| id: 1, | |
| category: 'sensitive-files', | |
| title: 'SQL Database Files', | |
| query: 'site:{target} ext:sql | ext:db | ext:sqlite | ext:sqlite3 | ext:mdb | ext:dbf', | |
| description: 'Find exposed database files', | |
| icon: 'database' | |
| }, | |
| { | |
| id: 2, | |
| category: 'sensitive-files', | |
| title: 'Configuration Files', | |
| query: 'site:{target} ext:xml | ext:conf | ext:cnf | ext:reg | ext:inf | ext:rdp | ext:cfg | ext:ini | ext:env', | |
| description: 'Exposed configuration and settings files', | |
| icon: 'file-cog' | |
| }, | |
| { | |
| id: 3, | |
| category: 'sensitive-files', | |
| title: 'Log Files', | |
| query: 'site:{target} ext:log', | |
| description: 'Find log files with sensitive data', | |
| icon: 'file-text' | |
| }, | |
| { | |
| id: 4, | |
| category: 'sensitive-files', | |
| title: 'Backup & Old Files', | |
| query: 'site:{target} ext:bkf | ext:bkp | ext:bak | ext:old | ext:backup | ext:save', | |
| description: 'Backup and old file versions', | |
| icon: 'archive' | |
| }, | |
| { | |
| id: 5, | |
| category: 'sensitive-files', | |
| title: 'Password Files', | |
| query: 'site:{target} intitle:index.of "password.txt" | "passwd" | "credentials"', | |
| description: 'Search for password files in directory listings', | |
| icon: 'key' | |
| }, | |
| { | |
| id: 6, | |
| category: 'sensitive-files', | |
| title: 'Git Repositories', | |
| query: 'inurl:.git site:{target} "index of" | intitle:"Index of /.git"', | |
| description: 'Exposed Git repositories', | |
| icon: 'git-branch' | |
| }, | |
| // Vulnerabilities | |
| { | |
| id: 7, | |
| category: 'vulnerabilities', | |
| title: 'SQL Injection Parameters', | |
| query: 'site:{target} inurl:".php?id=" | inurl:".asp?id=" | inurl:"/index.php?id=" | inurl:"/product.php?id="', | |
| description: 'Potential SQL injection points', | |
| icon: 'alert-triangle' | |
| }, | |
| { | |
| id: 8, | |
| category: 'vulnerabilities', | |
| title: 'XSS Parameters', | |
| query: 'site:{target} inurl:"?q=" | inurl:"?search=" | inurl:"?query=" | inurl:"?s=" | inurl:"?keyword="', | |
| description: 'Parameters that might be vulnerable to XSS', | |
| icon: 'crosshair' | |
| }, | |
| { | |
| id: 9, | |
| category: 'vulnerabilities', | |
| title: 'LFI/RFI Parameters', | |
| query: 'site:{target} inurl:"?file=" | inurl:"?page=" | inurl:"?path=" | inurl:"?folder=" | inurl:"?include="', | |
| description: 'File inclusion vulnerability parameters', | |
| icon: 'file-input' | |
| }, | |
| { | |
| id: 10, | |
| category: 'vulnerabilities', | |
| title: 'Open Redirects', | |
| query: 'site:{target} inurl:"?url=" | inurl:"?redirect=" | inurl:"?return=" | inurl:"?next=" | inurl:"?redirect_uri="', | |
| description: 'Potential open redirect parameters', | |
| icon: 'link' | |
| }, | |
| { | |
| id: 11, | |
| category: 'vulnerabilities', | |
| title: 'phpinfo() Pages', | |
| query: 'site:{target} "PHP Version" "phpinfo()" "Zend Scripting Language Engine"', | |
| description: 'Exposed PHP configuration pages', | |
| icon: 'info' | |
| }, | |
| { | |
| id: 12, | |
| category: 'vulnerabilities', | |
| title: 'API Keys & Tokens', | |
| query: 'site:{target} "api_key" | "apikey" | "api_secret" | "access_token" | "auth_token" | "client_secret"', | |
| description: 'Hardcoded API keys and tokens', | |
| icon: 'key-round' | |
| }, | |
| // Directories | |
| { | |
| id: 13, | |
| category: 'directories', | |
| title: 'Directory Listings', | |
| query: 'site:{target} intitle:"Index of" "Parent Directory" "Directory Listing"', | |
| description: 'Open directory indexes', | |
| icon: 'folder-open' | |
| }, | |
| { | |
| id: 14, | |
| category: 'directories', | |
| title: 'Admin Panels', | |
| query: 'site:{target} inurl:"/admin" | inurl:"/administrator" | inurl:"/adminpanel" | inurl:"/controlpanel" | inurl:"/dashboard"', | |
| description: 'Potential administrative interfaces', | |
| icon: 'shield' | |
| }, | |
| { | |
| id: 15, | |
| category: 'directories', | |
| title: 'Upload Folders', | |
| query: 'site:{target} inurl:"/upload" | inurl:"/uploads" | inurl:"/file" | inurl:"/files" intitle:"index of"', | |
| description: 'Exposed upload directories', | |
| icon: 'upload-cloud' | |
| }, | |
| { | |
| id: 16, | |
| category: 'directories', | |
| title: 'Backup Directories', | |
| query: 'site:{target} inurl:"/backup" | inurl:"/backups" | inurl:"/dump" | inurl:"/dumps" | inurl:"/archive"', | |
| description: 'Backup and dump directories', | |
| icon: 'archive-restore' | |
| }, | |
| { | |
| id: 17, | |
| category: 'directories', | |
| title: 'Source Code', | |
| query: 'site:{target} ext:zip | ext:tar | ext:gz | ext:rar | ext:7z "source" | "backup" | "code"', | |
| description: 'Compressed source code archives', | |
| icon: 'code-2' | |
| }, | |
| // Cameras/IoT | |
| { | |
| id: 18, | |
| category: 'cameras', | |
| title: 'Live Cameras', | |
| query: 'inurl:"view.shtml" | inurl:"viewerframe?mode=" | inurl:"view/index.shtml" | inurl:"camera"', | |
| description: 'Potentially exposed live cameras', | |
| icon: 'video' | |
| }, | |
| { | |
| id: 19, | |
| category: 'cameras', | |
| title: 'Webcam Interfaces', | |
| query: 'intitle:"webcam" | inurl:"webcam" | intitle:"live view" | inurl:"lvappl" | inurl:"live_view"', | |
| description: 'Webcam control interfaces', | |
| icon: 'webcam' | |
| }, | |
| { | |
| id: 20, | |
| category: 'cameras', | |
| title: 'CCTV Systems', | |
| query: 'intitle:"CCTV" | inurl:"cctv" | intitle:"DVR" | inurl:"dvr" | intitle:"NVR" | inurl:"nvr"', | |
| description: 'CCTV and DVR systems', | |
| icon: 'scan-eye' | |
| }, | |
| { | |
| id: 21, | |
| category: 'cameras', | |
| title: 'Network Printers', | |
| query: 'inurl:"printer" | intitle:"printer" | inurl:"ipp" | inurl:"print" | intitle:"HP Printer" | intitle:"Epson"', | |
| description: 'Exposed network printers', | |
| icon: 'printer' | |
| }, | |
| { | |
| id: 22, | |
| category: 'cameras', | |
| title: 'Routers/Modems', | |
| query: 'intitle:"router" | inurl:"router" | intitle:"modem" | inurl:"modem" | intitle:"gateway" | inurl:"gateway"', | |
| description: 'Router and modem admin pages', | |
| icon: 'wifi' | |
| }, | |
| // Login Pages | |
| { | |
| id: 23, | |
| category: 'login', | |
| title: 'Login Portals', | |
| query: 'site:{target} inurl:"login" | inurl:"signin" | inurl:"auth" | inurl:"account" | intitle:"login"', | |
| description: 'Login and authentication pages', | |
| icon: 'log-in' | |
| }, | |
| { | |
| id: 24, | |
| category: 'login', | |
| title: 'WordPress Admin', | |
| query: 'site:{target} inurl:"wp-login" | inurl:"wp-admin" | inurl:"wp-config"', | |
| description: 'WordPress administration pages', | |
| icon: 'type' | |
| }, | |
| { | |
| id: 25, | |
| category: 'login', | |
| title: 'cPanel/WebHost', | |
| query: 'site:{target} inurl:"cpanel" | inurl:"webmail" | inurl:"whm" | inurl:"webhost" | intitle:"cPanel"', | |
| description: 'Hosting control panels', | |
| icon: 'server' | |
| }, | |
| { | |
| id: 26, | |
| category: 'login', | |
| title: 'Joomla Admin', | |
| query: 'site:{target} inurl:"/administrator" "Joomla" | inurl:"joomla"', | |
| description: 'Joomla administration panels', | |
| icon: 'layout-template' | |
| }, | |
| { | |
| id: 27, | |
| category: 'login', | |
| title: 'phpMyAdmin', | |
| query: 'site:{target} inurl:"phpmyadmin" | inurl:"phpMyAdmin" | intitle:"phpMyAdmin"', | |
| description: 'Database management interfaces', | |
| icon: 'table' | |
| }, | |
| // Active Exploits & Redirects | |
| { | |
| id: 28, | |
| category: 'exploits', | |
| title: 'SSRF Parameters', | |
| query: 'site:{target} inurl:"?fetch=" | inurl:"?src=" | inurl:"?load=" | inurl:"?proxy=" | inurl:"?dest=" | inurl:"?target="', | |
| description: 'Server-Side Request Forgery vulnerable parameters', | |
| icon: 'globe' | |
| }, | |
| { | |
| id: 29, | |
| category: 'exploits', | |
| title: 'Google API Key Exposure', | |
| query: 'site:{target} "AIzaSy" | "google_api_key" | "GOOGLE_MAPS_API_KEY" | "gmaps_key" | "firebase_apiKey"', | |
| description: 'Exposed Google API keys (Maps, Firebase, etc.)', | |
| icon: 'key-round' | |
| }, | |
| { | |
| id: 30, | |
| category: 'exploits', | |
| title: 'JWT & Auth Tokens', | |
| query: 'site:{target} "eyJ" | "jwt_secret" | "json-web-token" | "session_secret" | "SECRET_KEY" ext:env | ext:yml | ext:json', | |
| description: 'Exposed JWT tokens and auth secrets in files', | |
| icon: 'lock' | |
| }, | |
| { | |
| id: 31, | |
| category: 'exploits', | |
| title: 'Debug/Actuator Endpoints', | |
| query: 'site:{target} inurl:"/debug" | inurl:"/trace" | inurl:"/env" | inurl:"/actuator" | inurl:"/metrics" | inurl:"/info"', | |
| description: 'Spring Boot Actuator and debug endpoints', | |
| icon: 'bug' | |
| }, | |
| { | |
| id: 32, | |
| category: 'exploits', | |
| title: 'GraphQL Interfaces', | |
| query: 'site:{target} inurl:"/graphql" | inurl:"/graphiql" | inurl:"/playground" | intitle:"GraphiQL"', | |
| description: 'Exposed GraphQL interfaces and playgrounds', | |
| icon: 'git-graph' | |
| }, | |
| { | |
| id: 33, | |
| category: 'exploits', | |
| title: 'Firebase Config', | |
| query: 'site:{target} "firebase" "apiKey" | "projectId" | "messagingSenderId" | "appId"', | |
| description: 'Exposed Firebase configuration with credentials', | |
| icon: 'flame' | |
| }, | |
| { | |
| id: 34, | |
| category: 'exploits', | |
| title: 'OAuth Redirect Abuse', | |
| query: 'site:{target} inurl:"/oauth/authorize" | inurl:"/oauth/callback" | inurl:"redirect_uri=" | inurl:"response_type="', | |
| description: 'OAuth endpoints vulnerable to redirect abuse', | |
| icon: 'arrow-right-left' | |
| }, | |
| { | |
| id: 35, | |
| category: 'exploits', | |
| title: 'Webhook URLs', | |
| query: 'site:{target} "https://hooks.slack.com" | "https://discord.com/api/webhooks" | "https://hooks.zapier.com" | "webhook_url"', | |
| description: 'Exposed webhook URLs for Slack, Discord, Zapier', | |
| icon: 'link-2' | |
| }, | |
| { | |
| id: 36, | |
| category: 'exploits', | |
| title: 'Environment Files', | |
| query: 'site:{target} ext:env | ext:ini | ext:yml | ext:yaml | ext:toml | ext:conf "DB_PASSWORD" | "SECRET" | "PRIVATE_KEY"', | |
| description: 'Environment and config files with secrets', | |
| icon: 'file-warning' | |
| } | |
| ]; | |
| let currentCategory = 'all'; | |
| let searchTerm = ''; | |
| // Initialize | |
| document.addEventListener('DOMContentLoaded', () => { | |
| lucide.createIcons(); | |
| loadTargetFromStorage(); | |
| renderDorks(); | |
| }); | |
| // Keyboard shortcut: Ctrl+K to focus search | |
| document.addEventListener('keydown', (e) => { | |
| if ((e.ctrlKey || e.metaKey) && e.key === 'k') { | |
| e.preventDefault(); | |
| const searchInput = document.getElementById('searchInput'); | |
| if (searchInput) searchInput.focus(); | |
| } | |
| }); | |
| // LocalStorage for target domain | |
| function loadTargetFromStorage() { | |
| const saved = localStorage.getItem('gdorks_target'); | |
| if (saved) { | |
| const input = document.getElementById('targetInput'); | |
| if (input) input.value = saved; | |
| } | |
| } | |
| function saveTargetToStorage(domain) { | |
| try { | |
| localStorage.setItem('gdorks_target', domain); | |
| } catch (e) { | |
| // localStorage might be unavailable | |
| } | |
| } | |
| function renderDorks() { | |
| const grid = document.getElementById('dorksGrid'); | |
| const emptyState = document.getElementById('emptyState'); | |
| const countNum = document.getElementById('dorkCountNum'); | |
| if (!grid || !emptyState) return; | |
| let filtered = dorks; | |
| if (currentCategory !== 'all') { | |
| filtered = filtered.filter(d => d.category === currentCategory); | |
| } | |
| if (searchTerm) { | |
| const term = searchTerm.toLowerCase(); | |
| filtered = filtered.filter(d => | |
| (d.title && d.title.toLowerCase().includes(term)) || | |
| (d.description && d.description.toLowerCase().includes(term)) || | |
| (d.query && d.query.toLowerCase().includes(term)) | |
| ); | |
| } | |
| // Update counter with bump animation | |
| if (countNum) { | |
| const prev = parseInt(countNum.textContent) || 0; | |
| countNum.textContent = filtered.length; | |
| if (prev !== filtered.length) { | |
| countNum.classList.add('bump'); | |
| setTimeout(() => countNum.classList.remove('bump'), 200); | |
| } | |
| } | |
| if (filtered.length === 0) { | |
| grid.innerHTML = ''; | |
| emptyState.classList.remove('hidden'); | |
| return; | |
| } | |
| emptyState.classList.add('hidden'); | |
| const categoryLabels = { | |
| 'sensitive-files': 'Sensitive Files', | |
| 'vulnerabilities': 'Vulnerabilities', | |
| 'directories': 'Directories', | |
| 'cameras': 'Cameras/IoT', | |
| 'login': 'Login Pages', | |
| 'exploits': 'Exploits & Redirects' | |
| }; | |
| grid.innerHTML = filtered.map(dork => { | |
| const badgeClass = `badge-${dork.category || 'error'}`; | |
| const label = categoryLabels[dork.category] || 'Unknown'; | |
| const icon = dork.icon || 'circle'; | |
| const title = dork.title || 'Untitled'; | |
| const desc = dork.description || ''; | |
| const query = dork.query || ''; | |
| return ` | |
| <div class="dork-card group relative bg-slate-900/50 border border-slate-800/80 rounded-xl p-5 hover:border-slate-700 hover:bg-slate-900/80"> | |
| <div class="flex items-start justify-between mb-3"> | |
| <div class="flex items-center gap-3"> | |
| <div class="w-10 h-10 rounded-lg bg-slate-800/80 flex items-center justify-center group-hover:bg-slate-800 transition-colors"> | |
| <i data-lucide="${icon}" class="w-5 h-5 text-slate-400 group-hover:text-blue-400 transition-colors"></i> | |
| </div> | |
| <div> | |
| <h3 class="font-semibold text-slate-100 text-sm leading-tight">${title}</h3> | |
| <span class="inline-block mt-1 px-2 py-0.5 rounded text-xs font-medium border ${badgeClass}">${label}</span> | |
| </div> | |
| </div> | |
| </div> | |
| <p class="text-slate-500 text-xs mb-3 leading-relaxed">${desc}</p> | |
| <div class="relative"> | |
| <div class="bg-slate-950 rounded-lg border border-slate-800/80 p-3 font-mono text-xs text-slate-400 break-all leading-relaxed group-hover:border-slate-700 transition-colors"> | |
| ${highlightQuery(query)} | |
| </div> | |
| </div> | |
| <div class="flex gap-2 mt-3"> | |
| <button onclick="copyDork('${dork.id}')" class="flex-1 flex items-center justify-center gap-2 bg-slate-800/50 hover:bg-slate-800 border border-slate-700/50 hover:border-slate-600 rounded-lg py-2 text-xs font-medium text-slate-300 hover:text-white transition-all"> | |
| <i data-lucide="copy" class="w-3.5 h-3.5"></i> | |
| Copy | |
| </button> | |
| <button onclick="searchDork('${dork.id}')" class="flex-1 flex items-center justify-center gap-2 bg-blue-600/10 hover:bg-blue-600/20 border border-blue-500/20 hover:border-blue-500/30 rounded-lg py-2 text-xs font-medium text-blue-400 hover:text-blue-300 transition-all"> | |
| <i data-lucide="external-link" class="w-3.5 h-3.5"></i> | |
| Search | |
| </button> | |
| </div> | |
| </div> | |
| `; | |
| }).join(''); | |
| lucide.createIcons(); | |
| } | |
| function highlightQuery(query) { | |
| if (!query) return ''; | |
| return query.replace(/\{target\}/g, '<span class="text-blue-400 font-semibold">{target}</span>'); | |
| } | |
| function getQueryById(id) { | |
| if (id == null) return ''; | |
| const dork = dorks.find(d => d.id == id); | |
| return dork && dork.query ? dork.query : ''; | |
| } | |
| function getDorkById(id) { | |
| if (id == null) return null; | |
| return dorks.find(d => d.id == id) || null; | |
| } | |
| function getTargetDomain() { | |
| const input = document.getElementById('targetInput'); | |
| const value = (input && input.value && input.value.trim()) ? input.value.trim() : 'example.com'; | |
| saveTargetToStorage(value); | |
| return value; | |
| } | |
| function copyToClipboard(text) { | |
| if (!text) return Promise.reject('Empty text'); | |
| if (navigator.clipboard && navigator.clipboard.writeText) { | |
| return navigator.clipboard.writeText(text); | |
| } | |
| // Fallback for non-HTTPS or older browsers | |
| return new Promise((resolve, reject) => { | |
| const textarea = document.createElement('textarea'); | |
| textarea.value = text; | |
| textarea.style.position = 'fixed'; | |
| textarea.style.opacity = '0'; | |
| document.body.appendChild(textarea); | |
| textarea.select(); | |
| try { | |
| document.execCommand('copy'); | |
| resolve(); | |
| } catch (err) { | |
| reject(err); | |
| } finally { | |
| document.body.removeChild(textarea); | |
| } | |
| }); | |
| } | |
| function copyDork(id) { | |
| const dork = getDorkById(id); | |
| if (!dork || !dork.query) return; | |
| const target = getTargetDomain(); | |
| const query = dork.query.replace(/\{target\}/g, target); | |
| copyToClipboard(query) | |
| .then(() => showToast()) | |
| .catch(() => showToast('Failed to copy', true)); | |
| } | |
| function searchDork(id) { | |
| const dork = getDorkById(id); | |
| if (!dork || !dork.query) return; | |
| const target = getTargetDomain(); | |
| const query = dork.query.replace(/\{target\}/g, target); | |
| const url = `https://www.google.com/search?q=${encodeURIComponent(query)}`; | |
| window.open(url, '_blank'); | |
| } | |
| function filterByCategory(category, btn) { | |
| if (!category) return; | |
| currentCategory = category; | |
| // Update buttons — use btn parameter instead of event.target | |
| document.querySelectorAll('.category-btn').forEach(b => { | |
| b.classList.remove('active'); | |
| }); | |
| if (btn) { | |
| btn.classList.add('active'); | |
| } | |
| renderDorks(); | |
| } | |
| function filterDorks() { | |
| const input = document.getElementById('searchInput'); | |
| searchTerm = input ? input.value : ''; | |
| renderDorks(); | |
| } | |
| function buildCustomDork() { | |
| const target = document.getElementById('targetInput'); | |
| const keywords = document.getElementById('keywordInput'); | |
| if (!target || !target.value || !target.value.trim()) { | |
| showToast('Enter a target domain first', true); | |
| return; | |
| } | |
| let query = `site:${target.value.trim()}`; | |
| if (keywords && keywords.value && keywords.value.trim()) { | |
| query += ` ${keywords.value.trim()}`; | |
| } | |
| const resultDiv = document.getElementById('customResult'); | |
| const queryText = document.getElementById('customQueryText'); | |
| if (queryText) queryText.textContent = query; | |
| if (resultDiv) resultDiv.classList.remove('hidden'); | |
| } | |
| function copyCustomDork() { | |
| const queryEl = document.getElementById('customQueryText'); | |
| if (!queryEl) return; | |
| const query = queryEl.textContent; | |
| copyToClipboard(query) | |
| .then(() => showToast()) | |
| .catch(() => showToast('Failed to copy', true)); | |
| } | |
| function searchCustomDork() { | |
| const queryEl = document.getElementById('customQueryText'); | |
| if (!queryEl) return; | |
| const query = queryEl.textContent; | |
| const url = `https://www.google.com/search?q=${encodeURIComponent(query)}`; | |
| window.open(url, '_blank'); | |
| } | |
| function showToast(message, isError) { | |
| const toast = document.getElementById('toast'); | |
| if (!toast) return; | |
| const textEl = toast.querySelector('span'); | |
| const iconContainer = toast.querySelector('.rounded-lg'); | |
| const iconEl = iconContainer ? iconContainer.querySelector('i') : null; | |
| if (textEl) { | |
| textEl.textContent = message || 'Copied to clipboard!'; | |
| } | |
| // Update icon style for error vs success | |
| if (iconContainer) { | |
| if (isError) { | |
| iconContainer.className = 'w-8 h-8 bg-red-500/20 rounded-lg flex items-center justify-center'; | |
| } else { | |
| iconContainer.className = 'w-8 h-8 bg-green-500/20 rounded-lg flex items-center justify-center'; | |
| } | |
| } | |
| if (iconEl) { | |
| iconEl.setAttribute('data-lucide', isError ? 'x' : 'check'); | |
| iconEl.className = isError ? 'w-4 h-4 text-red-400' : 'w-4 h-4 text-green-400'; | |
| } | |
| lucide.createIcons(); | |
| toast.classList.add('show'); | |
| setTimeout(() => { | |
| toast.classList.remove('show'); | |
| }, 2000); | |
| } | |
| // Copy all visible dorks to clipboard | |
| function copyAllVisible() { | |
| const grid = document.getElementById('dorksGrid'); | |
| if (!grid) return; | |
| const target = getTargetDomain(); | |
| let filtered = dorks; | |
| if (currentCategory !== 'all') { | |
| filtered = filtered.filter(d => d.category === currentCategory); | |
| } | |
| if (searchTerm) { | |
| const term = searchTerm.toLowerCase(); | |
| filtered = filtered.filter(d => | |
| (d.title && d.title.toLowerCase().includes(term)) || | |
| (d.description && d.description.toLowerCase().includes(term)) || | |
| (d.query && d.query.toLowerCase().includes(term)) | |
| ); | |
| } | |
| if (filtered.length === 0) { | |
| showToast('No dorks to copy', true); | |
| return; | |
| } | |
| const text = filtered.map(d => { | |
| const query = (d.query || '').replace(/\{target\}/g, target); | |
| return `# ${d.title || 'Untitled'}\n${query}`; | |
| }).join('\n\n'); | |
| copyToClipboard(text) | |
| .then(() => showToast(`${filtered.length} dorks copied!`)) | |
| .catch(() => showToast('Failed to copy', true)); | |
| } | |
| // Export all visible dorks as text file | |
| function exportDorks() { | |
| const target = getTargetDomain(); | |
| let filtered = dorks; | |
| if (currentCategory !== 'all') { | |
| filtered = filtered.filter(d => d.category === currentCategory); | |
| } | |
| if (searchTerm) { | |
| const term = searchTerm.toLowerCase(); | |
| filtered = filtered.filter(d => | |
| (d.title && d.title.toLowerCase().includes(term)) || | |
| (d.description && d.description.toLowerCase().includes(term)) || | |
| (d.query && d.query.toLowerCase().includes(term)) | |
| ); | |
| } | |
| if (filtered.length === 0) { | |
| showToast('No dorks to export', true); | |
| return; | |
| } | |
| const categoryLabels = { | |
| 'sensitive-files': 'Sensitive Files', | |
| 'vulnerabilities': 'Vulnerabilities', | |
| 'directories': 'Directories', | |
| 'cameras': 'Cameras/IoT', | |
| 'login': 'Login Pages', | |
| 'exploits': 'Exploits & Redirects' | |
| }; | |
| let content = `GDorks Export\n`; | |
| content += `Target: ${target}\n`; | |
| content += `Category: ${currentCategory === 'all' ? 'All' : (categoryLabels[currentCategory] || currentCategory)}\n`; | |
| content += `Total: ${filtered.length} dorks\n`; | |
| content += `${'='.repeat(60)}\n\n`; | |
| filtered.forEach((d, i) => { | |
| const query = (d.query || '').replace(/\{target\}/g, target); | |
| content += `[${i + 1}] ${d.title || 'Untitled'}\n`; | |
| content += ` Category: ${categoryLabels[d.category] || 'Unknown'}\n`; | |
| content += ` Description: ${d.description || 'N/A'}\n`; | |
| content += ` Query: ${query}\n\n`; | |
| }); | |
| content += `${'='.repeat(60)}\n`; | |
| content += `Generated by GDorks - https://github.com/Ishanoshada/GDorks\n`; | |
| const blob = new Blob([content], { type: 'text/plain' }); | |
| const url = URL.createObjectURL(blob); | |
| const a = document.createElement('a'); | |
| a.href = url; | |
| a.download = `gdorks-${target.replace(/[^a-zA-Z0-9]/g, '_')}-${currentCategory}.txt`; | |
| document.body.appendChild(a); | |
| a.click(); | |
| document.body.removeChild(a); | |
| URL.revokeObjectURL(url); | |
| showToast(`Exported ${filtered.length} dorks!`); | |
| } | |
| // Initialize Lucide icons on load | |
| lucide.createIcons(); |