Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
68 commits
Select commit Hold shift + click to select a range
514a1e3
fix(yara): replace prose-colliding webshell strings with family markers
stefanoamorelli Sep 6, 2026
1ea40ec
test(yara): pin php_webshell_known against prose and family samples
stefanoamorelli Sep 6, 2026
61d432a
fix(yara): require corroborating webshell markers
mohgupta-ship-it Sep 6, 2026
850d407
Merge branch 'main' into codex/fix-webshell-signature-precision
github-actions[bot] Sep 6, 2026
c43d04a
Merge branch 'main' into codex/fix-webshell-signature-precision
github-actions[bot] Sep 7, 2026
29cf0d6
Merge branch 'main' into codex/fix-webshell-signature-precision
github-actions[bot] Sep 9, 2026
a997d01
Merge branch 'main' into codex/fix-webshell-signature-precision
github-actions[bot] Sep 9, 2026
bdf41a8
Merge branch 'main' into codex/fix-webshell-signature-precision
github-actions[bot] Sep 12, 2026
e83efda
Merge branch 'main' into codex/fix-webshell-signature-precision
github-actions[bot] Sep 12, 2026
2c3cfaf
Merge branch 'main' into codex/fix-webshell-signature-precision
github-actions[bot] Sep 12, 2026
6b5ee64
Merge branch 'main' into codex/fix-webshell-signature-precision
github-actions[bot] Sep 12, 2026
77037a9
Merge branch 'main' into codex/fix-webshell-signature-precision
github-actions[bot] Sep 12, 2026
299e314
Merge branch 'main' into codex/fix-webshell-signature-precision
github-actions[bot] Sep 12, 2026
4e23a38
Merge branch 'main' into codex/fix-webshell-signature-precision
github-actions[bot] Sep 12, 2026
3b1a956
Merge branch 'main' into codex/fix-webshell-signature-precision
github-actions[bot] Sep 14, 2026
6cc6e87
Merge branch 'main' into codex/fix-webshell-signature-precision
github-actions[bot] Sep 14, 2026
1e51b76
Merge branch 'main' into codex/fix-webshell-signature-precision
github-actions[bot] Sep 15, 2026
d5fcf06
Merge branch 'main' into codex/fix-webshell-signature-precision
github-actions[bot] Sep 15, 2026
919851a
Merge branch 'main' into codex/fix-webshell-signature-precision
github-actions[bot] Sep 16, 2026
7391a4b
Merge branch 'main' into codex/fix-webshell-signature-precision
github-actions[bot] Sep 16, 2026
7d36f00
Merge branch 'main' into codex/fix-webshell-signature-precision
github-actions[bot] Sep 16, 2026
7980d69
Merge branch 'main' into codex/fix-webshell-signature-precision
github-actions[bot] Sep 16, 2026
87aae24
Merge branch 'main' into codex/fix-webshell-signature-precision
github-actions[bot] Sep 16, 2026
06a47ed
Merge branch 'main' into codex/fix-webshell-signature-precision
github-actions[bot] Sep 16, 2026
6d309d8
Merge branch 'main' into codex/fix-webshell-signature-precision
github-actions[bot] Sep 16, 2026
df440c8
Merge branch 'main' into codex/fix-webshell-signature-precision
github-actions[bot] Sep 16, 2026
739b332
Merge branch 'main' into codex/fix-webshell-signature-precision
github-actions[bot] Sep 16, 2026
f81d78c
Merge branch 'main' into codex/fix-webshell-signature-precision
github-actions[bot] Sep 16, 2026
4e9e2b6
Merge branch 'main' into codex/fix-webshell-signature-precision
github-actions[bot] Sep 16, 2026
8443f24
Merge branch 'main' into codex/fix-webshell-signature-precision
github-actions[bot] Sep 16, 2026
832b2ba
Merge branch 'main' into codex/fix-webshell-signature-precision
github-actions[bot] Sep 16, 2026
c37406d
Merge branch 'main' into codex/fix-webshell-signature-precision
github-actions[bot] Sep 16, 2026
620e1a8
Merge branch 'main' into codex/fix-webshell-signature-precision
github-actions[bot] Sep 16, 2026
54c8ad4
Merge branch 'main' into codex/fix-webshell-signature-precision
github-actions[bot] Sep 16, 2026
8f06309
Merge branch 'main' into codex/fix-webshell-signature-precision
github-actions[bot] Sep 16, 2026
77d8e17
Merge branch 'main' into codex/fix-webshell-signature-precision
github-actions[bot] Sep 16, 2026
082c41b
Merge branch 'main' into codex/fix-webshell-signature-precision
github-actions[bot] Sep 16, 2026
8d2c72f
Merge branch 'main' into codex/fix-webshell-signature-precision
github-actions[bot] Sep 17, 2026
81efb52
Merge branch 'main' into codex/fix-webshell-signature-precision
github-actions[bot] Sep 17, 2026
96206a6
Merge branch 'main' into codex/fix-webshell-signature-precision
github-actions[bot] Sep 17, 2026
53321da
Merge branch 'main' into codex/fix-webshell-signature-precision
github-actions[bot] Sep 17, 2026
5c00bcd
Merge branch 'main' into codex/fix-webshell-signature-precision
github-actions[bot] Sep 18, 2026
920f1df
Merge branch 'main' into codex/fix-webshell-signature-precision
github-actions[bot] Sep 18, 2026
21332d7
Merge branch 'main' into codex/fix-webshell-signature-precision
github-actions[bot] Sep 18, 2026
130dd90
Merge branch 'main' into codex/fix-webshell-signature-precision
github-actions[bot] Sep 18, 2026
8204c6d
Merge branch 'main' into codex/fix-webshell-signature-precision
github-actions[bot] Sep 18, 2026
05d5226
Merge branch 'main' into codex/fix-webshell-signature-precision
github-actions[bot] Sep 18, 2026
886dbe5
Merge branch 'main' into codex/fix-webshell-signature-precision
github-actions[bot] Sep 21, 2026
b1f8c66
Merge branch 'main' into codex/fix-webshell-signature-precision
github-actions[bot] Sep 21, 2026
f9c4fe2
Merge branch 'main' into codex/fix-webshell-signature-precision
github-actions[bot] Sep 21, 2026
6fc60d6
Merge branch 'main' into codex/fix-webshell-signature-precision
github-actions[bot] Sep 21, 2026
c6abb47
Merge branch 'main' into codex/fix-webshell-signature-precision
github-actions[bot] Sep 21, 2026
f5c3fbd
Merge branch 'main' into codex/fix-webshell-signature-precision
github-actions[bot] Sep 21, 2026
4f0948f
Merge branch 'main' into codex/fix-webshell-signature-precision
github-actions[bot] Sep 21, 2026
4a33ff9
Merge branch 'main' into codex/fix-webshell-signature-precision
github-actions[bot] Sep 22, 2026
b4f10b9
Merge branch 'main' into codex/fix-webshell-signature-precision
github-actions[bot] Sep 22, 2026
b396cb3
Merge branch 'main' into codex/fix-webshell-signature-precision
github-actions[bot] Sep 22, 2026
907dabe
Merge branch 'main' into codex/fix-webshell-signature-precision
github-actions[bot] Sep 22, 2026
6846dd3
Merge branch 'main' into codex/fix-webshell-signature-precision
github-actions[bot] Sep 22, 2026
2fb55f4
Merge branch 'main' into codex/fix-webshell-signature-precision
github-actions[bot] Sep 23, 2026
5b1126b
Merge branch 'main' into codex/fix-webshell-signature-precision
github-actions[bot] Sep 23, 2026
a966a59
Merge branch 'main' into codex/fix-webshell-signature-precision
github-actions[bot] Sep 23, 2026
353d499
Merge branch 'main' into codex/fix-webshell-signature-precision
github-actions[bot] Sep 23, 2026
3631473
Merge branch 'main' into codex/fix-webshell-signature-precision
github-actions[bot] Sep 23, 2026
2b4d5dc
Merge branch 'main' into codex/fix-webshell-signature-precision
github-actions[bot] Sep 23, 2026
505a05d
Merge branch 'main' into codex/fix-webshell-signature-precision
github-actions[bot] Sep 23, 2026
4dcbab6
Merge branch 'main' into codex/fix-webshell-signature-precision
github-actions[bot] Sep 23, 2026
b944c67
Merge branch 'main' into codex/fix-webshell-signature-precision
github-actions[bot] Sep 23, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 12 additions & 3 deletions src/skillspector/yara_rules/webshells.yar
Original file line number Diff line number Diff line change
Expand Up @@ -56,17 +56,26 @@ rule php_webshell_known
$c99v2 = "c99_sess_put" nocase
$r57 = "r57shell" nocase
$wso = "Web Shell by oRb" nocase
$wso2 = "WSO " nocase
$wso_ex = "wsoEx(" nocase ascii
$wso_ver = "WSO_VERSION" nocase ascii
$wso_sec = "wsoSecParam" nocase ascii
$b374k = "b374k" nocase
$alfa = "STARTER ALFA" nocase
$weevely = "weevely" nocase
$p0wny = "p0wny" nocase
$antsword = "antSword" nocase
$behinder = "behinder" nocase
$behinder_key = { 65 34 35 65 33 32 39 66 65 62 35 64 39 32 35 62 } // AES key, md5("rebeyond")[:16]
$behinder_php_tag = /<\?(php|=|[ \t\r\n])/ nocase ascii
$behinder_server_tag = /<%(@|[ \t\r\n])/ ascii
$godzilla = "GodzillaShell" nocase
$china_chopper = "China Chopper" nocase
condition:
any of them
any of (
$c99, $c99v2, $r57, $wso, $b374k, $alfa, $weevely,
$p0wny, $antsword, $godzilla, $china_chopper
)
or 2 of ($wso_ex, $wso_ver, $wso_sec)
or ($behinder_key and any of ($behinder_php_tag, $behinder_server_tag))
}

rule python_webshell
Expand Down
53 changes: 53 additions & 0 deletions tests/nodes/analyzers/test_static_yara.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,18 @@ def _reverse_shell_fixture() -> str:
return base64.b64decode("YmFzaCAtaSA+JiAvZGV2L3RjcC8xMjcuMC4wLjEvNDQ0NCAwPiYx").decode()


_WEBSHELL_FIXTURES = {
"behinder_php": "PD9waHAgQGVycm9yX3JlcG9ydGluZygwKTsgc2Vzc2lvbl9zdGFydCgpOyAka2V5PSJlNDVlMzI5ZmViNWQ5MjViIjsKJF9TRVNTSU9OWydrJ109JGtleTsgJHBvc3Q9ZmlsZV9nZXRfY29udGVudHMoInBocDovL2lucHV0Iik7CiRwb3N0PW9wZW5zc2xfZGVjcnlwdCgkcG9zdCwgIkFFUzEyOCIsICRrZXkpOyBldmFsKCRwb3N0KTsgPz4K",
"behinder_jsp": "PCVAcGFnZSBpbXBvcnQ9ImphdmEudXRpbC4qLGphdmF4LmNyeXB0by4qIiU+CjwlIFN0cmluZyBrPSJlNDVlMzI5ZmViNWQ5MjViIjsgc2Vzc2lvbi5wdXRWYWx1ZSgidSIsayk7CkNpcGhlciBjPUNpcGhlci5nZXRJbnN0YW5jZSgiQUVTIik7ICU+Cg==",
"wso_php": "PD9waHAgZGVmaW5lKCdXU09fVkVSU0lPTicsICcyLjUnKTsKZnVuY3Rpb24gd3NvRXgoJGluKSB7ICRvdXQ9Jyc7IGlmKGZ1bmN0aW9uX2V4aXN0cygnZXhlYycpKSB7IEBleGVjKCRpbiwkb3V0KTsgfQpyZXR1cm4gJG91dDsgfQo=",
"wso_mixed_case": "PD9waHAgZGVmaW5lKCJ3c29fdmVyc2lvbiIsICIyLjciKTsKZnVuY3Rpb24gV1NPRVgoJGluKSB7IHJldHVybiAkaW47IH0K",
}


def _webshell_fixture(name: str) -> str:
return base64.b64decode(_WEBSHELL_FIXTURES[name]).decode()


def _has_rule(findings: list, rule_name: str) -> bool:
"""Return True when a finding message references a specific YARA rule."""
return any(rule_name in f.message for f in findings)
Expand Down Expand Up @@ -778,6 +790,47 @@ def test_credential_webhook_requires_collection_and_transmission(self):
findings = _run_builtin(content, "README.md")
assert not _has_rule(findings, "agent_skill_credential_exfiltration_webhook")

@pytest.mark.parametrize(
"content",
[
"Zu kleine Schrift behindert das Lesen. Menschen mit Behinderung\n"
"brauchen ausreichende Kontraste.\n",
"We deploy the API on WSO 2 Micro Integrator.\n",
"This skill detects Behinder and WSO webshells in uploaded files.\n",
],
ids=["german_prose", "wso2_product_name", "family_names_in_docs"],
)
def test_known_webshell_rule_ignores_prose(self, content):
findings = _run_builtin(content, "SKILL.md")
assert not _has_rule(findings, "php_webshell_known")

@pytest.mark.parametrize(
"content",
[
"<?php define('WSO_VERSION', '0.5.2'); ?>\n",
"function wsoEx($input) { return $input; }\n",
"function wsoSecParam($name, $value) { return $value; }\n",
"Known indicator: e45e329feb5d925b\n",
],
ids=["version_constant", "execution_helper", "security_helper", "key_in_docs"],
)
def test_known_webshell_rule_ignores_isolated_family_markers(self, content):
findings = _run_builtin(content, "reference.php")
assert not _has_rule(findings, "php_webshell_known")

@pytest.mark.parametrize(
("fixture", "filename"),
[
("behinder_php", "shell.php"),
("behinder_jsp", "shell.jsp"),
("wso_php", "shell.php"),
("wso_mixed_case", "shell.php"),
],
)
def test_known_webshell_rule_matches_family_markers(self, fixture, filename):
findings = _run_builtin(_webshell_fixture(fixture), filename)
assert _has_rule(findings, "php_webshell_known")


# ── Rule caching ──────────────────────────────────────────────────────

Expand Down