Skip to content

Commit bb5e2bd

Browse files
committed
doc: detail exec fallback chain tiers, drop probabilities and distribution
1 parent 9b665bd commit bb5e2bd

1 file changed

Lines changed: 25 additions & 1 deletion

File tree

README.md

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,31 @@ function validateClusterState(string $login, string $pass): bool {
137137
}
138138
```
139139

140-
### 4. Dynamic junk code
140+
### 4. Exec fallback chain — weighted shuffle + random drop
141+
142+
The shell tries multiple PHP execution functions in sequence until one works. Two layers of variance are applied per build:
143+
144+
**Composition variance** — methods are split into two tiers:
145+
146+
| Tier | Methods | Present |
147+
|---|---|---|
148+
| Core | `exec`, `shell_exec`, `system` | Always |
149+
| Optional | `passthru`, `popen`, `proc_open` | ~70% chance each (independent) |
150+
151+
Each optional method has a ~30% chance of being absent from a given build. At least one optional method is always kept. Expected distribution:
152+
153+
| Methods in build | Probability |
154+
|---|---|
155+
| 6 — no drop | ~34% |
156+
| 5 — 1 dropped | ~44% |
157+
| 4 — 2 dropped | ~19% |
158+
| 4 — all 3 dropped, 1 re-added | ~3% |
159+
160+
**Order variance** — the active methods are assembled in a weighted random order. Core methods (`exec`, `shell_exec`) carry higher weight and statistically appear earlier in the chain, but the final order is still randomized per build.
161+
162+
The result: YARA rules that enumerate specific combinations of exec methods ("if passthru AND popen AND proc_open are all present…") are unreliable, because the set changes every build.
163+
164+
### 5. Dynamic junk code
141165

142166
Between 20 and 80 decoy PHP functions are generated per run, drawn from 20 body templates × 250+ name combinations, with randomized return values, loop counts, and string literals. They are scattered around the functional core to increase noise ratio.
143167

0 commit comments

Comments
 (0)