Skip to content

armgit / AiSOC

Public Imported from GitHub
0

Open-source AI Security Operations Center: alert fusion, LLM-agent triage, MITRE ATT&CK investigation, and a replayable decision ledger for every agent step. Self-hostable, runs with no API keys, MIT licensed. Ships an MCP server for Claude, Cursor and Continue.

4.5 KB
Raw Blame
id: chronicle-detection-rules-mitre-attack-t1140-encoded-powershell-command
name: mitre_attack_T1140_encoded_powershell_command
description: mitre_attack_T1140_encoded_powershell_command
severity: medium
enabled: false
tags:
  mitre: []
  categories:
  - endpoint
references: []
logsource:
  product: chronicle
detection:
  chronicle_yaral: "/*\n * Copyright 2023 Google LLC\n *\n * Licensed under the Apache\
    \ License, Version 2.0 (the \"License\");\n * you may not use this file except\
    \ in compliance with the License.\n * You may obtain a copy of the License at\n\
    \ *\n *     https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required\
    \ by applicable law or agreed to in writing, software\n * distributed under the\
    \ License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS\
    \ OF ANY KIND, either express or implied.\n * See the License for the specific\
    \ language governing permissions and\n * limitations under the License.\n */\n\
    \nrule mitre_attack_T1140_encoded_powershell_command {\n\n  meta:\n    author\
    \ = \"Google Cloud Security\"\n    description = \"Detects encoded powershell\
    \ commands\"\n    rule_id = \"mr_c01d7d92-db49-4044-a2c5-5a16c74a141d\"\n    rule_name\
    \ = \"MITRE ATT&CK T1140 Encoded Powershell Command\"\n    tactic = \"TA0005\"\
    \n    technique = \"T1140\"\n    type = \"hunt\"\n    platform = \"Windows\"\n\
    \    data_source = \"microsoft sysmon, microsoft windows events\"\n    severity\
    \ = \"Info\"\n    priority = \"Info\"\n\n  events:\n    $process.metadata.event_type\
    \ = \"PROCESS_LAUNCH\"\n    $process.principal.hostname = $hostname\n    re.regex($process.target.process.file.full_path,\
    \ `(system32|syswow64)\\\\WindowsPowerShell\\\\v1\\.0\\\\powershell(|\\_ise)\\\
    .exe`) nocase\n    re.regex($process.target.process.command_line, `(?i)(?:-enc|-ec|-en)\\\
    s*\\S*`)\n    $encoded_value = re.capture($process.target.process.command_line,\
    \ `(?i)(?:-enc|-ec|-en)\\s*(\\S*)`)\n    $decoded_value = re.replace(strings.base64_decode(re.capture($process.target.process.command_line,\
    \ `(?i)(?:-enc|-ec|-en)\\s*(\\S*)`)),`\\0`, \"\")\n\n  match:\n    $hostname over\
    \ 5m\n\n  outcome:\n    $risk_score = 10\n    $event_count = count_distinct($process.metadata.id)\n\
    \    $encoded_powershell = array_distinct($encoded_value)\n    $decoded_powershell\
    \ = array_distinct($decoded_value)\n    // added to populate alert graph with\
    \ additional context\n    // Commented out principal.hostname because it is already\
    \ represented in graph as match variable. If match changes, can uncomment to add\
    \ to results\n    $principal_hostname = array_distinct($process.principal.hostname)\n\
    \    $principal_process_pid = array_distinct($process.principal.process.pid)\n\
    \    $principal_process_command_line = array_distinct($process.principal.process.command_line)\n\
    \    $principal_process_file_sha256 = array_distinct($process.principal.process.file.sha256)\n\
    \    $principal_process_file_full_path = array_distinct($process.principal.process.file.full_path)\n\
    \    $principal_process_product_specific_process_id = array_distinct($process.principal.process.product_specific_process_id)\n\
    \    $principal_process_parent_process_product_specific_process_id = array_distinct($process.principal.process.parent_process.product_specific_process_id)\n\
    \    $target_process_pid = array_distinct($process.target.process.pid)\n    $target_process_command_line\
    \ = array_distinct($process.target.process.command_line)\n    $target_process_file_sha256\
    \ = array_distinct($process.target.process.file.sha256)\n    $target_process_file_full_path\
    \ = array_distinct($process.target.process.file.full_path)\n    $target_process_product_specific_process_id\
    \ = array_distinct($process.target.process.product_specific_process_id)\n    $principal_user_userid\
    \ = array_distinct($process.principal.user.userid)\n\ncondition:\n    $process\n\
    }"
  chronicle_rule_name: mitre_attack_T1140_encoded_powershell_command
provenance:
  source: chronicle/detection-rules
  source_id: mitre_attack_T1140_encoded_powershell_command
  source_commit: 74dd490
  license: Apache-2.0
  license_url: https://github.com/chronicle/detection-rules/blob/main/LICENSE
  imported_at: '2026-05-04'
  imported_by: chronicle_importer
  upstream_path: rules/community/microsoft/windows/mitre_attack_T1140_encoded_powershell_command.yaral
notes:
  chronicle_meta: {}
  quarantine_reason: raw YARA-L — needs translation to AiSOC schema