SkillAgentSearch skills...

Pcap2squid

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

Install / Use

/learn @aleksandr-oliferuk/Pcap2squid
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

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

View on GitHub
GitHub Stars89
CategoryDevelopment
Updated2d ago
Forks7

Languages

Perl

Security Score

80/100

Audited on Apr 7, 2026

No findings