Skip to content

πŸͺ“ High-Speed Log Analysis & Forensics Tool - Part of NullSec Toolkit

License

Notifications You must be signed in to change notification settings

bad-antics/nullsec-logreaper

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

1 Commit
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸͺ“ LogReaper v1.0

High-Speed Log Analysis & Forensics Tool

Version Patterns Parsers License

Stars NullSec

Blazing-fast log analysis for incident response, threat hunting, and forensic investigations


πŸ’» Tech Stack

Core

C Linux POSIX

Log Sources

Syslog Journald Apache Nginx AWS

Output Formats

JSON CSV SIEM


🎯 Features

πŸ”¬ Analysis Modules (8)

Module Flag Description
Auth Analysis -a SSH brute force, sudo abuse
Web Forensics -w SQLi, XSS, path traversal
Network Events -n Firewall, connection anomalies
System Events -s User changes, service starts
Timeline -t Event correlation timeline
IOC Extract -i IPs, hashes, domains
Baseline Diff -b Compare against known-good
Live Stream -l Real-time log monitoring

πŸ“‹ Supported Logs (25+)

Category Sources
System syslog, auth.log, secure, messages
Journald systemd journal binary logs
Web Apache, Nginx, IIS, HAProxy
Apps PostgreSQL, MySQL, Redis, MongoDB
Cloud AWS CloudTrail, Azure Activity
Auth PAM, SSSD, Kerberos, LDAP
Firewall iptables, nftables, firewalld
Container Docker, Kubernetes audit

πŸš€ Quick Start

Installation

# Clone and build
git clone https://github.com/bad-antics/nullsec-logreaper
cd nullsec-logreaper
make

# Install system-wide (optional)
sudo make install

Basic Usage

# Analyze auth logs for brute force
./logreaper -a /var/log/auth.log

# Hunt for web attacks
./logreaper -w /var/log/nginx/access.log

# Full system analysis with timeline
./logreaper -t /var/log/

# Real-time monitoring
./logreaper -l /var/log/syslog

# Extract IOCs to JSON
./logreaper -i /var/log/ -o iocs.json

πŸ“Š Detection Patterns

Authentication Threats

Pattern Description Severity
AUTH_BRUTE_SSH SSH brute force attempts πŸ”΄ High
AUTH_SUDO_ABUSE Unusual sudo usage 🟑 Medium
AUTH_SU_ROOT Privilege escalation via su πŸ”΄ High
AUTH_FAIL_BURST Rapid auth failures πŸ”΄ High
AUTH_NEW_USER New user created 🟑 Medium
AUTH_PASSWD_CHG Password changed 🟑 Medium

Web Attack Signatures

Pattern Description Severity
WEB_SQLI SQL injection attempts πŸ”΄ Critical
WEB_XSS Cross-site scripting πŸ”΄ High
WEB_LFI Local file inclusion πŸ”΄ Critical
WEB_RFI Remote file inclusion πŸ”΄ Critical
WEB_PATH_TRAV Path traversal (../) πŸ”΄ High
WEB_CMD_INJ Command injection πŸ”΄ Critical
WEB_SCANNER Automated scanner detected 🟑 Medium

System Anomalies

Pattern Description Severity
SYS_KERNEL_MOD Kernel module loaded 🟑 Medium
SYS_SELINUX_OFF SELinux disabled πŸ”΄ High
SYS_CRON_CHANGE Cron job modified 🟑 Medium
SYS_SERVICE_NEW New systemd service 🟑 Medium
SYS_MOUNT_EXEC Exec mount option 🟑 Medium

πŸ“ˆ Output Formats

JSON Report

{
  "scan_id": "lr-20250127-143022",
  "total_events": 15847,
  "threats_found": 23,
  "timeline": [...],
  "iocs": {
    "ips": ["192.168.1.100", "10.0.0.5"],
    "domains": ["evil.example.com"],
    "hashes": []
  },
  "findings": [...]
}

Terminal Output

╔══════════════════════════════════════════════════════════════╗
β•‘                    πŸͺ“ LogReaper v1.0                         β•‘
╠══════════════════════════════════════════════════════════════╣
β•‘  Target: /var/log/auth.log                                   β•‘
β•‘  Lines:  15,847                                              β•‘
β•‘  Period: 2025-01-20 β†’ 2025-01-27                            β•‘
╠══════════════════════════════════════════════════════════════╣
β•‘  πŸ”΄ CRITICAL  β”‚ 3                                            β•‘
β•‘  🟠 HIGH      β”‚ 12                                           β•‘
β•‘  🟑 MEDIUM    β”‚ 8                                            β•‘
β•‘  🟒 LOW       β”‚ 0                                            β•‘
β•šβ•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•

[!] AUTH_BRUTE_SSH detected
    Time:   2025-01-26 14:32:15
    Source: 192.168.1.100
    Count:  847 attempts in 5 minutes
    User:   root, admin, ubuntu

πŸ”§ Advanced Usage

Timeline Correlation

# Build attack timeline from multiple sources
./logreaper -t \
    /var/log/auth.log \
    /var/log/nginx/access.log \
    /var/log/syslog \
    -o timeline.json

IOC Extraction for SIEM

# Extract IOCs in Splunk-compatible format
./logreaper -i /var/log/ --format splunk > iocs.txt

# Extract for ELK Stack
./logreaper -i /var/log/ --format elastic | curl -X POST ...

Integration with RKHunt

# Run LogReaper β†’ pipe suspicious IPs to firewall
./logreaper -a /var/log/auth.log --extract-ips | \
    xargs -I {} iptables -A INPUT -s {} -j DROP

# Correlate with RKHunt findings
./logreaper -s /var/log/syslog | grep -f <(rkhunt --list-iocs)

πŸ› οΈ Build Options

# Standard build
make

# Build with debug symbols
make DEBUG=1

# Build with PCRE2 regex (faster patterns)
make PCRE2=1

# Build static binary
make STATIC=1

# Cross-compile for ARM64
make ARCH=aarch64

πŸ“ Project Structure

nullsec-logreaper/
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ main.c           # Entry point, arg parsing
β”‚   β”œβ”€β”€ parser.c         # Log format parsers
β”‚   β”œβ”€β”€ analyzer.c       # Pattern matching engine
β”‚   β”œβ”€β”€ timeline.c       # Event correlation
β”‚   β”œβ”€β”€ output.c         # Report generation
β”‚   β”œβ”€β”€ patterns.h       # Detection signatures
β”‚   └── utils.c          # Helper functions
β”œβ”€β”€ patterns/
β”‚   β”œβ”€β”€ auth.rules       # Authentication patterns
β”‚   β”œβ”€β”€ web.rules        # Web attack signatures
β”‚   └── system.rules     # System anomaly patterns
β”œβ”€β”€ Makefile
β”œβ”€β”€ LICENSE
└── README.md

πŸ”— NullSec Toolkit Integration

LogReaper works seamlessly with other NullSec tools:

Tool Integration
RKHunt Correlate rootkit indicators with log anomalies
Specter Feed extracted IOCs for threat intelligence
NetSniff Combine network + log analysis
MemScan Timeline memory artifacts with system logs

πŸ“œ License

MIT License - See LICENSE for details.


Part of the NullSec Toolkit

"From logs to leads."

About

πŸͺ“ High-Speed Log Analysis & Forensics Tool - Part of NullSec Toolkit

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published