SlideShare a Scribd company logo
Reg Command                                                   WMIC                                                       Windows
                                                                                                                                         Command Line
Adding Keys and Values:                                Fundamental grammar:
C:> reg add                                           C:> wmic [alias] [where clause] [verb                                             Cheat Sheet
[TargetIPaddr][RegDomain][Key]                     clause]                                                                                    By Ed Skoudis

                                                                                                                                           POCKET REFERENCE GUIDE
Add a key to the registry on machine                   Useful [aliases]:
[TargetIPaddr] within the registry domain                     process            service                                                           http://www.sans.org

[RegDomain] to location [Key]. If no remote                   share              nicconfig
machine is specified, the current machine is                  startup            useraccount                                       Purpose
assumed.                                                      qfe (Quick Fix Engineering – shows patches)       The purpose of this cheat sheet is to provide
                                                                                                                    tips on how to use various Windows
Export and Import:                                     Example [where clauses]:                                  command that are frequently referenced in
C:> reg export [RegDomain][Key]                           where name="nc.exe"                                        SANS 504, 517, 531, and 560.
[FileName]                                                  where (commandline like "%stuff")
                                                            where (name="cmd.exe" and                                Process and Service Information
Export all subkeys and values located in the domain              parentprocessid!="[pid]")
[RegDomain] under the location [Key] to the file                                                            List all processes currently running:
[FileName]                                             Example [verb clauses]:                              C:> tasklist
                                                            list [full|brief]
C:> reg import [FileName]                                  get [attrib1,attrib2…]                          List all processes currently running and the DLLs
                                                            call [method]                                   each has loaded:
Import all registry entries from the file [FileName]        delete                                          C:> tasklist /m

Import and export can only be done from or to the      List all attributes of [alias]:                      Lists all processes currently running which have the
local machine.                                         C:> wmic [alias] get /?                             specified [dll] loaded:
                                                                                                            C:> tasklist /m [dll]
Query for a specific Value of a Key:                   List all callable methods of [alias]:
C:> reg query                                         C:> wmic [alias] call /?                            List all processes currently running and the services
[TargetIPaddr][RegDomain][Key] /v                                                                       hosted in those processes:
[ValueName]                                            Example:                                             C:> tasklist /svc
                                                       List all attributes of all running processes:
Query a key on machine [TargetIPaddr] within           C:> wmic process list full                          Query brief status of all services:
the registry domain [RegDomain] in location                                                                 C:> sc query
[Key] and get the specific value [ValueName]           Make WMIC effect remote [TargetIPaddr]:
under that key. Add /s to recurse all values.          C:> wmic /node:[TargetIPaddr]                       Query the configuration of a specific service:
                                                       /user:[User] /password:[Passwd] process              C:> sc qc [ServiceName]
                                                       list full
Shutdown and Restart                            File Search and Counting Lines                      Invoking Useful GUIs at the Command Line

                                                   Search directory structure for a file in a specific        Local User Manager (includes group management):
Shutdown Windows immediately:                                                                                 C:> lusrmgr.msc
C:> shutdown /s /t 0                              directory:
                                                   C:> dir /b /s [Directory][FileName]
                                                                                                              Services Control Panel:
Note: Command may not power down the hardware.                                                                C:> services.msc
                                                   Count the number of lines on StandardOuy of
Restart Windows immediately:                       [Command]:
                                                   C:> [Command] | find /c /v ""                             Task Manager:
C:> shutdown /r /t 0                                                                                         C:> taskmgr.exe

Abort shutdown/restart countdown:                  Finds the count (/c) of lines that do not contain (/v)
                                                                                                              Security Policy Manager:
C:> shutdown /a                                   nothing (""). Lines that do not have nothing are all       C:> secpol.msc
                                                   lines, even blank lines, which contain CR/LF
              Useful Netstat Syntax                                                                           Event Viewer:
                                                                                                              C:> eventvwr.msc
Show all TCP and UDP port usage and process ID:                Command Line FOR Loops
C:> netstat –nao
                                                   Counting Loop:                                             Control Panel:
                                                   C:> for /L %i in                                          C:> control
Look for usage of port [port] every [N] seconds:
C:> netstat –nao [N] | find [port]                ([start],[step],[stop]) do [command]
                                                                                                              Close GUI windows by hitting Alt-F4
Dump detailed protocol statistics:                 Set %i to an initial value of [start] and increment            Interacting with the Network Using Netsh
C:> netstat –s –p [tcp|udp|ip|icmp]               it by [step] at every iteration until its value is equal
                                                   to [stop]. For each iteration, run [command]. The          Turn off built-in Windows firewall:
      Installing Built-in Packages on Vista        iterator variable %i can be used anywhere in the           C:> netsh firewall set opmode disable
                                                   command to represent its current value.
Install telnet service on Vista:                                                                              Configure interface “Local Area Connection” with
C:> pkgmgr /iu:"TelnetServer"                                                                                [IPaddr] [Netmask] [DefaultGW]:
                                                   Iterate over file contents:
                                                   C:> for /F %i in ([file-set]) do                          C:> netsh interface ip set address
Install telnet client on Vista:                    [command]                                                  local static [IPaddr] [Netmask]
C:> pkgmgr /iu:"TelnetClient"                                                                                [DefaultGW] 1
                                                   Iterate through the contents of the file on a line-by-
Install IIS on Vista:                                                                                         Configure DNS server for “Local Area Connection”:
                                                   line basis. For each iteration, store the contents of
C:> pkgmgr /iu:IIS-WebServerRole;WAS-                                                                        C:> netsh interface ip set dns local
                                                   the line into %i and run [command].
WindowsActivationService;WAS-                                                                                 static [IPaddr]
ProcessModel; WAS-NetFxEnvironment;WAS-
ConfigurationAPI                                                                                              Configure interface to use DHCP:
                                                                                                              C:> netsh interface ip set address
To remove any of these packages, replace install
                                                                                                              local dhcp
update (/iu) with uninstall update (/uu)

More Related Content

Similar to Windows command line_sheet_v1

Building Better Backdoors with WMI - DerbyCon 2017
Building Better Backdoors with WMI - DerbyCon 2017Building Better Backdoors with WMI - DerbyCon 2017
Building Better Backdoors with WMI - DerbyCon 2017
Alexander Polce Leary
 
CMake Tutorial
CMake TutorialCMake Tutorial
CMake Tutorial
Fu Haiping
 
Post exploitation using powershell
Post exploitation using powershellPost exploitation using powershell
Post exploitation using powershell
Mihir Shah
 
Windows Attacks AT is the new black
Windows Attacks   AT is the new blackWindows Attacks   AT is the new black
Windows Attacks AT is the new black
Rob Fuller
 
Windows attacks - AT is the new black
Windows attacks - AT is the new blackWindows attacks - AT is the new black
Windows attacks - AT is the new black
Chris Gates
 
Internal commands.29to30
Internal commands.29to30Internal commands.29to30
Internal commands.29to30myrajendra
 
Internal commands.29to30
Internal commands.29to30Internal commands.29to30
Internal commands.29to30myrajendra
 
Advanced System Security and Digital Forensics
Advanced System Security and Digital ForensicsAdvanced System Security and Digital Forensics
Advanced System Security and Digital Forensics
Dr. Ramchandra Mangrulkar
 
Presentation iv implementasi 802x eap tls peap mscha pv2
Presentation iv implementasi  802x eap tls peap mscha pv2Presentation iv implementasi  802x eap tls peap mscha pv2
Presentation iv implementasi 802x eap tls peap mscha pv2Hell19
 
Android Logging System
Android Logging SystemAndroid Logging System
Android Logging System
William Lee
 
Docker Essentials Workshop— Innovation Labs July 2020
Docker Essentials Workshop— Innovation Labs July 2020Docker Essentials Workshop— Innovation Labs July 2020
Docker Essentials Workshop— Innovation Labs July 2020
CloudHero
 
Appdomains
AppdomainsAppdomains
Appdomains
Dhowlath Mohammed
 
Deep dive in Citrix Troubleshooting
Deep dive in Citrix TroubleshootingDeep dive in Citrix Troubleshooting
Deep dive in Citrix Troubleshooting
Denis Gundarev
 
Introduction To Managing VMware With PowerShell
Introduction To Managing VMware With PowerShellIntroduction To Managing VMware With PowerShell
Introduction To Managing VMware With PowerShell
Hal Rottenberg
 
Scaffolding for Serverless: lightning talk for AWS Arlington Meetup
Scaffolding for Serverless: lightning talk for AWS Arlington MeetupScaffolding for Serverless: lightning talk for AWS Arlington Meetup
Scaffolding for Serverless: lightning talk for AWS Arlington Meetup
Chris Shenton
 
CONFidence 2015: DTrace + OSX = Fun - Andrzej Dyjak
CONFidence 2015: DTrace + OSX = Fun - Andrzej Dyjak   CONFidence 2015: DTrace + OSX = Fun - Andrzej Dyjak
CONFidence 2015: DTrace + OSX = Fun - Andrzej Dyjak
PROIDEA
 
PuppetConf 2016: The Challenges with Container Configuration – David Lutterko...
PuppetConf 2016: The Challenges with Container Configuration – David Lutterko...PuppetConf 2016: The Challenges with Container Configuration – David Lutterko...
PuppetConf 2016: The Challenges with Container Configuration – David Lutterko...
Puppet
 
Challenges of container configuration
Challenges of container configurationChallenges of container configuration
Challenges of container configuration
lutter
 
c bstatC nslookupDefault Server pdc.corp.example.comAdd.pdf
c bstatC nslookupDefault Server pdc.corp.example.comAdd.pdfc bstatC nslookupDefault Server pdc.corp.example.comAdd.pdf
c bstatC nslookupDefault Server pdc.corp.example.comAdd.pdf
annaelctronics
 
Docker Security workshop slides
Docker Security workshop slidesDocker Security workshop slides
Docker Security workshop slides
Docker, Inc.
 

Similar to Windows command line_sheet_v1 (20)

Building Better Backdoors with WMI - DerbyCon 2017
Building Better Backdoors with WMI - DerbyCon 2017Building Better Backdoors with WMI - DerbyCon 2017
Building Better Backdoors with WMI - DerbyCon 2017
 
CMake Tutorial
CMake TutorialCMake Tutorial
CMake Tutorial
 
Post exploitation using powershell
Post exploitation using powershellPost exploitation using powershell
Post exploitation using powershell
 
Windows Attacks AT is the new black
Windows Attacks   AT is the new blackWindows Attacks   AT is the new black
Windows Attacks AT is the new black
 
Windows attacks - AT is the new black
Windows attacks - AT is the new blackWindows attacks - AT is the new black
Windows attacks - AT is the new black
 
Internal commands.29to30
Internal commands.29to30Internal commands.29to30
Internal commands.29to30
 
Internal commands.29to30
Internal commands.29to30Internal commands.29to30
Internal commands.29to30
 
Advanced System Security and Digital Forensics
Advanced System Security and Digital ForensicsAdvanced System Security and Digital Forensics
Advanced System Security and Digital Forensics
 
Presentation iv implementasi 802x eap tls peap mscha pv2
Presentation iv implementasi  802x eap tls peap mscha pv2Presentation iv implementasi  802x eap tls peap mscha pv2
Presentation iv implementasi 802x eap tls peap mscha pv2
 
Android Logging System
Android Logging SystemAndroid Logging System
Android Logging System
 
Docker Essentials Workshop— Innovation Labs July 2020
Docker Essentials Workshop— Innovation Labs July 2020Docker Essentials Workshop— Innovation Labs July 2020
Docker Essentials Workshop— Innovation Labs July 2020
 
Appdomains
AppdomainsAppdomains
Appdomains
 
Deep dive in Citrix Troubleshooting
Deep dive in Citrix TroubleshootingDeep dive in Citrix Troubleshooting
Deep dive in Citrix Troubleshooting
 
Introduction To Managing VMware With PowerShell
Introduction To Managing VMware With PowerShellIntroduction To Managing VMware With PowerShell
Introduction To Managing VMware With PowerShell
 
Scaffolding for Serverless: lightning talk for AWS Arlington Meetup
Scaffolding for Serverless: lightning talk for AWS Arlington MeetupScaffolding for Serverless: lightning talk for AWS Arlington Meetup
Scaffolding for Serverless: lightning talk for AWS Arlington Meetup
 
CONFidence 2015: DTrace + OSX = Fun - Andrzej Dyjak
CONFidence 2015: DTrace + OSX = Fun - Andrzej Dyjak   CONFidence 2015: DTrace + OSX = Fun - Andrzej Dyjak
CONFidence 2015: DTrace + OSX = Fun - Andrzej Dyjak
 
PuppetConf 2016: The Challenges with Container Configuration – David Lutterko...
PuppetConf 2016: The Challenges with Container Configuration – David Lutterko...PuppetConf 2016: The Challenges with Container Configuration – David Lutterko...
PuppetConf 2016: The Challenges with Container Configuration – David Lutterko...
 
Challenges of container configuration
Challenges of container configurationChallenges of container configuration
Challenges of container configuration
 
c bstatC nslookupDefault Server pdc.corp.example.comAdd.pdf
c bstatC nslookupDefault Server pdc.corp.example.comAdd.pdfc bstatC nslookupDefault Server pdc.corp.example.comAdd.pdf
c bstatC nslookupDefault Server pdc.corp.example.comAdd.pdf
 
Docker Security workshop slides
Docker Security workshop slidesDocker Security workshop slides
Docker Security workshop slides
 

More from Ganesh Kumar Veerla

Boot prom basics
Boot prom basicsBoot prom basics
Boot prom basics
Ganesh Kumar Veerla
 
Chapter 5 HP OVOw Node management
Chapter 5 HP OVOw Node managementChapter 5 HP OVOw Node management
Chapter 5 HP OVOw Node management
Ganesh Kumar Veerla
 
Chapter 2 hp ovo service driven management
Chapter 2  hp ovo service driven managementChapter 2  hp ovo service driven management
Chapter 2 hp ovo service driven managementGanesh Kumar Veerla
 
Sunadmin
SunadminSunadmin
Hp open view(hp ov)
Hp open view(hp ov)Hp open view(hp ov)
Hp open view(hp ov)
Ganesh Kumar Veerla
 
imp websites for solaris and linux
imp websites for solaris and linux imp websites for solaris and linux
imp websites for solaris and linux
Ganesh Kumar Veerla
 
Managerof managerarchitecture
Managerof managerarchitectureManagerof managerarchitecture
Managerof managerarchitecture
Ganesh Kumar Veerla
 
Hp open view
Hp open viewHp open view
Hp open view
Ganesh Kumar Veerla
 
Solaris
SolarisSolaris

More from Ganesh Kumar Veerla (15)

Boot prom basics
Boot prom basicsBoot prom basics
Boot prom basics
 
Omw doc
Omw docOmw doc
Omw doc
 
Chapter 12 user roles
Chapter 12 user rolesChapter 12 user roles
Chapter 12 user roles
 
Chapter 6 polices
Chapter 6 policesChapter 6 polices
Chapter 6 polices
 
Chapter 5 HP OVOw Node management
Chapter 5 HP OVOw Node managementChapter 5 HP OVOw Node management
Chapter 5 HP OVOw Node management
 
Chapter 3 HP OVOW architecture
Chapter 3 HP OVOW architectureChapter 3 HP OVOW architecture
Chapter 3 HP OVOW architecture
 
Chapter 2 hp ovo service driven management
Chapter 2  hp ovo service driven managementChapter 2  hp ovo service driven management
Chapter 2 hp ovo service driven management
 
Sunadmin
SunadminSunadmin
Sunadmin
 
Hp open view(hp ov)
Hp open view(hp ov)Hp open view(hp ov)
Hp open view(hp ov)
 
imp websites for solaris and linux
imp websites for solaris and linux imp websites for solaris and linux
imp websites for solaris and linux
 
Managerof managerarchitecture
Managerof managerarchitectureManagerof managerarchitecture
Managerof managerarchitecture
 
Hp open view
Hp open viewHp open view
Hp open view
 
Solaris
SolarisSolaris
Solaris
 
Nsm overview
Nsm overviewNsm overview
Nsm overview
 
Ovo and nnm work flow at ahcc
Ovo and nnm work flow at ahccOvo and nnm work flow at ahcc
Ovo and nnm work flow at ahcc
 

Recently uploaded

From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
Product School
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
Elena Simperl
 
Search and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical FuturesSearch and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical Futures
Bhaskar Mitra
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
DianaGray10
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
Alison B. Lowndes
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
Safe Software
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
Jemma Hussein Allen
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Product School
 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
RTTS
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
Alan Dix
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
Kari Kakkonen
 
Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
OnBoard
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
DianaGray10
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
ThousandEyes
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance
 
ODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User GroupODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User Group
CatarinaPereira64715
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
Sri Ambati
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Product School
 
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
Product School
 

Recently uploaded (20)

From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
 
Search and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical FuturesSearch and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical Futures
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
 
Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
 
ODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User GroupODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User Group
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
 
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
 

Windows command line_sheet_v1

  • 1. Reg Command WMIC Windows Command Line Adding Keys and Values: Fundamental grammar: C:> reg add C:> wmic [alias] [where clause] [verb Cheat Sheet [TargetIPaddr][RegDomain][Key] clause] By Ed Skoudis POCKET REFERENCE GUIDE Add a key to the registry on machine Useful [aliases]: [TargetIPaddr] within the registry domain process service http://www.sans.org [RegDomain] to location [Key]. If no remote share nicconfig machine is specified, the current machine is startup useraccount Purpose assumed. qfe (Quick Fix Engineering – shows patches) The purpose of this cheat sheet is to provide tips on how to use various Windows Export and Import: Example [where clauses]: command that are frequently referenced in C:> reg export [RegDomain][Key] where name="nc.exe" SANS 504, 517, 531, and 560. [FileName] where (commandline like "%stuff") where (name="cmd.exe" and Process and Service Information Export all subkeys and values located in the domain parentprocessid!="[pid]") [RegDomain] under the location [Key] to the file List all processes currently running: [FileName] Example [verb clauses]: C:> tasklist list [full|brief] C:> reg import [FileName] get [attrib1,attrib2…] List all processes currently running and the DLLs call [method] each has loaded: Import all registry entries from the file [FileName] delete C:> tasklist /m Import and export can only be done from or to the List all attributes of [alias]: Lists all processes currently running which have the local machine. C:> wmic [alias] get /? specified [dll] loaded: C:> tasklist /m [dll] Query for a specific Value of a Key: List all callable methods of [alias]: C:> reg query C:> wmic [alias] call /? List all processes currently running and the services [TargetIPaddr][RegDomain][Key] /v hosted in those processes: [ValueName] Example: C:> tasklist /svc List all attributes of all running processes: Query a key on machine [TargetIPaddr] within C:> wmic process list full Query brief status of all services: the registry domain [RegDomain] in location C:> sc query [Key] and get the specific value [ValueName] Make WMIC effect remote [TargetIPaddr]: under that key. Add /s to recurse all values. C:> wmic /node:[TargetIPaddr] Query the configuration of a specific service: /user:[User] /password:[Passwd] process C:> sc qc [ServiceName] list full
  • 2. Shutdown and Restart File Search and Counting Lines Invoking Useful GUIs at the Command Line Search directory structure for a file in a specific Local User Manager (includes group management): Shutdown Windows immediately: C:> lusrmgr.msc C:> shutdown /s /t 0 directory: C:> dir /b /s [Directory][FileName] Services Control Panel: Note: Command may not power down the hardware. C:> services.msc Count the number of lines on StandardOuy of Restart Windows immediately: [Command]: C:> [Command] | find /c /v "" Task Manager: C:> shutdown /r /t 0 C:> taskmgr.exe Abort shutdown/restart countdown: Finds the count (/c) of lines that do not contain (/v) Security Policy Manager: C:> shutdown /a nothing (""). Lines that do not have nothing are all C:> secpol.msc lines, even blank lines, which contain CR/LF Useful Netstat Syntax Event Viewer: C:> eventvwr.msc Show all TCP and UDP port usage and process ID: Command Line FOR Loops C:> netstat –nao Counting Loop: Control Panel: C:> for /L %i in C:> control Look for usage of port [port] every [N] seconds: C:> netstat –nao [N] | find [port] ([start],[step],[stop]) do [command] Close GUI windows by hitting Alt-F4 Dump detailed protocol statistics: Set %i to an initial value of [start] and increment Interacting with the Network Using Netsh C:> netstat –s –p [tcp|udp|ip|icmp] it by [step] at every iteration until its value is equal to [stop]. For each iteration, run [command]. The Turn off built-in Windows firewall: Installing Built-in Packages on Vista iterator variable %i can be used anywhere in the C:> netsh firewall set opmode disable command to represent its current value. Install telnet service on Vista: Configure interface “Local Area Connection” with C:> pkgmgr /iu:"TelnetServer" [IPaddr] [Netmask] [DefaultGW]: Iterate over file contents: C:> for /F %i in ([file-set]) do C:> netsh interface ip set address Install telnet client on Vista: [command] local static [IPaddr] [Netmask] C:> pkgmgr /iu:"TelnetClient" [DefaultGW] 1 Iterate through the contents of the file on a line-by- Install IIS on Vista: Configure DNS server for “Local Area Connection”: line basis. For each iteration, store the contents of C:> pkgmgr /iu:IIS-WebServerRole;WAS- C:> netsh interface ip set dns local the line into %i and run [command]. WindowsActivationService;WAS- static [IPaddr] ProcessModel; WAS-NetFxEnvironment;WAS- ConfigurationAPI Configure interface to use DHCP: C:> netsh interface ip set address To remove any of these packages, replace install local dhcp update (/iu) with uninstall update (/uu)