[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7AA29GMV80W8GWKB9TK0WCW":3,"skill-same:01M7AA29GMV80W8GWKB9TK0WCW":105},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":16,"sourceHtmlUrl":17,"categories":18,"keywords":19,"publishedAt":20,"linkOnly":21,"markdownContent":22,"markdownBody":23,"frontMatter":24,"refName":50,"commitSha":51,"skillDirectory":52,"forksCount":14,"repositoryHtmlUrl":53,"repositoryHomepageUrl":6,"ownerHtmlUrl":54,"ownerBlogUrl":6,"ownerDescription":55,"updatedAt":56,"install":57,"resources":70},"01M7AA29GMV80W8GWKB9TK0WCW","performing-linux-log-forensics-investigation",null,"Perform forensic investigation of Linux system logs including syslog, auth.log, systemd journal (via journalctl), kern.log, auditd, and application logs to reconstruct user sessions, identify unauthorized access and privilege escalation, trace lateral movement, and establish event timelines. Use when investigating a suspected compromise of a Linux system and needing to analyze SSH, sudo, cron, or kernel-level activity from plain-text or systemd journal logs.","NeelakshSaxena\u002FVayu","NeelakshSaxena","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F87892838?v=4","01M7A3B9YFS6F6N9DD1787DT86","Neelaksh Saxena","01M7A3B9ZKBT09MNMPX2XN69BY",0,"Apache-2.0","https:\u002F\u002Fgithub.com\u002FNeelakshSaxena\u002FVayu\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fperforming-linux-log-forensics-investigation\u002FLICENSE","https:\u002F\u002Fgithub.com\u002FNeelakshSaxena\u002FVayu\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fperforming-linux-log-forensics-investigation\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: performing-linux-log-forensics-investigation\ndescription: Perform forensic investigation of Linux system logs including syslog,\n  auth.log, systemd journal (via journalctl), kern.log, auditd, and application logs\n  to reconstruct user sessions, identify unauthorized access and privilege escalation,\n  trace lateral movement, and establish event timelines. Use when investigating a\n  suspected compromise of a Linux system and needing to analyze SSH, sudo, cron, or\n  kernel-level activity from plain-text or systemd journal logs.\ndomain: cybersecurity\nsubdomain: digital-forensics\ntags:\n- linux-forensics\n- syslog\n- auth-log\n- systemd-journal\n- journalctl\n- linux-logs\n- ssh-forensics\n- cron\n- audit-log\n- log-analysis\nversion: '1.0'\nauthor: mahipal\nlicense: Apache-2.0\nnist_csf:\n- RS.AN-03\n- DE.AE-02\n- RS.MA-01\nmitre_attack:\n- T1005\n- T1074\n- T1119\n- T1070\n- T1059\n---\n\n# Performing Linux Log Forensics Investigation\n\n## Overview\n\nLinux systems maintain extensive logs that serve as primary evidence sources in forensic investigations. Unlike Windows Event Logs, Linux logs are typically plain-text files stored in \u002Fvar\u002Flog\u002F and binary journal files managed by systemd-journald. Key forensic logs include auth.log (authentication events, sudo usage, SSH sessions), syslog (system-wide messages), kern.log (kernel events), and application-specific logs. The Linux Audit framework (auditd) provides detailed security event logging comparable to Windows Security Event Logs. Forensic analysis of these logs enables investigators to reconstruct user sessions, identify unauthorized access, detect privilege escalation, trace lateral movement, and establish comprehensive event timelines.\n\n\n## When to Use\n\n- When conducting security assessments that involve performing linux log forensics investigation\n- When following incident response procedures for related security events\n- When performing scheduled security testing or auditing activities\n- When validating security controls through hands-on testing\n\n## Prerequisites\n\n- Familiarity with digital forensics concepts and tools\n- Access to a test or lab environment for safe execution\n- Python 3.8+ with required dependencies installed\n- Appropriate authorization for any testing activities\n\n## Key Log Files and Locations\n\n| Log File | Path | Contents |\n|----------|------|----------|\n| auth.log \u002F secure | \u002Fvar\u002Flog\u002Fauth.log (Debian) or \u002Fvar\u002Flog\u002Fsecure (RHEL) | Authentication, sudo, SSH, PAM |\n| syslog \u002F messages | \u002Fvar\u002Flog\u002Fsyslog (Debian) or \u002Fvar\u002Flog\u002Fmessages (RHEL) | General system messages |\n| kern.log | \u002Fvar\u002Flog\u002Fkern.log | Kernel messages, USB events, driver loads |\n| lastlog | \u002Fvar\u002Flog\u002Flastlog | Last login per user (binary) |\n| wtmp | \u002Fvar\u002Flog\u002Fwtmp | Login\u002Flogout records (binary, read with `last`) |\n| btmp | \u002Fvar\u002Flog\u002Fbtmp | Failed login attempts (binary, read with `lastb`) |\n| faillog | \u002Fvar\u002Flog\u002Ffaillog | Failed login counter (binary) |\n| cron.log | \u002Fvar\u002Flog\u002Fcron or \u002Fvar\u002Flog\u002Fsyslog | Scheduled task execution |\n| audit.log | \u002Fvar\u002Flog\u002Faudit\u002Faudit.log | Linux Audit Framework events |\n| journal | \u002Fvar\u002Flog\u002Fjournal\u002F or \u002Frun\u002Flog\u002Fjournal\u002F | systemd binary journal |\n| dpkg.log | \u002Fvar\u002Flog\u002Fdpkg.log | Package installation\u002Fremoval (Debian) |\n| yum.log | \u002Fvar\u002Flog\u002Fyum.log | Package installation\u002Fremoval (RHEL) |\n\n## Analysis Techniques\n\n### Authentication Log Analysis\n\n```bash\n# Find all successful SSH logins\ngrep \"Accepted\" \u002Fvar\u002Flog\u002Fauth.log\n\n# Find failed SSH login attempts\ngrep \"Failed password\" \u002Fvar\u002Flog\u002Fauth.log\n\n# Extract unique source IPs from failed logins\ngrep \"Failed password\" \u002Fvar\u002Flog\u002Fauth.log | grep -oP '\\d+\\.\\d+\\.\\d+\\.\\d+' | sort -u\n\n# Find sudo command execution\ngrep \"sudo:\" \u002Fvar\u002Flog\u002Fauth.log | grep \"COMMAND\"\n\n# Detect brute force patterns (>10 failures from same IP)\ngrep \"Failed password\" \u002Fvar\u002Flog\u002Fauth.log | awk '{print $(NF-3)}' | sort | uniq -c | sort -rn | head -20\n\n# Find account creation events\ngrep \"useradd\\|adduser\" \u002Fvar\u002Flog\u002Fauth.log\n\n# Detect SSH key authentication\ngrep \"Accepted publickey\" \u002Fvar\u002Flog\u002Fauth.log\n```\n\n### Systemd Journal Analysis\n\n```bash\n# Export journal in JSON format for forensic processing\njournalctl --output=json --no-pager > journal_export.json\n\n# Filter by time range\njournalctl --since \"2025-02-01\" --until \"2025-02-15\" --output=json > timerange.json\n\n# Filter by unit\u002Fservice\njournalctl -u sshd --output=json > sshd_journal.json\n\n# Show kernel messages (USB events, module loads)\njournalctl -k --output=json > kernel_journal.json\n\n# Filter by priority (0=emerg to 7=debug)\njournalctl -p err --output=json > errors.json\n\n# Boot-specific logs\njournalctl -b 0 --output=json > current_boot.json\njournalctl --list-boots  # List all recorded boot sessions\n```\n\n### Linux Audit Framework Analysis\n\n```bash\n# Search audit log for specific event types\nausearch -m USER_AUTH --start today\n\n# Search for file access events\nausearch -f \u002Fetc\u002Fshadow\n\n# Search for process execution\nausearch -m EXECVE --start \"02\u002F01\u002F2025\" --end \"02\u002F28\u002F2025\"\n\n# Generate report of login events\naureport --login --start \"02\u002F01\u002F2025\"\n\n# Generate summary of failed authentications\naureport --auth --failed\n\n# Search for specific user activity\nausearch -ua 1001  # By UID\nausearch -ua username  # By username\n```\n\n### Cron Job Investigation\n\n```bash\n# Check system-wide crontab\ncat \u002Fetc\u002Fcrontab\n\n# Check user crontabs\nls -la \u002Fvar\u002Fspool\u002Fcron\u002Fcrontabs\u002F\n\n# Review cron execution logs\ngrep \"CRON\" \u002Fvar\u002Flog\u002Fsyslog\n\n# Check for at\u002Fbatch jobs\nls -la \u002Fvar\u002Fspool\u002Fat\u002F\natq\n```\n\n## Python Forensic Log Parser\n\n```python\nimport re\nimport json\nimport sys\nimport os\nfrom datetime import datetime\nfrom collections import defaultdict\n\n\nclass LinuxLogForensicAnalyzer:\n    \"\"\"Analyze Linux system logs for forensic investigation.\"\"\"\n\n    def __init__(self, log_dir: str, output_dir: str):\n        self.log_dir = log_dir\n        self.output_dir = output_dir\n        os.makedirs(output_dir, exist_ok=True)\n\n    def parse_auth_log(self, auth_log_path: str) -> dict:\n        \"\"\"Parse auth.log for authentication events.\"\"\"\n        events = {\n            \"successful_logins\": [],\n            \"failed_logins\": [],\n            \"sudo_commands\": [],\n            \"account_changes\": [],\n            \"ssh_sessions\": []\n        }\n\n        ssh_accepted = re.compile(\n            r'(\\w+\\s+\\d+\\s+[\\d:]+)\\s+(\\S+)\\s+sshd\\[\\d+\\]:\\s+Accepted\\s+(\\S+)\\s+for\\s+(\\S+)\\s+from\\s+([\\d.]+)'\n        )\n        ssh_failed = re.compile(\n            r'(\\w+\\s+\\d+\\s+[\\d:]+)\\s+(\\S+)\\s+sshd\\[\\d+\\]:\\s+Failed\\s+password\\s+for\\s+(\\S*)\\s+from\\s+([\\d.]+)'\n        )\n        sudo_cmd = re.compile(\n            r'(\\w+\\s+\\d+\\s+[\\d:]+)\\s+(\\S+)\\s+sudo:\\s+(\\S+)\\s+:.*COMMAND=(.*)'\n        )\n        useradd = re.compile(\n            r'(\\w+\\s+\\d+\\s+[\\d:]+)\\s+(\\S+)\\s+useradd\\[\\d+\\]:\\s+new user: name=(\\S+)'\n        )\n\n        with open(auth_log_path, \"r\", errors=\"replace\") as f:\n            for line in f:\n                m = ssh_accepted.search(line)\n                if m:\n                    events[\"successful_logins\"].append({\n                        \"timestamp\": m.group(1), \"host\": m.group(2),\n                        \"method\": m.group(3), \"user\": m.group(4), \"source_ip\": m.group(5)\n                    })\n                    continue\n\n                m = ssh_failed.search(line)\n                if m:\n                    events[\"failed_logins\"].append({\n                        \"timestamp\": m.group(1), \"host\": m.group(2),\n                        \"user\": m.group(3), \"source_ip\": m.group(4)\n                    })\n                    continue\n\n                m = sudo_cmd.search(line)\n                if m:\n                    events[\"sudo_commands\"].append({\n                        \"timestamp\": m.group(1), \"host\": m.group(2),\n                        \"user\": m.group(3), \"command\": m.group(4).strip()\n                    })\n                    continue\n\n                m = useradd.search(line)\n                if m:\n                    events[\"account_changes\"].append({\n                        \"timestamp\": m.group(1), \"host\": m.group(2),\n                        \"new_user\": m.group(3)\n                    })\n\n        return events\n\n    def detect_brute_force(self, auth_events: dict, threshold: int = 10) -> list:\n        \"\"\"Detect brute force attempts from auth log data.\"\"\"\n        ip_failures = defaultdict(int)\n        for event in auth_events.get(\"failed_logins\", []):\n            ip_failures[event[\"source_ip\"]] += 1\n\n        brute_force = []\n        for ip, count in ip_failures.items():\n            if count >= threshold:\n                brute_force.append({\"source_ip\": ip, \"failed_attempts\": count})\n\n        return sorted(brute_force, key=lambda x: x[\"failed_attempts\"], reverse=True)\n\n    def generate_report(self, auth_log_path: str) -> str:\n        \"\"\"Generate comprehensive forensic analysis report.\"\"\"\n        auth_events = self.parse_auth_log(auth_log_path)\n        brute_force = self.detect_brute_force(auth_events)\n\n        report = {\n            \"analysis_timestamp\": datetime.now().isoformat(),\n            \"log_source\": auth_log_path,\n            \"summary\": {\n                \"successful_logins\": len(auth_events[\"successful_logins\"]),\n                \"failed_logins\": len(auth_events[\"failed_logins\"]),\n                \"sudo_commands\": len(auth_events[\"sudo_commands\"]),\n                \"account_changes\": len(auth_events[\"account_changes\"]),\n                \"brute_force_sources\": len(brute_force)\n            },\n            \"brute_force_detected\": brute_force,\n            \"auth_events\": auth_events\n        }\n\n        report_path = os.path.join(self.output_dir, \"linux_log_forensics.json\")\n        with open(report_path, \"w\") as f:\n            json.dump(report, f, indent=2)\n\n        print(f\"[*] Successful logins: {report['summary']['successful_logins']}\")\n        print(f\"[*] Failed logins: {report['summary']['failed_logins']}\")\n        print(f\"[*] Sudo commands: {report['summary']['sudo_commands']}\")\n        print(f\"[*] Brute force sources: {report['summary']['brute_force_sources']}\")\n        return report_path\n\n\ndef main():\n    if len(sys.argv) \u003C 3:\n        print(\"Usage: python process.py \u003Cauth_log_path> \u003Coutput_dir>\")\n        sys.exit(1)\n    analyzer = LinuxLogForensicAnalyzer(os.path.dirname(sys.argv[1]), sys.argv[2])\n    analyzer.generate_report(sys.argv[1])\n\n\nif __name__ == \"__main__\":\n    main()\n```\n\n## References\n\n- Linux Forensics In Depth: https:\u002F\u002Famr-git-dot.github.io\u002Fforensic%20investigation\u002FLinux_Forensics\u002F\n- SANS Practical Linux Forensics: https:\u002F\u002Fnostarch.com\u002Flinuxforensics\n- HackTricks Linux Forensics: https:\u002F\u002Fbook.hacktricks.xyz\u002Fgeneric-methodologies-and-resources\u002Fbasic-forensic-methodology\u002Flinux-forensics\n- Log Sources for Digital Forensics: https:\u002F\u002Fletsdefend.io\u002Fblog\u002Flog-sources-for-digital-forensics-windows-and-linux\n","# Performing Linux Log Forensics Investigation\n\n## Overview\n\nLinux systems maintain extensive logs that serve as primary evidence sources in forensic investigations. Unlike Windows Event Logs, Linux logs are typically plain-text files stored in \u002Fvar\u002Flog\u002F and binary journal files managed by systemd-journald. Key forensic logs include auth.log (authentication events, sudo usage, SSH sessions), syslog (system-wide messages), kern.log (kernel events), and application-specific logs. The Linux Audit framework (auditd) provides detailed security event logging comparable to Windows Security Event Logs. Forensic analysis of these logs enables investigators to reconstruct user sessions, identify unauthorized access, detect privilege escalation, trace lateral movement, and establish comprehensive event timelines.\n\n\n## When to Use\n\n- When conducting security assessments that involve performing linux log forensics investigation\n- When following incident response procedures for related security events\n- When performing scheduled security testing or auditing activities\n- When validating security controls through hands-on testing\n\n## Prerequisites\n\n- Familiarity with digital forensics concepts and tools\n- Access to a test or lab environment for safe execution\n- Python 3.8+ with required dependencies installed\n- Appropriate authorization for any testing activities\n\n## Key Log Files and Locations\n\n| Log File | Path | Contents |\n|----------|------|----------|\n| auth.log \u002F secure | \u002Fvar\u002Flog\u002Fauth.log (Debian) or \u002Fvar\u002Flog\u002Fsecure (RHEL) | Authentication, sudo, SSH, PAM |\n| syslog \u002F messages | \u002Fvar\u002Flog\u002Fsyslog (Debian) or \u002Fvar\u002Flog\u002Fmessages (RHEL) | General system messages |\n| kern.log | \u002Fvar\u002Flog\u002Fkern.log | Kernel messages, USB events, driver loads |\n| lastlog | \u002Fvar\u002Flog\u002Flastlog | Last login per user (binary) |\n| wtmp | \u002Fvar\u002Flog\u002Fwtmp | Login\u002Flogout records (binary, read with `last`) |\n| btmp | \u002Fvar\u002Flog\u002Fbtmp | Failed login attempts (binary, read with `lastb`) |\n| faillog | \u002Fvar\u002Flog\u002Ffaillog | Failed login counter (binary) |\n| cron.log | \u002Fvar\u002Flog\u002Fcron or \u002Fvar\u002Flog\u002Fsyslog | Scheduled task execution |\n| audit.log | \u002Fvar\u002Flog\u002Faudit\u002Faudit.log | Linux Audit Framework events |\n| journal | \u002Fvar\u002Flog\u002Fjournal\u002F or \u002Frun\u002Flog\u002Fjournal\u002F | systemd binary journal |\n| dpkg.log | \u002Fvar\u002Flog\u002Fdpkg.log | Package installation\u002Fremoval (Debian) |\n| yum.log | \u002Fvar\u002Flog\u002Fyum.log | Package installation\u002Fremoval (RHEL) |\n\n## Analysis Techniques\n\n### Authentication Log Analysis\n\n```bash\n# Find all successful SSH logins\ngrep \"Accepted\" \u002Fvar\u002Flog\u002Fauth.log\n\n# Find failed SSH login attempts\ngrep \"Failed password\" \u002Fvar\u002Flog\u002Fauth.log\n\n# Extract unique source IPs from failed logins\ngrep \"Failed password\" \u002Fvar\u002Flog\u002Fauth.log | grep -oP '\\d+\\.\\d+\\.\\d+\\.\\d+' | sort -u\n\n# Find sudo command execution\ngrep \"sudo:\" \u002Fvar\u002Flog\u002Fauth.log | grep \"COMMAND\"\n\n# Detect brute force patterns (>10 failures from same IP)\ngrep \"Failed password\" \u002Fvar\u002Flog\u002Fauth.log | awk '{print $(NF-3)}' | sort | uniq -c | sort -rn | head -20\n\n# Find account creation events\ngrep \"useradd\\|adduser\" \u002Fvar\u002Flog\u002Fauth.log\n\n# Detect SSH key authentication\ngrep \"Accepted publickey\" \u002Fvar\u002Flog\u002Fauth.log\n```\n\n### Systemd Journal Analysis\n\n```bash\n# Export journal in JSON format for forensic processing\njournalctl --output=json --no-pager > journal_export.json\n\n# Filter by time range\njournalctl --since \"2025-02-01\" --until \"2025-02-15\" --output=json > timerange.json\n\n# Filter by unit\u002Fservice\njournalctl -u sshd --output=json > sshd_journal.json\n\n# Show kernel messages (USB events, module loads)\njournalctl -k --output=json > kernel_journal.json\n\n# Filter by priority (0=emerg to 7=debug)\njournalctl -p err --output=json > errors.json\n\n# Boot-specific logs\njournalctl -b 0 --output=json > current_boot.json\njournalctl --list-boots  # List all recorded boot sessions\n```\n\n### Linux Audit Framework Analysis\n\n```bash\n# Search audit log for specific event types\nausearch -m USER_AUTH --start today\n\n# Search for file access events\nausearch -f \u002Fetc\u002Fshadow\n\n# Search for process execution\nausearch -m EXECVE --start \"02\u002F01\u002F2025\" --end \"02\u002F28\u002F2025\"\n\n# Generate report of login events\naureport --login --start \"02\u002F01\u002F2025\"\n\n# Generate summary of failed authentications\naureport --auth --failed\n\n# Search for specific user activity\nausearch -ua 1001  # By UID\nausearch -ua username  # By username\n```\n\n### Cron Job Investigation\n\n```bash\n# Check system-wide crontab\ncat \u002Fetc\u002Fcrontab\n\n# Check user crontabs\nls -la \u002Fvar\u002Fspool\u002Fcron\u002Fcrontabs\u002F\n\n# Review cron execution logs\ngrep \"CRON\" \u002Fvar\u002Flog\u002Fsyslog\n\n# Check for at\u002Fbatch jobs\nls -la \u002Fvar\u002Fspool\u002Fat\u002F\natq\n```\n\n## Python Forensic Log Parser\n\n```python\nimport re\nimport json\nimport sys\nimport os\nfrom datetime import datetime\nfrom collections import defaultdict\n\n\nclass LinuxLogForensicAnalyzer:\n    \"\"\"Analyze Linux system logs for forensic investigation.\"\"\"\n\n    def __init__(self, log_dir: str, output_dir: str):\n        self.log_dir = log_dir\n        self.output_dir = output_dir\n        os.makedirs(output_dir, exist_ok=True)\n\n    def parse_auth_log(self, auth_log_path: str) -> dict:\n        \"\"\"Parse auth.log for authentication events.\"\"\"\n        events = {\n            \"successful_logins\": [],\n            \"failed_logins\": [],\n            \"sudo_commands\": [],\n            \"account_changes\": [],\n            \"ssh_sessions\": []\n        }\n\n        ssh_accepted = re.compile(\n            r'(\\w+\\s+\\d+\\s+[\\d:]+)\\s+(\\S+)\\s+sshd\\[\\d+\\]:\\s+Accepted\\s+(\\S+)\\s+for\\s+(\\S+)\\s+from\\s+([\\d.]+)'\n        )\n        ssh_failed = re.compile(\n            r'(\\w+\\s+\\d+\\s+[\\d:]+)\\s+(\\S+)\\s+sshd\\[\\d+\\]:\\s+Failed\\s+password\\s+for\\s+(\\S*)\\s+from\\s+([\\d.]+)'\n        )\n        sudo_cmd = re.compile(\n            r'(\\w+\\s+\\d+\\s+[\\d:]+)\\s+(\\S+)\\s+sudo:\\s+(\\S+)\\s+:.*COMMAND=(.*)'\n        )\n        useradd = re.compile(\n            r'(\\w+\\s+\\d+\\s+[\\d:]+)\\s+(\\S+)\\s+useradd\\[\\d+\\]:\\s+new user: name=(\\S+)'\n        )\n\n        with open(auth_log_path, \"r\", errors=\"replace\") as f:\n            for line in f:\n                m = ssh_accepted.search(line)\n                if m:\n                    events[\"successful_logins\"].append({\n                        \"timestamp\": m.group(1), \"host\": m.group(2),\n                        \"method\": m.group(3), \"user\": m.group(4), \"source_ip\": m.group(5)\n                    })\n                    continue\n\n                m = ssh_failed.search(line)\n                if m:\n                    events[\"failed_logins\"].append({\n                        \"timestamp\": m.group(1), \"host\": m.group(2),\n                        \"user\": m.group(3), \"source_ip\": m.group(4)\n                    })\n                    continue\n\n                m = sudo_cmd.search(line)\n                if m:\n                    events[\"sudo_commands\"].append({\n                        \"timestamp\": m.group(1), \"host\": m.group(2),\n                        \"user\": m.group(3), \"command\": m.group(4).strip()\n                    })\n                    continue\n\n                m = useradd.search(line)\n                if m:\n                    events[\"account_changes\"].append({\n                        \"timestamp\": m.group(1), \"host\": m.group(2),\n                        \"new_user\": m.group(3)\n                    })\n\n        return events\n\n    def detect_brute_force(self, auth_events: dict, threshold: int = 10) -> list:\n        \"\"\"Detect brute force attempts from auth log data.\"\"\"\n        ip_failures = defaultdict(int)\n        for event in auth_events.get(\"failed_logins\", []):\n            ip_failures[event[\"source_ip\"]] += 1\n\n        brute_force = []\n        for ip, count in ip_failures.items():\n            if count >= threshold:\n                brute_force.append({\"source_ip\": ip, \"failed_attempts\": count})\n\n        return sorted(brute_force, key=lambda x: x[\"failed_attempts\"], reverse=True)\n\n    def generate_report(self, auth_log_path: str) -> str:\n        \"\"\"Generate comprehensive forensic analysis report.\"\"\"\n        auth_events = self.parse_auth_log(auth_log_path)\n        brute_force = self.detect_brute_force(auth_events)\n\n        report = {\n            \"analysis_timestamp\": datetime.now().isoformat(),\n            \"log_source\": auth_log_path,\n            \"summary\": {\n                \"successful_logins\": len(auth_events[\"successful_logins\"]),\n                \"failed_logins\": len(auth_events[\"failed_logins\"]),\n                \"sudo_commands\": len(auth_events[\"sudo_commands\"]),\n                \"account_changes\": len(auth_events[\"account_changes\"]),\n                \"brute_force_sources\": len(brute_force)\n            },\n            \"brute_force_detected\": brute_force,\n            \"auth_events\": auth_events\n        }\n\n        report_path = os.path.join(self.output_dir, \"linux_log_forensics.json\")\n        with open(report_path, \"w\") as f:\n            json.dump(report, f, indent=2)\n\n        print(f\"[*] Successful logins: {report['summary']['successful_logins']}\")\n        print(f\"[*] Failed logins: {report['summary']['failed_logins']}\")\n        print(f\"[*] Sudo commands: {report['summary']['sudo_commands']}\")\n        print(f\"[*] Brute force sources: {report['summary']['brute_force_sources']}\")\n        return report_path\n\n\ndef main():\n    if len(sys.argv) \u003C 3:\n        print(\"Usage: python process.py \u003Cauth_log_path> \u003Coutput_dir>\")\n        sys.exit(1)\n    analyzer = LinuxLogForensicAnalyzer(os.path.dirname(sys.argv[1]), sys.argv[2])\n    analyzer.generate_report(sys.argv[1])\n\n\nif __name__ == \"__main__\":\n    main()\n```\n\n## References\n\n- Linux Forensics In Depth: https:\u002F\u002Famr-git-dot.github.io\u002Fforensic%20investigation\u002FLinux_Forensics\u002F\n- SANS Practical Linux Forensics: https:\u002F\u002Fnostarch.com\u002Flinuxforensics\n- HackTricks Linux Forensics: https:\u002F\u002Fbook.hacktricks.xyz\u002Fgeneric-methodologies-and-resources\u002Fbasic-forensic-methodology\u002Flinux-forensics\n- Log Sources for Digital Forensics: https:\u002F\u002Fletsdefend.io\u002Fblog\u002Flog-sources-for-digital-forensics-windows-and-linux\n",{"name":5,"tags":25,"author":36,"domain":37,"license":15,"version":38,"nist_csf":39,"subdomain":43,"description":7,"mitre_attack":44},[26,27,28,29,30,31,32,33,34,35],"linux-forensics","syslog","auth-log","systemd-journal","journalctl","linux-logs","ssh-forensics","cron","audit-log","log-analysis","mahipal","cybersecurity","1.0",[40,41,42],"RS.AN-03","DE.AE-02","RS.MA-01","digital-forensics",[45,46,47,48,49],"T1005","T1074","T1119","T1070","T1059","main","7540bbccf0c1ded6156a467b02c95b61ad62413f",".agents\u002Fskills\u002Fperforming-linux-log-forensics-investigation","https:\u002F\u002Fgithub.com\u002FNeelakshSaxena\u002FVayu","https:\u002F\u002Fgithub.com\u002FNeelakshSaxena","Currently exploring the intersection of tech","2026-09-11 03:02:31",{"source":8,"skillName":5,"commands":58,"prompt":68,"zipAvailable":69},[59,62,65],{"tool":60,"command":61},"npx","npx skills add NeelakshSaxena\u002FVayu --skill performing-linux-log-forensics-investigation",{"tool":63,"command":64},"bunx","bunx skills add NeelakshSaxena\u002FVayu --skill performing-linux-log-forensics-investigation",{"tool":66,"command":67},"pnpm","pnpm dlx skills add NeelakshSaxena\u002FVayu --skill performing-linux-log-forensics-investigation","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FNeelakshSaxena\u002FVayu\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fperforming-linux-log-forensics-investigation\u002FSKILL.md",true,[71,77,81,87,91,95,101],{"path":72,"resourceType":73,"resourceTypeDesc":74,"sizeBytes":75,"sourceHtmlUrl":76},"assets\u002Ftemplate.md","ASSET","资产文件",399,"https:\u002F\u002Fgithub.com\u002FNeelakshSaxena\u002FVayu\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fperforming-linux-log-forensics-investigation\u002Fassets\u002Ftemplate.md",{"path":78,"resourceType":78,"resourceTypeDesc":79,"sizeBytes":80,"sourceHtmlUrl":16},"LICENSE","许可证",11255,{"path":82,"resourceType":83,"resourceTypeDesc":84,"sizeBytes":85,"sourceHtmlUrl":86},"references\u002Fapi-reference.md","REFERENCE","参考文档",1710,"https:\u002F\u002Fgithub.com\u002FNeelakshSaxena\u002FVayu\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fperforming-linux-log-forensics-investigation\u002Freferences\u002Fapi-reference.md",{"path":88,"resourceType":83,"resourceTypeDesc":84,"sizeBytes":89,"sourceHtmlUrl":90},"references\u002Fstandards.md",660,"https:\u002F\u002Fgithub.com\u002FNeelakshSaxena\u002FVayu\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fperforming-linux-log-forensics-investigation\u002Freferences\u002Fstandards.md",{"path":92,"resourceType":83,"resourceTypeDesc":84,"sizeBytes":93,"sourceHtmlUrl":94},"references\u002Fworkflows.md",634,"https:\u002F\u002Fgithub.com\u002FNeelakshSaxena\u002FVayu\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fperforming-linux-log-forensics-investigation\u002Freferences\u002Fworkflows.md",{"path":96,"resourceType":97,"resourceTypeDesc":98,"sizeBytes":99,"sourceHtmlUrl":100},"scripts\u002Fagent.py","SCRIPT","脚本",6838,"https:\u002F\u002Fgithub.com\u002FNeelakshSaxena\u002FVayu\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fperforming-linux-log-forensics-investigation\u002Fscripts\u002Fagent.py",{"path":102,"resourceType":97,"resourceTypeDesc":98,"sizeBytes":103,"sourceHtmlUrl":104},"scripts\u002Fprocess.py",2160,"https:\u002F\u002Fgithub.com\u002FNeelakshSaxena\u002FVayu\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fperforming-linux-log-forensics-investigation\u002Fscripts\u002Fprocess.py",[106,113,120,127,134,141],{"skillNo":107,"name":108,"nameZh":6,"description":109,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":110,"categories":111,"keywords":112,"publishedAt":20},"01M7ACCCVNCFKMA9X6D15X6G98","runpodctl","Runpod CLI for managing GPU\u002FCPU workloads from the terminal — pods, serverless endpoints, templates, network volumes, Hub deploys, models, SSH, and file transfer (send\u002Freceive). Use for terminal\u002FCI\u002Fscripting, Hub browse\u002Fdeploy, SSH setup, `doctor`, or when the Runpod MCP tools are not connected. For structured tool calls in an MCP-enabled session, prefer runpod-mcp.","https:\u002F\u002Fgithub.com\u002FNeelakshSaxena\u002FVayu\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Frunpodctl\u002FSKILL.md",[],[],{"skillNo":114,"name":115,"nameZh":6,"description":116,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":117,"categories":118,"keywords":119,"publishedAt":20},"01M7ACC63SRHEA5KMCHSMZK2TC","runpod","Start here for any Runpod task — running GPU\u002FCPU pods, deploying serverless endpoints, templates, network volumes, building images, or understanding how Runpod works. Routes to the right skill (runpod-mcp, runpodctl, flash, companion-clis, runpod-usage, runpod-templates, runpod-migrate) and indexes two dozen live-verified end-to-end examples (golden paths) — use it when the lane is unclear, and for any multi-step or provisioning task even when it is not.","https:\u002F\u002Fgithub.com\u002FNeelakshSaxena\u002FVayu\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Frunpod\u002FSKILL.md",[],[],{"skillNo":121,"name":122,"nameZh":6,"description":123,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":124,"categories":125,"keywords":126,"publishedAt":20},"01M7ACC0Q1C89N9BZBV91CTQTF","runpod-usage","How Runpod works and how to work it — pods vs serverless, GPU\u002FVRAM selection, storage, building a container, networking, plus the agentic pod development loop (provision → ssh-exec → set up → poll readiness) and on-pod install hygiene (uv\u002Fapt). Use to answer \"how does X work\", \"which GPU\", \"how do I build a container\", or \"how do I stand up a workload on a pod\". Guidance, not a tool — execute with runpodctl, runpod-mcp, or flash.","https:\u002F\u002Fgithub.com\u002FNeelakshSaxena\u002FVayu\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Frunpod-usage\u002FSKILL.md",[],[],{"skillNo":128,"name":129,"nameZh":6,"description":130,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":131,"categories":132,"keywords":133,"publishedAt":20},"01M7ACBRPE345GF5GM5B8P8RRC","runpod-templates","Runpod's official prebuilt pod templates (ComfyUI, PyTorch, and others): what each image ships, which ports and paths it uses, how to pick one, how to pin a version, and what is missing on first boot. Use when a task says \"run \u003CX> on a pod\" and an official template already covers it, instead of building an image — and when a user needs help with or wants to fix something about a Runpod template they are already running (won't boot, can't reach the UI, missing models, wrong CUDA line, broken ComfyUI workflow metadata on imported workflows): start here and route onward. Deploy with runpodctl or runpod-mcp; end-to-end walkthroughs live in the runpod router's golden paths.","https:\u002F\u002Fgithub.com\u002FNeelakshSaxena\u002FVayu\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Frunpod-templates\u002FSKILL.md",[],[],{"skillNo":135,"name":136,"nameZh":6,"description":137,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":138,"categories":139,"keywords":140,"publishedAt":20},"01M7ACBJATHKVX1TWES2F44GY8","runpod-migrate","Migrate a codebase from the Runpod GraphQL API or REST v1 to REST v2 — inventory which parts use which API version, rewrite the call sites, flag breaking changes, and verify. Use when someone asks to move to v2, asks what v2 would change, or asks which Runpod API their code is on. For managing infrastructure rather than migrating code, use runpod-mcp or runpodctl.","https:\u002F\u002Fgithub.com\u002FNeelakshSaxena\u002FVayu\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Frunpod-migrate\u002FSKILL.md",[],[],{"skillNo":142,"name":143,"nameZh":6,"description":144,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":145,"categories":146,"keywords":147,"publishedAt":20},"01M7ACBC7GHVH6T9YEAPCG2AP8","runpod-mcp","Manage Runpod infrastructure — pods, serverless endpoints, jobs, templates, network volumes, container-registry auth, GPU\u002FCPU catalog, and billing — via the Runpod MCP server's structured tool calls. Use when the Runpod MCP tools (create-pod, list-endpoints, …) are connected in this session, or to connect them (hosted OAuth or local npx). Prefer this over runpodctl for plain infra CRUD when MCP is available; use runpodctl for the terminal, file transfer, or SSH setup.","https:\u002F\u002Fgithub.com\u002FNeelakshSaxena\u002FVayu\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Frunpod-mcp\u002FSKILL.md",[],[]]