Skip to content

YARA · SEKOIA.IO Community

SEKOIA_Tool_Pivotnacci_Webshell

Detects pivotnacci webshell

Hack toolSEKOIA.IO CommunityDetection Rule License 1.1Compiles with YARA-X
Author
Sekoia.io
Date
2024-04-22
Modified
2024-12-19
Score / Quality
75 / 80

What this rule detects

Detects pivotnacci webshell

It defines 9 patterns (9 text, 0 hex, 0 regex).

Summary generated from the rule's metadata and condition.

Rule source

tool-pivotnacci-webshell.yarDetection Rule License 1.1
rule SEKOIA_Tool_Pivotnacci_Webshell : FILE
{
	meta:
		description = "Detects pivotnacci webshell"
		author = "Sekoia.io"
		id = "729b6381-b59d-46fe-9ad4-b8b68fb0ceea"
		date = "2024-04-22"
		modified = "2024-12-19"
		reference = "https://github.com/SEKOIA-IO/Community"
		source_url = "https://github.com/SEKOIA-IO/Community/blob/a438a5901a211c2abdf75da9c93921ef187473d1/yara_rules/tool_pivotnacci_webshell.yar#L1-L23"
		license_url = "https://github.com/SEKOIA-IO/Community/blob/a438a5901a211c2abdf75da9c93921ef187473d1/LICENSE.md"
		logic_hash = "a57792915b4c888547ebe0b08b928e4bc32b3526c98a3ccc9fca0193cedee20a"
		score = 75
		quality = 80
		tags = "FILE"
		version = "1.0"
		classification = "TLP:CLEAR"

	strings:
		$ = "if (cmd == SEND_OPERATION) {"
		$ = "Response.BinaryWrite(newBuff)"
		$ = "Request.Headers.Get(ID_HEADER)"
		$ = "[$READ_BUFFER_SESSION_KEY . $connection_id]"
		$ = "extract_session_readbuf($conn_id"
		$ = "Failed connecting to target $addr:$port : $errstr"
		$ = "void handle_post(String cmd)"
		$ = "SocketChannel socketChannel = this.get_socket(socket_id"
		$ = "this.get_svc().compareTo(this.get_hostname())"

	condition:
		3 of them and filesize < 10KB
}

Strings (9 patterns)

IdentifierTypeValueModifiers
$text"if (cmd == SEND_OPERATION) {"
$text"Response.BinaryWrite(newBuff)"
$text"Request.Headers.Get(ID_HEADER)"
$text"[$READ_BUFFER_SESSION_KEY . $connection_id]"
$text"extract_session_readbuf($conn_id"
$text"Failed connecting to target $addr:$port : $errstr"
$text"void handle_post(String cmd)"
$text"SocketChannel socketChannel = this.get_socket(socket_id"
$text"this.get_svc().compareTo(this.get_hostname())"

Condition

3 of them and filesize < 10KB

In plain words (Heuristic)

  • The file must be smaller than 10KB (a cheap guard that skips large files).
  • At least 3 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.

Open in editor

References

Licence & attribution

Author: Sekoia.io

Source repository: SEKOIA.IO Community @ a438a5901a

Licence: Detection Rule License 1.1 (repository licence)

Original rule

Mirrored via YARA Forge 20260927, which prefixes rule names with the source and adds normalised meta fields.

Rule id: 729b6381-b59d-46fe-9ad4-b8b68fb0ceea

Metadata

version1.0
classificationTLP:CLEAR

Tags:FILE