This repository was archived by the owner on Mar 6, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgrim.php
More file actions
59 lines (47 loc) · 1.41 KB
/
grim.php
File metadata and controls
59 lines (47 loc) · 1.41 KB
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
#!/usr/bin/env php
<?php
/**
* GRIM Security Scanner v4.0.0
* Advanced Information Gathering and Vulnerability Scanning Tool
*
* @author Swanit Anuran [MaskedVirus]
* @license GPL-3.0
*/
// Check if running from CLI
if (php_sapi_name() !== 'cli') {
die('This tool is designed to run from the command line only.');
}
// Autoloader
require_once __DIR__ . '/vendor/autoload.php';
// Error handling
error_reporting(E_ALL);
ini_set('display_errors', 1);
// Set timezone
date_default_timezone_set('UTC');
// Set unlimited execution time for long scans
set_time_limit(0);
// Memory limit for large scans
ini_set('memory_limit', '512M');
try {
// Initialize the application
$app = new \Grim\GrimApplication();
// Run the application
exit($app->run());
} catch (\Throwable $e) {
// Fatal error handling
echo "\n\033[31m[FATAL ERROR] " . $e->getMessage() . "\033[0m\n";
echo "\nStack trace:\n" . $e->getTraceAsString() . "\n";
// Log the error if logger is available
if (class_exists('\Grim\Utils\Logger')) {
try {
$logger = \Grim\Utils\Logger::getInstance();
$logger->critical('Fatal error in GRIM application', [
'error' => $e->getMessage(),
'trace' => $e->getTraceAsString()
]);
} catch (\Throwable $logError) {
// If logging fails, just continue
}
}
exit(1);
}