// 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 = `
${toolName}
${description}
`;
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 = `
${timeString} |
${action} |
target-${Math.floor(Math.random() * 100)}.com |
${statuses[randomStatus]}
|
`;
// 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 = `
`;
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...');
}
});