Skip to content

SECLogics

Cybersecurity | Tech News | Engineering Solutions

Primary Menu
  • Home
  • Technology
  • Cybersecurity
  • Systems
  • DevOps
  • AWS
  • Azure
  • Virtualization
  • Networking
  • Home
  • 2026
  • April
  • 21
  • Most Useful Cybersecurity Commands in 2026 (Linux + Windows Incident Pack)
  • Cybersecurity
  • Systems

Most Useful Cybersecurity Commands in 2026 (Linux + Windows Incident Pack)

Editorial Team April 21, 2026 (Last updated: May 9, 2026) 3 minutes read

If this article is going to be useful, it should help you investigate real incidents fast. This version is a practical command pack for Linux and Windows with context on when to run each command and what to look for.

Use this pack for 3 common situations

  • Suspected credential abuse or brute force attempts
  • Unexpected process/network activity on servers
  • Post-change validation after hardening or patching

Linux command pack (high signal)

1) Who logged in and from where

last -ai | head -n 30
who
w

Look for unusual source IPs, odd login times, and unknown TTY sessions.

2) Failed SSH authentication spikes

# Debian/Ubuntu
grep "Failed password" /var/log/auth.log | tail -n 100

# RHEL/CentOS/Alma
grep "Failed password" /var/log/secure | tail -n 100

If one source repeatedly fails across many usernames, treat it as brute-force behavior and block quickly.

3) Privilege escalation trail (sudo)

grep "sudo" /var/log/auth.log | tail -n 100

Correlate who escalated and what commands were run.

4) Listening services and process owners

ss -tulpen
lsof -i -P -n | grep LISTEN

Flag unexpected listeners, especially on internet-exposed hosts.

5) Active outbound connections (possible beaconing)

ss -tpn state established

Investigate persistent connections to unfamiliar external addresses.

6) Persistence checks (cron/systemd)

crontab -l
ls -la /etc/cron* 
systemctl list-timers --all
systemctl list-unit-files | grep enabled

Look for unknown scheduled tasks/services created recently.

7) World-writable file quick check

find / -xdev -type f -perm -0002 2>/dev/null | head -n 200

Use with care; verify whether writable files are expected for the application role.

Windows command pack (PowerShell-first)

1) Failed logons (Event ID 4625)

Get-WinEvent -FilterHashtable @{LogName='Security'; Id=4625; StartTime=(Get-Date).AddHours(-6)} |
  Select-Object TimeCreated, Message

High failed-logon volume against multiple accounts often indicates spray or stuffing attempts.

2) Privileged logons (Event ID 4672)

Get-WinEvent -FilterHashtable @{LogName='Security'; Id=4672; StartTime=(Get-Date).AddHours(-6)} |
  Select-Object TimeCreated, Message

Validate that privileged logons match known admin activity windows.

3) Process creation (Event ID 4688)

Get-WinEvent -FilterHashtable @{LogName='Security'; Id=4688; StartTime=(Get-Date).AddHours(-4)} |
  Select-Object TimeCreated, Message

Hunt for LOLBins (e.g., rundll32, mshta, suspicious PowerShell execution chains).

4) New service installation (Event ID 4697)

Get-WinEvent -FilterHashtable @{LogName='Security'; Id=4697; StartTime=(Get-Date).AddDays(-1)} |
  Select-Object TimeCreated, Message

Unexpected services can indicate persistence attempts.

5) Listening ports and owning process

Get-NetTCPConnection -State Listen |
  Sort-Object LocalPort |
  Select-Object LocalAddress, LocalPort, OwningProcess

Map suspicious process IDs with Get-Process -Id <PID>.

6) Local Administrators drift

Get-LocalGroupMember Administrators

Detect unauthorized membership changes quickly.

7) Recent updates (patch visibility)

Get-HotFix | Sort-Object InstalledOn -Descending | Select-Object -First 20

Use this during post-patch validation and incident containment windows.

Fast triage workflow (15 minutes)

  1. Check authentication anomalies (failed + privileged logons).
  2. Check suspicious process execution and service creation.
  3. Check listening ports and active outbound connections.
  4. Capture evidence and isolate affected host if compromise is likely.

What to avoid

  • Do not run destructive cleanup before collecting evidence.
  • Do not assume one alert = one host; pivot laterally across related systems.
  • Do not skip timeline correlation between auth, process, and network events.

This command pack is built for operators who need signal fast, not generic theory.

Post navigation

Previous: Auto HDR Switcher Script for Steam Games (PowerShell)

Recent Posts

  • Most Useful Cybersecurity Commands in 2026 (Linux + Windows Incident Pack)
  • Auto HDR Switcher Script for Steam Games (PowerShell)
  • Windows Security Triage Playbook with PowerShell (Step-by-Step)
  • 15 Windows Event IDs Every Security Admin Should Track
  • Hyper-V: Building a Small S2D Cluster (Practical Guide)

You May Have Missed

Most Useful Cybersecurity Commands in 2026 (Linux + Windows Incident Pack)
  • Cybersecurity
  • Systems

Most Useful Cybersecurity Commands in 2026 (Linux + Windows Incident Pack)

Editorial Team April 21, 2026
Auto HDR Switcher Script for Steam Games (PowerShell)
  • Systems

Auto HDR Switcher Script for Steam Games (PowerShell)

Editorial Team April 5, 2026
Windows Security Triage Playbook with PowerShell (Step-by-Step)
  • Cybersecurity
  • Systems

Windows Security Triage Playbook with PowerShell (Step-by-Step)

Editorial Team March 31, 2026
15 Windows Event IDs Every Security Admin Should Track
  • Cybersecurity
  • Systems

15 Windows Event IDs Every Security Admin Should Track

Editorial Team March 31, 2026
Copyright © 2026 All rights reserved. | ReviewNews by AF themes.
Share

Facebook

X

LinkedIn

WhatsApp

Copy Link
×