
Analizzatore statico per eseguibili PE con rilevamento basato su plugin di packer, compilatori, importazioni sospette, costanti crittografiche e firme ClamAV. Supporta l'invio di hash a VirusTotal e la verifica di authenticode.
Manalyze è un tool di analisi statica per file PE che puoi utilizzare per condurre una valutazione primaria su un eseguibile (o un insieme di eseguibili). Raccoglie segnali deboli che potrebbero indicare un comportamento malevolo e mostra informazioni che possono aiutare una successiva analisi manuale.
Se vuoi vedere alcuni report di esempio generati dal tool, sentiti libero di provare il servizio web che ho creato per esso: manalyzer.org.
Manalyze è stato scritto in C++ per Windows e Linux ed è rilasciato sotto i termini della licenza GPLv3. È un parser robusto per file PE con un'architettura flessibile a plugin che permette agli utenti di analizzare staticamente i file in profondità. Manalyze...
WriteProcessMemory + CreateRemoteThread)Ci sono poche cose che odio più che fare il checkout di un progetto open-source e passare due ore a cercare di compilarlo. Ecco perché ho fatto del mio meglio per rendere Manalyze il più semplice possibile da compilare. Se queste poche righe non funzionano per te, allora ho fallito nel mio lavoro e dovresti scrivermi così posso risolvere il problema.
$> [sudo o come root] apt-get install libboost-dev libboost-system-dev libssl-dev build-essential cmake git
$> [in alternativa, anche sudo o come root] pkg install boost libressl cmake git
$> git clone https://github.com/JusticeRage/Manalyze.git && cd Manalyze
$> cmake .
$> make -j5
$> cd bin && ./manalyze --version
Nota: il plugin VirusTotal è opzionale e richiede la libreria Boost.System.
Infine, se vuoi accedere a Manalyze da qualsiasi directory della tua macchina, installalo usando $> make install dalla cartella radice del progetto.
cd boost_1_XX_0 && ./bootstrap.bat && ./b2.exe --build-type=complete --with-systemBOOST_ROOT che contiene il percorso alla tua cartella boost_1_XX_0.git clone https://github.com/JusticeRage/Manalyze.git && cd Manalyze && cmake .manalyze.sln nella cartella Manalyze!# Salta queste due righe se hai già un ambiente di compilazione sano
user$ xcode-select --install
user$ sudo installer -pkg /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg -target /
user$ git clone https://github.com/JusticeRage/Manalyze.git && cd Manalyze
user$ brew install openssl boost
user$ cmake . -DOPENSSL_ROOT_DIR=/usr/local/opt/openssl/ && make -j5
user$ bin && ./manalyze --version
Se devi compilare Manalyze su una macchina senza accesso a Internet, devi fare il checkout manuale dei seguenti progetti:
Posiziona le due cartelle nella cartella external rispettivamente come external/yara e external/hash-library. Poi esegui cmake . -DGitHub=OFF e continua normalmente.
Un'immagine Docker per Manalyze è fornita dalla community. Esegui docker pull evanowe/manalyze e ottieni ulteriori informazioni qui.
Poiché le firme ClamAV sono voluminose e aggiornate regolarmente, non aveva molto senso distribuirle da GitHub o con il binario. Quando provi a utilizzare il plugin ClamAV per la prima volta, molto probabilmente incontrerai il seguente messaggio di errore: [!] Error: Could not load yara_rules/clamav.yara. Per generarli, esegui lo script Python update_clamav_signatures.py situato in bin/yara_rules (albero dei sorgenti) o ${CMAKE_INSTALL_DATADIR}/manalyze/yara_rules (installato, comunemente /usr/share/manalyze/yara_rules o /usr/local/share/manalyze/yara_rules).
Esegui lo script ogni volta che desideri aggiornare le firme. Le cache Yara compilate sono memorizzate in $XDG_CACHE_HOME/manalyze/yara_rules o ~/.cache/manalyze/yara_rules, e possono essere sovrascritte con MANALYZE_CACHE_DIR.
Le posizioni di installazione predefinite (che onorano CMAKE_INSTALL_PREFIX) sono:
${CMAKE_INSTALL_SYSCONFDIR}/manalyze/manalyze.conf (spesso /etc/manalyze/manalyze.conf o /usr/local/etc/manalyze/manalyze.conf)${CMAKE_INSTALL_DATADIR}/manalyze/yara_rules (spesso /usr/share/manalyze/yara_rules o /usr/local/share/manalyze/yara_rules)${CMAKE_INSTALL_LIBDIR}/manalyze/pluginsPuoi sovrascriverli con le variabili d'ambiente:
MANALYZE_CONFIG_DIR, MANALYZE_DATA_DIR, MANALYZE_PLUGIN_DIR, MANALYZE_CACHE_DIR.
$ ./manalyze.exe --help
Usage:
-h [ --help ] Displays this message.
-v [ --version ] Prints the program's version.
--pe arg The PE to analyze. Also accepted as a positional
argument. Multiple files may be specified.
-r [ --recursive ] Scan all files in a directory (subdirectories will be
ignored).
-o [ --output ] arg The output format. May be 'raw' (default) or 'json'.
-d [ --dump ] arg Dump PE information. Available choices are any
combination of: all, summary, dos (dos header), pe (pe
header), opt (pe optional header), sections, imports,
exports, resources, version, debug, tls, config, delay, rich
--hashes Calculate various hashes of the file (may slow down the
analysis!)
-x [ --extract ] arg Extract the PE resources to the target directory.
-p [ --plugins ] arg Analyze the binary with additional plugins. (may slow
down the analysis!)
Available plugins:
- clamav: Scans the binary with ClamAV virus definitions.
- compilers: Tries to determine which compiler generated the binary.
- peid: Returns the PEiD signature of the binary.
- strings: Looks for suspicious strings (anti-VM, process names...).
- findcrypt: Detects embedded cryptographic constants.
- packer: Tries to structurally detect packer presence.
## Python bindings (manapy)
I binding Python si trovano in `manapy/` e vengono importati come `manalyze`.
Dalla radice del repository:
cd manapy python -m pip install .
- imports: Looks for suspicious imports.
- resources: Analyzes the program's resources.
- mitigation: Displays the enabled exploit mitigation techniques (DEP, ASLR, etc.).
- overlay: Analyzes data outside of the PE's boundaries.
- authenticode: Checks if the digital signature of the PE is valid.
- virustotal: Checks existing AV results on VirusTotal.
- all: Run all the available plugins.
Examples:
manalyze.exe program.exe
manalyze.exe -dresources -dexports -x out/ program.exe
manalyze.exe --dump=imports,sections --hashes program.exe
manalyze.exe -r malwares/ --plugins=peid,clamav --dump all
Contattami o apri una pull request se desideri essere aggiunto a questa lista!