Sitemap

InfosecPandey

Welcome! InfosecPandey is a platform for cybersecurity learning, offering tutorials, hands-on labs, and tools on ethical hacking, penetration testing, and more. Stay updated with the latest trends and enhance your skills through real-world challenges and expert advice.

Member-only story

100 Cybersecurity One-Liners (PowerShell, Bash, CMD)

4 min readJun 14, 2025

Welcome to the dark arts of the cyber command line!

Below is a curated arsenal of 100 cybersecurity one-liners that are perfect for incident response, threat hunting, enumeration, privilege escalation, or just flexing at your next CTF.

Each one-liner is like a mini-hack spell — quick, precise, and battle-tested.

PowerShell One-Liners

  1. Get-LocalUser | Where-Object {$_.Enabled -eq $true} — List all enabled local users.
  2. Get-EventLog -LogName Security -Newest 10 — Show the last 10 Security events.
  3. Get-Service | Where-Object {$_.Status -eq 'Running'} — List running services.
  4. Get-ChildItem -Recurse -Force C:\Users | Where-Object {$_.Attributes -match 'Hidden'} — Find hidden files.
  5. Get-Process | Sort CPU -Descending | Select -First 5 — Top 5 CPU hogging processes.
  6. Get-NetTCPConnection -State Listen — List all listening TCP ports.
  7. Test-Connection google.com -Count 3 — Quick ping test.
  8. Get-WmiObject -Class Win32_Product | Select-Object Name — List installed programs.
  9. Get-Command *password* — Find commands related to 'password'.
  10. whoami /priv — List current privileges.

Bash One-Liners

  1. whoami && id — Show user and UID info.

Create an account to read the full story.

The author made this story available to Medium members only.
If you’re new to Medium, create a new account to read this story on us.

Or, continue in mobile web
Already have an account? Sign in

InfosecPandey

Published in InfosecPandey

Welcome! InfosecPandey is a platform for cybersecurity learning, offering tutorials, hands-on labs, and tools on ethical hacking, penetration testing, and more. Stay updated with the latest trends and enhance your skills through real-world challenges and expert advice.

InfosecPandey
InfosecPandey

Written by InfosecPandey

https://www.youtube.com/@InfosecPandey InfoSec Expert | Cloud Security, & Sec. Architecture. | AI-Sec Enthusiast

No responses yet

Unknown user

Write a response