Basic CMD for Pentesters

System info

Version and Patches info

wmic os get osarchitecture || echo %PROCESSOR_ARCHITECTURE% systeminfosysteminfo | findstr /B /C:"OS Name" /C:"OS Version" wmic qfe get Caption,Description,HotFixID,InstalledOn hostnameDRIVERQUERY 

Environment

Some env variables to highlight:

  • COMPUTERNAME: Name of the computer

  • TEMP/TMP: Temp folder

  • USERNAME: Your username

  • HOMEPATH/USERPROFILE: Home directory

  • windir: C:\Windows

  • OS:Windos OS

  • LOGONSERVER: Name of domain controller

  • USERDNSDOMAIN: Domain name to use with DNS

  • USERDOMAIN: Name of the domain

nslookup %LOGONSERVER%.%USERDNSDOMAIN% 

Mounted disks

AV

Recycle Bin

Processes, Services & Software

Domain info

Logs & Events

Users & Groups

Users

Groups

List sessions

Password Policy

Persistence with users

Network

Interfaces, Routes, Ports, Hosts and DNSCache

Firewall

Wifi

SNMP

Network Interfaces

ARP table

Download

Bitsadmin.exe

CertReq.exe

Certutil.exe

Desktopimgdownldr.exe

Diantz.exe

Esentutl.exe

Expand.exe

Extrac32.exe

Findstr.exe

Ftp.exe

GfxDownloadWrapper.exe

Hh.exe

Ieexec.exe

Makecab.exe

MpCmdRun.exe

Replace.exe

Excel.exe

Powerpnt.exe

Squirrel.exe

Update.exe

Winword.exe

Wsl.exe

Misc

Listen address ACLs

You can listen on http://+:80/Temporary_Listen_Addresses/arrow-up-right without being administrator.

Manual DNS shell

Attacker (Kali) must use one of these 2 options:

Victim

for /f tokens _**_technique: This allows us to execute commands, get the first X words of each line and send it through DNS to our server

You can also redirect the output, and then read it.

Calling CMD from C code

Alternate Data Streams CheatSheet (ADS/Alternate Data Stream)

Taken from https://gist.github.com/api0cradle/cdd2d0d0ec9abb686f0e89306e277b8farrow-up-right

Last updated

Was this helpful?