本文へスキップ
Skillpedia
分析とスプレッドシート35k · #8257

performing-linux-log-forensics-investigation

できること

このツールは、Linuxシステムのログファイルを調べて、何が起きたかの手がかりを見つけます。誰が、いつ、どのようにシステムにアクセスしたかを明らかにするのに役立つため、不審な動きや攻撃の調査に便利です。

使う場面

  • ✓Linuxサーバーに不正侵入された疑いがあるとき。
  • ✓セキュリティインシデントを調査中で、誰が何をしたかを知る必要があるとき。
  • ✓システム上でのアクセス履歴や実行されたコマンドを確認するとき。

スキルのリンク

https://github.com/mukul975/Anthropic-Cybersecurity-Skills/blob/main/skills/performing-linux-log-forensics-investigation/SKILL.md

コピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。

使い方

いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。

貼り付け用メッセージ

このスキルを使って手伝ってください:https://github.com/mukul975/Anthropic-Cybersecurity-Skills/blob/main/skills/performing-linux-log-forensics-investigation/SKILL.md このリンクのSKILL.mdファイルを読んで、私の作業でその指示に従ってください。
こういうスキルを、AIが自分で見つけてくれたら?無料のSkillpedia MCPをインストール。1行で、作業の前に15,000+のスキルから探してくれます。1分でインストール →

AIへの頼み方の例

“私のLinuxサーバーのログを分析して、過去24時間に不正アクセスがなかったか調べてください。”

毎週5つの新しいスキル。1分で読めます。

仕組み

auth.logやjournalなどの重要なログファイルを読み取り、アクセスのパターン、実行されたコマンド、ログイン試行を探します。その情報を整理し、出来事の流れを理解できるようにします。

技術的な内容(元のSKILL.md)

作者による元のテキスト(英語)をGitHubからそのまま表示しています。

Performing Linux Log Forensics Investigation

Overview

Linux 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 /var/log/ 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.

When to Use

  • When conducting security assessments that involve performing linux log forensics investigation
  • When following incident response procedures for related security events
  • When performing scheduled security testing or auditing activities
  • When validating security controls through hands-on testing

Prerequisites

  • Familiarity with digital forensics concepts and tools
  • Access to a test or lab environment for safe execution
  • Python 3.8+ with required dependencies installed
  • Appropriate authorization for any testing activities

Key Log Files and Locations

Log File Path Contents
auth.log / secure /var/log/auth.log (Debian) or /var/log/secure (RHEL) Authentication, sudo, SSH, PAM
syslog / messages /var/log/syslog (Debian) or /var/log/messages (RHEL) General system messages
kern.log /var/log/kern.log Kernel messages, USB events, driver loads
lastlog /var/log/lastlog Last login per user (binary)
wtmp /var/log/wtmp Login/logout records (binary, read with last)
btmp /var/log/btmp Failed login attempts (binary, read with lastb)
faillog /var/log/faillog Failed login counter (binary)
cron.log /var/log/cron or /var/log/syslog Scheduled task execution
audit.log /var/log/audit/audit.log Linux Audit Framework events
journal /var/log/journal/ or /run/log/journal/ systemd binary journal
dpkg.log /var/log/dpkg.log Package installation/removal (Debian)
yum.log /var/log/yum.log Package installation/removal (RHEL)

Analysis Techniques

Authentication Log Analysis

# Find all successful SSH logins
grep "Accepted" /var/log/auth.log

# Find failed SSH login attempts
grep "Failed password" /var/log/auth.log

# Extract unique source IPs from failed logins
grep "Failed password" /var/log/auth.log | grep -oP '\d+\.\d+\.\d+\.\d+' | sort -u

# Find sudo command execution
grep "sudo:" /var/log/auth.log | grep "COMMAND"

# Detect brute force patterns (>10 failures from same IP)
grep "Failed password" /var/log/auth.log | awk '{print $(NF-3)}' | sort | uniq -c | sort -rn | head -20

# Find account creation events
grep "useradd\|adduser" /var/log/auth.log

# Detect SSH key authentication
grep "Accepted publickey" /var/log/auth.log

Systemd Journal Analysis

# Export journal in JSON format for forensic processing
journalctl --output=json --no-pager > journal_export.json

# Filter by time range
journalctl --since "2025-02-01" --until "2025-02-15" --output=json > timerange.json

# Filter by unit/service
journalctl -u sshd --output=json > sshd_journal.json

# Show kernel messages (USB events, module loads)
journalctl -k --output=json > kernel_journal.json

# Filter by priority (0=emerg to 7=debug)
journalctl -p err --output=json > errors.json

# Boot-specific logs
journalctl -b 0 --output=json > current_boot.json
journalctl --list-boots  # List all recorded boot sessions

Linux Audit Framework Analysis

# Search audit log for specific event types
ausearch -m USER_AUTH --start today

# Search for file access events
ausearch -f /etc/shadow

# Search for process execution
ausearch -m EXECVE --start "02/01/2025" --end "02/28/2025"

# Generate report of login events
aureport --login --start "02/01/2025"

# Generate summary of failed authentications
aureport --auth --failed

# Search for specific user activity
ausearch -ua 1001  # By UID
ausearch -ua username  # By username

Cron Job Investigation

# Check system-wide crontab
cat /etc/crontab

# Check user crontabs
ls -la /var/spool/cron/crontabs/

# Review cron execution logs

…
よくある質問

分析できるログの種類は何ですか?

認証ログ(auth.log)、システムメッセージ(syslog)、カーネルログ(kern.log)、監査ログ(auditd)、systemdのjournalなどを分析します。

この文脈で「フォレンジック」とは何を意味しますか?

フォレンジックとは、システムログなどのデジタル証拠を使って過去の出来事を調べ、何が起きたのかを明らかにすることです。警察の捜査に似ています。

Linuxの専門家である必要はありますか?

専門家である必要はありませんが、Linuxの基本的な仕組みやログが何かを理解しておくと、結果を読み解くのに役立ちます。

詳細

作者による元の説明

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

repo: mukul975/Anthropic-Cybersecurity-Skills

人気

GitHubのスター
35k
ランキング
#8257
ライセンス
Apache-2.0
更新日
2026/8/31

このスキルは役に立ちますか?

0

ログイン して投票しましょう。

コメント

  • …

このリポジトリの他のスキル

似ているスキル