SShiD is a proof-of-concept, Linux-based tool that utilizes principles of network steganography and enables covert communication by embedding encrypted messages within Wi-Fi beacon frames' Vendor-Specific Information Elements (IEs). This method allows for discreet data transmission without establishing a traditional network connection.
π NOTE: This is an ongoing research project for educational purposes rather than a full-fledged production-ready tool, so treat it accordingly.
- Covert Communication: Transmit messages without active network connections.
- Encryption: Utilizes ChaCha20-Poly1305 encryption for secure message transmission.
- Custom SSID Generation: Creates unique SSIDs based on a shared secret password.
- Vendor-Specific IEs: Embeds messages within standard-compliant beacon frames.
- Channel Specification: Operates on a user-defined Wi-Fi channel (default is 1).
-
Stealthy Transmission: By leveraging beacon frames, communication remains passive and less detectable.
-
No Network Association Required: Devices can exchange information without connecting to an access point.
-
No Single Point of Failure: Communication cannot be filtered by a firewall or IDS system.
-
Standard Compliance: Uses Wi-Fi standards, enhancing compatibility with various devices.
-
Encryption Security: Ensures messages remain confidential and tamper-proof.
-
Reliability of using beacon frames for the communication flow.
- For the sake of blending our covert traffic into the overall traffic, keep in mind that communication via SShiD will not always be 100% reliable. Since we're using broadcast messages over Wi-Fi, there's always a chance that packets can be lost due to network congestion, wireless interference, or other factors. Message retries are planned for future versions.
The project consists of two main components:
- Speaker: Broadcasts beacon frames containing encrypted messages.
- Listener: Sniffs beacon frames and extracts the hidden messages.
Both components use a shared secret password for SSID generation and message encryption/decryption.
Make sure that the Listener is running and listening prior to executing the Speaker script.
-
Initialization:
- Speaker and Listener share a secret password before using SShiD.
- Both set their wireless interfaces to monitor mode (see commands below).
-
SSID Generation:
- The Speaker generates a unique SSID by hashing the password.
- This SSID serves as an identifier for the Listener.
- The Listener derives the same SSID from the password.
-
Message Encryption:
- The Speaker encrypts the message using ChaCha20-Poly1305 with a key derived from the password.
-
Beacon Frame Construction:
- The Speaker constructs a beacon frame with:
- The generated SSID.
- The encrypted message embedded in a Vendor-Specific IE.
- Standard IEs like RSN information for compliance.
- The Speaker constructs a beacon frame with:
-
Broadcasting:
- The Speaker broadcasts a set of 50 beacon frames.
-
Packet Capturing:
- The Listener captures beacon frames in monitor mode.
- Captures only frames matching the unique SSID.
-
Message Extraction:
- The Listener extracts the encrypted message from the Vendor-Specific IE.
- Decrypts the message using the shared password.
-
Output:
- The decrypted message is displayed to the user.
- Broadcasting and listening are turned off.
π NOTE: SShiD enables one-to-many communication between the Speaker and any Listener who knows the password. Therefore, the message exchange is not bidirectional.
SShiD employs robust cryptographic algorithms to ensure the confidentiality and integrity of messages transmitted via Wi-Fi beacon frames. The following algorithms were chosen for their security and performance:
-
Key Derivation Function (KDF): PBKDF2HMAC with SHA-256
- Reason for Choice: PBKDF2 (Password-Based Key Derivation Function 2) with HMAC-SHA256 is a widely accepted standard for deriving cryptographic keys from passwords. It incorporates a salt and a high iteration count to mitigate brute-force and rainbow table attacks.
-
Symmetric Encryption: ChaCha20-Poly1305
- Reason for Choice: ChaCha20-Poly1305 is an authenticated encryption algorithm that provides both confidentiality and integrity. It is designed to be efficient in software and resistant to timing attacks. It is also used in modern protocols like TLS 1.3.
-
Hashing Algorithm: SHA-256
- Reason for Choice: SHA-256 is a cryptographic hash function that produces a 256-bit hash value. It is widely used and considered secure for generating unique identifiers, such as the SSID in this application.
-
Purpose: Both the Speaker and Listener need to identify each other without broadcasting a known SSID that could be easily intercepted.
-
Process:
-
The user provides a secret password.
-
SHA-256 is used to hash the password combined with a fixed salt (
b'sshid_ssid_salt'
).ssid_salt = b'sshid_ssid_salt' ssid_hash = hashlib.sha256(password.encode() + ssid_salt).digest()
-
The resulting hash is encoded using Base64 URL-safe encoding and truncated to create a unique, non-guessable SSID.
ssid = base64.urlsafe_b64encode(ssid_hash).decode('utf-8').rstrip('=')[:10]
-
-
Security Benefit: Only users who know the secret password can generate the same SSID, preventing unauthorized parties from easily discovering the communication.
-
Purpose: Create a strong encryption key from the user-provided password to encrypt the message securely.
-
Process:
-
Uses PBKDF2HMAC with SHA-256 to derive a 256-bit key from the password and a fixed salt (
b'sshid_encryption_salt'
).kdf = PBKDF2HMAC( algorithm=hashes.SHA256(), length=32, salt=encryption_salt, iterations=100000, ) key = kdf.derive(password.encode())
-
The iteration count (100,000) adds computational complexity, making brute-force attacks more difficult.
-
-
Security Benefit: The derived key is cryptographically strong and resistant to attacks targeting weak or predictable keys.
-
Purpose: Ensure that the message content remains confidential and tamper-proof during transmission.
-
Process:
-
Generates a random 12-byte nonce for use with the ChaCha20-Poly1305 algorithm.
nonce = os.urandom(12)
-
Uses ChaCha20-Poly1305 to encrypt the message with the derived key and nonce.
aead = ChaCha20Poly1305(key) ciphertext = aead.encrypt(nonce, message.encode('utf-8'), None)
-
Combines the nonce and ciphertext, then encodes them using Base64 URL-safe encoding for inclusion in the beacon frame.
data = nonce + ciphertext encoded_data = base64.urlsafe_b64encode(data).decode('utf-8').rstrip('=')
-
-
Security Benefit:
- Confidentiality: Only users with the correct key can decrypt the message.
- Integrity and Authenticity: ChaCha20-Poly1305 provides built-in authentication, ensuring the message hasn't been tampered with.
-
Purpose: Transmit the encrypted message covertly within Wi-Fi beacon frames.
-
Process:
-
Constructs a Vendor-Specific Information Element (IE) in the beacon frame, including the encrypted message.
vendor_ie_info = vendor_oui_bytes + vendor_oui_type + encoded_data_bytes vendor_ie = Dot11Elt(ID=221, info=vendor_ie_info)
-
The beacon frame is broadcasted, and only listeners with the correct SSID and decryption key can retrieve and decrypt the message.
-
-
Security Benefit: The message is hidden within standard Wi-Fi management frames, reducing the likelihood of detection by unauthorized parties.
-
Purpose: Allow the intended recipient to read the message securely.
-
Process:
-
The Listener extracts the nonce and ciphertext from the received beacon frame.
-
Uses the same derived key and ChaCha20-Poly1305 to decrypt the message.
plaintext = aead.decrypt(nonce, ciphertext, None)
-
-
Security Benefit: Ensures that only recipients with the correct password can access the message content.
-
Password-Based Security: The use of a shared secret password ensures that only authorized users can generate the correct SSID and derive the encryption key.
-
Strong Cryptographic Algorithms: Utilizing PBKDF2HMAC, SHA-256, and ChaCha20-Poly1305 provides a high level of security against known cryptographic attacks.
-
Nonce Usage: The inclusion of a random nonce for each message prevents replay attacks and ensures that the same message encrypted multiple times will result in different ciphertexts.
-
Covert Communication: Embedding the encrypted message within Wi-Fi beacon frames allows for discreet transmission without establishing a traditional network connection.
-
Secure Passwords: Users should choose strong, unique passwords to prevent brute-force attacks.
-
Limited Exposure: Since beacon frames are broadcasted, it's essential to minimize the transmission duration to reduce the risk of interception.
-
Environment Awareness: Be mindful of local regulations and potential interference with other wireless networks when using this application.
By carefully integrating these encryption and hashing operations, SShiD ensures secure and confidential communication over Wi-Fi beacon frames, suitable for covert message transmission between parties who share a secret password.
- Operating System: Linux-based systems (e.g., Ubuntu, Debian, Kali)
- Latest release tested and functional on Ubuntu 24.04
- Python Version: Python 3.8 or higher
- Dependencies:
scapy
for packet crafting and sniffingcryptography
for encryption and decryption
- Privileges: Root or sudo access to send or sniff WiFi beacons
- Network Interface: Wireless interfaces in UP state and Monitor mode. SShiD will automatically detect and prompt you to select the active interface if multiple are detected.
Monitor mode should be enabled on both the Speaker and Listener machines prior to using SShiD. To identify your wireless interface and check if it supports Monitor mode use:
iw dev
sudo iw list | grep -A 10 "Supported interface modes"
To enable Monitor mode (assuming wlan0
is your interface) use:
sudo apt update
sudo apt install aircrack-ng
Then enter the following commands:
sudo airmon-ng check kill
sudo ip link set wlan0 down
sudo iw dev wlan0 set type monitor
sudo ip link set wlan0 up
Or, if you prefer:
sudo airmon-ng check kill
sudo airmon-ng start wlan0
After enabling Monitor mode, check with iwconfig
to see if your interface shows Mode: Monitor.
Some WiFi cards may show support for Monitor mode but not function properly, for instance when capturing frames.
To check your wireless adapter driver use:
lspci -k | grep -A 3 -i network
or, for USB adapters:
lsusb
Additionally, check logs for failure messages if your adapter doesn't capture any traffic at all in Monitor mode.
sudo dmesg | grep -i <driver_name>
π NOTE: Do your own research on your adapter and any issues related to Monitor mode. Best case scenario, you need a driver update. Otherwise, you need an adapter that supports Monitor mode. The cheapest option may be TP-Link TL-WN722N. Here's a tutorial on how to set it up to allow Monitor mode:
To disable Monitor mode and re-enable the default Managed mode:
sudo iw dev wlan0 set type managed
sudo systemctl start NetworkManager
-
Clone the Repository:
git clone https://github.com/pdudotdev/SShiD.git cd SShiD
-
Install Dependencies:
sudo apt install python3-scapy sudo apt install python3-cryptography
Both Speaker and Listener scripts require root privileges to send or sniff beacons. You can run the scripts using sudo
:
Speaker:
sudo python3 speaker.py
Listener:
sudo python3 listener.py
- Hardware Compatibility: Requires wireless adapters that support monitor mode and packet injection.
- Range Constraints: Effective communication range is limited to Wi-Fi transmission distances.
- Legal Compliance: Users must comply with local laws and regulations regarding wireless transmissions.
- Improved CLI experience
- More testing is needed
SShiD is intended for educational and authorized security testing purposes only. Unauthorized interception or manipulation of network traffic is illegal and unethical. Users are responsible for ensuring that their use of this tool complies with all applicable laws and regulations. The developers of SShiD do not endorse or support any malicious or unauthorized activities. Use this tool responsibly and at your own risk.
For efficiency, the implementation of my funky Network Stego ideas is done using:
- Python, Scapy, nmap, cryptography libraries, etc.
- Home-lab with dedicated Linux machines and adapters.
- GPT-4o & o1-preview (let it do the heavy lifting!).
- Careful, refined, hardcore prompt engineering.
- Manual optimization and verification of AI-generated code.
- Countless iterations, what-ifs, adjustments, and tests.
SShiD is licensed under the GNU GENERAL PUBLIC LICENSE Version 3.