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>
<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="icon" type="image/svg+xml" href="assets/Logo.svg">
</head>
<body>
<div class="container">
<!-- 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>
<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>

View File

@@ -26,9 +26,11 @@ $report = [
// Helper function to read file safely
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);
if ($content === false) return null;
if ($content === false)
return null;
// Limit very long files
$lines = explode("\n", $content);
if (count($lines) > $maxLines) {
@@ -42,17 +44,28 @@ function readFileContent($path, $maxLines = 500)
function categorizeFile($filename)
{
$lower = strtolower($filename);
if (strpos($lower, 'nmap') !== false) return 'Port Scans';
if (strpos($lower, 'nuclei') !== false) return 'Vulnerability Findings';
if (strpos($lower, 'nikto') !== false) return 'Web Server Analysis';
if (strpos($lower, 'whatweb') !== false) return 'Technology Detection';
if (strpos($lower, 'dns') !== false || strpos($lower, 'subdomain') !== false) return 'DNS & Subdomains';
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';
if (strpos($lower, 'nmap') !== false)
return 'Port Scans';
if (strpos($lower, 'nuclei') !== false)
return 'Vulnerability Findings';
if (strpos($lower, 'nikto') !== false)
return 'Web Server Analysis';
if (strpos($lower, 'whatweb') !== false)
return 'Technology Detection';
if (strpos($lower, 'dns') !== false || strpos($lower, 'subdomain') !== false)
return 'DNS & Subdomains';
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';
}
@@ -60,11 +73,13 @@ function categorizeFile($filename)
function scanWorkspaceFiles($dir, $prefix = '')
{
$files = [];
if (!is_dir($dir)) return $files;
if (!is_dir($dir))
return $files;
$items = scandir($dir);
foreach ($items as $item) {
if ($item === '.' || $item === '..') continue;
if ($item === '.' || $item === '..')
continue;
$path = $dir . '/' . $item;
$relativePath = $prefix . $item;
@@ -128,7 +143,10 @@ $sectionId = 0;
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<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>
:root {
--bg-primary: #0f1419;
@@ -521,7 +539,10 @@ $sectionId = 0;
<!-- Sidebar / Table of Contents -->
<aside class="sidebar">
<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 $report['modified']; ?></div>
</div>
@@ -562,10 +583,11 @@ $sectionId = 0;
</div>
<div class="stat-card">
<div class="number"><?php
$total = 0;
foreach ($allFiles as $f) $total += $f['size'];
echo number_format($total / 1024, 1);
?> KB</div>
$total = 0;
foreach ($allFiles as $f)
$total += $f['size'];
echo number_format($total / 1024, 1);
?> KB</div>
<div class="label">Total Size</div>
</div>
</div>
@@ -579,15 +601,21 @@ $sectionId = 0;
<?php
$sectionId = 0;
foreach ($sectionOrder as $section):
if (!isset($categorized[$section])) continue;
if (!isset($categorized[$section]))
continue;
$files = $categorized[$section];
$iconClass = 'other';
if (strpos($section, 'Port') !== false) $iconClass = 'port';
elseif (strpos($section, 'Vuln') !== false) $iconClass = 'vuln';
elseif (strpos($section, 'Web') !== false) $iconClass = 'web';
elseif (strpos($section, 'DNS') !== false) $iconClass = 'dns';
elseif (strpos($section, 'SSL') !== false) $iconClass = 'ssl';
?>
if (strpos($section, 'Port') !== false)
$iconClass = 'port';
elseif (strpos($section, 'Vuln') !== false)
$iconClass = 'vuln';
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++; ?>">
<div class="section-header">
<span class="section-icon <?php echo $iconClass; ?>">
@@ -620,10 +648,12 @@ $sectionId = 0;
</div>
<?php else: ?>
<?php foreach ($files as $file): ?>
<?php if ($file['isBinary']): continue;
<?php if ($file['isBinary']):
continue;
endif; ?>
<?php $content = readFileContent($file['fullPath']); ?>
<?php if ($content === null || trim($content) === ''): continue;
<?php if ($content === null || trim($content) === ''):
continue;
endif; ?>
<div class="file-card">