Implement Logo.svg in webui index and reports

This commit is contained in:
2026-01-03 10:25:38 +11:00
parent 559a0862cd
commit 3bad151b60
3 changed files with 670 additions and 31 deletions

605
webui/assets/Logo.svg Normal file

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 232 KiB

View File

@@ -7,13 +7,17 @@
<title>UltyScan - Web Interface</title> <title>UltyScan - Web Interface</title>
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap" rel="stylesheet"> <link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap" rel="stylesheet">
<link rel="stylesheet" href="assets/style.css"> <link rel="stylesheet" href="assets/style.css">
<link rel="icon" type="image/svg+xml" href="assets/Logo.svg">
</head> </head>
<body> <body>
<div class="container"> <div class="container">
<!-- Header --> <!-- Header -->
<header class="header"> <header class="header">
<h1>🔍 UltyScan</h1> <h1 style="display: flex; align-items: center; justify-content: center; gap: 0.5rem;">
<img src="assets/Logo.svg" alt="UltyScan Logo" style="height: 1.5em;">
UltyScan
</h1>
<p class="subtitle">Attack Surface Management Platform</p> <p class="subtitle">Attack Surface Management Platform</p>
<div style="margin-top: 1rem; display: flex; align-items: center; justify-content: center; gap: 1rem;"> <div style="margin-top: 1rem; display: flex; align-items: center; justify-content: center; gap: 1rem;">
<span id="scan-status" class="status-badge status-idle">Idle</span> <span id="scan-status" class="status-badge status-idle">Idle</span>

View File

@@ -26,9 +26,11 @@ $report = [
// Helper function to read file safely // Helper function to read file safely
function readFileContent($path, $maxLines = 500) function readFileContent($path, $maxLines = 500)
{ {
if (!file_exists($path) || !is_readable($path)) return null; if (!file_exists($path) || !is_readable($path))
return null;
$content = file_get_contents($path); $content = file_get_contents($path);
if ($content === false) return null; if ($content === false)
return null;
// Limit very long files // Limit very long files
$lines = explode("\n", $content); $lines = explode("\n", $content);
if (count($lines) > $maxLines) { if (count($lines) > $maxLines) {
@@ -42,17 +44,28 @@ function readFileContent($path, $maxLines = 500)
function categorizeFile($filename) function categorizeFile($filename)
{ {
$lower = strtolower($filename); $lower = strtolower($filename);
if (strpos($lower, 'nmap') !== false) return 'Port Scans'; if (strpos($lower, 'nmap') !== false)
if (strpos($lower, 'nuclei') !== false) return 'Vulnerability Findings'; return 'Port Scans';
if (strpos($lower, 'nikto') !== false) return 'Web Server Analysis'; if (strpos($lower, 'nuclei') !== false)
if (strpos($lower, 'whatweb') !== false) return 'Technology Detection'; return 'Vulnerability Findings';
if (strpos($lower, 'dns') !== false || strpos($lower, 'subdomain') !== false) return 'DNS & Subdomains'; if (strpos($lower, 'nikto') !== false)
if (strpos($lower, 'whois') !== false) return 'WHOIS Information'; return 'Web Server Analysis';
if (strpos($lower, 'ssl') !== false || strpos($lower, 'cert') !== false) return 'SSL/TLS Analysis'; if (strpos($lower, 'whatweb') !== false)
if (strpos($lower, 'dir') !== false || strpos($lower, 'brute') !== false) return 'Directory Discovery'; return 'Technology Detection';
if (strpos($lower, 'host') !== false) return 'Host Information'; if (strpos($lower, 'dns') !== false || strpos($lower, 'subdomain') !== false)
if (strpos($lower, 'osint') !== false) return 'OSINT Data'; return 'DNS & Subdomains';
if (strpos($lower, 'screenshot') !== false) return 'Screenshots'; if (strpos($lower, 'whois') !== false)
return 'WHOIS Information';
if (strpos($lower, 'ssl') !== false || strpos($lower, 'cert') !== false)
return 'SSL/TLS Analysis';
if (strpos($lower, 'dir') !== false || strpos($lower, 'brute') !== false)
return 'Directory Discovery';
if (strpos($lower, 'host') !== false)
return 'Host Information';
if (strpos($lower, 'osint') !== false)
return 'OSINT Data';
if (strpos($lower, 'screenshot') !== false)
return 'Screenshots';
return 'Other Findings'; return 'Other Findings';
} }
@@ -60,11 +73,13 @@ function categorizeFile($filename)
function scanWorkspaceFiles($dir, $prefix = '') function scanWorkspaceFiles($dir, $prefix = '')
{ {
$files = []; $files = [];
if (!is_dir($dir)) return $files; if (!is_dir($dir))
return $files;
$items = scandir($dir); $items = scandir($dir);
foreach ($items as $item) { foreach ($items as $item) {
if ($item === '.' || $item === '..') continue; if ($item === '.' || $item === '..')
continue;
$path = $dir . '/' . $item; $path = $dir . '/' . $item;
$relativePath = $prefix . $item; $relativePath = $prefix . $item;
@@ -128,7 +143,10 @@ $sectionId = 0;
<meta charset="UTF-8"> <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>UltyScan Report - <?php echo htmlspecialchars($name); ?></title> <title>UltyScan Report - <?php echo htmlspecialchars($name); ?></title>
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap" rel="stylesheet"> <link
href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap"
rel="stylesheet">
<link rel="icon" type="image/svg+xml" href="assets/Logo.svg">
<style> <style>
:root { :root {
--bg-primary: #0f1419; --bg-primary: #0f1419;
@@ -521,7 +539,10 @@ $sectionId = 0;
<!-- Sidebar / Table of Contents --> <!-- Sidebar / Table of Contents -->
<aside class="sidebar"> <aside class="sidebar">
<div class="sidebar-header"> <div class="sidebar-header">
<h1>🔍 UltyScan Report</h1> <h1 style="display: flex; align-items: center; gap: 0.5rem;">
<img src="assets/Logo.svg" alt="UltyScan Logo" style="height: 1.25em;">
UltyScan Report
</h1>
<div class="meta"><?php echo htmlspecialchars($name); ?></div> <div class="meta"><?php echo htmlspecialchars($name); ?></div>
<div class="meta"><?php echo $report['modified']; ?></div> <div class="meta"><?php echo $report['modified']; ?></div>
</div> </div>
@@ -562,10 +583,11 @@ $sectionId = 0;
</div> </div>
<div class="stat-card"> <div class="stat-card">
<div class="number"><?php <div class="number"><?php
$total = 0; $total = 0;
foreach ($allFiles as $f) $total += $f['size']; foreach ($allFiles as $f)
echo number_format($total / 1024, 1); $total += $f['size'];
?> KB</div> echo number_format($total / 1024, 1);
?> KB</div>
<div class="label">Total Size</div> <div class="label">Total Size</div>
</div> </div>
</div> </div>
@@ -579,15 +601,21 @@ $sectionId = 0;
<?php <?php
$sectionId = 0; $sectionId = 0;
foreach ($sectionOrder as $section): foreach ($sectionOrder as $section):
if (!isset($categorized[$section])) continue; if (!isset($categorized[$section]))
continue;
$files = $categorized[$section]; $files = $categorized[$section];
$iconClass = 'other'; $iconClass = 'other';
if (strpos($section, 'Port') !== false) $iconClass = 'port'; if (strpos($section, 'Port') !== false)
elseif (strpos($section, 'Vuln') !== false) $iconClass = 'vuln'; $iconClass = 'port';
elseif (strpos($section, 'Web') !== false) $iconClass = 'web'; elseif (strpos($section, 'Vuln') !== false)
elseif (strpos($section, 'DNS') !== false) $iconClass = 'dns'; $iconClass = 'vuln';
elseif (strpos($section, 'SSL') !== false) $iconClass = 'ssl'; elseif (strpos($section, 'Web') !== false)
?> $iconClass = 'web';
elseif (strpos($section, 'DNS') !== false)
$iconClass = 'dns';
elseif (strpos($section, 'SSL') !== false)
$iconClass = 'ssl';
?>
<section class="section" id="section-<?php echo $sectionId++; ?>"> <section class="section" id="section-<?php echo $sectionId++; ?>">
<div class="section-header"> <div class="section-header">
<span class="section-icon <?php echo $iconClass; ?>"> <span class="section-icon <?php echo $iconClass; ?>">
@@ -620,10 +648,12 @@ $sectionId = 0;
</div> </div>
<?php else: ?> <?php else: ?>
<?php foreach ($files as $file): ?> <?php foreach ($files as $file): ?>
<?php if ($file['isBinary']): continue; <?php if ($file['isBinary']):
continue;
endif; ?> endif; ?>
<?php $content = readFileContent($file['fullPath']); ?> <?php $content = readFileContent($file['fullPath']); ?>
<?php if ($content === null || trim($content) === ''): continue; <?php if ($content === null || trim($content) === ''):
continue;
endif; ?> endif; ?>
<div class="file-card"> <div class="file-card">