{"id":"f4a623c2-4ef5-4c33-b811-0642f702c9f1","title":"Visual Studio Code Tunnel Shell Execution","description":"Detects the execution of a shell (powershell, bash, wsl...) via Visual Studio Code tunnel. Attackers can abuse this functionality to establish a C2 channel and execute arbitrary commands on the system.","author":"Nasreddine Bencherchali (Nextron Systems)","status":"test","level":"medium","date":"2023-10-25","modified":"","tags":["attack.command-and-control","attack.t1071.001"],"technique_ids":["T1071.001"],"logsource":{"category":"process_creation","product":"windows"},"falsepositives":["Legitimate use of Visual Studio Code tunnel and running code from there"],"references":["https://ipfyx.fr/post/visual-studio-code-tunnel/","https://badoption.eu/blog/2023/01/31/code_c2.html","https://code.visualstudio.com/docs/remote/tunnels"],"source_path":"rules/windows/process_creation/proc_creation_win_vscode_tunnel_remote_shell_.yml","source_sha256":"7b67ddab4a5e625eb28c151ae1de5d78a832e7f87fd77231e0a0cab6864f13af","source_url":"https://github.com/anpa1200/sigma/blob/b249e9683190cffdcaf188ccbfb90bf4759844e1/rules/windows/process_creation/proc_creation_win_vscode_tunnel_remote_shell_.yml","license":"Detection Rule License 1.1","license_url":"https://github.com/SigmaHQ/Detection-Rule-License/blob/main/LICENSE.Detection.Rules.md","yaml":"title: Visual Studio Code Tunnel Shell Execution\nid: f4a623c2-4ef5-4c33-b811-0642f702c9f1\nstatus: test\ndescription: Detects the execution of a shell (powershell, bash, wsl...) via Visual Studio Code tunnel. Attackers can abuse this functionality to establish a C2 channel and execute arbitrary commands on the system.\nreferences:\n    - https://ipfyx.fr/post/visual-studio-code-tunnel/\n    - https://badoption.eu/blog/2023/01/31/code_c2.html\n    - https://code.visualstudio.com/docs/remote/tunnels\nauthor: Nasreddine Bencherchali (Nextron Systems)\ndate: 2023-10-25\ntags:\n    - attack.command-and-control\n    - attack.t1071.001\nlogsource:\n    category: process_creation\n    product: windows\ndetection:\n    selection_parent:\n        ParentImage|contains: '\\servers\\Stable-'\n        ParentImage|endswith: '\\server\\node.exe'\n        ParentCommandLine|contains: '.vscode-server' # Technically one can host its own local server instead of using the VsCode one. And that would probably change the name (requires further research)\n    # Note: Child processes (ie: shells) can be whatever technically (with some efforts)\n    selection_child_1:\n        Image|endswith:\n            - '\\powershell.exe'\n            - '\\pwsh.exe'\n        CommandLine|contains: '\\terminal\\browser\\media\\shellIntegration.ps1'\n    selection_child_2:\n        Image|endswith:\n            - '\\wsl.exe'\n            - '\\bash.exe'\n    condition: selection_parent and 1 of selection_child_*\nfalsepositives:\n    - Legitimate use of Visual Studio Code tunnel and running code from there\nlevel: medium\n","validation":"yaml_parsed_not_backend_compiled_or_live_validated","techniques":[{"key":"enterprise/T1071.001","id":"T1071.001","name":"Web Protocols","page":"techniques/enterprise/T1071.001/"}],"data_path":"data/detection-rules/f4a623c2-4ef5-4c33-b811-0642f702c9f1.json","kind":"sigma"}
