Detection of Suspicious AWS API Activity via Offensive Tooling User Agents
This brief details the detection of successful AWS API calls utilizing user-agent fingerprints associated with Kali Linux or TruffleHog, which are commonly indicative of credential testing or unauthorized access attempts.
Security teams should monitor for unauthorized use of AWS API credentials by identifying suspicious user-agent strings within CloudTrail logs. Attackers frequently use Kali Linux to interact with AWS environments, leaving distrib#kali fingerprints, or leverage tools like TruffleHog to validate stolen credentials against cloud APIs. These activities are highly indicative of compromised IAM principals or unauthorized external scanning. While these tools may exist within authorized penetration testing or DevSecOps workflows, their usage outside of documented change windows or by unexpected IAM roles often signals an active security incident. This detection mechanism specifically targets successful API calls to distinguish between noise and high-confidence alerts.
Attack Chain
- Attacker obtains valid AWS IAM access keys or temporary security tokens through phishing, secret leakage, or source-code repository compromise.
- Attacker configures a CLI/SDK environment, potentially using a Kali Linux distribution for its pre-installed toolset.
- Attacker uses a tool such as TruffleHog to programmatically verify the validity and scope of the stolen credentials by making authenticated AWS API calls.
- Attacker performs discovery tasks, such as
ListRoles,GetCallerIdentity, orListBuckets, to assess the permissions attached to the compromised account. - Attacker executes higher-impact API actions, such as
CreateAccessKeyfor persistent access orAssumeRoleto escalate privileges across accounts. - Attacker exfiltrates sensitive data or modifies infrastructure configurations to establish long-term persistence.
Impact
Successful exploitation allows threat actors to gain unauthorized access to cloud environments, leading to potential data exfiltration, service disruption, or infrastructure manipulation. The use of automated tools allows for rapid discovery and privilege expansion, potentially exposing an entire organization's cloud footprint if high-privileged keys are compromised.
Recommendation
- Deploy the provided Sigma rule to alert on non-standard user agents in your SIEM environment.
- Implement service control policies (SCPs) or IAM policies to restrict API access for sensitive roles to known corporate IP ranges or VPN gateways.
- Establish a process to audit and rotate access keys for any IAM principal flagged by these user-agent signatures.
- Review all authorized red team or automated security scanning activities to ensure they are properly documented and allowlisted to reduce alert fatigue.
Immediate actions
Review CloudTrail logs for the flagged indicators and verify the IAM principal intent.
Threat Hunt
Search for non-standard user agent strings in CloudTrail logs originating from unusual source IPs.
Data: user_agent.original, source.ip
Mitigations
Enforce MFA and source IP restrictions on high-privileged IAM roles.
T1078.004
Detection coverage 1
AWS Suspicious User Agent Fingerprint
highDetects successful AWS API calls using user agents associated with Kali Linux or TruffleHog, indicating potential credential validation or unauthorized access.
Detection queries are available on the platform. Get full rules →