-
Notifications
You must be signed in to change notification settings - Fork 492
Add socat utility detections #4253
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
themaryjo
wants to merge
5
commits into
develop
Choose a base branch
from
add-socat-utility-detections
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+179
−0
Open
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
f6de1d4
Add socat utility detections
themaryjo a7039c1
Update socat_utility_listener_binding_executable.yml
onurmerdogan 07a0c7a
minor fix on process name
onurmerdogan 8bc1928
Merge branch 'develop' into add-socat-utility-detections
onurmerdogan 10ede78
Merge branch 'develop' into add-socat-utility-detections
nasbench File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
89 changes: 89 additions & 0 deletions
89
detections/endpoint/socat_utility_listener_binding_executable.yml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,89 @@ | ||
| name: Socat Utility Listener Binding Executable | ||
| id: 72482d45-1d05-46f5-bb6c-e2b709a8073a | ||
| version: 1 | ||
| creation_date: '2026-08-27' | ||
| modification_date: '2026-08-27' | ||
| author: Maria Jose Erquiaga, Splunk | ||
| status: production | ||
| type: TTP | ||
| description: |- | ||
| Detects the execution of the socat utility with command-line arguments that configure a TCP or OpenSSL listener and bind an executable to incoming connections. Socat is a legitimate network utility, but this behavior may be used to expose executables, establish bind shells, facilitate remote command execution, or support lateral movement. | ||
| data_source: | ||
| - Osquery Results | ||
| search: |- | ||
| | tstats `security_content_summariesonly` | ||
| count | ||
| min(_time) as firstTime | ||
| max(_time) as lastTime | ||
|
|
||
| from datamodel=Endpoint.Processes where | ||
|
|
||
| Processes.process_name="socat*" | ||
| AND Processes.process="*exec:*" | ||
| AND Processes.process="*-listen:*" | ||
|
|
||
| by Processes.dest Processes.original_file_name Processes.parent_process_id | ||
| Processes.process Processes.process_exec Processes.process_guid | ||
| Processes.process_hash Processes.process_id | ||
| Processes.process_current_directory Processes.process_name | ||
| Processes.process_path Processes.user | ||
| Processes.user_id Processes.vendor_product | ||
|
|
||
| | `drop_dm_object_name(Processes)` | ||
| | `security_content_ctime(firstTime)` | ||
| | `security_content_ctime(lastTime)` | ||
| | `socat_utility_listener_binding_executable_filter` | ||
| how_to_implement: |- | ||
| This detection uses osquery and endpoint security on MacOS. Follow the link in references, which describes how to setup process auditing in MacOS with endpoint security and osquery. | ||
| Also the [TA-OSquery](https://splunkbase.splunk.com/app/8574) must be deployed across your indexers and universal forwarders in order to have the osquery data populate the data models. | ||
| known_false_positives: |- | ||
| Authorized penetration testing or red team exercises may use socat TCP listeners to validate security controls in lab environments. | ||
| Developers, network engineers, and system administrators may use socat to expose benign executables for protocol testing, debugging, data transformation, or troubleshooting. | ||
| references: | ||
| - https://attack.mitre.org/tactics/TA0002/ | ||
| - https://attack.mitre.org/techniques/T1059 | ||
| - https://blog.talosintelligence.com/bad-apples-weaponizing-native-macos-primitives-for-movement-and-execution/ | ||
| - https://gtfobins.github.io/gtfobins/socat/ | ||
| - https://hackers-arise.com/socat-the-advanced-hackers-network-tool/ | ||
| drilldown_searches: | ||
| - name: View the detection results for - "$user$" and "$host$" | ||
| search: '%original_detection_search% | search user="$user$" host="$host$"' | ||
| earliest_offset: $info_min_time$ | ||
| latest_offset: $info_max_time$ | ||
| - name: View risk events for the last 7 days for - "$user$" and "$host$" | ||
| search: '| from datamodel Risk.All_Risk | search normalized_risk_object IN ("$user$", "$host$") | 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: 7d | ||
| latest_offset: "0" | ||
| finding: | ||
| title: Socat was executed on endpoint $dest$ by user $user$ with a network listener binding an executable via $process$. | ||
| entity: | ||
| field: dest | ||
| type: system | ||
| score: 50 | ||
| intermediate_findings: | ||
| entities: | ||
| - field: user | ||
| type: user | ||
| score: 50 | ||
| message: Socat was executed on endpoint $dest$ by user $user$ with a network listener binding an executable via $process$. | ||
| threat_objects: | ||
| - field: process | ||
| type: process | ||
| analytic_story: | ||
| - MacOS Post-Exploitation | ||
| asset_type: Endpoint | ||
| mitre_attack_id: | ||
| - T1059 | ||
| product: | ||
| - Splunk Cloud | ||
| - Splunk Enterprise | ||
| - Splunk Enterprise Security | ||
| category: endpoint | ||
| security_domain: endpoint | ||
| tests: | ||
| - name: True Positive Test | ||
| attack_data: | ||
| - data: https://media.githubusercontent.com/media/splunk/attack_data/master/datasets/attack_techniques/T1059/utility_socat_listener_binding_executable/osquery.log | ||
| source: osqueryd.results.log | ||
| sourcetype: osquery:results | ||
| test_type: unit | ||
90 changes: 90 additions & 0 deletions
90
detections/endpoint/socat_utility_remote_tcp_connection_with_echo_disabled.yml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,90 @@ | ||
| name: Socat Utility Remote TCP Connection with Echo Disabled | ||
| id: 458c6c37-116d-4f01-8267-f09f5b82cd14 | ||
| version: 1 | ||
| creation_date: '2026-08-27' | ||
| modification_date: '2026-08-27' | ||
| author: Maria Jose Erquiaga, Splunk | ||
| status: production | ||
| type: TTP | ||
| description: |- | ||
| Detects the execution of the socat utility on a MacOS endpoint with command-line arguments that connect to a remote TCP endpoint while disabling local terminal echo. Socat can be used legitimately for network debugging, but this behavior may also support remote command execution, bind-shell access, or lateral movement. | ||
| data_source: | ||
| - Osquery Results | ||
| search: |- | ||
| | tstats `security_content_summariesonly` | ||
| count | ||
| min(_time) as firstTime | ||
| max(_time) as lastTime | ||
| from datamodel=Endpoint.Processes where | ||
| Processes.process_name="socat*" | ||
| AND Processes.process="*echo=0*" | ||
| AND ( | ||
| Processes.process="*openssl:*" | ||
| OR Processes.process="*tcp:*" | ||
| OR Processes.process="*tcp4:*" | ||
| OR Processes.process="*tcp6:*" | ||
| ) | ||
| by Processes.dest Processes.original_file_name Processes.parent_process_id | ||
| Processes.process Processes.process_exec Processes.process_guid | ||
| Processes.process_hash Processes.process_id | ||
| Processes.process_current_directory Processes.process_name | ||
| Processes.process_path Processes.user | ||
| Processes.user_id Processes.vendor_product | ||
| | `drop_dm_object_name(Processes)` | ||
| | `security_content_ctime(firstTime)` | ||
| | `security_content_ctime(lastTime)` | ||
| | `socat_utility_remote_tcp_connection_with_echo_disabled_filter` | ||
| how_to_implement: |- | ||
| This detection uses osquery and endpoint security on MacOS. Follow the link in references, which describes how to setup process auditing in MacOS with endpoint security and osquery. | ||
| Also the [TA-OSquery](https://splunkbase.splunk.com/app/8574) must be deployed across your indexers and universal forwarders in order to have the osquery data populate the data models. | ||
| known_false_positives: |- | ||
| Authorized penetration testing or red team exercises may use socat to connect to controlled TCP listeners or test bind-shell detections. | ||
| Developers and network engineers may use socat with local echo disabled for legitimate TCP debugging, protocol testing, terminal handling, or troubleshooting. | ||
| references: | ||
| - https://attack.mitre.org/tactics/TA0002/ | ||
| - https://attack.mitre.org/techniques/T1059 | ||
| - https://blog.talosintelligence.com/bad-apples-weaponizing-native-macos-primitives-for-movement-and-execution/ | ||
| - https://gtfobins.github.io/gtfobins/socat/ | ||
| - https://hackers-arise.com/socat-the-advanced-hackers-network-tool/ | ||
| drilldown_searches: | ||
| - name: View the detection results for - "$user$" and "$dest$" | ||
| search: '%original_detection_search% | search user="$user$" dest="$dest$"' | ||
| earliest_offset: $info_min_time$ | ||
| latest_offset: $info_max_time$ | ||
| - name: View risk events for the last 7 days for - "$user$" and "$dest$" | ||
| search: '| from datamodel Risk.All_Risk | search normalized_risk_object IN ("$user$", "$dest$") | 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: 7d | ||
| latest_offset: "0" | ||
| finding: | ||
| title: User $user$ executed socat on endpoint $dest$ with arguments configured to connect to a remote TCP or OpenSSL endpoint with local echo disabled via $process$. | ||
| entity: | ||
| field: dest | ||
| type: system | ||
| score: 50 | ||
| intermediate_findings: | ||
| entities: | ||
| - field: user | ||
| type: user | ||
| score: 50 | ||
| message: Socat was executed on endpoint $dest$ by user $user$ with arguments configured to connect to a remote TCP or OpenSSL endpoint with local echo disabled via $process$. | ||
| threat_objects: | ||
| - field: process | ||
| type: process | ||
| analytic_story: | ||
| - MacOS Post-Exploitation | ||
| asset_type: Endpoint | ||
| mitre_attack_id: | ||
| - T1059 | ||
| product: | ||
| - Splunk Cloud | ||
| - Splunk Enterprise | ||
| - Splunk Enterprise Security | ||
| category: endpoint | ||
| security_domain: endpoint | ||
| tests: | ||
| - name: True Positive Test | ||
| attack_data: | ||
| - data: https://media.githubusercontent.com/media/splunk/attack_data/master/datasets/attack_techniques/T1059/utility_socat_remote_tcp_connection_with_echo_disabled/osquery.log | ||
| source: osquery | ||
| sourcetype: osquery:results | ||
| test_type: unit |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When an analyst opens this drilldown, the detection result has
destbecause thetstatssearch groups byProcesses.dest, but it never emitshost; consequently$host$is unresolved and the appendedhost="$host$"filter returns no matching detection results. The risk-event drilldown below has the same problem because the system risk entity is alsodest, so both occurrences should use$dest$as the companion detection already does.Useful? React with 👍 / 👎.