Skip to content

YARA · Signature Base (Florian Roth / Nextron)

SIGNATURE_BASE_WEBSHELL_JSP_Generic_Processbuilder

Generic JSP webshell which uses processbuilder to execute user input

WebshellSignature Base (Florian Roth / Nextron)Detection Rule License 1.1Compiles with YARA-X
Author
Arnim Rupp (https://github.com/ruppde)
Date
2021-01-07
Modified
2023-04-05
Score / Quality
75 / 85

What this rule detects

Generic JSP webshell which uses processbuilder to execute user input

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

Summary generated from the rule's metadata and condition.

Rule source

webshell-jsp-generic-processbuilder.yarDetection Rule License 1.1
rule SIGNATURE_BASE_WEBSHELL_JSP_Generic_Processbuilder : FILE
{
	meta:
		description = "Generic JSP webshell which uses processbuilder to execute user input"
		author = "Arnim Rupp (https://github.com/ruppde)"
		id = "2a7c5f44-24a1-5f43-996e-945c209b79b1"
		date = "2021-01-07"
		modified = "2023-04-05"
		reference = "Internal Research"
		source_url = "https://github.com/Neo23x0/signature-base/blob/94a1c48d7ab499879287ff611dfe7f9c56376030/yara/gen_webshells.yar#L5963-L6000"
		license_url = "https://github.com/Neo23x0/signature-base/blob/94a1c48d7ab499879287ff611dfe7f9c56376030/LICENSE"
		hash = "82198670ac2072cd5c2853d59dcd0f8dfcc28923"
		hash = "c05a520d96e4ebf9eb5c73fc0fa446ceb5caf343"
		hash = "347a55c174ee39ec912d9107e971d740f3208d53af43ea480f502d177106bbe8"
		hash = "d0ba29b646274e8cda5be1b940a38d248880d9e2bba11d994d4392c80d6b65bd"
		logic_hash = "fffc173cc23e158e319e48097243a64da232151e441c39e4b6ecc2565a82d862"
		score = 75
		quality = 85
		tags = "FILE"
		license = "Detection Rule License 1.1 https://github.com/Neo23x0/signature-base/blob/master/LICENSE"
		importance = 70

	strings:
		$exec = "ProcessBuilder" fullword wide ascii
		$start = "start" fullword wide ascii
		$input1 = "getParameter" fullword ascii wide
		$input2 = "getHeaders" fullword ascii wide
		$input3 = "getInputStream" fullword ascii wide
		$input4 = "getReader" fullword ascii wide
		$req1 = "request" fullword ascii wide
		$req2 = "HttpServletRequest" fullword ascii wide
		$req3 = "getRequest" fullword ascii wide

	condition:
		filesize < 2000 and ( any of ( $input* ) and any of ( $req* ) ) and $exec and $start
}

Strings (9 patterns)

IdentifierTypeValueModifiers
$exectext"ProcessBuilder"fullword wide ascii
$starttext"start"fullword wide ascii
$input1text"getParameter"fullword ascii wide
$input2text"getHeaders"fullword ascii wide
$input3text"getInputStream"fullword ascii wide
$input4text"getReader"fullword ascii wide
$req1text"request"fullword ascii wide
$req2text"HttpServletRequest"fullword ascii wide
$req3text"getRequest"fullword ascii wide

Condition

filesize < 2000 and ( any of ( $input* ) and any of ( $req* ) ) and $exec and $start

In plain words (Heuristic)

  • The file must be smaller than 2000 (a cheap guard that skips large files).
  • At least one pattern in ( $input* ) must match.
  • At least one pattern in ( $req* ) must match.
  • Pattern $exec must be present.
  • Pattern $start must be present.

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

Sample hashes

Hashes of samples the author lists in the rule's meta (look them up in your threat-intelligence platform).

  • 82198670ac2072cd5c2853d59dcd0f8dfcc28923
  • c05a520d96e4ebf9eb5c73fc0fa446ceb5caf343
  • 347a55c174ee39ec912d9107e971d740f3208d53af43ea480f502d177106bbe8
  • d0ba29b646274e8cda5be1b940a38d248880d9e2bba11d994d4392c80d6b65bd

Licence & attribution

Author: Arnim Rupp (https://github.com/ruppde)

Source repository: Signature Base (Florian Roth / Nextron) @ 94a1c48d7a

Licence: Detection Rule License 1.1 (stated in the rule's own meta)

“Detection Rule License 1.1 https://github.com/Neo23x0/signature-base/blob/master/LICENSE”

Original rule

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

Rule id: 2a7c5f44-24a1-5f43-996e-945c209b79b1

Metadata

importance70

Tags:FILE