Git Product home page Git Product logo

pci's Introduction

Packet Communication Investigator

https://github.com/michoo/pci

Simply import network traffic into a graphtool to analyse packet interactions between machines and network on a graph approach to help investigate what's happening on your network. 3 modes are available:

  • pcap packet analysis: if you already have pcap you can upload to a graph database
  • live capture: you can live capture (no history backed up)
  • live ring capture*: same has live capture but keep a ring of pcap file on db/pcap directory.

It will find server name and geolocalize it based on ip (v4)

From neo4j browser available at localhost:7474 Alt text

From www/index.html (auto update every minutes for a 3d visualization) Alt text

nb* in the live ring capture you'll need to modify pyshark project in liveCapture.py line 68

#params += ['-r', '-']

Prerequesites

You'll need:

  • python3
  • docker installed or already a Neo4j installed
  • wireshark and tshark
  • pipenv (like it but you can modify this project to do in other ways)

nb1: Docker

to help running docker I made some scripts for newbies:

  • build.sh to build the image of Neo4j (with the best password ever)
  • start.sh to start a container

nb2: Tshark / Wireshark

If you are getting a ‘Permission Denied’ error when running wireshark or tshark as local user, you can add the user account to wireshark to avoid running pci.py with sudo

// permit all user to analyse traffic (by being part of wireshark's group)
$ sudo dpkg-reconfigure wireshark-common 
// add your local user to analyse traffic
$ sudo usermod -a -G wireshark $USER
// logout and login to update your account
$ gnome-session-quit --logout --no-prompt

How to use it?

1.setup.sh

A script to download geoip database in the right spot

2.start neo4j server (docker)

in neo4j-docker ./build.sh and then ./start.sh

3.run pci.py script

then you can run ./pci.py (pipenv shell!)

  • live Capture: i= interface to monitor (for example, wlp3s0)
./pci.py -i wlp3s0
  • live ring Capture i= interface to monitor (for example, wlp3s0), r= ring option
./pci.py -i wlp3s0 -r
  • pcap analysis: f=path to the file (for example, db/pcap/pci_00001_20191029095803.pcapng )
./pci.py -f db/pcap/pci_00001_20191029095803.pcapng

after you'll see nodes appearing into neo4j browser (http://localhost:7474)

clean.sh

Just a script to clean directories before commit

Faq:

  • Q:What the login/password for neo4j browser (http://localhost:7474)

  • A:it's set to neo4j/password1

  • Q:I don't know neo4j do you have some request examples

  • A:Yes look at the neo4j-script directory (delete all nodes, show last 10min). You can also import manually those file into neo4j (you can find in the ui left menu)

  • Q:In the graph, I don't have Ip shown in the bubbles.

  • A:It's normal. The first time you have to define colours, labels,... Sorry can't do automatically. After that setting it will be ok. Just select the type you want to tune (for ex: machine_local) and select at the bottom of the frame the colour, label, ... It works the same way for the links

Tested

  • debian10

pci's People

Contributors

michoo 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

Watchers

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