Intrusion Discovery Cheat Sheet V2.0 Windows Xp Pro / 2003 Server / Vista Page 2

ADVERTISEMENT

Invoking Useful GUIs at the Command Line
File Search and Counting Lines
Shutdown and Restart
Local User Manager (includes group management):
Search directory structure for a file in a specific
Shutdown Windows immediately:
C:\> lusrmgr.msc
directory:
C:\> shutdown /s /t 0
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
[Command]:
Restart Windows immediately:
Task Manager:
C:\> [Command] | find /c /v ""
C:\> shutdown /r /t 0
C:\> taskmgr.exe
Finds the count (/c) of lines that do not contain (/v)
Abort shutdown/restart countdown:
Security Policy Manager:
nothing (""). Lines that do not have nothing are all
C:\> shutdown /a
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
Control Panel:
Counting Loop:
C:\> control
Look for usage of port [port] every [N] seconds:
C:\> for /L %i in
([start],[step],[stop]) do [command]
C:\> netstat –nao [N] | find [port]
Close GUI windows by hitting Alt-F4
Set %i to an initial value of [start] and increment
Dump detailed protocol statistics:
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
Turn off built-in Windows firewall:
to [stop]. For each iteration, run [command]. The
C:\> netsh firewall set opmode disable
Installing Built-in Packages on Vista
iterator variable %i can be used anywhere in the
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:\> netsh interface ip set address
C:\> for /F %i in ([file-set]) do
Install telnet client on Vista:
local static [IPaddr] [Netmask]
[command]
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].
static [IPaddr]
WindowsActivationService;WAS-
ProcessModel; WAS-NetFxEnvironment;WAS-
Configure interface to use DHCP:
ConfigurationAPI
C:\> netsh interface ip set address
To remove any of these packages, replace install
local dhcp
update (/iu) with uninstall update (/uu)

ADVERTISEMENT

00 votes

Related Articles

Related forms

Related Categories

Parent category: Education
Go
Page of 2