YARA · SEKOIA.IO Community
SEKOIA_Tool_Gsocket_Strings
Detects Gsocket based on strings
- Author
- Sekoia.io
- Date
- 2024-06-10
- Modified
- 2024-12-19
- Score / Quality
- 75 / 80
What this rule detects
Detects Gsocket based on strings
Targets: Windows PE, Linux ELF, macOS Mach-O.
It defines 6 patterns (6 text, 0 hex, 0 regex).
Summary generated from the rule's metadata and condition.
Rule source
tool-gsocket-strings.yarDetection Rule License 1.1
rule SEKOIA_Tool_Gsocket_Strings : FILE
{
meta:
= "Detects Gsocket based on strings"
= "Sekoia.io"
= "55fb2f2b-1074-4b6d-9113-48eaeb0e1e27"
= "2024-06-10"
= "2024-12-19"
= "https://github.com/SEKOIA-IO/Community"
= "https://github.com/SEKOIA-IO/Community/blob/a438a5901a211c2abdf75da9c93921ef187473d1/yara_rules/tool_gsocket_strings.yar#L1-L28"
= "https://github.com/SEKOIA-IO/Community/blob/a438a5901a211c2abdf75da9c93921ef187473d1/LICENSE.md"
= "c54308293a9f64b571282eac9fba01e4671ba6b0cd45936fab92d4d9af904bbb"
= 75
= 80
= "FILE"
= "1.0"
= "TLP:CLEAR"
strings:
$ = "proxy. It allows multiple gs-netcat clients to (securely) relay"
$ = "GS-NETCAT(1) General Commands Manual GS-NETCAT(1)"
$ = "-T Use TOR. The gs-netcat tool will connect via TOR to the GSRN."
$ = "-D Daemon & Watchdog mode. Start gs-netcat as a background process"
$ = "gs-netcat [-rlgvqwCTSDiu] [-s secret] [-k keyfile] [-L logfile] [-d IP]"
$ = "The gs-netcat utility is a re-implementation of netcat."
condition:
( uint32be( 0 ) == 0x7f454c46 or uint16be( 0 ) == 0x4d5a or uint32be( 0 ) == 0xfeedface or uint32be( 0 ) == 0xcffaedfe or uint32be( 0 ) == 0xcafebabe ) and filesize > 2MB and filesize < 6MB and 2 of them
}
Strings (6 patterns)
| Identifier | Type | Value | Modifiers |
|---|---|---|---|
| $ | text | "proxy. It allows multiple gs-netcat clients to (securely) relay" | |
| $ | text | "GS-NETCAT(1) General Commands Manual GS-NETCAT(1)" | |
| $ | text | "-T Use TOR. The gs-netcat tool will connect via TOR to the GSRN." | |
| $ | text | "-D Daemon & Watchdog mode. Start gs-netcat as a background process" | |
| $ | text | "gs-netcat [-rlgvqwCTSDiu] [-s secret] [-k keyfile] [-L logfile] [-d IP]" | |
| $ | text | "The gs-netcat utility is a re-implementation of netcat." |
Condition
( uint32be( 0 ) == 0x7f454c46 or uint16be( 0 ) == 0x4d5a or uint32be( 0 ) == 0xfeedface or uint32be( 0 ) == 0xcffaedfe or uint32be( 0 ) == 0xcafebabe ) and filesize > 2MB and filesize < 6MB and 2 of themIn plain words (Heuristic)
- The file must start with “MZ” — a Windows executable (PE).
- The file must start with the ELF header — a Linux/Unix executable.
- The file must start with a Mach-O / fat binary magic — a macOS executable.
- The file must be smaller than 6MB (a cheap guard that skips large files).
- The file must be larger than 2MB.
- At least 2 patterns in the rule must match.
Test this rule in your browser
Drop a file to scan it with this rule using YARA-X compiled to WebAssembly. Nothing is uploaded.
Drop a file here or click to chooseScanned locally with YARA-X. Files up to 200 MB.
References
Licence & attribution
Author: Sekoia.io
Source repository: SEKOIA.IO Community @ a438a5901a
Licence: Detection Rule License 1.1 (repository licence)
Mirrored via YARA Forge 20260927, which prefixes rule names with the source and adds normalised meta fields.
Rule id: 55fb2f2b-1074-4b6d-9113-48eaeb0e1e27
Metadata
| version | 1.0 |
|---|---|
| classification | TLP:CLEAR |
Tags:FILE
Related rules
- Hack toolSEKOIA.IO Community· Sekoia.io· 2024-09-06
- Hack toolSEKOIA.IO Community· Sekoia.io· 2024-02-29
- Hack toolSEKOIA.IO Community· Sekoia.io· 2023-12-05
- Hack toolSEKOIA.IO Community· Sekoia.io· 2023-11-15
- Hack toolSEKOIA.IO Community· Sekoia.io· 2023-08-23
- Hack toolSEKOIA.IO Community· Sekoia.io· 2022-02-08
- Hack toolSEKOIA.IO Community· Sekoia.io· 2022-07-22
- Hack toolSEKOIA.IO Community· Sekoia.io· 2022-09-09