Git Product home page Git Product logo

pcap-mode's Introduction

pcap-mode.el

Load an display a pcap file using the tshark utility.

To copy it yourself, simply:

git clone https://github.com/orgcandman/pcap-mode.git

Setup

In your .emacs initialization, add the following:

(add-to-list 'load-path "/path/to/pcap-mode")
(require 'pcap-mode)

Then, when you open any .pcap file, the tshark-executable will be invoked against the filename, and the contents displayed in the buffer.

Normally working with pcap-mode

When pcap-mode initially completes, it will display a summary-line listing of the packets. This is comparable to the tshark output when run against the pcap file. Example:

extra/pcapmode-core.png

The mode map (customizable via pcap-mode-map variable) is defaulted as follows:

KeyFunctionDescription
<return>pcap-mode-view-pkt-contentsPop up a separate buffer with the contents of a specific packet
cpcap-mode-search-framesSearch frame contents
fpcap-mode-set-tshark-filterChange the buffer local display filter applied to the pcap file.
Fpcap-mode-set-named-filterChoose a predefined filter and apply it.
gpcap-mode-clear-filterClear the current filter.
qanonymous call to kill-bufferDestroys the pcap buffer and all open packet buffers.
rpcap-mode-reload-fileReload the current pcap buffer.
C-u fpcap-mode-set-tshark-single-packet-filterChange the command line settings passed when running against a single packet.
spcap-mode-set-tshark-single-packet-filterSame as ‘C-u f’ keybind.
tpcap-mode-toggle-tcp-conversation-viewSets the tshark options to follow tcp streams.
C-c C-danonymous debug functionDisplay some debugging information

The filters are “smart” and will remember previous values set, making switching between filters convenient.

The packet viewer is a call to pcap-mode--tshark-executable passing the pcap-mode--tshark-single-packet-filter variable as well as the text frame.number==%d where %d is replaced with the packet number.

Example:

extra/pcapmode-packet.png

Hooks and variables

The following hooks are exposed by pcap-mode:

hook variableHook entry notes
pcap-mode-hookHook run when pcap-mode starts
pcap-mode-quit-hookHook run when pcap-mode window is closed.
pcap-mode-reloaded-hookHook run when the main pcap windows is reloaded

The following customizable variables exist

Variable NameDescription
pcap-mode-tshark-executablePath to the tshark binary
pcap-mode-reload-pcap-when-filter-changesAutomatically reload pcap window buffer when changing filter
pcap-mode-tshark-filterFilter used when reloading the pcap viewer window
pcap-mode-tshark-single-packet-filterFilter used for single-packet viewing
pcap-mode-dfilters-fileLocation of wireshark dfilters file containing predefined display filters.

TODOS

The following list of todos should be eliminated as they are completed.

Syntax table to make the list view pretty

Unit tests? Maybe?

display filter building wizard

pcap-mode's People

Contributors

apconole avatar vapniks avatar syohex 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.