IIS HTTP Logging Disabled

Identifies when Internet Information Services (IIS) HTTP Logging is disabled on a server. An attacker with IIS server access via a webshell or other mechanism can disable HTTP Logging as an effective anti-forensics measure.

Elastic rule (View on GitHub)

 1[metadata]
 2creation_date = "2020/04/14"
 3integration = ["endpoint", "windows", "system"]
 4maturity = "production"
 5min_stack_comments = "New fields added: required_fields, related_integrations, setup"
 6min_stack_version = "8.3.0"
 7updated_date = "2024/03/28"
 8
 9[rule]
10author = ["Elastic"]
11description = """
12Identifies when Internet Information Services (IIS) HTTP Logging is disabled on a server. An attacker with IIS server
13access via a webshell or other mechanism can disable HTTP Logging as an effective anti-forensics measure.
14"""
15from = "now-9m"
16index = ["winlogbeat-*", "logs-endpoint.events.process-*", "logs-windows.*", "endgame-*", "logs-system.security*"]
17language = "eql"
18license = "Elastic License v2"
19max_signals = 33
20name = "IIS HTTP Logging Disabled"
21note = """## Triage and analysis
22
23### Investigating IIS HTTP Logging Disabled
24
25IIS (Internet Information Services) is a Microsoft web server software used to host websites and web applications on Windows. It provides features for serving dynamic and static content, and can be managed through a graphical interface or command-line tools.
26
27IIS logging is a data source that can be used for security monitoring, forensics, and incident response. It contains mainly information related to requests done to the web server, and can be used to spot malicious activities like webshells. Adversaries can tamper, clear, and delete this data to evade detection, cover their tracks, and slow down incident response.
28
29This rule monitors commands that disable IIS logging.
30
31#### Possible investigation steps
32
33- Investigate the process execution chain (parent process tree) for unknown processes. Examine their executable files for prevalence, whether they are located in expected locations, and if they are signed with valid digital signatures.
34- Identify the user account that performed the action and whether it should perform this kind of action.
35- Contact the account owner and confirm whether they are aware of this activity.
36- Investigate other alerts associated with the user/host during the past 48 hours.
37  - Verify if any other anti-forensics behaviors were observed.
38- Verify whether the logs stored in the `C:\\inetpub\\logs\\logfiles\\w3svc1` directory were deleted after this action.
39- Check if this operation is done under change management and approved according to the organization's policy.
40
41### False positive analysis
42
43- This activity is unlikely to happen legitimately. Benign true positives (B-TPs) can be added as exceptions if necessary.
44
45### Response and remediation
46
47- Initiate the incident response process based on the outcome of the triage.
48- Isolate the involved host to prevent further post-compromise behavior.
49- Re-enable affected logging components, services, and security monitoring.
50- Run a full antimalware scan. This may reveal additional artifacts left in the system, persistence mechanisms, and malware components.
51- Investigate credential exposure on systems compromised or used by the attacker to ensure all compromised accounts are identified. Reset passwords for these accounts and other potentially compromised credentials, such as email, business systems, and web services.
52- Determine the initial vector abused by the attacker and take action to prevent reinfection through the same vector.
53- Using the incident response data, update logging and audit policies to improve the mean time to detect (MTTD) and the mean time to respond (MTTR).
54"""
55risk_score = 73
56rule_id = "ebf1adea-ccf2-4943-8b96-7ab11ca173a5"
57setup = """## Setup
58
59If enabling an EQL rule on a non-elastic-agent index (such as beats) for versions <8.2,
60events will not define `event.ingested` and default fallback for EQL rules was not added until version 8.2.
61Hence for this rule to work effectively, users will need to add a custom ingest pipeline to populate
62`event.ingested` to @timestamp.
63For more details on adding a custom ingest pipeline refer - https://www.elastic.co/guide/en/fleet/current/data-streams-pipeline-tutorial.html
64"""
65severity = "high"
66tags = ["Domain: Endpoint", "OS: Windows", "Use Case: Threat Detection", "Tactic: Defense Evasion", "Data Source: Elastic Endgame", "Resources: Investigation Guide", "Data Source: Elastic Defend"]
67timestamp_override = "event.ingested"
68type = "eql"
69
70query = '''
71process where host.os.type == "windows" and event.type == "start" and
72  (process.name : "appcmd.exe" or ?process.pe.original_file_name == "appcmd.exe") and
73  process.args : "/dontLog*:*True" and
74  not process.parent.name : "iissetup.exe"
75'''
76
77
78[[rule.threat]]
79framework = "MITRE ATT&CK"
80[[rule.threat.technique]]
81id = "T1562"
82name = "Impair Defenses"
83reference = "https://attack.mitre.org/techniques/T1562/"
84[[rule.threat.technique.subtechnique]]
85id = "T1562.002"
86name = "Disable Windows Event Logging"
87reference = "https://attack.mitre.org/techniques/T1562/002/"
88
89
90
91[rule.threat.tactic]
92id = "TA0005"
93name = "Defense Evasion"
94reference = "https://attack.mitre.org/tactics/TA0005/"

Triage and analysis

Investigating IIS HTTP Logging Disabled

IIS (Internet Information Services) is a Microsoft web server software used to host websites and web applications on Windows. It provides features for serving dynamic and static content, and can be managed through a graphical interface or command-line tools.

IIS logging is a data source that can be used for security monitoring, forensics, and incident response. It contains mainly information related to requests done to the web server, and can be used to spot malicious activities like webshells. Adversaries can tamper, clear, and delete this data to evade detection, cover their tracks, and slow down incident response.

This rule monitors commands that disable IIS logging.

Possible investigation steps

  • Investigate the process execution chain (parent process tree) for unknown processes. Examine their executable files for prevalence, whether they are located in expected locations, and if they are signed with valid digital signatures.
  • Identify the user account that performed the action and whether it should perform this kind of action.
  • Contact the account owner and confirm whether they are aware of this activity.
  • Investigate other alerts associated with the user/host during the past 48 hours.
    • Verify if any other anti-forensics behaviors were observed.
  • Verify whether the logs stored in the C:\inetpub\logs\logfiles\w3svc1 directory were deleted after this action.
  • Check if this operation is done under change management and approved according to the organization's policy.

False positive analysis

  • This activity is unlikely to happen legitimately. Benign true positives (B-TPs) can be added as exceptions if necessary.

Response and remediation

  • Initiate the incident response process based on the outcome of the triage.
  • Isolate the involved host to prevent further post-compromise behavior.
  • Re-enable affected logging components, services, and security monitoring.
  • Run a full antimalware scan. This may reveal additional artifacts left in the system, persistence mechanisms, and malware components.
  • Investigate credential exposure on systems compromised or used by the attacker to ensure all compromised accounts are identified. Reset passwords for these accounts and other potentially compromised credentials, such as email, business systems, and web services.
  • Determine the initial vector abused by the attacker and take action to prevent reinfection through the same vector.
  • Using the incident response data, update logging and audit policies to improve the mean time to detect (MTTD) and the mean time to respond (MTTR).

Related rules

to-top