Created on
‎12-09-2024
02:54 AM
Edited on
‎03-17-2025
08:05 AM
By
Jean-Philippe_P
Description | This article describes how to collect indicators of compromise (IoC) debugs on a FortiGate (VDOM and non-VDOM) using automatic scripts. The script aggregates a list of debugs, file trees, and hashes to identify the presence of unknown artifacts in the filesystem. |
Scope | FortiGate (VM/physical) v7.0.x v7.2.x v7.4.x v7.6.x. |
Solution |
If there is a suspicion that FortiGate may be compromised, use the following steps to collect information and open a new ticket with the technical support team. Once the output is attached to the ticket, an engineer will confirm if any indication of compromise is found or not.
The following information is expected for a complete evaluation.
Before collecting the automated debugs, Methods A and B :
C:\Windows\system32> Get-ExecutionPolicy
Set the execution level to 'Unrestricted' by running PS C:\Windows\system32> Set-ExecutionPolicy Unrestricted then type Y to confirm.
Note: To install the module, an internet connection is required. To install the module and change the execution level in PowerShell must be running as an Administrator to make the above changes.
Method A: interactive prompt.
PS C:\Users\user\Desktop\FGT IoC Scripts> .\FGT-SysIntegrity_Debug.ps1
PS C:\Users\user\Desktop\FGT IoC Scripts> .\FGT-Hash_Debug.ps1
Method B: Predefined parameters.
Before executing, the script is designed to run from Windows PowerShell with predefined parameters (-ha using HA yes 1 or no 0; -from using HA yes 1 or no 0). Collect primary unit (no VDOM, no HA) executed from primary: PS C:\Users\rcaushi\Desktop\FGT IoC Scripts> .\FGT-SysIntegrity_Debugv2.0.ps1 -ip "10.191.19.172" -port 22 -username "admin" -password "fortinet" -vdom "0" -ha "0"
Collect secondary unit (no VDOM with HA) executed from primary:
PS C:\Users\rcaushi\Desktop\FGT IoC Scripts> .\FGT-SysIntegrity_Debugv2.0.ps1 -ip "10.191.19.172" -port 22 -username "admin" -password "fortinet" -vdom "0" -ha "1"
Collect primary unit (VDOM no HA) executed from primary:
PS C:\Users\rcaushi\Desktop\FGT IoC Scripts> .\FGT-SysIntegrity_Debugv2.0.ps1 -ip "10.191.19.172" -port 22 -username "admin" -password "fortinet" -vdom "1" -ha "0"
Collect secondary unit (VDOM with HA) executed from primary:
PS C:\Users\rcaushi\Desktop\FGT IoC Scripts> .\FGT-SysIntegrity_Debugv2.0.ps1 -ip "10.191.19.172" -port 22 -username "admin" -password "fortinet" -vdom "1" -ha "1"
2. Collecting: FortiGate SHA1 HASH Integrity debug output. Collect primary unit (no VDOM, no HA) executed from primary:
PS C:\Users\rcaushi\Desktop\FGT IoC Scripts> .\FGT-SHA1-HASH_Debugv2.0.ps1 -ip "10.191.19.172" -port 22 -username "admin" -password "fortinet" -vdom "0" -ha "0"
Collect secondary unit (no VDOM with HA) executed from the primary:
PS C:\Users\rcaushi\Desktop\FGT IoC Scripts> .\FGT-SHA1-HASH_Debugv2.0.ps1 -ip "10.191.19.172" -port 22 -username "admin" -password "fortinet" -vdom "0" -ha "1"
Collect primary unit (VDOM, no HA) executed from the primary:
PS C:\Users\rcaushi\Desktop\FGT IoC Scripts> .\FGT-SHA1-HASH_Debugv2.0.ps1 -ip "10.191.19.172" -port 22 -username "admin" -password "fortinet" -vdom "1" -ha "0"
Collect secondary unit (VDOM, with HA) executed from the primary:
PS C:\Users\rcaushi\Desktop\FGT IoC Scripts> .\FGT-SHA1-HASH_Debugv2.0.ps1 -ip "10.191.19.172" -port 22 -username "admin" -password "fortinet" -vdom "1" -ha "1"
Additional Notes:
Disclaimer:
|