Name:JetBrains TeamCity RCE Attempt id:89a58e5f-1365-4793-b45c-770abbb32b6c version:4 date:2024-09-30 author:Michael Haag, Splunk status:production type:TTP Description:The following analytic detects attempts to exploit the CVE-2023-42793 vulnerability in JetBrains TeamCity On-Premises. It identifies suspicious POST requests to /app/rest/users/id:1/tokens/RPC2, leveraging the Web datamodel to monitor specific URL patterns and HTTP methods. This activity is significant as it may indicate an unauthenticated attacker attempting to gain administrative access via Remote Code Execution (RCE). If confirmed malicious, this could allow the attacker to execute arbitrary code, potentially compromising the entire TeamCity environment and leading to further unauthorized access and data breaches. Data_source:
-Suricata
search:| tstats count min(_time) as firstTime max(_time) as lastTime from datamodel=Web where Web.url IN ("/app/rest/users/id:1/tokens/RPC2*") Web.status=200 Web.http_method=POST by Web.http_user_agent, Web.status Web.http_method, Web.url, Web.url_length, Web.src, Web.dest, sourcetype | `drop_dm_object_name("Web")` | `security_content_ctime(firstTime)` | `security_content_ctime(lastTime)` | `jetbrains_teamcity_rce_attempt_filter`
how_to_implement:The following analytic requires the Web datamodel. Ensure data source is mapped correctly or modify and tune for your data source. known_false_positives:If TeamCity is not in use, this analytic will not return results. Monitor and tune for your environment. References: -https://blog.jetbrains.com/teamcity/2023/09/critical-security-issue-affecting-teamcity-on-premises-update-to-2023-05-4-now/ -https://www.sonarsource.com/blog/teamcity-vulnerability/ -https://github.com/rapid7/metasploit-framework/pull/18408 -https://attackerkb.com/topics/1XEEEkGHzt/cve-2023-42793/rapid7-analysis drilldown_searches: name:'View the detection results for - "$dest$"' search:'%original_detection_search% | search dest = "$dest$"' earliest_offset:'$info_min_time$' latest_offset:'$info_max_time$' name:'View risk events for the last 7 days for - "$dest$"' search:'| from datamodel Risk.All_Risk | search normalized_risk_object IN ("$dest$") starthoursago=168 | stats count min(_time) as firstTime max(_time) as lastTime values(search_name) as "Search Name" values(risk_message) as "Risk Message" values(analyticstories) as "Analytic Stories" values(annotations._all) as "Annotations" values(annotations.mitre_attack.mitre_tactic) as "ATT&CK Tactics" by normalized_risk_object | `security_content_ctime(firstTime)` | `security_content_ctime(lastTime)`' earliest_offset:'$info_min_time$' latest_offset:'$info_max_time$' tags: cve: - 'CVE-2023-42793' analytic_story: - 'JetBrains TeamCity Unauthenticated RCE' - 'CISA AA23-347A' - 'JetBrains TeamCity Vulnerabilities' asset_type:Web Server atomic_guid: confidence:90 impact:90 message:Potential JetBrains TeamCity RCE Attempt detected against URL $url$ on $dest$. mitre_attack_id: - 'T1190' observable: name:'dest' type:'Hostname' - role: - 'Victim' name:'src' type:'IP Address' - role: - 'Attacker' product: - 'Splunk Enterprise' - 'Splunk Enterprise Security' - 'Splunk Cloud' risk_score:81 required_fields: - 'Web.http_user_agent' - 'Web.status' - 'Web.http_method' - 'Web.url' - 'Web.url_length' - 'Web.src' - 'Web.dest' security_domain:network