HackRF tools
Utilitaires en ligne de commande (hackrf_transfer, hackrf_info, et autres) pour la plateforme SDR HackRF One, pour transmettre et recevoir en RF de 1 MHz à 6 GHz. Command-line utilities (hackrf_transfer, hackrf_info, and others) for the HackRF One SDR platform, transmitting and receiving RF from 1 MHz to 6 GHz.
↗ https://greatscottgadgets.com/hackrf/Overview
The hackrf host tools are the command-line interface to a HackRF One software-defined radio — a half-duplex transceiver covering 1 MHz to 6 GHz. hackrf_transfer is the workhorse for raw IQ capture and transmission, with companion utilities for firmware management, device info, and sweeping. In RF security assessments they’re used for capturing and replaying signals (garage remotes, key fobs, wireless sensors) and for building custom transmit/receive workflows that feed into GNU Radio.
Common Usage
Show device info (serial, firmware version, board ID)
hackrf_info
Receive: capture raw IQ to file at a given frequency and sample rate
hackrf_transfer -r capture.raw -f 433920000 -s 2000000
Transmit: replay a previously captured raw IQ file
hackrf_transfer -t capture.raw -f 433920000 -s 2000000 -x 20
Wide sweep of a frequency range to find active signals
hackrf_sweep -f 400:500 -1
Firmware & Device Management
Check/update HackRF firmware version
hackrf_info
Flash new firmware (only when necessary — risk of bricking)
hackrf_spiflash -w hackrf_usb_firmware.bin
Set/verify sample rate and gain before a capture
hackrf_transfer -r out.raw -f 915000000 -s 8000000 -l 32 -g 40
Tips
-x(TX gain) and-l/-g(RX LNA/VGA gain) matter a lot — too high and you’ll clip/distort, too low and the signal is buried in noise- Always capture first with
hackrf_transfer -rand analyze offline (ininspectrumor GNU Radio) before attempting a blind replay - Transmit is illegal outside authorized bands/power levels without a license — confirm scope and legal authorization before using
-t - HackRF is half-duplex — it cannot receive and transmit simultaneously
Help / Man page
hackrf_transfer [options]
-r <file> Receive mode, write IQ samples to file (- for stdout)
-t <file> Transmit mode, read IQ samples from file (- for stdin)
-f <freq_hz> Frequency in Hz
-s <sample_rate> Sample rate in Hz (default 10000000)
-l <gain_db> RX LNA (IF) gain, 0-40dB in 8dB steps
-g <gain_db> RX VGA (baseband) gain, 0-62dB in 2dB steps
-x <gain_db> TX VGA gain, 0-47dB in 1dB steps
-a <1/0> Enable/disable RX/TX RF amplifier
-n <num_samples> Number of samples to transfer (default: unlimited)
-R Repeat TX file (loop)
hackrf_info Show connected device info
hackrf_sweep -f <range> Frequency sweep, range in MHz (e.g. 2400:2500)
hackrf_spiflash -w <file> Write firmware image to device
Vue d’ensemble
Les outils hôte hackrf sont l’interface en ligne de commande d’une radio logicielle HackRF One : un transceiver semi-duplex couvrant de 1 MHz à 6 GHz. hackrf_transfer est l’outil principal pour la capture et la transmission d’IQ brut, avec des utilitaires complémentaires pour la gestion du firmware, les infos périphérique, et le balayage. Dans les évaluations de sécurité RF, ils servent à capturer et rejouer des signaux (télécommandes de garage, badges, capteurs sans fil) et à construire des flux de travail personnalisés de transmission/réception qui alimentent GNU Radio.
Utilisation courante
# Afficher les infos du périphérique (numéro de série, version firmware, ID de carte)
hackrf_info
# Réception : capturer l'IQ brut dans un fichier à une fréquence et un taux d'échantillonnage donnés
hackrf_transfer -r capture.raw -f 433920000 -s 2000000
# Transmission : rejouer un fichier IQ brut précédemment capturé
hackrf_transfer -t capture.raw -f 433920000 -s 2000000 -x 20
# Balayage large d'une plage de fréquences pour trouver des signaux actifs
hackrf_sweep -f 400:500 -1
Gestion du firmware et du périphérique
# Vérifier/mettre à jour la version du firmware HackRF
hackrf_info
# Flasher un nouveau firmware (seulement quand nécessaire : risque de brickage)
hackrf_spiflash -w hackrf_usb_firmware.bin
# Définir/vérifier le taux d'échantillonnage et le gain avant une capture
hackrf_transfer -r out.raw -f 915000000 -s 8000000 -l 32 -g 40
Conseils
-x(gain TX) et-l/-g(gain RX LNA/VGA) comptent beaucoup : trop élevé et vous écrêtez/déformez le signal, trop bas et le signal se noie dans le bruit- Capturez toujours d’abord avec
hackrf_transfer -ret analysez hors ligne (dansinspectrumou GNU Radio) avant de tenter un rejeu à l’aveugle - La transmission est illégale hors des bandes/niveaux de puissance autorisés sans licence : confirmez le périmètre et l’autorisation légale avant d’utiliser
-t - HackRF est semi-duplex : il ne peut pas recevoir et transmettre simultanément
Aide / Page de manuel
hackrf_transfer [options]
-r <file> Receive mode, write IQ samples to file (- for stdout)
-t <file> Transmit mode, read IQ samples from file (- for stdin)
-f <freq_hz> Frequency in Hz
-s <sample_rate> Sample rate in Hz (default 10000000)
-l <gain_db> RX LNA (IF) gain, 0-40dB in 8dB steps
-g <gain_db> RX VGA (baseband) gain, 0-62dB in 2dB steps
-x <gain_db> TX VGA gain, 0-47dB in 1dB steps
-a <1/0> Enable/disable RX/TX RF amplifier
-n <num_samples> Number of samples to transfer (default: unlimited)
-R Repeat TX file (loop)
hackrf_info Show connected device info
hackrf_sweep -f <range> Frequency sweep, range in MHz (e.g. 2400:2500)
hackrf_spiflash -w <file> Write firmware image to device