]> _ Git - remote-logging.git/summary
 
descriptionRemote logging script
last changeSun, 2 Jun 2024 17:55:26 +0000 (12:55 -0500)
readme

Minimum Viable Remote Logging

This project is an attempt to make a logging solution for simple use cases.

This script can do the following:

The primary reason for creating this is to monitor a machine for activity from naive malware or attackers, although it is better suited for cases without active interference.

All needed binaries are static so dependencies don't need to be installed on the remote system.

Server vs. client

The server is the central collection point where logs and files are sent. The client is run on the machine that's monitored. It connects to the server to transfer logs and files.

Building

Use the included build script to retrieve and build dependencies:

./build.sh

Then edit build/_output/client/client.pl and change $server_ip and $server_port to match the ip and port of the server.

Deploying

Server

To deploy on the server, you'll need to transfer the build/_output/server directory to the remote system, then cd to that directory and run:

sh start_server.sh

By default the server uses the ports 46515-46550. This can be changed in start_server.sh

Client

To deploy on the client, you'll need to transfer the build/_output/client directory to the remote system, then cd to that directory and run:

perl client.pl

Monitoring

Once the server is running and a client has connected, files will appear on the server in srv/clients/ with the following naming scheme:

Logs can be monitored as they come in using lnav:

./lnav -r srv/clients
shortlog
2024-06-02 mivirlserver,client: Implement ssl/tls encryption master
2024-06-02 mivirlclient: don't transfer rotated and/or empty log files
2024-06-02 mivirlclient: add more files to log by default; include more...
2024-03-03 mivirlserver: use printf for writing input to file (for logs...
2024-03-03 mivirlserver: Limit ports used to 46515-46550
2024-03-03 mivirlserver: Add retries with random backoff for file uploads
2024-02-07 mivirlserver: Remove .log and .cmdlog suffixes
2024-02-07 mivirlbuild: Check for downloaded dependencies before fetching
2024-02-07 mivirlbuild: Replace static perl with actually portable perl
2024-02-07 mivirlclient: Don't monitor non-text logs
2024-02-07 mivirlclient: Remove packet capture
2024-02-07 mivirlclient: Add comments explaining behavior
2024-02-07 mivirlclient: Use global variables for configuration
2024-02-05 mivirlremove word
2024-01-26 mivirlAdd suffix to duplicate files; add comments
2024-01-26 mivirlAdd more default monitored files
...
heads
7 months ago master