-
Notifications
You must be signed in to change notification settings - Fork 15
Details ‐ Analysis
Michael Haag edited this page Jul 23, 2024
·
1 revision
The Analysis page is a crucial component of ShellSweepX, providing users with the ability to upload files for analysis, search through previously analyzed files, and view detailed results. This page combines file upload functionality with a comprehensive search and display system for analyzed files.
The analysis.html
template is structured as follows:
- Header: Contains the ShellSweepX logo and navigation menu.
-
Main Content:
- File Upload Section
- Upload Results Display
- File Search Section
- Search Results Display
- Pagination Controls
- Footer: Displays copyright information and a link to Terms of Service.
- Users can select multiple files for analysis.
- The
uploadFiles()
function handles the file upload process:- Sends files to the server via a POST request to
/upload
. - Displays upload results in the
upload-results
div.
- Sends files to the server via a POST request to
- Users can search for analyzed files using a text input.
- The
searchFiles()
function triggers the search:- Calls
loadFiles()
with the search query. - Results are fetched from the
/search
endpoint.
- Calls
- The
displayResults()
function renders search results:- Each result shows file details including name, SHA256, analysis result, file size, entropy, etc.
- Includes a link to VirusTotal for each file's SHA256.
- Provides a button to trigger AI triage for each file.
- Displays YARA matches if available.
- Shows AI analysis in an expandable details section.
- Includes an expandable section to view the file's content.
- The
updatePagination()
function handles pagination controls:- Displays current page and total pages.
- Provides "Previous" and "Next" buttons when applicable.
- The
triageWithAI()
function allows on-demand AI analysis of a file:- Sends a POST request to
/triage_with_ai
with the file's SHA256. - Updates the AI analysis section of the corresponding result item.
- Sends a POST request to
-
loadFiles(page, query)
: Fetches and displays search results. -
searchFiles()
: Triggers a new search based on user input. -
displayResults(results)
: Renders search results in the UI. -
updatePagination(page, totalPages)
: Updates pagination controls. -
escapeHtml(unsafe)
: Sanitizes HTML content for safe display. -
uploadFiles()
: Handles file upload process. -
displayUploadResults(result)
: Shows results of file uploads. -
triageWithAI(sha256)
: Requests and displays AI analysis for a specific file.
The page uses CSS styles defined in /static/css/styles.css
for consistent styling across the application.
- File content is escaped using
escapeHtml()
to prevent XSS attacks. - File uploads are handled server-side, with results displayed after processing.
- The page loads all files on initial load, providing immediate access to recent analyses.
- Search functionality allows quick filtering of results.
- Pagination ensures manageable loading of large result sets.
- Expandable sections (AI analysis and file content) keep the interface clean while allowing access to detailed information.
This Analysis page serves as a central hub for file analysis in ShellSweepX, combining upload capabilities with comprehensive result viewing and AI-powered triage.