Coder Social home page Coder Social logo

frozenburrito / pcapsecret Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 251 KB

Pcapsecret injects a secret message into a packet capture (pcap) file.

License: MIT License

Python 100.00%
computer-science-education pcap pcap-files scapy educational-game puzzle secret-message

pcapsecret's Introduction

pcapsecret v0.1

Pcapsecret injects a secret message into a packet capture (pcap) file. Students use Wireshark or a similar tool to: 1) inspect an output.pcap file to find malformed packets, and 2) reconstruct the secret message by combining the last bytes of each sequential malformed packet.

Description

I made pcapsecret as a game for students in my Comp. Sci. class (but also for fun and to help me learn about scapy!) Here's what it does:

  • Reads packets from input pcap file and extracts basic data (with scapy's pipetools);
    • Does not modify input pcap file.
  • Segments secret message and encapsulates message segments with encap chars (default encap chars: <>);
  • Injects message segments as payloads in random sequential packets;
    • Payloads containing message segments are appended as the last bytes of each chosen packet.
    • Does not overwrite existing payloads or bytes.
  • Provides hints by malforming or modifying packets which contain message segments;
  • Saves packets to output.pcap; and
  • Prints answer key table to console.
  • Hint Types (To Do: add hint types):
    • no_hint (disabled) = add segment as payload, reset size on wire = captured size (difficult to detect).
    • time_hint_small = time changed to outside range of time of pkts +2 or -2 indices away, causing packet to appear out of place.
    • time_hint_large = significant time change (index hint as time_hint_small).
    • length_hint = malformed packet length due to size on wire != captured size.
      • Easier to detect due to Wireshark auto-highlighting this type of malformed packet.
    • addr_hint_1 = MAC and/or IP source and destination are random, not in input pcap file.
    • addr_hint_2 = Ethernet layer contains broadcast mac address in source and destination.
  • For fun, try using a shortened url as the secret message.

Getting Started

Cloning and Environment Setup

  • Linux:
    Libpcap required, but is already provided in many distributions.
git clone https://github.com/FrozenBurrito/pcapsecret.git
cd pcapsecret
python -m venv .
source bin/activate
pip install -r requirements.txt
git clone https://github.com/FrozenBurrito/pcapsecret.git
cd pcapsecret
python -m venv .
scripts\activate.bat 
pip install -r requirements.txt

Running pcapsecret

python pcapsecret.py input.pcap "Secret Message Test!"

Usage

python pcapsecret.py --help

Help

Let me know if you have any questions or suggestions!

Authors

Jon Morris, frozenburrito

Version History

  • 0.1
    • It works!

License

This project is licensed under the MIT License. See the LICENSE.md file for details.

Helpful Libraries

Helpful Sources

pcapsecret's People

Contributors

frozenburrito avatar

Watchers

 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.