GithubHelp home page GithubHelp logo

marclachapelle / arduinopcap Goto Github PK

View Code? Open in Web Editor NEW

This project forked from spacehuhn/arduinopcap

0.0 2.0 0.0 69 KB

A library for creating and sending .pcap files for Wireshark and other programms.

License: MIT License

Python 32.56% C++ 67.44%

arduinopcap's Introduction

ArduinoPcap

Create and send .pcap files using ESP8266/ESP32 and Arduino.

Sniffing WiFi with ESP32 & ESP8266 in Wireshark

Support me and my projects on Patreon!
Support me on Patreon

Please Note

This is a proof of concept! The included examples are only for ESP8266 and ESP32, but the library can be used for other Arduinos as well. The packet output in the examples is unfiltered and maybe malformed, errors can occur!

Also a big thanks to xdavidhu for writing the python script to connect to Wireshark!

Installation

Download this project and extract the .zip file to the Arduino libraries folder.
For more information please read Installing Additional Arduino Libraries.

Dependencies

If you don't use an ESP32, you will need the SdFat library.

Following Arduino libraries are required for the included examples:

For the Serialshark script (the script located in extras):

Please be aware that the Serialshark script doesn't work on Windows!

Usage

General

To open one of the examples open Arduino and go to File>Examples>Arduino Pcap.
You might want to adjust the settings in the sketch (settings may be different depending on the example):

//===== SETTINGS =====//
#define CHANNEL 1
#define FILENAME "esp8266"
#define SAVE_INTERVAL 30 //save new file every 30s
#define CHANNEL_HOPPING true //if true it will scan on all channels
#define MAX_CHANNEL 11 //(only necessary if channelHopping is true)
#define HOP_INTERVAL 214 //in ms (only necessary if channelHopping is true)

Also note that when you use the ESP8266 most packets will be malformed or cut off at the end.
I don't know why the promiscuous mode returns this mostly false data, but it's still good enough to get some MAC addresses and SSIDs. I used it successfully in various projects to detect deauthentication packets, scan for client devices and build a low cost WiFi packet monitor.
But if you want something more reliable then have a look at the ESP32, its promiscuous mode is working way better.

Live capture using Wireshark

You also live capture the packets in Wireshark over the serial connection!
For that be sure to have everything installed - see Dependencies.

Flash your device and be sure it is connected.
Then start the SerialShark.py (it's in the extras folder) with python3 SerialShark.py.
It will ask you about about the serial port (you have to find that out), the baud rate (be sure it's the same as in your sketch) and where to save the pcap file (wherever you want).

The baudrate for the ESP32 example is 921600. The baudrate for the ESP8266 example is 115200.

Saving onto a SD-Card

For that you will need a SD-Card (obviously). You can connect it directly to the ESP8266/ESP32, but I recommend buying a SD-Card module/shield. Wire up the SPI connection (MOSI,MISO,SCL,CS,GND,VCC) to your module and basically you are ready to go!
[If you don't know which pins to connect to which, just search for a pinout picture of your module]

The included examples will save a new .pcap file every 30s. If you open the serial monitor in Arduino (baudrate is 115200), you will get some more information.

License

This project is licensed under the MIT License - see the license file for details.

arduinopcap's People

Contributors

landrash avatar spacehuhn 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.