Skip to content

Python script to hoover up network traffic and spit it out the audio interface.

Notifications You must be signed in to change notification settings

cyberfishtools/CFT--Packet-to-audio

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 

Repository files navigation

Packet-to-audio

A minimal python script to hoover up network traffic and spit it out the audio interface.

Compatibility

Tested and working on Raspberry Pi v3 B+ (Raspbian Stretch and Buster), Debian v8-10, Kali.

Might work on Linux VMs.

Not compatible with MacOSX at the moment. Windows compatibility not tested.

Installation

Requirements: python3, pyaudio

install pyaudio on Debian systems using:

$ sudo apt-get update && sudo apt-get install python3-pyaudio portaudio19-dev
$ git clone https://github.com/cyberfishtools/CFT--Packet-to-audio.git

Create a symlink for handy command line usage:

$ sudo ln -s /path/to/packet2audio/packet2audio.py /usr/local/bin/packet2audio

Run with:

$ packet2audio -i <iface_name>

Usage

Simple, but it must be run as root (with sudo):

usage: packet2audio [-h] [-a] [-s] -i INTERFACE [-c CHUNK_SIZE]
                    [-r SAMPLE_RATE] [-w WIDTH] [-t TIMEOUT] [-p]

optional arguments:
  -h, --help            show this help message and exit
  -a, --audio-blocking  non-blocking by default
  -s, --socket-blocking
                        non-blocking by default
  -i INTERFACE, --interface INTERFACE
                        [if0[,if1]]
  -c CHUNK_SIZE, --chunk-size CHUNK_SIZE
                        chunk size in frames
  -r SAMPLE_RATE, --sample-rate SAMPLE_RATE
                        frames per second
  -w WIDTH, --width WIDTH
                        bytes per sample
  -t TIMEOUT, --timeout TIMEOUT
                        socket timeout in seconds
  -p, --print-packet    print packet to console

Examples:

Listen to WiFi traffic:

sudo packet2audio -i wlan0

Listen on more than one interface:

sudo packet2audio -i wlan0,eth0

Enable blocking with -a for audio and -s for socket:

sudo packet2audio -i wlan0,eth0 -a -s

Print the data written to the audio buffer with -p (hint: doesn't make sense to use without a monitor):

sudo packet2audio -i wlan0 -p

Credits

by CyberFishTools 2019

Code cobbled together from examples at:

A nice link illuminating protocol codes in linux:

About

Python script to hoover up network traffic and spit it out the audio interface.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages