Skip to content

Files

Latest commit

 

History

History

encrypted-message-exchanger

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Discord

Screenshots | Features | Command-line Arguments | Install | Configure | Run

Encrypted Message Exchanger

A small command-line Encrypted Message Exchanger that allows the user to craft, send, recieve, encrypt, and decrypt custom (Blowfish) encrypted payloads with HMAC (SHA256) signatures, across networks, using Scapy and Python Cryptography Toolkit.

Screenshots

Sender


Recipient




Features

Blowfish Encryption: The command-line tool uses Blowfish encryption to secure the payload of the packets.
HMAC Signature: Ensure packet intergrity with HMAC signatures using SHA-256.
Custom Packets: Craft custom IP, TCP, and UDP packets with the specified parameters.

Command-line Arguments

Important

MAC operations are limited to machines directly connected within your subnet. When sending encrypted packets intended for hosts outside your subnet, you must set [-fd FRAME_DST] to your router/gateway's MAC address, and [-fs FRAME_SRC] to your computer's MAC address.

This tool provides various command-line arguments to configure the frame/packet parameters and mode of operation.

usage: eme.py [-h] [-c SEND_COUNT] [-f {arp,icmp,igmp,ip,udp,tcp}]
              [-fd FRAME_DST] [-fs FRAME_SRC] [-i IFACE] [-ip IP_DST]
              [-is IP_SRC] [-k KEY] [-l] [-lp LISTEN_PORT] [-m MESSAGE]
              [-p DST_PORT] [-P PROTOCOL] [-S SRC_PORT] [-t SEND_TIMEOUT]

options:
  -h, --help            show this help message and exit
  -c SEND_COUNT, --send_count SEND_COUNT
                        Specify the number of packets to send. Set 0 to send
                        an unlimited number of packets.
  -f {arp,icmp,igmp,ip,udp,tcp}, --filter {arp,icmp,igmp,ip,udp,tcp}
                        Packet filter: ARP, ICMP, IGMP, IP, UDP, TCP, NOT,
                        AND, OR
  -fd FRAME_DST, --frame_dst FRAME_DST
                        Specify the destination MAC address.
  -fs FRAME_SRC, --frame_src FRAME_SRC
                        Specify the source MAC address.
  -i IFACE, --iface IFACE
                        Specify the network interface.
  -ip IP_DST, --ip_dst IP_DST
                        Specify the destination IP address.
  -ips IP_SRC, --ip_src IP_SRC
                        Specify the source IP address.
  -k KEY, --key KEY     
                        Specify the encryption key.
  -l, --listen          
                        Specify the mode (listen or send).
  -lp LISTEN_PORT, --listen-port LISTEN_PORT
                        Specify the mode (listen or send).
  -m MESSAGE, --message MESSAGE
                        Specify the secret message.
  -p PORT_DST, --port_dst PORT_DST
                        Specify the destination port.
  -ps PORT_SRC, --port_src PORT_SRC
                        Specify the source port.
  -P PROTOCOL, --protocol PROTOCOL
                        Specify the protocol (TCP or UDP).
  -t SEND_TIMEOUT, --send_timeout SEND_TIMEOUT
                        Specify the number of seconds to wait before each
                        packet send.

Install

Important

Requires atleast Python 3.10 to work

1. Create and activate a virtual enviroment

conda update conda
conda create -n <env name> python=3.10
conda activate <env name>

2. Create a new folder for this repository

mkdir <repo>
cd <repo>

3. Create a treeless, shallow clone of this repository

git clone -n --depth=1 --filter=tree:0 https://github.com/shaunbarnard/python.git
cd python

4. Enable the sparse-checkout feature and specify the folder you want to clone (encrypted-message-exchanger)

git sparse-checkout set --no-cone encrypted-message-exchanger

5. Check out the contents of the specified folder (encrypted-message-exchanger)

git checkout
cd encrypted-message-exchanger

6. Install the necessary Python dependencies

pip install -r requirements.txt

Configuration

1. Adjust the settings in .env as necessary

####################
# SECRETS
####################
PRIVATE_KEY="Password I shared with recipient"
SECRET_MESSAGE="This is a secret message\n\nFROM: Neo"
####################
# DEFAULT SETTINGS
####################
I_FACE=""
####################
# FRAME SETTINGS
####################
FRAME_DST ="11:11:11:11:11:11"
FRAME_SRC="00:00:00:00:00:00"
IP_DST ="192.168.1.2"
IP_SRC ="192.168.1.1"
PORT_DST=80
PORT_SRC=80
PROTOCOL="TCP"

Run

sudo python eme.py

Important

MAC operations are limited to machines directly connected within your subnet. When sending encrypted packets intended for hosts outside your subnet, you must set [-fd FRAME_DST] to your router/gateway's MAC address, and [-fs FRAME_SRC] to your computer's MAC address.

Usage Examples

Listen for encrypted packets using the default settings:

sudo python eme.py -l

Send a single encrypted packet using the default settings:

sudo python eme.py

Listen for encrypted messages containing the specified custom key

sudo python eme.py -l -k "Password I shared with recipient"

Send a custom encrypted message with a custom key

sudo python eme.py -m "Secret Message" -k "Password I shared with recipient"

Send a custom UDP packet containing an encrypted message and a custom key

sudo python eme.py -m "Secret Message" -k "Password I shared with recipient" -P udp

Send a custom UDP packet containing an encrypted message, a custom key, and a spoofed IP source address

sudo python eme.py -m "Secret Message" -k "Password I shared with recipient" -P udp -ips 33.33.33.33

Send 10 encrypted packets

sudo python eme.py -c 10

Send a total of 10 encrypted packets with a 5 second interval between each send

sudo python eme.py -c 10 -t 5

Send an unlimited number of packets

sudo python eme.py -c 0

Send a flood of an unlimited number of packets

sudo python eme.py -c 0 -t 0