# Agentic attack detections by ThreatDefence (ARTEX) # https://threatdefence.com/article/artex-agentic-attack-framework-detection-hunting # All searches ship disabled. Adjust the macros in macros.conf, run each search over 30 days to baseline, then enable. # Each search looks back further than it is scheduled, so one hit is returned by many runs. alert.suppress holds repeats of # the same hit (alert.suppress.fields) for the length of the search window. alert.digest_mode = 0 alerts per result, which # Splunk needs before it applies suppression by field. [ARTEX - User agent naming ARTEX in any source] description = A web request, sign-in or cloud API call carried a user agent that names ARTEX or a renamed build. search = `artex_indexes` `artex_ua_terms` \ | eval ua=coalesce(http_user_agent, useragent, userAgent, user_agent, cs_user_agent, 'client.userAgent.rawUserAgent', 'properties.userAgent') \ | eval src=coalesce(src, src_ip, sourceIPAddress, ipAddress, 'properties.ipAddress', callerIpAddress, clientip, c_ip, "unknown") \ | stats count min(_time) as first_seen max(_time) as last_seen values(sourcetype) as sourcetypes by src ua \ | convert ctime(first_seen) ctime(last_seen) dispatch.earliest_time = -24h dispatch.latest_time = now cron_schedule = 7 * * * * enableSched = 1 disabled = 1 alert.digest_mode = 0 alert.suppress = 1 alert.suppress.period = 24h alert.suppress.fields = src,ua alert.severity = 5 [ARTEX - Password spray at a fixed rhythm] description = One source fails sign-ins for 20 or more users with a median gap of two seconds or less. Uses the CIM Authentication data model. search = | tstats summariesonly=false count from datamodel=Authentication where Authentication.action=failure by _time span=1s Authentication.src Authentication.user \ | rename Authentication.* as * \ | sort 0 src _time \ | streamstats current=f last(_time) as prev_time by src \ | eval gap=_time-prev_time \ | stats sum(count) as attempts dc(user) as users median(gap) as median_gap_sec min(_time) as first_seen max(_time) as last_seen by src \ | where attempts>=200 AND users>=20 AND median_gap_sec<=2 \ | convert ctime(first_seen) ctime(last_seen) dispatch.earliest_time = -2h dispatch.latest_time = now cron_schedule = 15 * * * * enableSched = 1 disabled = 1 alert.digest_mode = 0 alert.suppress = 1 alert.suppress.period = 2h alert.suppress.fields = src alert.severity = 5 [ARTEX - Spray that ends in a successful sign-in] description = Many failures across users followed by a success from the same source. search = | tstats summariesonly=false count from datamodel=Authentication by Authentication.src Authentication.action Authentication.user \ | rename Authentication.* as * \ | stats sum(eval(if(action="failure",count,0))) as failures dc(eval(if(action="failure",user,null()))) as failed_users values(eval(if(action="success",user,null()))) as success_users by src \ | where failures>=50 AND failed_users>=10 AND isnotnull(success_users) dispatch.earliest_time = -24h dispatch.latest_time = now cron_schedule = 20 * * * * enableSched = 1 disabled = 1 alert.digest_mode = 0 alert.suppress = 1 alert.suppress.period = 24h alert.suppress.fields = src alert.severity = 5 [ARTEX - Web probe artifacts] description = Placeholder probe paths, alg none JWTs and the fixed OAuth callback probe that ARTEX sends while mapping an application. search = | tstats summariesonly=false count min(_time) as first_seen max(_time) as last_seen values(Web.url) as urls from datamodel=Web where (Web.url="*zzz-nonexistent-xyz123*" OR Web.url="*zzz_nonexistent_abc.txt*" OR Web.url="*Notexist-xyz*" OR Web.url="*eyJhbGciOiJub25lI*" OR Web.url="*eyJ0eXAiOiJKV1QiLCJhbGciOiJub25lI*" OR Web.url="*eyJhbGciOiJOb25lI*" OR Web.url="*eyJhbGciOiJOT05FI*" OR Web.url="*code=AAAA&state=notvalidb64!!*") by Web.src Web.http_user_agent \ | rename Web.* as * \ | convert ctime(first_seen) ctime(last_seen) dispatch.earliest_time = -24h dispatch.latest_time = now cron_schedule = 25 * * * * enableSched = 1 disabled = 1 alert.digest_mode = 0 alert.suppress = 1 alert.suppress.period = 24h alert.suppress.fields = src,http_user_agent alert.severity = 4 [ARTEX - User agent family burst from one source] description = Three or more unrelated user agent families and 20 or more requests from one public source in a minute, after Elastic Security Labs. search = | tstats summariesonly=false count from datamodel=Web by _time span=1m Web.src Web.http_user_agent \ | rename Web.* as * \ | where NOT cidrmatch("10.0.0.0/8",src) AND NOT cidrmatch("172.16.0.0/12",src) AND NOT cidrmatch("192.168.0.0/16",src) AND NOT cidrmatch("100.64.0.0/10",src) \ | eval family=case(match(http_user_agent,"^(Boto3|aws-cli|aws-sdk)"),"aws", match(http_user_agent,"python-requests|Python-urllib|aiohttp|httpx"),"python", match(http_user_agent,"^curl/"),"curl", match(http_user_agent,"^norma"),"norma", match(http_user_agent,"^Go-http-client"),"go", match(http_user_agent,"(?i)nuclei|sqlmap|ffuf|katana|gobuster|nikto"),"scanner", match(http_user_agent,"^Mozilla/5.0"),"browser", true(),"other") \ | stats sum(count) as requests dc(family) as families values(family) as family_list by _time src \ | where families>=3 AND requests>=20 \ | stats count as minutes sum(requests) as total_requests values(family_list) as families min(_time) as first_seen max(_time) as last_seen by src \ | convert ctime(first_seen) ctime(last_seen) dispatch.earliest_time = -24h dispatch.latest_time = now cron_schedule = 30 * * * * enableSched = 1 disabled = 1 alert.digest_mode = 0 alert.suppress = 1 alert.suppress.period = 24h alert.suppress.fields = src alert.severity = 3 [ARTEX - Web or database service spawns a shell or download tool] description = A web server, runtime or database process starts a shell, curl, wget, netcat or a Windows download binary. java and node count only under a service account, because they also run Jenkins, npm and AI agent CLIs. search = | tstats summariesonly=false count min(_time) as first_seen max(_time) as last_seen values(Processes.process) as command_lines from datamodel=Endpoint.Processes where (Processes.parent_process_name IN ("nginx","httpd","apache2","php-fpm*","java","node","mysqld","mariadbd","postgres","w3wp.exe","httpd.exe","tomcat*.exe","java.exe","node.exe","php-cgi.exe","sqlservr.exe","mysqld.exe")) AND (Processes.process_name IN ("sh","bash","dash","curl","wget","nc","ncat","socat","busybox","cmd.exe","powershell.exe","pwsh.exe","curl.exe","certutil.exe","bitsadmin.exe","whoami.exe","tasklist.exe")) by Processes.dest Processes.parent_process_name Processes.process_name Processes.user \ | rename Processes.* as * \ | where NOT parent_process_name IN ("java","node","java.exe","node.exe") OR match(user, "(?i)(^|\\\\)(www-data|apache|nginx|http|tomcat\d*|jetty|jboss|wildfly|node|nodejs|nobody|daemon|iusr)$") OR match(user, "(?i)(iis apppool|network service|local service)") \ | convert ctime(first_seen) ctime(last_seen) dispatch.earliest_time = -24h dispatch.latest_time = now cron_schedule = 35 * * * * enableSched = 1 disabled = 1 alert.digest_mode = 0 alert.suppress = 1 alert.suppress.period = 24h alert.suppress.fields = dest,parent_process_name,process_name alert.severity = 4 [ARTEX - Artifact names in processes and files] description = artex-probe files, ArtexProbe accounts, the artx5v folder, art18- comments and probe markers. search = | tstats summariesonly=false count values(Processes.process) as command_lines from datamodel=Endpoint.Processes where (Processes.process="*artex-probe-*" OR Processes.process="*ArtexProbe*" OR Processes.process="*artx5v*" OR Processes.process="*art18-*" OR Processes.process="*ARTEX_WRITE_PROBE*" OR Processes.process="*ARTX_PERSIST_OK*") by Processes.dest Processes.user \ | rename Processes.* as * \ | append [| tstats summariesonly=false count values(Filesystem.file_path) as command_lines from datamodel=Endpoint.Filesystem where (Filesystem.file_name="artex-probe-*" OR Filesystem.file_path="*\\ProgramData\\artx5v\\*" OR Filesystem.file_name IN ("cl1217.jsp","f1219a.jsp","z1219.jsp","graphics-hook-filter64.dll","graphics-hook_config.bin")) by Filesystem.dest Filesystem.user | rename Filesystem.* as *] dispatch.earliest_time = -24h dispatch.latest_time = now cron_schedule = 40 * * * * enableSched = 1 disabled = 1 alert.digest_mode = 0 alert.suppress = 1 alert.suppress.period = 24h alert.suppress.fields = dest,user alert.severity = 5 [ARTEX - CloudWatch logs searched for secrets] description = FilterLogEvents with patterns for passwords or keys, or the constant limit of 1000 seen in ARTEX sessions. search = `artex_cloudtrail` eventSource="logs.amazonaws.com" eventName="FilterLogEvents" \ | spath path=requestParameters.filterPattern output=pattern \ | spath path=requestParameters.limit output=limit \ | where match(pattern,"(?i)password|AKIA|secret|token") OR limit=1000 \ | stats count dc(requestParameters.logGroupName) as log_groups values(pattern) as patterns min(_time) as first_seen max(_time) as last_seen by userIdentity.arn sourceIPAddress userAgent \ | convert ctime(first_seen) ctime(last_seen) dispatch.earliest_time = -24h dispatch.latest_time = now cron_schedule = 45 * * * * enableSched = 1 disabled = 1 alert.digest_mode = 0 alert.suppress = 1 alert.suppress.period = 24h alert.suppress.fields = userIdentity.arn,sourceIPAddress alert.severity = 4 [ARTEX - EC2 DryRun burst] description = Ten or more EC2 DryRun calls from one identity in five minutes. search = `artex_cloudtrail` eventSource="ec2.amazonaws.com" errorCode="Client.DryRunOperation" \ | bin _time span=5m \ | stats count as dryruns dc(eventName) as actions values(eventName) as action_list by _time userIdentity.arn sourceIPAddress userAgent \ | where dryruns>=10 dispatch.earliest_time = -24h dispatch.latest_time = now cron_schedule = 50 * * * * enableSched = 1 disabled = 1 alert.digest_mode = 0 alert.suppress = 1 alert.suppress.period = 24h alert.suppress.fields = userIdentity.arn,sourceIPAddress alert.severity = 4 [ARTEX - AWS access denied sweep] description = One identity denied on 15 or more different API calls in ten minutes. search = `artex_cloudtrail` errorCode IN ("AccessDenied","AccessDeniedException","UnauthorizedOperation","Client.UnauthorizedOperation") \ | bin _time span=10m \ | stats count as denied dc(eventName) as apis dc(eventSource) as services values(eventSource) as service_list by _time userIdentity.arn sourceIPAddress userAgent \ | where apis>=15 dispatch.earliest_time = -24h dispatch.latest_time = now cron_schedule = 52 * * * * enableSched = 1 disabled = 1 alert.digest_mode = 0 alert.suppress = 1 alert.suppress.period = 24h alert.suppress.fields = userIdentity.arn,sourceIPAddress alert.severity = 4 [ARTEX - Cognito sign-up burst] description = Twenty or more Cognito sign-ups from one address in ten minutes, or sign-ups that try to set custom:isAdmin. search = `artex_cloudtrail` eventSource="cognito-idp.amazonaws.com" eventName="SignUp" \ | eval admin_attempt=if(like(_raw,"%custom:isAdmin%") OR like(_raw,"%artex-%"),1,0) \ | bin _time span=10m \ | stats count as signups sum(admin_attempt) as admin_attempts values(errorMessage) as errors by _time sourceIPAddress userAgent \ | where signups>=20 OR admin_attempts>0 dispatch.earliest_time = -24h dispatch.latest_time = now cron_schedule = 54 * * * * enableSched = 1 disabled = 1 alert.digest_mode = 0 alert.suppress = 1 alert.suppress.period = 24h alert.suppress.fields = sourceIPAddress alert.severity = 4 [ARTEX - Service principal assigns a role to itself] description = A service principal adds a directory or app role assignment to itself. search = `artex_azure_audit` (operationName="Add member to role" OR operationName="Add app role assignment to service principal" OR activityDisplayName="Add member to role" OR activityDisplayName="Add app role assignment to service principal") \ | spath path=initiatedBy.app.servicePrincipalId output=initiator \ | spath path=targetResources{}.id output=targets \ | where isnotnull(initiator) AND mvfind(targets, initiator)>=0 \ | table _time operationName activityDisplayName initiator targets result dispatch.earliest_time = -24h dispatch.latest_time = now cron_schedule = 5 * * * * enableSched = 1 disabled = 1 alert.digest_mode = 0 alert.suppress = 1 alert.suppress.period = 24h alert.suppress.fields = initiator alert.severity = 5 [ARTEX - Bulk Key Vault secret reads] description = One identity reads 20 or more secrets across three or more vaults in 15 minutes. search = `artex_keyvault` operationName="SecretGet" \ | eval identity=coalesce('identity.claim.oid', 'identity.claim.appid', 'identity.claim.upn') \ | bin _time span=15m \ | stats count as reads dc(resourceId) as vaults values(callerIpAddress) as sources by _time identity \ | where reads>=20 AND vaults>=3 dispatch.earliest_time = -24h dispatch.latest_time = now cron_schedule = 10 * * * * enableSched = 1 disabled = 1 alert.digest_mode = 0 alert.suppress = 1 alert.suppress.period = 24h alert.suppress.fields = identity alert.severity = 4 [ARTEX - Azure Resource Manager validate sweep] description = Five or more deployments validate calls from one caller in a minute. search = `artex_azure_activity` operationName="*/deployments/validate/action" \ | bin _time span=1m \ | stats count as validates dc(resourceId) as targets by _time caller callerIpAddress \ | where validates>=5 dispatch.earliest_time = -24h dispatch.latest_time = now cron_schedule = 12 * * * * enableSched = 1 disabled = 1 alert.digest_mode = 0 alert.suppress = 1 alert.suppress.period = 24h alert.suppress.fields = caller,callerIpAddress alert.severity = 4 [ARTEX - Indicator sweep] description = Network events touching reported ARTEX addresses and domains. Upload lookups/artex_iocs.csv first. search = | tstats summariesonly=false count min(_time) as first_seen max(_time) as last_seen from datamodel=Network_Traffic by All_Traffic.src All_Traffic.dest \ | rename All_Traffic.* as * \ | lookup artex_iocs value as dest OUTPUTNEW type as ioc_type actor source \ | lookup artex_iocs value as src OUTPUTNEW type as src_ioc_type actor as src_actor \ | where isnotnull(ioc_type) OR isnotnull(src_ioc_type) \ | convert ctime(first_seen) ctime(last_seen) dispatch.earliest_time = -30d dispatch.latest_time = now cron_schedule = 0 6 * * * enableSched = 1 disabled = 1 alert.digest_mode = 0 alert.suppress = 1 alert.suppress.period = 30d alert.suppress.fields = src,dest alert.severity = 4