Ajout de la personnalisation X à DeepBlueHash
This commit is contained in:
@ -1,23 +1,22 @@
|
||||
# DeepBlue.py
|
||||
|
||||
DeepBlueCLI, ported to Python. Designed for parsing evtx files on Unix/Linux.
|
||||
DeepBlueCLI, porté en Python. Conçu pour analyser les fichiers `evtx` sur Unix/Linux.
|
||||
|
||||
Current version: alpha. It supports command line parsing for Security event log 4688, PowerShell log 4014, and Sysmon log 1. Will be porting more functionality from DeepBlueCLI after DerbyCon 7.
|
||||
Version actuelle : alpha. Il supporte l'analyse en ligne de commande pour le journal de sécurité (ID 4688), le journal PowerShell (ID 4014) et le journal Sysmon (ID 1). D'autres fonctionnalités de DeepBlueCLI seront portées après la conférence DerbyCon 7.
|
||||
|
||||
## libevtx
|
||||
|
||||
Requires libevtx: https://github.com/libyal/libevtx
|
||||
Ce projet nécessite `libevtx` pour fonctionner.
|
||||
Lien : https://github.com/libyal/libevtx
|
||||
|
||||
## Other evtx frameworks
|
||||
## Autres frameworks evtx
|
||||
|
||||
Note that I tested a few Unix/Linux/Python evtx frameworks.
|
||||
Notez que j'ai testé plusieurs frameworks `evtx` pour Unix/Linux/Python.
|
||||
|
||||
This is quite popular: https://github.com/williballenthin/python-evtx
|
||||
Celui-ci est assez populaire : https://github.com/williballenthin/python-evtx
|
||||
|
||||
I ran into trouble with *some* .evtx files, where it would crash with this error:
|
||||
J'ai rencontré des problèmes avec *certains* fichiers `.evtx`, où il plantait avec cette erreur :
|
||||
|
||||
```
|
||||
UnicodeDecodeError: 'utf16' codec can't decode bytes in position 0-1: illegal UTF-16 surrogate
|
||||
```
|
||||
|
||||
I found libevtx 'just worked', and had the added benefit of both Python and compiled options.
|
||||
J'ai trouvé que `libevtx` "fonctionnait tout simplement", avec l'avantage supplémentaire d'offrir des options à la fois en Python et compilées.
|
@ -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.
|
@ -1,15 +1,13 @@
|
||||
## Set-ExecutionPolicy
|
||||
|
||||
If you see this error: `.\DeepBlue.ps1 : File .\DeepBlue.ps1 cannot be loaded because running scripts is
|
||||
disabled on this system. For more information, see about_Execution_Policies at
|
||||
http://go.microsoft.com/fwlink/?LinkID=135170.`
|
||||
Si vous rencontrez cette erreur : `.\DeepBlue.ps1 : File .\DeepBlue.ps1 cannot be loaded because running scripts is disabled on this system. For more information, see about_Execution_Policies at http://go.microsoft.com/fwlink/?LinkID=135170.`
|
||||
|
||||
You must run Set-ExecutionPolicy as Administrator, here is an example (this will warn every time you run a ps1 script):
|
||||
Vous devez exécuter `Set-ExecutionPolicy` en tant qu'**Administrateur**. Voici un exemple (cette commande vous avertira à chaque fois que vous exécuterez un script .ps1) :
|
||||
|
||||
`Set-ExecutionPolicy RemoteSigned`
|
||||
|
||||
This command will bypass Set-Execution entirely: `Set-ExecutionPolicy Bypass`
|
||||
Cette commande contournera complètement la politique d'exécution : `Set-ExecutionPolicy Bypass`
|
||||
|
||||
See `get-help Set-ExecutionPolicy` for more options.
|
||||
Consultez `get-help Set-ExecutionPolicy` pour plus d'options.
|
||||
|
||||
Please note that "Set-ExecutionPolicy is not a security control" (quoting [@Ben0xA](https://twitter.com/ben0xa))
|
||||
Veuillez noter que "Set-ExecutionPolicy n'est pas un contrôle de sécurité" (citation de [@Ben0xA](https://twitter.com/ben0xa)).
|
Reference in New Issue
Block a user