File size: 12,989 Bytes
0adca4b a0c2820 0adca4b a0c2820 0adca4b a0c2820 0adca4b a0c2820 0adca4b a0c2820 0adca4b a0c2820 0adca4b | 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 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 | // Zero-Day Hunter Dashboard - Main JavaScript
document.addEventListener('DOMContentLoaded', function() {
console.log('%cπ Zero-Day Hunter Dashboard Initialized', 'color: #00ff00; font-size: 16px; font-weight: bold;');
console.log('%cStrictly Pentesting | Bug Bounties Only | Zero-Days Are The Way', 'color: #cccccc;');
console.log('%cPages: Dashboard | Zero-Day Lab | Report Manager | Tool Suite', 'color: #666666;');
// Initialize animations and interactions
initDashboard();
initHuntingTools();
initActivitySimulator();
initManifesto();
initPageSpecificFeatures();
});
function initPageSpecificFeatures() {
// Page-specific initializations
const currentPage = window.location.pathname.split('/').pop();
switch(currentPage) {
case 'index.html':
case '':
// Dashboard specific features
break;
case 'zerodays.html':
// Zero-day lab features
break;
case 'reports.html':
// Report manager features
break;
case 'tools.html':
// Tool suite features
break;
}
}
function initDashboard() {
// Update real-time stats
updateStats();
// Add click effects to targets
const targets = document.querySelectorAll('.border-gray-800');
targets.forEach(target => {
target.addEventListener('click', function() {
this.classList.add('border-hacker-green');
setTimeout(() => {
this.classList.remove('border-hacker-green');
}, 500);
});
});
// Add tooltip functionality
const toolIcons = document.querySelectorAll('.bg-gray-900\\/50');
toolIcons.forEach(tool => {
tool.addEventListener('mouseenter', function() {
const toolName = this.querySelector('h3').textContent;
showTooltip(toolName);
});
tool.addEventListener('mouseleave', function() {
hideTooltip();
});
});
}
function updateStats() {
// Simulate real-time stat updates
setInterval(() => {
const stats = document.querySelectorAll('.text-3xl');
stats.forEach(stat => {
const current = parseInt(stat.textContent);
if (current < 100) { // Only animate smaller numbers
const change = Math.random() > 0.7 ? 1 : 0;
if (change && Math.random() > 0.5) {
stat.textContent = current + change;
stat.classList.add('animate-pulse');
setTimeout(() => {
stat.classList.remove('animate-pulse');
}, 1000);
}
}
});
}, 5000);
}
function initHuntingTools() {
// Tool buttons functionality
const toolButtons = document.querySelectorAll('.hover\\:border-hacker-green, .hover\\:border-bug-red, .hover\\:border-zero-day-blue');
toolButtons.forEach(button => {
button.addEventListener('click', function(e) {
e.stopPropagation();
const toolName = this.querySelector('h3')?.textContent || 'Tool';
const toolDesc = this.querySelector('.text-xs')?.textContent || '';
showToolModal(toolName, toolDesc);
});
});
// Quick action buttons
const actionButtons = document.querySelectorAll('.group');
actionButtons.forEach(button => {
button.addEventListener('click', function() {
const action = this.querySelector('.font-medium').textContent;
simulateAction(action);
});
});
}
function simulateAction(action) {
const messages = {
'Submit Report': 'π€ Preparing report for submission to HackerOne...',
'Analyze PoC': 'π Analyzing proof-of-concept code...',
'Check Bounties': 'π° Fetching latest bounty opportunities...'
};
const message = messages[action] || `Executing: ${action}`;
// Create notification
showNotification(message);
// Add to activity log
addActivityLog(action);
}
function showTooltip(text) {
// Remove existing tooltip
const existing = document.querySelector('.custom-tooltip');
if (existing) existing.remove();
// Create new tooltip
const tooltip = document.createElement('div');
tooltip.className = 'custom-tooltip fixed z-50 bg-gray-900 text-white px-3 py-2 rounded-lg text-sm border border-gray-700 shadow-lg';
tooltip.textContent = `Tool: ${text}`;
tooltip.style.top = `${event.clientY + 10}px`;
tooltip.style.left = `${event.clientX + 10}px`;
document.body.appendChild(tooltip);
// Update position on mouse move
document.addEventListener('mousemove', function moveTooltip(e) {
tooltip.style.top = `${e.clientY + 10}px`;
tooltip.style.left = `${e.clientX + 10}px`;
});
// Store reference for removal
tooltip._moveHandler = moveTooltip;
}
function hideTooltip() {
const tooltip = document.querySelector('.custom-tooltip');
if (tooltip) {
document.removeEventListener('mousemove', tooltip._moveHandler);
tooltip.remove();
}
}
function showToolModal(toolName, description) {
// Create modal
const modal = document.createElement('div');
modal.className = 'fixed inset-0 z-50 flex items-center justify-center bg-black/50 backdrop-blur-sm';
modal.innerHTML = `
<div class="bg-dark-panel border border-gray-800 rounded-2xl p-6 max-w-md w-full mx-4">
<div class="flex justify-between items-center mb-4">
<h3 class="text-xl font-bold text-white font-mono">${toolName}</h3>
<button class="text-gray-400 hover:text-white text-2xl" onclick="this.closest('.fixed').remove()">×</button>
</div>
<p class="text-gray-300 mb-6">${description}</p>
<div class="space-y-3">
<button class="w-full p-3 bg-hacker-green text-black rounded-lg font-medium hover:bg-hacker-green/90 transition">
Launch Tool
</button>
<button class="w-full p-3 border border-gray-700 rounded-lg hover:border-gray-500 transition" onclick="this.closest('.fixed').remove()">
Cancel
</button>
</div>
</div>
`;
document.body.appendChild(modal);
// Close on escape
modal.addEventListener('keydown', function(e) {
if (e.key === 'Escape') modal.remove();
});
// Launch tool functionality
modal.querySelector('.bg-hacker-green').addEventListener('click', function() {
showNotification(`π Launching ${toolName}...`);
modal.remove();
// Simulate tool loading
setTimeout(() => {
showNotification(`β
${toolName} loaded successfully`);
}, 1500);
});
}
function initActivitySimulator() {
// Simulate live activity updates
setInterval(() => {
const activities = [
'Subdomain scanning in progress',
'Analyzing JavaScript files',
'Testing authentication endpoints',
'Fuzzing API parameters',
'Checking for CORS misconfigurations',
'Testing for SSRF vulnerabilities',
'Analyzing JWT tokens',
'Testing GraphQL introspection'
];
const randomActivity = activities[Math.floor(Math.random() * activities.length)];
// Only update sometimes
if (Math.random() > 0.7) {
addActivityLog(randomActivity);
}
}, 10000);
}
function addActivityLog(action) {
const activityLog = document.querySelector('tbody');
if (!activityLog) return;
const now = new Date();
const timeString = now.toLocaleTimeString([], { hour: '2-digit', minute: '2-digit' });
const statuses = ['VULNERABLE', 'PENDING', 'RESEARCH', 'ANALYZING'];
const statusColors = ['bug-red', 'bounty-gold', 'zero-day-blue', 'gray-500'];
const randomStatus = Math.floor(Math.random() * statuses.length);
const row = document.createElement('tr');
row.className = 'border-b border-gray-800/50';
row.innerHTML = `
<td class="py-3 text-gray-500">${timeString}</td>
<td class="py-3">${action}</td>
<td class="py-3 text-hacker-green">target-${Math.floor(Math.random() * 100)}.com</td>
<td class="py-3">
<span class="px-2 py-1 bg-${statusColors[randomStatus]}/20 text-${statusColors[randomStatus]} rounded text-xs">
${statuses[randomStatus]}
</span>
</td>
`;
// Add at the top
activityLog.insertBefore(row, activityLog.firstChild);
// Limit to 10 entries
if (activityLog.children.length > 10) {
activityLog.removeChild(activityLog.lastChild);
}
// Add animation
row.classList.add('bg-gray-900/30');
setTimeout(() => {
row.classList.remove('bg-gray-900/30');
}, 1000);
}
function showNotification(message) {
// Remove existing notification
const existing = document.querySelector('.custom-notification');
if (existing) existing.remove();
// Create notification
const notification = document.createElement('div');
notification.className = 'custom-notification fixed top-4 right-4 z-50 bg-dark-panel border border-gray-800 rounded-xl p-4 shadow-lg transform translate-x-full animate-slide-in';
notification.innerHTML = `
<div class="flex items-center space-x-3">
<div class="w-8 h-8 rounded-full bg-hacker-green/20 flex items-center justify-center">
<span>β‘</span>
</div>
<div>
<p class="text-white text-sm">${message}</p>
</div>
</div>
`;
document.body.appendChild(notification);
// Animate in
setTimeout(() => {
notification.classList.remove('translate-x-full');
notification.classList.add('translate-x-0');
}, 10);
// Remove after 3 seconds
setTimeout(() => {
notification.classList.remove('translate-x-0');
notification.classList.add('translate-x-full');
setTimeout(() => {
notification.remove();
}, 300);
}, 3000);
}
function initManifesto() {
// Make manifesto interactive
const manifesto = document.querySelector('.bg-gradient-to-br');
if (manifesto) {
manifesto.addEventListener('click', function() {
const lines = this.querySelectorAll('p');
lines.forEach((line, index) => {
setTimeout(() => {
line.classList.add('text-hacker-green');
setTimeout(() => {
line.classList.remove('text-hacker-green');
}, 1000);
}, index * 200);
});
});
}
}
// Add CSS for animations
const style = document.createElement('style');
style.textContent = `
@keyframes slide-in {
from {
transform: translateX(100%);
}
to {
transform: translateX(0);
}
}
.animate-slide-in {
animation: slide-in 0.3s ease-out forwards;
}
.custom-notification {
transition: transform 0.3s ease-out;
}
`;
document.head.appendChild(style);
// Export functions for global access (if needed)
window.ZeroDayHunter = {
showNotification,
addActivityLog,
simulateAction,
navigateToPage
};
// Navigation function
function navigateToPage(page) {
showNotification(`π Navigating to ${page}...`);
setTimeout(() => {
window.location.href = page;
}, 500);
}
// Keyboard shortcuts
document.addEventListener('keydown', function(e) {
// Ctrl+Shift+H for help
if (e.ctrlKey && e.shiftKey && e.key === 'H') {
showNotification('π Keyboard Shortcuts: Ctrl+Shift+1 (Dashboard) | Ctrl+Shift+2 (Zero-Days) | Ctrl+Shift+3 (Reports) | Ctrl+Shift+4 (Tools)');
}
// Ctrl+Shift+1 for Dashboard
if (e.ctrlKey && e.shiftKey && e.key === '1') {
e.preventDefault();
navigateToPage('index.html');
}
// Ctrl+Shift+2 for Zero-Days
if (e.ctrlKey && e.shiftKey && e.key === '2') {
e.preventDefault();
navigateToPage('zerodays.html');
}
// Ctrl+Shift+3 for Reports
if (e.ctrlKey && e.shiftKey && e.key === '3') {
e.preventDefault();
navigateToPage('reports.html');
}
// Ctrl+Shift+4 for Tools
if (e.ctrlKey && e.shiftKey && e.key === '4') {
e.preventDefault();
navigateToPage('tools.html');
}
// Ctrl+Shift+R to refresh stats
if (e.ctrlKey && e.shiftKey && e.key === 'R') {
e.preventDefault();
updateStats();
showNotification('π Refreshing hunting statistics...');
}
}); |