Git Product home page Git Product logo

pcap-browser's Introduction

pcap browser

This is an experimental project to view pcaps in the browser with tshark from a server. This is a starter project, and works for small pcap files.

Start

  1. Install pip dependencies
pip install -r requirements.txt
  1. start the app
python app.py

Images

file upload view

upload view

Dependencies

The following dependencies are required for this tool installation.

Install tshark

Install tshark package, instructions for all platforms here: https://tshark.dev/setup/install/

Here are the steps for Ubuntu:

https://pkgs.org/search/?q=tshark

sudo apt install tshark

verify the tshark location

$ whereis tshark
tshark: /usr/bin/tshark /usr/share/man/man1/tshark.1.gz

$ tshark -v
TShark (Wireshark) 3.6.2 (Git v3.6.2 packaged as 3.6.2-2)

pcap-browser's People

Contributors

j143 avatar

Stargazers

 avatar

Watchers

 avatar  avatar

pcap-browser's Issues

E: Sub-process /usr/bin/dpkg returned an error code (1)

Error message:

$ sudo apt install tshark --fix-missing
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following additional packages will be installed:
  libbcg729-0 libc-ares2 liblua5.2-0 libpcap0.8 libsbc1 libsmi2ldbl libsnappy1v5 libspandsp2 libspeexdsp1 libssh-gcrypt-4 libwireshark-data libwireshark15
  libwiretap12 libwsutil13 wireshark-common
Suggested packages:
  snmp-mibs-downloader geoipupdate geoip-database geoip-database-extra libjs-leaflet libjs-leaflet.markercluster wireshark-doc
The following NEW packages will be installed:
  libbcg729-0 libc-ares2 liblua5.2-0 libpcap0.8 libsbc1 libsmi2ldbl libsnappy1v5 libspandsp2 libspeexdsp1 libssh-gcrypt-4 libwireshark-data libwireshark15
  libwiretap12 libwsutil13 tshark wireshark-common
0 upgraded, 16 newly installed, 0 to remove and 0 not upgraded.
Need to get 45.1 kB/23.2 MB of archives.
After this operation, 121 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Ign:1 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 libc-ares2 amd64 1.18.1-1ubuntu0.22.04.1
Err:1 http://security.ubuntu.com/ubuntu jammy-updates/main amd64 libc-ares2 amd64 1.18.1-1ubuntu0.22.04.1
  404  Not Found [IP: 185.125.190.39 80]
debconf: delaying package configuration, since apt-utils is not installed
Selecting previously unselected package libpcap0.8:amd64.
(Reading database ... 35573 files and directories currently installed.)
.....
dpkg: dependency problems prevent configuration of libwireshark15:amd64:
 libwireshark15:amd64 depends on libc-ares2 (>= 1.7.1); however:
  Package libc-ares2 is not installed.

dpkg: error processing package libwireshark15:amd64 (--configure):
 dependency problems - leaving unconfigured
Setting up libwireshark-data (3.6.2-2) ...
Setting up liblua5.2-0:amd64 (5.2.4-2) ...
Setting up libspeexdsp1:amd64 (1.2~rc1.2-1.1ubuntu3) ...
dpkg: dependency problems prevent configuration of wireshark-common:
 wireshark-common depends on libwireshark15 (>= 3.6.2-2); however:
  Package libwireshark15:amd64 is not configured yet.

dpkg: error processing package wireshark-common (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of tshark:
 tshark depends on libwireshark15 (>= 3.5.0); however:
  Package libwireshark15:amd64 is not configured yet.
 tshark depends on wireshark-common (= 3.6.2-2); however:
  Package wireshark-common is not configured yet.

dpkg: error processing package tshark (--configure):
 dependency problems - leaving unconfigured
Processing triggers for hicolor-icon-theme (0.17-2) ...
Processing triggers for libc-bin (2.35-0ubuntu3.1) ...
Processing triggers for man-db (2.10.2-1) ...
Processing triggers for shared-mime-info (2.1-2) ...
Errors were encountered while processing:
 libwireshark15:amd64
 wireshark-common
 tshark
E: Failed to fetch http://security.ubuntu.com/ubuntu/pool/main/c/c-ares/libc-ares2_1.18.1-1ubuntu0.22.04.1_amd64.deb  404  Not Found [IP: 185.125.190.39 80]
E: Sub-process /usr/bin/dpkg returned an error code (1)

RuntimeError: Working outside of application context.

$ python app.py
Traceback (most recent call last):
File "/workspace/pcap-browser/app.py", line 187, in
db.create_all()
File "/workspace/.pyenv_mirror/user/current/lib/python3.11/site-packages/flask_sqlalchemy/extension.py", line 887, in create_all
self._call_for_binds(bind_key, "create_all")
File "/workspace/.pyenv_mirror/user/current/lib/python3.11/site-packages/flask_sqlalchemy/extension.py", line 858, in _call_for_binds
engine = self.engines[key]
^^^^^^^^^^^^
File "/workspace/.pyenv_mirror/user/current/lib/python3.11/site-packages/flask_sqlalchemy/extension.py", line 639, in engines
app = current_app._get_current_object() # type: ignore[attr-defined]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/workspace/.pyenv_mirror/user/current/lib/python3.11/site-packages/werkzeug/local.py", line 508, in _get_current_object
raise RuntimeError(unbound_message) from None
RuntimeError: Working outside of application context.

This typically means that you attempted to use functionality that needed
the current application. To solve this, set up an application context
with app.app_context(). See the documentation for more information.

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.