Coder Social home page Coder Social logo

eonraider / packet-sniffer Goto Github PK

View Code? Open in Web Editor NEW
722.0 23.0 94.0 15.41 MB

A Network Packet Sniffing tool developed in Python 3.

License: GNU Affero General Public License v3.0

Python 100.00%
network-programming ethical-hacking pentesting-tools tcp-ip packet-sniffer

packet-sniffer's Introduction

Python 3 Network Packet Sniffer

Python Version OS CodeFactor Grade License

Reddit Discord Twitter

A Network Packet Sniffer developed in Python 3. Packets are disassembled as they arrive at a given network interface controller and their information is displayed on the screen.

This application depends exclusively on the NETProtocols library (also developed and maintained by EONRaider) from version 2.0.0 and above and can be run by any Python 3.8+ interpreter.

Demo

sniffer_demo

Running the Application

I. Development Mode

Simply clone this repository with git clone, install the dependencies and execute the sniffer.py file.

user@host:~$ git clone https://github.com/EONRaider/Packet-Sniffer.git
user@host:~$ cd Packet-Sniffer
user@host:~/packet-sniffer$ pip install -r requirements.txt <--or--> poetry install
user@host:~/packet-sniffer$ sudo python3 packet_sniffer/sniffer.py

The sudo command is required due to the use of socket.SOCK_RAW, which needs administrative privileges to run on GNU/Linux. Notice that the existence of dependencies may require the execution of the interpreter contained in the virtual environment in which the dependencies have been installed (if you use one), instead of just using the system interpreter.

II. (Optional) Build the binary

Use the build.py file to compile your own binary with the PyInstaller package. You just need to install all dependencies and build. Dependency management works with both Poetry (recommended) and Virtualenv.

<-- Install dependencies as shown above in Step I -->
user@host:~/packet-sniffer$ python3 build.py

Usage

sniffer.py [-h] [-i INTERFACE] [-d]

Network Packet Sniffer

optional arguments:
  -h, --help            show this help message and exit
  -i INTERFACE, --interface INTERFACE
                        Interface from which packets will be captured (monitors
                        all available interfaces by default).
  -d, --data            Output packet data during capture.

Legal Disclaimer

The use of code contained in this repository, either in part or in its totality, for engaging targets without prior mutual consent is illegal. It is the end user's responsibility to obey all applicable local, state and federal laws.

Developers assume no liability and are not responsible for misuses or damages caused by any code contained in this repository in any event that, accidentally or otherwise, it comes to be utilized by a threat agent or unauthorized entity as a means to compromise the security, privacy, confidentiality, integrity, and/or availability of systems and their associated resources. In this context the term "compromise" is henceforth understood as the leverage of exploitation of known or unknown vulnerabilities present in said systems, including, but not limited to, the implementation of security controls, human- or electronically-enabled.

The use of this code is only endorsed by the developers in those circumstances directly related to educational environments or authorized penetration testing engagements whose declared purpose is that of finding and mitigating vulnerabilities in systems, limiting their exposure to compromises and exploits employed by malicious agents as defined in their respective threat models.

packet-sniffer's People

Contributors

eonraider avatar folkertvanheusden avatar jdevries3133 avatar zahash avatar

Stargazers

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

Watchers

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

packet-sniffer's Issues

Docker support

Add very basic docker support.

Provides a means for those on Windows and Mac (#2 and #4) to run this program.

Error on Mac. Cannot import name 'PF_PACKET' from 'socket'

I get this error when I try to run it on my Mac (OSX 10.13.6)

$python3.9 packet_sniffer.py -i en9 -d
Traceback (most recent call last):
  File "/Users/frak/git/Packet-Sniffer/packet_sniffer.py", line 10, in <module>
    from socket import ntohs, socket, PF_PACKET, SOCK_RAW
ImportError: cannot import name 'PF_PACKET' from 'socket' (/usr/local/Cellar/python@3.9/3.9.0_1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/socket.py)

AttributeError: 'Ethernet' object has no attribute 'lower'

I am on ubuntu based machine, using python 3.8.5

ran the script
sudo python3 packet_sniffer.py -i wlo1 -d

Traceback (most recent call last):
  File "packet_sniffer.py", line 153, in <module>
    sniff(cli_args)
  File "packet_sniffer.py", line 138, in sniff
    packet_sniffer.execute()
  File "packet_sniffer.py", line 44, in execute
    setattr(self, protocol.lower(), protocol)
AttributeError: 'Ethernet' object has no attribute 'lower'

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.