Skip to content

Network & remote access

IIS Web Server Logs

IIS logs cheat sheet: W3C log location per site, UTC timestamps, default fields, HTTPERR, applicationHost.config and how to hunt webshells on Windows servers.

Location
C:\inetpub\logs\LogFiles\W3SVC<siteID>\u_exYYMMDD.log
Proves
Which client IP requested which URL, with method, status code and user agent, per IIS site
Timestamps
date and time columns in UTC by default (W3C format), one file per day
Retention
Daily rollover by default; IIS never deletes old logs, so history is limited only by disk and admin cleanup
Access
Administrator; the current day's file is open by IIS, and entries are buffered before being flushed
Type
File / file system
Windows
XPVista / 78 / 8.11011
KAPE target
IISLogFiles
Velociraptor
Windows.Triage.Targets:IISLogFiles

What it is

Internet Information Services (IIS) is the Microsoft web server behind many internet-facing Windows hosts: intranet apps, SharePoint, and Exchange (OWA, ECP, EWS, Autodiscover). By default it writes one W3C text log per site per day. On a compromised web server these logs are often the only record of the initial exploit and of the requests that drove a webshell.

Location

VersionDefault log pathNotes
IIS 5.1 / 6 (XP, Server 2003)%SystemRoot%\System32\LogFiles\W3SVC<siteID>\exYYMMDD.log
IIS 7 and later (Vista and later)%SystemDrive%\inetpub\logs\LogFiles\W3SVC<siteID>\u_exYYMMDD.logu_ means UTF-8
HTTP.sys errors%SystemRoot%\System32\LogFiles\HTTPERR\httperr*.logRequests rejected before IIS (bad requests, timeouts, 503)
Server configuration%SystemRoot%\System32\inetsrv\config\applicationHost.configSites, bindings, physical paths, log settings
Site configurationweb.config in each web rootHandlers, modules, authentication

<siteID> maps to a site in applicationHost.config (Default Web Site is 1). Admins frequently move logs to another drive: always read the logFile directory attribute there first.

What it proves

  • A client IP sent a specific HTTP request (method, path, query string) at a given time, and what the server answered (status, substatus, Win32 status, time taken).
  • Repeated requests to one .aspx file from few IPs, typically POST, suggest webshell use.

It does not record request or response bodies, POST parameters, or cookies by default. Behind a load balancer or reverse proxy, c-ip is the proxy; the real client appears only if an X-Forwarded-For custom field was configured. A 200 response does not prove the attacker's command succeeded.

Key fields

FieldMeaningDefault
date, timeRequest time (written when the response completes; subtract time-taken for long requests)Yes
s-ip, s-portServer IP and portYes
cs-methodGET, POST, etc.Yes
cs-uri-stem, cs-uri-queryPath and query stringYes
cs-usernameAuthenticated user (- if anonymous)Yes
c-ipClient IPYes
cs(User-Agent), cs(Referer)Client headersYes
sc-status, sc-substatus, sc-win32-statusResponse statusYes
time-takenMillisecondsYes
cs-host, sc-bytes, cs-bytesHost header, bytes out/inNo, must be enabled

The #Fields: header line in each file lists the actual columns; they can change mid-file after a config change.

Timestamps

TimestampFormatPitfalls
date + timeYYYY-MM-DD HH:MM:SS, UTC for W3COther log formats (IIS, NCSA) use local time; see UTC and local time
File name YYMMDDUTC day unless "Use local time for file naming and rollover" is setOne day's activity can span two files in local terms
Web root file timesNTFS, UTCWebshell creation time: check $MFT and the USN journal for timestomping

Retention and clearing

  • Default rollover is daily; IIS has no built-in deletion, so months or years of logs often exist unless a scheduled cleanup script runs.
  • Entries are buffered in memory and flushed periodically; on a live server run netsh http flush logbuffer before collecting.
  • Attackers delete or truncate log files or disable logging in applicationHost.config; missing days and a changed logFile element are both findings.

Collection

Get-Content C:\Windows\System32\inetsrv\config\applicationHost.config | Select-String "logFile|physicalPath|<site "
netsh http flush logbuffer
robocopy C:\inetpub\logs\LogFiles E:\case\IIS /E /COPY:DAT /DCOPY:T
robocopy C:\Windows\System32\LogFiles\HTTPERR E:\case\HTTPERR /COPY:DAT

KAPE IISLogFiles collects the default locations only; add custom log directories manually. Also copy the web roots (physicalPath values) to hash and review scripts.

Parsing tools

  • Log Parser 2.2 / Log Parser Studio: SQL over W3C logs.
LogParser.exe -i:IISW3C "SELECT c-ip, cs-method, cs-uri-stem, COUNT(*) AS hits FROM u_ex*.log WHERE cs-uri-stem LIKE '%.aspx' GROUP BY c-ip, cs-method, cs-uri-stem ORDER BY hits DESC"
  • PowerShell / grep: fast string hunts across many files.
  • Velociraptor: collection and parsing of IIS logs at scale.
  • Timeline Explorer: after converting logs to CSV.

Investigation tips

  • Webshells: look for .aspx, .ashx, .asmx or .config files recently created in web roots, rarely requested pages hit only by POST from one IP, and odd user agents. Compiled pages leave App_Web_*.dll under Temporary ASP.NET Files in the .NET Framework folder.
  • Process lineage: w3wp.exe spawning cmd.exe, powershell.exe, whoami.exe or other LOLBins is a top signal. Correlate the request time with Security 4688 or Sysmon event 1, where the User is the application pool identity (IIS APPPOOL\<name>).
  • Exchange: the 2021 ProxyLogon and ProxyShell chains left patterns such as unusual requests to /ecp/ or /autodiscover/autodiscover.json with an email address in the query, followed by webshells in OWA/ECP folders. Exchange also keeps its own logs under the install path Logging folder (HttpProxy, ECP, OWA). Use vendor and CISA guidance for exact indicators.
  • Pivot on attacker IPs across all sites and HTTPERR, then on the time window across Prefetch and Amcache for tools they dropped.

Related artifacts

Glossary terms

Guides

All artifacts on one page: cheat sheet