cybernovaacademy/SOC---LOGS-THREAT-HUNTING

GitHub: cybernovaacademy/SOC---LOGS-THREAT-HUNTING

一套面向蓝队分析师的综合性日志分析与威胁狩猎实验教程,涵盖 Windows 和 Linux 多源日志的采集、分析、攻击检测与 SIEM 规则编写的完整流程。

Stars: 0 | Forks: 0

# SOC---日志-威胁狩猎 SOC 日志威胁狩猎 # CyberNova 学院 - 精英日志分析、SOC 与威胁狩猎实验

## 专业实验目的 这个增强型实验将原始的日志分析内容转化为一个专业的 SOC、系统管理和威胁狩猎学习资料。原始提供的内容被安全地保留在一个可展开的部分中,而专家层则添加了高级命令、分析师解释、检测逻辑、MITRE ATT&CK 映射以及可用于作品集的文档。 ## 核心学习成果 - 了解 Linux、Windows 安全和 PowerShell 日志。 - 在受控实验室中模拟安全事件。 - 检测失败的登录、PowerShell 执行、SSH 暴力破解活动和防火墙拦截。 - 使用 Linux 命令、PowerShell、事件查看器和 UFW 日志进行调查。 - 将观察到的事件映射到 SOC 工作流和 MITRE ATT&CK 技术。 - 生成适合网络安全作品集的证据。 ## 目录 1. 保留的原始内容 2. SOC 分析师增强层 3. Linux 日志分析专家命令 4. Windows 安全日志狩猎 5. PowerShell 威胁狩猎 6. 使用 UFW 进行基于网络的攻击检测 7. SSH 暴力破解检测 8. MITRE ATT&CK 映射 9. SIEM 检测示例 10. 分析师报告模板 11. 最终检查清单 # 1. 保留的原始内容
点击展开完全按原样提供的原始内容

Table of Contents

1.	Introduction to Log Analysis

2.	Log Analysis Basics: Windows Security Logs

3.	Log Analysis Basics: Windows Powershell Logs

4.	Log Analysis Basics: Network-Based Attacks on Linux

5.	Log Analysis Basics: Linux Auth Logs

6.	basics of powershell



Introduction to Linux Logs + Cheat Sheet

Linux logs are essential for system monitoring, debugging, troubleshooting, and security analysis. Understanding how to access and interpret these logs is a foundational skill for system administrators, DevOps engineers, and security analysts.

________________________________________

📂 Where Are Linux Logs Stored?

Most logs in Linux are stored in the /var/log/ directory.

________________________________________

📄 Common Log Files

Log File	Description

/var/log/syslog / messages	General system activity logs

/var/log/auth.log	Authentication logs (login, sudo, ssh)

/var/log/kern.log	Kernel messages

/var/log/dmesg	Boot-time and hardware-related messages

/var/log/faillog	Failed login attempts

/var/log/secure	Security-related logs (RHEL/CentOS)

/var/log/boot.log	System boot logs

/var/log/cron or cron.log	Cron job scheduling logs

/var/log/httpd/	Apache web server logs

/var/log/audit/	SELinux and AuditD logs

________________________________________

🧠 Linux Logs Cheat Sheet

🔍 View Logs

cat /var/log/syslog              # Display entire log

less /var/log/auth.log           # Scroll through logs

tail -f /var/log/syslog          # Live log monitoring

journalctl                       # View systemd journal logs



### 📌 过滤 Logs

```bash

grep "error" /var/log/syslog                     # Search for 'error'

journalctl -u ssh                                # Logs for SSH service

journalctl --since "1 hour ago"                  # Logs from the past hour

journalctl --since "2024-10-01" --until "2024-10-02” # Logs between two dates

🛠️ Useful Log Management Commands

dmesg | less                        # View kernel ring buffer

logrotate -d /etc/logrotate.conf   # Test log rotation

last                               # Show login history

lastb                              # Show failed login attempts

###🧾 Example: Detect Failed SSH Logins

grep "Failed password" /var/log/auth.log

🔐 Why Are Logs Important?

•	🔍 Security Monitoring – Detect brute force attacks, unauthorized logins.

•	🛠️ Troubleshooting – Identify service errors and system crashes.

•	📜 Auditing – Track user activity and system changes.







Day#1: Introduction to Log Analysis

Objective:

The objective of this lab is to introduce students to the basics of log analysis and demonstrate how logs from different systems can be collected, analyzed, and used for security monitoring. Students will learn how to generate simple logs on both Windows and Linux systems and how SOC Analysts use logs to detect security incidents.________________________________________What is a Log?

A log is a record of events in a system that captures important actions like errors, warnings, or user activities. These logs contain key information such as:

•	Timestamp

•	Event Description

•	Severity (Critical, Error, Warning, Information)

•	Source (User, Process, Service)

Logs are essential for understanding system behavior, detecting security incidents, and conducting forensic investigations.

________________________________________

Example logs

🐧Linux auth.log Example

Apr 7 10:42:15 ubuntu sshd[12345]: Failed password for invalid user admin from 192.168.1.100 port 54321 ssh2

Explanation:

•	Apr 7 10:42:15 — Timestamp

•	ubuntu — Hostname

•	sshd[12345] — Service name and process ID

•	Failed password for invalid user admin — Failed login attempt

•	from 192.168.1.100 — Source IP address

•	port 54321 — Source port

•	ssh2 — Protocol version

Log Sources on Linux:

•	System Logs: Stored in /var/log/, including files like syslog (system messages), auth.log (authentication attempts), and kern.log (kernel-related logs).

•	Application Logs: Application-specific logs like Apache (/var/log/apache2/access.log) or MySQL (/var/log/mysql/error.log).

Log Sources on Windows:

•	Event Viewer: Provides access to logs such as:

o	System Logs: Logs related to operating system events.

o	Security Logs: Logs related to login attempts, permission changes, etc.

o	Application Logs: Logs for system applications.

o	PowerShell Logs: Logs for PowerShell commands, including suspicious execution.

________________________________________

How Does a SOC Analyst Use Log Analysis?

•	Incident Detection: SOC Analysts review logs to detect unusual or unauthorized activities, such as failed login attempts or suspicious processes.

•	Forensics: Logs are used to trace back the actions taken by an attacker during or after an incident.

•	Security Monitoring: Continuous log analysis helps detect potential security threats in real-time.

•	Compliance: Logs assist in maintaining compliance with regulatory standards (e.g., GDPR, HIPAA).

________________________________________

Popular Tools for Log Analysis:

•	ELK Stack (Elasticsearch, Logstash, Kibana): A powerful suite for log collection, storage, and visualization.

•	Splunk: A leading tool for searching, analyzing, and visualizing machine-generated data.

•	Graylog: An open-source log management solution.

•	Wazuh: An open-source security monitoring platform that integrates well with ELK for log analysis and threat detection.

________________________________________

Lab Task: Simulating and Detecting Windows Powershell events

Lab Setup

Requirements:

•	Systems: Windows 10/11 or Windows Server 2019/2022, Linux (Ubuntu or CentOS)

•	Tools:

o	Windows Event Viewer

o	PowerShell (Pre-installed on Windows)

________________________________________

Preparation:

For this lab, you will need to set up log collection on both Windows and Linux systems. Follow these steps to ensure everything is ready:

On Windows:

1.	Open Group Policy Editor (gpedit.msc):

o	Navigate to Computer Configuration > Administrative Templates > Windows Components > Windows PowerShell.

o	Ensure that Module Logging, Script Block Logging, and Script Execution are enabled.

2.	Open Event Viewer:

o	Go to Applications and Services Logs → Microsoft → Windows → PowerShell → Operational.

Step 1: Simulate a Suspicious PowerShell Command

To simulate a suspicious activity, open an elevated PowerShell session and run the following command:

Get-LocalUser | Select-Object Name, Enabled

This command lists all local user accounts on the system, which could be used by attackers to enumerate users post-exploitation.

Step 2: Detect the Log in Windows Event Viewer

1.	Press Win + R, type eventvwr.msc, and press Enter.

2.	Navigate to: Applications and Services Logs → Microsoft → Windows → PowerShell → Operational.

3.	Click Filter Current Log, and filter for Event ID 4104 (which logs PowerShell script execution).

4.	Look for an entry that shows the execution of the Get-LocalUser command.

5.	Take a screenshot of the event details.

Conclusion:

•	Understanding Log Analysis: Logs are crucial for detecting, investigating, and responding to security incidents. Through the use of Windows Event Viewer and Linux log files, you can monitor system activity and identify potential security issues.

•	SOC Analyst Role: SOC Analysts use log analysis to detect threats, investigate incidents, and ensure system compliance.

Submission:

•	Windows Logs: Submit a screenshot of the log generated on the Windows machine.







Log Analysis Basics: Windows Security Logs

Objective:

The objective of this lab is to introduce students to Windows Security Logs and help them understand how to analyze logs for security-related events. Students will learn how to explore and analyze various security logs such as login attempts, user account changes, and other critical system events that could indicate potential security threats.

Lab Setup

Requirements:

•	System: Windows 10/11 or Windows Server 2019/2022

•	Tools:

o	Windows Event Viewer (pre-installed)

o	Notepad (to create custom events, if needed)

o	Administrative Privileges (to access certain security logs)

________________________________________

What are Windows Security Logs?

Windows Security Logs contain records of security-related events on the system, such as:

•	Successful and Failed Login Attempts: Track users who log in or fail to log in.

•	Account Lockouts: Occurs when a user exceeds the maximum allowed number of incorrect login attempts.

•	Audit Policies: Logs related to changes in system audit settings and configurations.

•	Group Membership Changes: Tracks changes in group memberships and user privileges.

•	Privilege Escalation: Logs events when a user gains elevated privileges.

These logs are valuable for monitoring security incidents, detecting unauthorized access, and auditing system changes.

________________________________________

Understanding Event IDs in Security Logs:

Some common Event IDs in Windows Security Logs that you will encounter include:

•	Event ID 4624: Successful Logon.

•	Event ID 4625: Failed Logon.

•	Event ID 4740: Account Lockout.

•	Event ID 4732: A user was added to a security-enabled local group.

•	Event ID 4672: Special privileges assigned to a new logon (Privilege escalation).

________________________________________

Lab Task: Explore and Analyze Windows Security Logs

Step 1: Simulate a Failed Login Attempt

1.	Create a test user name "haxuser1" on Windows machine.

2.	Simulate a failed account access using this command Open PowerShell and enter an invalid username and password. You can do this by using the following command:

net use \\127.0.0.1\IPC$ /user:haxuser1 WrongPassword

Here:

Command Part	Explanation

net use	A command used to connect to shared resources (like network shares or printers).

\\127.0.0.1\IPC$	A special hidden administrative share called IPC$ on your local machine (127.0.0.1 = localhost). IPC$ is used for inter-process communication, especially for authentication purposes.

/user:haxuser1	Specifies the username to use for authentication (in this case, haxuser1).

WrongPassword	The password you're trying to authenticate with — which is intentionally incorrect.

Or Else you can sign out with your existing account and sign in with haxuser1 account with an invalid password

Step 2: Detect the Log in Windows Event Viewer

1.	In the Event Viewer, navigate to:

Windows Logs → Security

2.	After the failed login, go back to Event Viewer.

3.	Filter the Security Logs for Event ID 4625 (Failed Logon). 4.. Look for entries that correspond to the failed login attempt.

4.	Take a screenshot of the event details, including:

o	Failed Login Attempt Details

o	User Name

o	Logon Type

o	Source Network Address

Conclusion:

•	Understanding Windows Security Logs: Windows Security Logs are essential for identifying suspicious behavior such as unauthorized login attempts, privilege escalation, and system configuration changes.

•	SOC Analyst Role: As a SOC Analyst, reviewing and analyzing these logs regularly is critical to detecting and responding to security incidents in real-time.

•	Threat Detection: By monitoring for multiple failed logins, account lockouts, and privilege escalations, SOC Analysts can quickly detect malicious activities on a network.

Submission:

•	Event ID 4624 (Successful Login): Submit a screenshot showing a successful login event from the Security logs.

•	Event ID 4625 (Failed Login): Submit a screenshot showing a failed login attempt event from the Security logs.

Log Analysis Basics: Windows PowerShell Logs

Objective:

The objective of this lab is to introduce students to Windows PowerShell Logs and help them understand how to analyze PowerShell-related events. Students will learn how to explore and analyze PowerShell logs to detect suspicious or malicious PowerShell commands that could indicate an attack or compromise.

 Setup

Requirements:

•	System: Windows 10/11 or Windows Server 2019/2022

•	Tools:

o	Windows Event Viewer (pre-installed)

o	PowerShell (Pre-installed on Windows)

o	Administrative Privileges (required for enabling logs)

________________________________________

Preparation:

Before proceeding, make sure PowerShell script block logging is enabled on your system:

1.	Press Win + R, type gpedit.msc, and press Enter to open the Group Policy Editor.

2.	Navigate to: Computer Configuration > Administrative Templates > Windows Components > Windows PowerShell

3.	Turn on Module Logging, Script Block Logging, and Script Execution.

4.	Apply the settings and close the Group Policy Editor.

________________________________________

What are Windows PowerShell Logs?

PowerShell logs contain information about PowerShell script executions, including details about the commands that were run, the processes that invoked them, and the user who executed them. These logs can be used to detect potential misuse of PowerShell, including post-exploitation techniques often used by attackers.

Key PowerShell Logs to Monitor:

•	Event ID 4104: Script block logging, capturing the PowerShell commands executed.

•	Event ID 4103: Command invocation with parameter binding (detailed command execution).

•	Event ID 4698: PowerShell Module Logging for the execution of specific modules.

•	Event ID 4101: Execution of PowerShell commands through command-line arguments.

________________________________________

Lab Task: Explore and Analyze Windows PowerShell Logs

Step 1: Generate PowerShell Logs

1.	Open PowerShell as Administrator.

2.	Run the following PowerShell command to generate a log entry:

Start-Process "notepad.exe" -ArgumentList "C:\Windows\System32\drivers\etc\hosts"

This command

•	Starts a new process using the Start-Process cmdlet.

•	Specifies "notepad.exe" as the program to launch.

•	Passes "C:\Windows\System32\drivers\etc\hosts" as an argument to Notepad.

•	As a result, Notepad opens the hosts file directly.

Step 2: Visualize the events

1.	After running the command, go back to Event Viewer and navigate to:

Applications and Services Logs → Microsoft → Windows → PowerShell → Operational

4.	Look for Event ID 4103 in the logs (this will show script block logging for the PowerShell command you executed).

5.	Take a screenshot of the event details, including:

•	PowerShell command that was executed

•	User who ran the command

•	Timestamp of the execution

Step 3: Why Is This Important for Blue Teams?

This log can be used to detect malicious PowerShell usage, such as:

•	LOLBAS (Living Off The Land Binaries) like using Start-Process or Invoke-WebRequest

•	Loading payloads or obfuscated PowerShell commands

•	Persistence via PowerShell commands in startup or tasks

Example of LOLBAS Tools These are legitimate Windows tools that attackers often abuse for stealthy malicious actions.

🛠️ Tool	📌 Path	🚩 Abuse Technique

powershell.exe	C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe	Execute payloads, download malware, bypass AV

certutil.exe	C:\Windows\System32\certutil.exe	Download files using: certutil -urlcache -f

mshta.exe	C:\Windows\System32\mshta.exe	Execute malicious HTML apps or remote scripts

regsvr32.exe	C:\Windows\System32\regsvr32.exe	Load and execute remote/local DLLs

rundll32.exe	C:\Windows\System32\rundll32.exe	Execute DLLs or scripts to evade detection

wmic.exe	C:\Windows\System32\wbem\wmic.exe	Execute commands, gather system info

bitsadmin.exe	C:\Windows\System32\bitsadmin.exe	Download/upload files silently

msbuild.exe	C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exe	Execute malicious C# code in project files

installutil.exe	C:\Windows\Microsoft.NET\Framework\v4.0.30319\installutil.exe	Run code during .NET assembly install

schtasks.exe	C:\Windows\System32\schtasks.exe	Create scheduled tasks for persistence

ℹ️ For more: lolbas-project.github.io

Conclusion:

•	PowerShell Logs: Key to spotting malicious command usage.

•	SOC Analyst Role: Review logs to detect post-exploitation actions.

•	Threat Detection: Flags abnormal activity for faster response.

Submission:

•	Event ID 4103 (PowerShell Script Execution): Submit a screenshot showing a PowerShell script execution event from the logs.













Log Analysis Basics – Network-Based Attack Detection Using UFW

________________________________________

🎯 Objective

The objective of this lab is to simulate a network-based port scan attack and demonstrate how to detect it using ufw.log logs on a Linux system. Students will learn how to launch the HTTP scan prob from Kali Linux(attacker) machine and detect these scan ataempt on Victim machine using UFW.

🛠️ Lab Setup

System Requirements

•	Attacker Machine:: Kali Linux

•	Target Machine: Ubuntu Linux

Tools Needed

•	nmap (on attacker machine)

•	ufw or iptables (on target machine)

Log Files

•	/var/log/ufw.log on Ubuntu Server– Captures system and network-related messages

________________________________________

🧠 What is a Network Port Scan?

A port scan is a technique used by attackers to probe a system for open ports and active services. Tools like nmap are commonly used to map a system’s network surface.

Why It’s Dangerous

•	Port scans are often a precursor to exploitation

•	They help attackers identify vulnerable services like open SSH, FTP, or outdated web servers

________________________________________

What is Nmap?

•	Nmap (Network Mapper) is an open-source network scanning tool.

•	Used to discover hosts and services on a network.

•	Helps in identifying open ports, running services, and OS detection.

•	Commonly used for network inventory and vulnerability scanning.

________________________________________

Nmap Popular Scan Types

•	SYN Scan (-sS): Fast and stealthy port scan.

•	TCP Connect Scan (-sT): Full TCP connection, less stealthy.

•	UDP Scan (-sU): Scans UDP ports for services.

•	Ping Scan (-sn): Checks which hosts are up, no port scan.

🔐 What is UFW?

•	UFW stands for Uncomplicated Firewall, a frontend for iptables.

•	Simplifies firewall management for Linux users.

•	Used to allow, deny, and manage traffic rules easily.

•	Logs are stored in /var/log/ufw.log.

•	Rule file /etc/ufw/before.rules

•	To check ufw status ufw status

•	To check the rule number ufw status numbered

###🧾 UFW Rule Syntax

•	Basic allow rule: ufw allow

•	Deny a port: ufw deny

•	Allow by service: ufw allow (e.g., ufw allow ssh)

•	Allow by IP: ufw allow from

•	Allow specific port from IP: ufw allow from to any port

•	Delete rule: ufw delete allow

🧪 Lab Task: Explore and Analyze Linux Syslog for Network Scans

________________________________________

⚔️ Step 1: Attack Simulation – Perform a Port Scan

⚠️ Only scan systems you own or are authorized to test.

On the Attacker Machine:

nmap -p80 TARGET-IP

🔍 Step 2: Detection and Analysis – Analyze Syslog

1.	Installing UFW firewall

2.	sudo apt install ufw

3.	sudo ufw enable

4.	sudo ufw logging on

5.	sudo ufw logging high

6.	Create a Firewall rule to drop HTTP traffic from Attack machine

7.	sudo ufw deny from 69.62.84.69 to any port 80 proto tcp

8.	Reload the firewall rules to take effect

9.	sudo ufw reload

10.	Detect the HTTP Scanning traffic

11.	sudo tail -f /var/log/ufw.log | grep "Attcker IP"

✅ Conclusion

•	ufw.log, combined with firewall logs, is powerful for detecting early-stage reconnaissance

•	Port scanning is often the first indicator of an attacker mapping your system

•	Detecting and blocking IPs performing scans is a crucial step in proactive defense

📸 Submission

Submit a screenshot of a syslog entry showing blocked network traffic due to a port scan. Include:

•	Source IP of scan

•	Targeted port

•	Timestamp

Log Analysis Basics – Linux Auth Log

________________________________________

🎯 Objective

The objective of this lab is to simulate an SSH brute force attack and demonstrate how to detect it using Linux authentication logs. Students will learn how to identify multiple failed logins attempts and analyze patterns to uncover brute force activity.

________________________________________

🛠️ Lab Setup

System Requirements

•	Attacker Machine: Kali Linux (or any Linux with hydra)

•	Target Machine: Ubuntu Linux Server

Tools Needed

•	hydra (on attacker machine)

•	openssh-server (on target machine)

•	rsyslog (default logging service)

Log Files

•	/var/log/auth.log – Authentication logs (Ubuntu/Debian)

•	/var/log/secure – (CentOS/RHEL)

________________________________________

📘 Preparation

Linux systems log every authentication event, including successful and failed SSH login attempts. Brute force attacks can be identified by analyzing patterns such as:

•	Rapid failed logins from a single IP

•	Attempts with multiple usernames

•	Login successes after a string of failures

________________________________________

🧠 What is an SSH Brute Force Attack?

A brute force attack attempts to guess a user’s SSH password by trying many combinations quickly using automated tools like Hydra.

Why It’s Dangerous

•	Successful brute force = full shell access

•	Attackers can pivot, install malware, or exfiltrate data

•	It often goes unnoticed without proper log monitoring

________________________________________

🛡️ Attack Patterns Detectable via Auth Logs

•	Multiple failed password attempts from one IP

•	Repeated login attempts to root/admin accounts

•	Success after multiple failures (brute force success)

•	Logins from unknown or foreign IPs

________________________________________

What is Hydra?

•	Hydra is a fast, open-source password-cracking tool used for brute force attacks on logins.

•	It supports 50+ protocols like SSH, FTP, HTTP, SMB, and more.

•	Common use: penetration testing and checking for weak passwords in network services.

•	Syntax: hydra -L users.txt -P passlist.txt <target_ip> <protocol>

•	Use -l/-p for single username/password or -L/-P for files.

•	Add -vV for verbose output and -t 4 to set number of threads.

🧪 Lab Task: Explore and Analyze Auth Logs for SSH Brute Force

________________________________________

⚔️ Step 1: Attack Simulation – Brute Force SSH using Hydra

⚠️ Only perform on authorized systems you own or control.

On the Attacker Machine:

hydra -l root -P /usr/share/wordlists/rockyou.txt ssh://TARGET-IP

This will attempt multiple password guesses for user root on the SSH port.

Ensure SSH is enabled on the target:

sudo systemctl status ssh

🔍 Step 2: Detection and Analysis – Analyze Auth Logs

Check for failed login attempts:

sudo grep "Failed password" /var/log/auth.log

Find usernames tried:

sudo grep "Failed password" /var/log/auth.log | awk '{print $(NF-5)}' | sort | uniq -c | sort -nr

Watch live log activity:

sudo tail -f /var/log/auth.log

🔍 What to Look For

•	20+ failed attempts from the same IP in under 5 mins

•	Attempts on sensitive users (root, admin)

•	Sudden success after multiple failures

✅ Conclusion

•	Auth logs are vital for detecting brute force login attempts

•	Multiple failures from a single IP is a strong signal of attack

•	Combine log analysis with tools like fail2ban to block repeat offenders automatically

📸 Submission

Submit a screenshot showing:

•	failed login entries from the same IP

•	Username attempted

PowerShell for Security Analysts

________________________________________

1. Introduction to PowerShell

PowerShell is a powerful command-line shell and scripting language developed by Microsoft, designed specifically for system administration. It is built on the .NET framework and is widely used for automating tasks, managing configurations, and performing administrative tasks on both Windows and Linux systems.

Why Should Security Analysts Learn PowerShell?

•	Automation and Efficiency: Automate repetitive tasks such as log analysis, system audits, and security monitoring.

•	Incident Response: Quickly collect forensic artifacts, investigate suspicious activities, and respond to incidents.

•	Threat Hunting: Identify anomalous behaviours by querying system information and event logs.

•	Red Teaming and Blue Teaming: Used by attackers for persistence and lateral movement, making it crucial for defenders to understand its capabilities.

________________________________________

2. Overview of Cmdlets, Scripts, and the PowerShell Environment

2.1 Cmdlets

•	Cmdlets (pronounced "command-lets") are the building blocks of PowerShell. They are lightweight commands that perform specific operations.

•	Syntax: Verb-Noun (e.g., Get-Process, Set-Item, New-User)

•	Example:

•	Get-Process          # Lists all running

•	Get-Service          # Displays all services on the system

Get-EventLog -LogName Security # Retrieves security event logs

2.2 Scripts

•	Scripts are text files containing a series of PowerShell commands saved with the .ps1 extension.

•	They allow automation of complex tasks by executing multiple cmdlets in sequence.

•	Example Script (Get-SystemInfo.ps1):

•	# Get System Information

•	Get-ComputerInfo

•	Get-Process | Where-Object {$_.CPU -gt 100}  # High CPU usage processes

Get-EventLog -LogName Security -Newest 10

2.3 The PowerShell Environment

•	Console and ISE: PowerShell can be executed from the traditional console or the Integrated Scripting Environment (ISE).

•	Modules: Packages containing cmdlets, functions, variables, and other resources.

•	Pipeline (|): Used to pass output from one cmdlet as input to another.

Get-Process | Where-Object {$_.CPU -gt 50} | Select-Object ProcessName, CPU

________________________________________

3. Understanding the Execution Policy

Execution Policy in PowerShell determines the conditions under which PowerShell loads configuration files and runs scripts.

Types of Execution Policies

1.	Restricted: Default setting allows no scripts to run.

2.	AllSigned: Only scripts signed by a trusted publisher can be run.

3.	RemoteSigned: Local scripts can run, but scripts downloaded from the internet must be signed.

4.	Unrestricted: Scripts are allowed to run without restrictions.

5.	Bypass: No restrictions; used for automation.

Checking and Setting Execution Policy

Get-ExecutionPolicy        # Check current execution policy

Set-ExecutionPolicy RemoteSigned   # Set to RemoteSigned

###Best Practice for Security Analysts

•	Always set the policy to RemoteSigned or AllSigned to prevent unauthorized scripts from running.

•	Use Bypass only in controlled environments, such as for incident response scripts.

4. Use Cases for Security Analysts

4.1 Incident Response

•	Collect logs and system artifacts for forensic analysis.

Get-EventLog -LogName Security -Newest 100 | Export-Csv C:\Logs\SecurityLogs.csv

4.2 Threat Hunting

•	Identify suspicious processes or unusual network activity.

Get-Process | Where-Object { $_.CPU -gt 80 }

Get-NetTCPConnection | Where-Object { $_.RemotePort -eq 4444 }

4.3 Vulnerability Assessment

•	Check for missing security patches.

Get-HotFix | Where-Object { $_.InstalledOn -lt (Get-Date).AddMonths(-6) }

4.4 Security Audits and Compliance

•	Audit user accounts and permissions.

Get-LocalUser

Get-LocalGroupMember -Group "Administrators"

4.5 Automation and Scripting

•	Automate repetitive security tasks like log cleanup or system health checks.

Get-EventLog -LogName Application -EntryType Error -Newest 50 | Out-File C:\Logs\ErrorLogs.txt

5. PowerShell Basics

5.1 Basic Commands

Get-Help Get-Process   # Display help for a cmdlet

Get-Command            # List all available cmdlets

Get-Module             # List all imported modules

5.2 Variables and Data Types

$Name = "Security Analyst"

$Number = 42

$Array = @(1, 2, 3, 4)

5.3 Loops and Conditionals

# If-Else 语句

$CPUUsage = Get-Process | Where-Object { $_.CPU -gt 80 }

If ($CPUUsage) {

    Write-Host "High CPU Usage Detected"

} Else {

    Write-Host "CPU Usage is Normal"

}



# ForEach 循环

$Processes = Get-Process

ForEach ($Process in $Processes) {

    Write-Host $Process.ProcessName

}

5.4 Functions

Function Get-HighCPU {

    Param($Threshold = 50)

    Get-Process | Where-Object { $_.CPU -gt $Threshold }

}

Get-HighCPU -Threshold 80

6. PowerShell Command Cheatsheet for Security Analysts

6.1 System Information

Get-ComputerInfo                    # System Information

Get-WmiObject Win32_OperatingSystem  # Detailed OS Information

6.2 Process and Service Monitoring

Get-Process                         # List Running Processes

Get-Service                         # List Installed Services

Stop-Process -Name "notepad"         # Stop a 

6.3 Network Information

Get-NetAdapter                      # Network Adapter Information

Get-NetTCPConnection                 # Active Network Connections

6.4 Event Log Analysis

Get-EventLog -LogName Security -Newest 100

Get-WinEvent -LogName Application -MaxEvents 50

6.5 File and Directory Management

Get-ChildItem -Path C:\Logs -Recurse # List all files in a directory

Remove-Item -Path C:\Logs\*.log       # Delete all log files

6.6 User and Permissions Auditing

Get-LocalUser                        # List all Local Users

Get-LocalGroup                       # List all Local Groups

Get-LocalGroupMember -Group "Admins” # List Admin Group Members

7. Summary

•	PowerShell is a versatile and powerful tool for Security Analysts.

•	Use cmdlets to perform system audits, incident response, and threat hunting.

•	Leverage scripts for automation of repetitive security tasks.

•	Set execution policies securely (preferably RemoteSigned).

•	Always review and understand scripts before execution to prevent malicious activities.

•	Continuously learn and update your PowerShell skills to stay ahead of attackers.

# 2. SOC 分析师增强层
## 分析师思维 | 分析师问题 | 为什么重要 | |---|---| | 谁执行了该操作? | 确定用户、服务账户或攻击者上下文 | | 涉及哪台主机? | 确定受影响的资产范围 | | 什么进程或服务生成了事件? | 有助于区分正常的管理员活动和可疑行为 | | 之前和之后发生了什么? | 构建时间线和攻击者序列 | | 这对该用户或主机来说正常吗? | 支持基线和异常检测 | | 业务影响是什么? | 帮助确定响应优先级 | # 3. Linux 日志分析专家命令
## 查看重要日志 ``` sudo less /var/log/auth.log sudo less /var/log/syslog sudo less /var/log/kern.log sudo journalctl -xe ``` ## 实时监控身份验证日志 ``` sudo tail -f /var/log/auth.log ``` ## 检测失败的 SSH 登录 ``` sudo grep "Failed password" /var/log/auth.log ``` ## 按源 IP 统计失败的 SSH 登录次数 ``` sudo grep "Failed password" /var/log/auth.log | awk '{print $(NF-3)}' | sort | uniq -c | sort -nr ``` ## 检测成功的 SSH 登录 ``` sudo grep "Accepted" /var/log/auth.log ``` ## 检测 Sudo 滥用或权限提升尝试 ``` sudo grep "sudo" /var/log/auth.log sudo grep "authentication failure" /var/log/auth.log ``` ## Journalctl 调查命令 ``` sudo journalctl --since "1 hour ago" sudo journalctl -u ssh --since "today" sudo journalctl -p warning..alert ``` ### 分析师解释 这些命令有助于识别失败的身份验证、成功访问、权限提升尝试和异常的服务活动。在 SOC 工作流中,这些日志支持初步分诊、时间线构建和遏制决策。 # 4. Windows 安全日志狩猎
## 高价值 Windows 事件 ID | 事件 ID | 含义 | SOC 用例 | |---:|---|---| | 4624 | 成功登录 | 验证访问和登录类型 | | 4625 | 登录失败 | 检测暴力破解和密码喷洒 | | 4634 | 注销 | 会话时间线分析 | | 4672 | 分配特殊权限 | 识别特权访问 | | 4720 | 已创建用户账户 | 检测可疑的账户创建 | | 4726 | 已删除用户账户 | 检测账户篡改 | | 4732 | 已将用户添加到本地组 | 检测权限提升 | | 4740 | 账户已锁定 | 检测暴力破解结果 | | 4688 | 进程创建 | 如果启用,可检测可疑执行 | ## PowerShell:检测失败的登录 ``` Get-WinEvent -FilterHashtable @{LogName='Security'; ID=4625} -MaxEvents 20 | Select-Object TimeCreated, Id, ProviderName, Message ``` ## PowerShell:检测成功的登录 ``` Get-WinEvent -FilterHashtable @{LogName='Security'; ID=4624} -MaxEvents 20 | Select-Object TimeCreated, Id, ProviderName, Message ``` ## PowerShell:检测特权登录 ``` Get-WinEvent -FilterHashtable @{LogName='Security'; ID=4672} -MaxEvents 20 | Select-Object TimeCreated, Id, Message ``` ### 分析师解释 失败的登录事件并不一定都是恶意的。需将重复失败、源 IP 地址、账户名、登录类型、一天中的时间以及失败后不久是否发生成功登录等因素关联起来分析。 # 5. PowerShell 威胁狩猎
## 重要的 PowerShell 事件 ID | 事件 ID | 含义 | 检测价值 | |---:|---|---| | 4103 | 模块日志记录 | 捕获命令调用细节 | | 4104 | 脚本块日志记录 | 捕获脚本内容和可疑命令 | | 400 | 引擎启动 | PowerShell 已启动 | | 403 | 引擎停止 | PowerShell 已停止 | | 600 | 提供程序生命周期 | 提供程序活动 | ## 检测 PowerShell 脚本块日志 ``` Get-WinEvent -LogName "Microsoft-Windows-PowerShell/Operational" | Where-Object {$_.Id -eq 4104} | Select-Object TimeCreated, Id, Message -First 20 ``` ## 狩猎编码命令 ``` Get-WinEvent -LogName "Microsoft-Windows-PowerShell/Operational" | Where-Object {$_.Message -match "EncodedCommand|FromBase64String|IEX|Invoke-Expression"} | Select-Object TimeCreated, Id, Message ``` ## 狩猎下载活动 ``` Get-WinEvent -LogName "Microsoft-Windows-PowerShell/Operational" | Where-Object {$_.Message -match "Invoke-WebRequest|curl|wget|DownloadString|WebClient"} | Select-Object TimeCreated, Id, Message ``` ## 狩猎本地用户枚举 ``` Get-WinEvent -LogName "Microsoft-Windows-PowerShell/Operational" | Where-Object {$_.Message -match "Get-LocalUser|net user|whoami|Get-ADUser"} | Select-Object TimeCreated, Id, Message ``` ### 分析师解释 PowerShell 是受信任的,内置于 Windows 中,并且在管理方面非常强大。SOC 分析师应重点关注可疑意图和周围上下文,而不仅仅是工具本身。 # 6. 使用 UFW 进行基于网络的攻击检测
## 启用 UFW 和日志记录 ``` sudo apt update sudo apt install ufw -y sudo ufw enable sudo ufw logging on sudo ufw logging high sudo ufw status verbose ``` ## 拒绝来自实验室攻击者 IP 的流量 将 `ATTACKER-IP` 替换为您授权的实验室机器 IP。 ``` sudo ufw deny from ATTACKER-IP to any port 80 proto tcp sudo ufw reload ``` ## 监控 UFW 日志 ``` sudo tail -f /var/log/ufw.log ``` ## 过滤被拦截的流量 ``` sudo grep "UFW BLOCK" /var/log/ufw.log ``` ## 识别被攻击的目标端口 ``` sudo grep "UFW BLOCK" /var/log/ufw.log | grep -o "DPT=[0-9]*" | sort | uniq -c | sort -nr ``` ## 识别源 IP ``` sudo grep "UFW BLOCK" /var/log/ufw.log | grep -o "SRC=[0-9.]*" | sort | uniq -c | sort -nr ``` ## 安全的授权 Nmap 测试 仅针对您自己的 Ubuntu 目标虚拟机运行: ``` nmap -p80 TARGET-IP ``` ### 分析师解释 单个被拦截的连接可能是正常的。来自同一源的跨多个端口的重复拦截连接可能表明正在进行侦察。 # 7. SSH 暴力破解检测
## 检测失败的 SSH 尝试 ``` sudo grep "Failed password" /var/log/auth.log ``` ## 按用户名统计尝试次数 ``` sudo grep "Failed password" /var/log/auth.log | awk '{for(i=1;i<=NF;i++) if($i=="user") print $(i+1)}' | sort | uniq -c | sort -nr ``` ## 按 IP 地址统计尝试次数 ``` sudo grep "Failed password" /var/log/auth.log | grep -oE "from ([0-9]{1,3}\.){3}[0-9]{1,3}" | awk '{print $2}' | sort | uniq -c | sort -nr ``` ## 检测失败后的成功登录 ``` sudo grep -E "Failed password|Accepted password|Accepted publickey" /var/log/auth.log ``` ## 安装 Fail2Ban ``` sudo apt install fail2ban -y sudo systemctl enable fail2ban sudo systemctl start fail2ban sudo fail2ban-client status ``` ### 分析师解释 最强的信号是重复失败后跟随成功登录,特别是当其来自异常的 IP 地址或针对特权账户时。 # 8. MITRE ATT&CK 映射
| 实验室活动 | 可能的 MITRE 技术 | 解释 | |---|---|---| | Windows 登录失败尝试 | T1110 - 暴力破解 | 重复的身份验证尝试 | | 失败后的成功登录 | T1078 - 有效账户 | 攻击者可能已获取有效凭证 | | PowerShell 命令执行 | T1059.001 - PowerShell | 命令和脚本解释器滥用 | | 用户枚举 | T1087 - 账户发现 | 访问后列出用户 | | Nmap 端口扫描 | T1046 - 网络服务发现 | 发现暴露的服务 | | 计划任务持久化 | T1053.005 - 计划任务 | 使用 Windows 任务计划程序进行持久化 | | 防火墙拦截事件 | 侦察指标 | 显示探测或被拦截的连接尝试 | # 9. SIEM 检测示例
## Microsoft Sentinel KQL:Windows 登录失败 ``` SecurityEvent | where EventID == 4625 | summarize FailedAttempts=count() by Account, Computer, IpAddress, bin(TimeGenerated, 15m) | where FailedAttempts >= 5 ``` ## Microsoft Sentinel KQL:PowerShell 编码命令 ``` Event | where Source == "Microsoft-Windows-PowerShell" | where RenderedDescription has_any ("EncodedCommand", "FromBase64String", "Invoke-Expression", "IEX") ``` ## Splunk SPL:Windows 登录失败 ``` index=windows sourcetype=WinEventLog:Security EventCode=4625 | stats count by Account_Name, src_ip, host | where count >= 5 ``` ## Splunk SPL:Linux SSH 暴力破解 ``` index=linux "Failed password" | rex "from (?\d+\.\d+\.\d+\.\d+)" | stats count by src_ip, host | where count >= 5 ``` ## Sigma 规则:可疑的 PowerShell 编码命令 ``` title: Suspicious PowerShell Encoded Command id: cybernova-powershell-encoded-command status: experimental description: Detects PowerShell commands using encoded command patterns. logsource: product: windows category: ps_script selection: ScriptBlockText|contains: - 'EncodedCommand' - 'FromBase64String' - 'Invoke-Expression' - 'IEX' condition: selection level: high ``` # 10. 分析师报告模板
## 事件摘要 | 字段 | 详情 | |---|---| | 告警名称 | | | 日期 / 时间 | | | 分析师 | | | 受影响主机 | | | 受影响用户 | | | 源 IP | | | 严重性 | 低 / 中 / 高 / 严重 | | MITRE 技术 | | ## 调查笔记 ``` What happened? Who was involved? What evidence supports the finding? Was the activity authorised? Was containment required? ``` ## 建议的响应措施 - 确认用户活动是否已授权。 - 审查身份验证历史。 - 检查重复失败后是否成功登录。 - 如果怀疑受到破坏,隔离受影响的主机。 - 如果怀疑账户被入侵,重置凭证。 - 如果确认,拦截恶意源 IP。 - 保留日志和屏幕截图作为证据。 # CyberNova Linux + Windows 日志命令 SOC 速查表 ## 高级身份验证调查 | 暴力破解检测 | 权限提升 | 威胁狩猎
# 目录 . Linux 身份验证日志调查 2. 查看身份验证日志 3. 失败的登录尝试 4. 按 IP 统计失败尝试 5. 成功的登录 6. 无效用户登录尝试 7. SSH 登录活动 8. 失败的 sudo 尝试 9. journalctl 调查 10. 登录历史 11. 用户名过滤 12. 日期和近期日志过滤 13. 组合 SOC 过滤器 14. 轮转日志调查 15. 快速摘要脚本 16. 防御行动 17. Windows 用户枚举 18. Windows 权限提升检测 19. Windows 事件日志调查 20. MITRE ATT&CK 映射 # Linux 身份验证日志调查 要在 Linux 上调查针对 `/var/log` 的暴力破解尝试、身份验证活动和常规日志,您主要将处理系统日志,例如: | 日志来源 | 用途 | |---|---| | `/var/log/auth.log` | Ubuntu/Debian 上的身份验证日志 | | `/var/log/secure` | RHEL/CentOS/Rocky/AlmaLinux 上的身份验证日志 | | `/var/log/syslog` | 常规系统活动 | | `journalctl` | systemd 日志系统日志 | | `/var/log/faillog` | 失败的登录尝试 | | `/var/log/fail2ban.log` | Fail2Ban 拦截的 IP | # 1. 查看身份验证日志 ## Ubuntu / Debian ``` sudo less /var/log/auth.log ``` ## RHEL / CentOS / Rocky / AlmaLinux ``` sudo less /var/log/secure ``` # 2. 查找失败的登录尝试 ## Debian / Ubuntu ``` sudo grep "Failed password" /var/log/auth.log ``` ## RHEL / CentOS / Alma / Rocky ``` sudo grep "Failed password" /var/log/secure ``` ## 替代的身份验证失败检测 ``` sudo grep "authentication failure" /var/log/auth.log ``` # 仅包含 IP 地址的失败登录尝试 ``` sudo grep "Failed password" /var/log/auth.log | awk '{print $(NF-3)}' ``` # 3. 按 IP 统计失败尝试 ``` sudo grep "Failed password" /var/log/auth.log | awk '{print $(NF-3)}' | sort | uniq -c | sort -nr ``` ## 这显示了什么 | 输出 | 含义 | |---|---| | 计数 | 失败尝试的次数 | | IP 地址 | 失败登录活动的来源 | ## SOC 分析师用例 这非常适合检测: - 暴力破解攻击 - 密码喷洒 - 凭证填充 - 来自单个 IP 的重复攻击者活动 # 4. 成功的登录 ## Debian / Ubuntu ``` sudo grep "Accepted password" /var/log/auth.log ``` ## 基于 RHEL 的系统 ``` sudo grep "Accepted password" /var/log/secure ``` ## 会话打开事件 ``` sudo grep "session opened" /var/log/auth.log ``` # 5. 无效用户登录尝试 ``` sudo grep "Invalid user" /var/log/auth.log ``` ## 为什么这很重要 无效用户尝试通常表明: - 用户名枚举 - 机器人扫描 - 暴力破解准备 - 凭证填充 - 攻击者侦察 # 6. 所有 SSH 登录活动 ``` sudo grep "sshd" /var/log/auth.log ``` ## SSH 失败密码活动 ``` sudo grep "sshd" /var/log/auth.log | grep "Failed password" ``` # 7. 失败的 sudo 尝试 ``` sudo grep "authentication failure" /var/log/auth.log ``` ## 安全洞察 失败的 sudo 尝试可能表明: - 权限提升尝试 - 内部人员滥用 - 低权限账户被盗用 - 攻击者试图获取 root 访问权限 # 8. 在 systemd 系统上使用 journalctl ## 失败的 SSH 登录 ``` sudo journalctl -u ssh | grep "Failed password" ``` ## 在某些系统上 ``` sudo journalctl -u sshd | grep "Failed password" ``` ## 成功的 SSH 登录 ``` sudo journalctl -u ssh | grep "Accepted password" ``` ## 最近一小时 ``` sudo journalctl --since "1 hour ago" ``` ## 实时日志 ``` sudo journalctl -f ``` # 9. 登录历史 ## 成功登录历史 ``` last ``` ## 失败登录历史 ``` sudo lastb ``` ## 重启历史 ``` last reboot ``` # 10. 按用户名过滤 ``` sudo grep "Failed password for username" /var/log/auth.log ``` ## 示例 ``` sudo grep "Failed password for cecilia" /var/log/auth.log ``` # 11. 按日期或近期条目过滤 ## 最近 50 行身份验证日志 ``` sudo tail -50 /var/log/auth.log ``` ## 实时跟踪登录尝试 ``` sudo tail -f /var/log/auth.log ``` ## 今天的失败登录 ``` sudo grep "$(date '+%b %e')" /var/log/auth.log | grep "Failed password" ``` # 12. 有用的组合过滤器 ## 失败 + 无效 + 接受的登录 ``` sudo egrep "Failed password|Invalid user|Accepted password" /var/log/auth.log ``` ## 仅显示失败尝试中的用户名 ``` sudo grep "Failed password" /var/log/auth.log | awk '{for(i=1;i<=NF;i++) if($i=="for") print $(i+1)}' ``` ## 显示源 IP 和用户名 ``` sudo grep "Failed password" /var/log/auth.log | awk '{print $(NF-3), $(NF-5)}' ``` # 13. 如果日志已轮转 ## 搜索旧的压缩 Ubuntu/Debian 日志 ``` sudo zgrep "Failed password" /var/log/auth.log* ``` ## 搜索旧的压缩基于 RHEL 的日志 ``` sudo zgrep "Failed password" /var/log/secure* ``` # 14. 快速摘要脚本 ``` sudo grep "Failed password" /var/log/auth.log | awk '{print $(NF-3)}' | sort | uniq -c | sort -nr | head ``` ## 它的作用 它显示导致登录失败最多的 IP。 ## SOC 价值 在以下情况使用它: - 快速分诊 - 暴力破解调查 - 事件响应 - SSH 攻击检测 # 探索 /var/log 中的所有日志 ``` ls -lh /var/log ``` ## 常见的重要日志 | 日志 | 用途 | |---|---| | `auth.log` | 身份验证 | | `syslog` | 常规系统日志 | | `kern.log` | 内核日志 | | `dmesg` | 启动消息 | | `fail2ban.log` | 如果安装了 Fail2Ban,记录被禁止的 IP | # 跨所有日志搜索可疑活动 ``` sudo grep -i "fail" /var/log/* ``` ## 递归搜索 ``` sudo grep -Ri "failed password" /var/log/ ``` # 寻找什么 | 指标 | 可能的含义 | |---|---| | 来自同一 IP 的重复失败 | 暴力破解 | | 尝试多个用户名 | 凭证填充 | | Root 登录尝试 | 高风险账户定向攻击 | | 异常时间登录 | 可疑访问 | | 多次失败后成功 | 可能已被入侵 | | 未知的国外 IP | 可疑远程访问 | # 防御行动 如果检测到暴力破解: ## 安装 Fail2Ban ``` sudo apt install fail2ban ``` ## 启用 Fail2Ban ``` sudo systemctl enable fail2ban sudo systemctl start fail2ban ``` ## 检查 Fail2Ban 状态 ``` sudo systemctl status fail2ban ``` ## 使用 UFW 手动拦截 IP ``` sudo ufw deny from ``` # Windows 用户枚举和账户调查 Windows 用户和权限命令对于以下方面至关重要: - 账户调查 - 权限提升检测 - 内部威胁调查 - 被盗用账户的响应 - 持久化检测 # 1. 用户枚举命令 | 命令 | 解释 | 网络安全用途 | |---|---|---| | `net user` | 列出所有本地用户 | 枚举 | | `net user username` | 显示用户详细信息 | 账户调查 | | `net user username password` | 更改密码 | 管理员重置 / 攻击者操作 | | `net user username /add` | 创建新用户 | 持久化 | | `net user username /delete` | 删除用户 | 清理 / 防御 | | `net user username /active:no` | 禁用账户 | 锁定被盗用的账户 | | `net user username /active:yes` | 启用账户 | 恢复访问 | | `net user username *` | 提示输入密码 | 安全密码输入 | # Windows 用户命令示例 ## 列出所有本地用户 ``` net user ``` ## 调查特定用户 ``` net user username ``` ## 创建新用户 ``` net user analyst Password123! /add ``` ## 删除用户 ``` net user analyst /delete ``` ## 禁用被盗用的账户 ``` net user analyst /active:no ``` ## 启用账户 ``` net user analyst /active:yes ``` ## 安全密码提示 ``` net user analyst * ``` # 2. 权限提升检测 | 命令 | 解释 | 威胁用途 | |---|---|---| | `net localgroup administrators` | 列出管理员 | 识别特权用户 | | `net localgroup administrators username /add` | 将用户添加到管理员组 | 权限提升 | | `net localgroup administrators username /delete` | 移除管理员权限 | 防御 | # Windows 权限命令示例 ## 列出本地管理员 ``` net localgroup administrators ``` ## 将用户添加到本地管理员 ``` net localgroup administrators username /add ``` ## 从本地管理员中移除用户 ``` net localgroup administrators username /delete ``` # Windows SOC 调查命令 ## 查看近期的安全事件 ``` Get-WinEvent -LogName Security -MaxEvents 50 ``` ## 失败的登录 - 事件 ID 4625 ``` Get-WinEvent -FilterHashtable @{LogName='Security'; ID=4625} ``` ## 成功的登录 - 事件 ID 4624 ``` Get-WinEvent -FilterHashtable @{LogName='Security'; ID=4624} ``` ## 特权登录 - 事件 ID 4672 ``` Get-WinEvent -FilterHashtable @{LogName='Security'; ID=4672} ``` ## 已将用户添加到本地组 - 事件 ID 4732 ``` Get-WinEvent -FilterHashtable @{LogName='Security'; ID=4732} ``` # 蓝队检测提示 务必调查: - 意外出现的新用户 - 被禁用的账户 - 重新启用的账户 - 新的管理员账户 - 管理员组成员身份的更改 - 失败登录后接着成功登录 - 非工作时间的的管理员活动 # MITRE ATT&CK 映射 | 活动 | MITRE 技术 | 含义 | |---|---|---| | 失败的登录尝试 | T1110 暴力破解 | 密码猜测 | | 尝试多个用户名 | T1110.003 密码喷洒 | 凭证攻击 | | 失败后成功登录 | T1078 有效账户 | 可能的账户被盗用 | | 创建新的本地用户 | T1136 创建账户 | 持久化 | | 将用户添加到管理员组 | T1068 / T1078 | 权限提升 / 有效账户 | | SSH 扫描 | T1046 网络服务发现 | 侦察 | | Sudo 滥用 | T1548 滥用提权控制机制 | 权限提升 | # CyberNova 专业提示 这就是为什么: # 身份 = 新的边界 # 最终 SOC 总结 - Linux 身份验证日志有助于检测暴力破解和 SSH 滥用。 - `journalctl` 提供强大的基于 systemd 的事件可见性。 - `last` 和 `lastb` 可快速显示登录历史。 - Windows `net user` 命令对于账户调查非常强大。 - Windows 本地组命令可揭示权限提升。 - 事件 ID 4624、4625、4672 和 4732 对于 SOC 调查至关重要。 - 始终将失败的登录活动与成功的登录相关联。 - 上下文胜过告警。 - 调查胜过假设。
# 11. 最终检查清单 | 任务 | 已完成 | |---|---| | 审查了 Linux 日志位置 | ☐ | | 练习了 `journalctl` 和 `/var/log/auth.log` 分析 | ☐ | | 生成了 Windows 安全事件 ID 4625 | ☐ | | 审查了 PowerShell 事件 ID 4103 和 4104 | ☐ | | 在授权实验室中模拟了安全的 Nmap 扫描 | ☐ | | 启用了 UFW 日志记录 | ☐ | | 捕获了证据屏幕截图 | ☐ | | 将事件映射到 MITRE ATT&CK | ☐ | | 撰写了分析师报告 | ☐ | | 将实验室证据添加到了作品集 | ☐ | # 最终专业总结 日志是网络安全运营的证据层。对于 SOC 分析师、Windows 管理员、Linux 管理员和威胁狩猎者来说,日志分析将原始事件转化为安全情报。本实验建立了检测身份验证攻击、PowerShell 滥用、网络侦察、SSH 暴力破解活动和早期入侵指标所需的实践基础。
标签:AI合规, Awesome, Conpot, CTI, CyberNova Academy, IPv6, Microsoft Sentinel, PowerShell, TTP映射, UFW防火墙, Wazuh, Windows事件日志, Windows安全, 安全分析师, 安全实战, 安全实验室, 安全运营中心, 库, 应急响应, 漏洞修复, 系统加固, 系统管理, 网络安全, 网络安全培训, 网络映射, 隐私保护