29.04.2014 Views

Spotting the Adversary with Windows Event Log Monitoring

Spotting the Adversary with Windows Event Log Monitoring

Spotting the Adversary with Windows Event Log Monitoring

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Generally, WinRM produces an error message when au<strong>the</strong>ntication fails. The service provides a second<br />

option to help <strong>the</strong> au<strong>the</strong>ntication process. A detailed explanation of different au<strong>the</strong>ntication methods<br />

used by WinRM can be viewed using <strong>the</strong> above command.<br />

winrm help auth<br />

Au<strong>the</strong>ntication Error<br />

The WinRM client cannot process <strong>the</strong> request. Negotiate au<strong>the</strong>ntication is currently disabled in <strong>the</strong><br />

client configuration. Change <strong>the</strong> client configuration and try <strong>the</strong> request again. If this is a request for <strong>the</strong><br />

local configuration, use one of <strong>the</strong> enabled au<strong>the</strong>ntication mechanisms still enabled. To use Kerberos,<br />

specify <strong>the</strong> local computer name as <strong>the</strong> remote destination. To use Basic, specify <strong>the</strong> local computer<br />

name as <strong>the</strong> remote destination, specify Basic au<strong>the</strong>ntication and provide user name and password.<br />

The recommended method to satisfy WinRM is to supply <strong>the</strong> –remote option <strong>with</strong> <strong>the</strong> target hostname<br />

(local or remote). If <strong>the</strong> source is part of a domain, <strong>the</strong>n executing this command requires an<br />

uninterrupted connection to <strong>the</strong> Domain Controller.<br />

Assume <strong>the</strong> command is being executed on a computer whose hostname is ABCD.<br />

winrm get winrm/config –remote:ABCD<br />

7.8.1 Operational <strong>Log</strong>s<br />

While troubleshooting an issue, it is natural for one to look at <strong>the</strong> logs to help to identify a problem.<br />

<strong>Event</strong> Forwarding and WinRM have operational logs that can be viewed in <strong>the</strong> <strong>Event</strong> Viewer or by using<br />

<strong>the</strong> command line tool wevtutil.exe. When WinRM is installed on a <strong>Windows</strong> XP client, an operational<br />

log is created.<br />

The operational log files for <strong>the</strong> <strong>Event</strong> Collector, <strong>Event</strong> Forwarding, and WinRM services can be found by<br />

navigating to Applications and Services <strong>Log</strong>s in <strong>the</strong> <strong>Event</strong> Viewer on <strong>Windows</strong> Vista and later. The list<br />

below shows <strong>the</strong> location of <strong>the</strong> operational logs under Applications and Services <strong>Log</strong>s:<br />

<br />

<br />

<br />

Microsoft > <strong>Windows</strong> > <strong>Event</strong>Collector > Operational<br />

Microsoft > <strong>Windows</strong> > <strong>Event</strong>log-ForwardPlugin > Operational<br />

Microsoft > <strong>Windows</strong> > <strong>Windows</strong> Remote Management > Operational<br />

The <strong>Event</strong>log-ForwardPlugin and <strong>Windows</strong> Remote Management operational logs are <strong>the</strong> locations<br />

that <strong>the</strong> local WinRM service will log to. Querying <strong>the</strong> <strong>Event</strong> Forwarding log can be done by using <strong>the</strong><br />

Microsoft-<strong>Windows</strong>-Forwarding publisher <strong>with</strong> <strong>the</strong> command line tool wevtutil. An example of using<br />

wevtutil:<br />

wevtutil qe “” /c:1 /rd:true /q:””<br />

If PATH_TO_LOG is not <strong>with</strong>in %SYSROOT%\system32\Winevt\<strong>Log</strong>s\, <strong>the</strong> /lf option must be used <strong>with</strong><br />

<strong>the</strong> true argument. The /rd option cannot be used on evt files (e.g., <strong>Windows</strong> XP log file format).<br />

The help documentation of <strong>the</strong> wevutil tool provides more insight of <strong>the</strong> o<strong>the</strong>r capabilities of <strong>the</strong> tool.<br />

This documentation can be found by executing <strong>the</strong> following command:<br />

wevutil /?<br />

62

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!