IIS AppCmd Tool Used to Dump Service Account Credentials
Attackers with access to IIS web servers may use the AppCmd command-line tool to dump sensitive configuration data, including application pool credentials, potentially leading to lateral movement and privilege escalation.
Attackers who have gained a foothold on a Windows web server running Internet Information Services (IIS) may attempt to extract sensitive information, such as application pool credentials, to facilitate lateral movement and privilege escalation. This is achieved by leveraging the AppCmd.exe utility, a command-line tool used to manage IIS configurations. By issuing specific commands, attackers can dump the entire web server configuration or target specific fields containing credential-related data, exposing usernames, passwords, and connection strings in clear text. Successful exploitation allows attackers to reuse these credentials to access other systems within the environment, potentially leading to significant data breaches or system compromise. This technique is particularly effective against organizations that store sensitive credentials within their IIS configurations.
Attack Chain
- The attacker gains initial access to the Windows web server, often through a web shell or by exploiting a vulnerability in a web application.
- The attacker executes
appcmd.exevia the command line. - The attacker uses the
listargument to enumerate application pools or other relevant IIS configurations. - The attacker uses
/text:*password*,/text:*processModel*,/text:*userName*,/configor*connectionstring*parameters withappcmd.exeto filter the output and specifically target credential-related data. Alternatively the attacker may use/text:*to output the full configuration. appcmd.exeoutputs the requested configuration data, which may include usernames, passwords, and connection strings in clear text.- The attacker parses the output to extract valid credentials.
- The attacker uses the extracted credentials to authenticate to other systems or services within the network.
- The attacker achieves lateral movement, privilege escalation, and access to sensitive data.
Impact
Successful exploitation allows attackers to recover service account passwords and other sensitive credentials stored within the IIS configuration. This can lead to unauthorized access to databases, file shares, and other internal systems, potentially resulting in data breaches, financial loss, and reputational damage. While the rule itself is low severity, the subsequent impact of exposed credentials can be severe.
Recommendation
- Deploy the “Microsoft IIS Service Account Password Dumped” Sigma rule to your SIEM to detect the use of
appcmd.exeto dump sensitive IIS configuration data. - Review IIS and web server activity for signs of exploitation, such as requests to newly created ASPX or PHP files as suggested in the rule’s Triage and Analysis section.
- Enable Sysmon process creation logging to activate the rules above and provide detailed process execution data.
- Implement the password rotation for affected service accounts as suggested in the rule’s Triage and Analysis section.
Detection coverage 2
Detect IIS AppCmd Usage to Dump Credentials
mediumDetects the use of AppCmd to list IIS configuration with parameters indicative of credential dumping.
Detect IIS AppCmd Usage to Dump Full Configuration
lowDetects the use of AppCmd to list the full IIS configuration, which may expose credentials.
Detection queries are kept inside the platform. Get full rules →