👨‍💻
Hacking Notes
  • Hacking Notes
  • 💅One-Liners
  • ⚔️Offensive
    • Exploit Workflow
    • Recon
      • OSINT
      • DNS
        • Domain Discovery
      • Layer 2 Config and Analysis
      • Port Scanning and Discovery
      • Port Attacks
      • Link it all together
    • Payloads
      • MSFVenom
      • Reverse Shells
    • Websites
      • Enumeration
      • Injection/LFI
      • Session Management
      • Brute Forcing
      • JavaScript & XSS
      • SSRF
      • XXE
      • PHP
    • Password Attacks
      • Brute Forcing
      • Mimikatz
      • Password Cracking
      • Hash Extraction
      • Wordlist Generation
    • Databases
      • SQL
      • Mongodb
    • Microsoft Windows Exploits
      • Enumeration
      • Powershell
      • Cmd
      • Privilege Escalation
      • Active Directory
      • Bloodhound
    • Social Engineering
    • Netcat & Socat
    • File Transfers
    • Metasploit
      • Writing Modules
    • PS Empire
    • Priv Escalation
    • Post Exploitation
    • Pivoting
    • Certs and Secrets
    • NGROK
    • Misc.
  • 🛡️Defensive
    • Defensive Notes
    • Windows Forensics
      • Program Execution Artifacts
      • ASEP Locations
      • Event Logs
    • Linux Forensics
    • Network Forensics
      • tshark
      • Wireshark Filters
    • Memory Forensics
    • Stego
    • Malware Analysis
    • Volatility
  • 🌩️Cloud
    • Scope and Shared Responsibility
    • AWS CLI
    • Azure CLI
    • SaaS Attacks
    • PaaS
  • ⌨️Programming
    • Programming Notes
    • Examples and Quick Scripts
    • PowerShell
    • Pwn
      • Windows Pwn
    • Python
      • Basic Python
      • Modules
      • Working with Files
      • Networking
      • Attack Related
      • Scapy
        • Using Scapy
        • Reading PCAP
    • C
      • Code Examples
      • GDB
    • PHP
Powered by GitBook
On this page

Was this helpful?

  1. Offensive
  2. Microsoft Windows Exploits

Cmd

Windows cmd might be old but is still a very useful tool!

Command

Output

type flag.txt

Read the output of flag.txt like the cat command

type *.txt

Output of all *.txt files in current dir

more flag.txt

Read one page at a time of the file

type flag.txt | find /i "flag{"

Search for a string in a file

type flag.txt | findstr "flag.*$"

Searches for a regex string in a file

dir /b /s C:\msbuild.exe

search for a file named msbuild.exe in the C:\ drive recursively

net user

List local users

net localgroup

local groups

net localgroup administrators

Members of local admin group

net user haha lmao /add

Adds a user named haha with the pw lmao

net localgroup administrators haha /add

Adds the haha user to the local administrators group

netsh advfirewall show allprofiles

See the config of the built-in firewall

netsh advfirewall set allprofiles state off

Turn off the built in firewall

reg query [key name]

Read a key

reg add [key name] /v [value] /t [type] /d [data]

adding a reg key

net use \\10.0.0.1 lmao /u:haha

Connect to host 10.0.0.1 on SMB for user haha with pwd lmao

sc query

List all running services

sc query state=all

List ALL services

sc qc VSS

List information about one specific service

sc start VSS

sc stop VSS

Start/stop a service

PreviousPowershellNextPrivilege Escalation

Last updated 4 years ago

Was this helpful?

⚔️