Coder Social home page Coder Social logo

aleksandr-oliferuk / pcap2squid Goto Github PK

View Code? Open in Web Editor NEW
88.0 3.0 7.0 761 KB

Recieve raw network trafic dump in pcap-format and parse it to squid-proxy log. Then generate report for lightsquid and shows it in Web UI

Python 1.99% Dockerfile 0.99% Perl 67.39% HTML 29.63%

pcap2squid's Introduction

pcap-dump parser to squid-proxy log format

Description

Recieve raw network trafic dump in pcap-format and parse it to squid-proxy log. Then generate report for lightsquid and shows it in Web UI.

This implementation get traffic from mikrotik sniffer on udp port 37008 and parse it with trafr program. You could rebuild parser image without it and recieve trafic just with tcpdump.

With this tool you will get statistics, which sites and when watch users of your LAN. But it doesn't give you actual trafic amount.

Usage

Clone this project, complete .env with your values, then run it with docker-compose up -d

After that you should setup your cron on host machine with something like this:

*/5 * * * * docker exec pcap2squid_lightsquid_1 ./lightparser.pl today 2>> $PROJ_PATH/errors.log
59 23 * * * echo '' > $PROJ_PATH/log/access.log

Report will appear at http://$LIGHTSQUID_ADDR:$LIGHTSQUID_LISTEN_PORT

Environment example

# Path, where you download this project
PROJ_PATH="/srv/pcap2squid"

# Lightsquid vars
LIGHTSQUID_ADDR="192.168.1.1"
LIGHTSQUID_LISTEN_PORT=80

Some advices

The best way to use ramdisk for all processed files. E.g. of fstab:

tmpfs   $PROJ_PATH/dump   tmpfs   rw,size=500M    0       0
tmpfs   $PROJ_PATH/log   tmpfs   rw,size=5G        0       0

To change language of lightsquid report just change $lang parameter in lightsquid.cfg and rebuild lightsquid image.

If you are using phpIPAM, you could use my script to complete lightsquid report with real names of ip-addrs owners (realname.cfg).

Screenshots

Daily report Popular sites User report Visited sites

pcap2squid's People

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

Watchers

 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.