Ajout de la personnalisation X à DeepBlueHash

This commit is contained in:
moxi
2025-07-07 16:02:16 +02:00
parent 2eecc65698
commit 48a8d826e9
4 changed files with 152 additions and 173 deletions

View File

@ -1,76 +1,68 @@
# DeepBlueHash
Detective safelisting using Sysmon event logs.
Mise en liste blanche ("safelisting") de type "détective" en utilisant les journaux d'événements Sysmon.
Parses the Sysmon event logs, grabbing the SHA256 hashes from process creation (event 1), driver load (event 6, sys), and image load (event 7, DLL) events.
Ce script analyse les journaux d'événements Sysmon, récupérant les hachages SHA256 des événements de création de processus (événement 1), de chargement de pilote (événement 6, .sys), et de chargement d'image (événement 7, .dll).
## VirusTotal and Safelisting setup
## Configuration de VirusTotal et de la liste blanche
**Note**: Virustotal has changed their free API for some users. My old account has this limitation:
**Note** : Virustotal a modifié son API gratuite pour certains utilisateurs. Mon ancien compte a cette limitation :
- Daily quota 1 lookups / day
- Monthly quota 31 lookups / month
- Quota journalier : 1 requête / jour
- Quota mensuel : 31 requêtes / mois
New accounts get this:
Les nouveaux comptes obtiennent ceci :
- Request rate 4 lookups / min
- Daily quota 500 lookups / day
- Monthly quota 15.5 K lookups / month
- Taux de requêtes : 4 requêtes / min
- Quota journalier : 500 requêtes / jour
- Quota mensuel : 15 500 requêtes / mois
Not sure why that is, so FYI.
Je ne suis pas sûr de la raison de ce changement, donc c'est pour votre information.
Setting up VirusTotal hash submissions and safelisting:
Mise en place des soumissions de hachages à VirusTotal et de la liste blanche :
The hash checker requires VirusTotalAnalyzer: https://github.com/EvotecIT/VirusTotalAnalyzer
Le vérificateur de hachage nécessite VirusTotalAnalyzer : https://github.com/EvotecIT/VirusTotalAnalyzer
It also requires a VirusTotal API key:
Il nécessite également une clé d'API VirusTotal :
- https://www.virustotal.com/en/documentation/public-api/
- https://www.virustotal.com/en/documentation/public-api/
The script assumes a personal API key, and waits 15 seconds between submissions.
Le script suppose une clé d'API personnelle et attend 15 secondes entre les soumissions.
## Sysmon setup
## Configuration de Sysmon
Sysmon is required: https://docs.microsoft.com/en-us/sysinternals/downloads/sysmon
Sysmon est requis : https://docs.microsoft.com/fr-fr/sysinternals/downloads/sysmon
Must log the SHA256 hash, DeepBlueHash will ignore the others.
Il doit journaliser le hachage SHA256, DeepBlueHash ignorera les autres.
This minimal Sysmon 6.0 config will log the proper events/hashes. Note that image (DLL) logging may create performance issues. This config ignores DLLs signed by Microsoft (which should lighten the load), but please test!
Cette configuration minimale de Sysmon 6.0 journalisera les événements/hachages appropriés. Notez que la journalisation des images (.dll) peut créer des problèmes de performance. Cette configuration ignore les DLL signées par Microsoft (ce qui devrait alléger la charge), mais veuillez tester !
```xml
<Sysmon schemaversion="3.3">
<!-- Capture SHA256 hashes only -->
<HashAlgorithms>SHA256</HashAlgorithms>
<EventFiltering>
<!-- Log all drivers (.sys) except if the signature contains Microsoft or Windows -->
<DriverLoad onmatch="exclude">
<Signature condition="contains">microsoft</Signature>
<Signature condition="contains">windows</Signature>
</DriverLoad>
<!-- Log all images (.dll) except if the signature contains Microsoft or Windows -->
<!-- Note: this may create a performance issue, please test -->
<ImageLoad onmatch="exclude">
<Signature condition="contains">microsoft</Signature>
<Signature condition="contains">windows</Signature>
</ImageLoad>
<!-- Do not log process termination -->
<ProcessTerminate onmatch="include" />
<!-- Log process creation -->
<ProcessCreate onmatch="exclude" />
</EventFiltering>
    <HashAlgorithms>SHA256</HashAlgorithms>
  <EventFiltering>
        <DriverLoad onmatch="exclude">
      <Signature condition="contains">microsoft</Signature>
      <Signature condition="contains">windows</Signature>
    </DriverLoad>
            <ImageLoad onmatch="exclude">
      <Signature condition="contains">microsoft</Signature>
      <Signature condition="contains">windows</Signature>
    </ImageLoad>
        <ProcessTerminate onmatch="include" />
        <ProcessCreate onmatch="exclude" />
  </EventFiltering>
</Sysmon>
```
These are the events used by DeepBlueCLI and DeepBlueHash.
You can go *much* further than this with Sysmon. The Sysinternals Sysmon page has a good basic configuration: https://docs.microsoft.com/en-us/sysinternals/downloads/sysmon
Ce sont les événements utilisés par DeepBlueCLI et DeepBlueHash.
Also see @swiftonsecurity's awesome Sysmon config here: https://github.com/SwiftOnSecurity/sysmon-config
Vous pouvez aller beaucoup plus loin que cela avec Sysmon. La page Sysmon de Sysinternals a une bonne configuration de base : https://docs.microsoft.com/fr-fr/sysinternals/downloads/sysmon
## Generating a Safelist
Consultez également l'excellente configuration Sysmon de @swiftonsecurity ici : https://github.com/SwiftOnSecurity/sysmon-config
Generate a custom safelist on Windows (note: this is optional):
Générer une liste blanche (Safelist)
Générez une liste blanche personnalisée sur Windows (note : c'est optionnel) :
```
PS C:\> Get-ChildItem c:\windows\system32 -Include '*.exe','*.dll','*.sys','*.com' -Recurse | Get-FileHash| Export-Csv -Path safelist.csv
```
Note: this will generate (harmless) 'PermissionDenied' warnings for locked files, etc. They may be ignored.
Note : cela générera des avertissements (inoffensifs) de type 'PermissionDenied' pour les fichiers verrouillés, etc. Ils peuvent être ignorés.