# Malware pattern rules

The 306 regular-expression rules of malscan-engine v0.6.1, the version the CLI ships, with where each runs and the class a hit gets.

These are the pattern rules in `detect/data/patterns.toml` at malscan-engine `v0.6.1`, the version `cli@2449840` pins in `go.mod`. A newer engine on its default branch can have more rules; they reach the CLI only when the pin moves.

How a hit is classed:

- **evidence**: the rule has `override_gate = true`, or `points` of 40 or more. One evidence hit marks the package malicious, gives the finding severity `critical`, and fails `vulnetix malscan` with exit code 1.
- **context**: fewer points and no override. Recorded at severity `low`, never fails the scan.
- **install hook only** (`hook_only`): a dual-use command. In an install script it is classed by points; in the primary manifest a rule under the threshold is dropped and one at or over it is recorded as context.
- **only in a PKGBUILD or install hook** (`pkgbuild_only`): source hygiene for Arch packages, skipped on a declarative manifest.

The points are weights inherited from traur. malscan does not add them up into a score; they only decide the class above.

## Install scripts

57 rules, section `install_script_analysis`, capability `install-script`. Runs over: npm `preinstall`, `install`, `postinstall`, `preuninstall`, `postuninstall`, `prepare` and `prepublish` scripts, Rust `build.rs` and Ruby `extconf.rb`. Always an auto-execution surface.

| Rule | Points | Class | Description |
|---|---|---|---|
| <span id="p-install-curl"></span>`P-INSTALL-CURL` | 45 | evidence | curl in install script (should not download during install) |
| <span id="p-install-wget"></span>`P-INSTALL-WGET` | 45 | evidence | wget in install script (should not download during install) |
| <span id="p-install-pipe-shell"></span>`P-INSTALL-PIPE-SHELL` | 90 | evidence | Download-and-execute in install script |
| <span id="p-install-persistence"></span>`P-INSTALL-PERSISTENCE` | 45 | evidence | Persistence mechanism in install script |
| <span id="p-install-profile-mod"></span>`P-INSTALL-PROFILE-MOD` | 55 | evidence | Shell profile modification in install script |
| <span id="p-install-ssh-access"></span>`P-INSTALL-SSH-ACCESS` | 80 | evidence | Accessing SSH keys from install script |
| <span id="p-install-browser-data"></span>`P-INSTALL-BROWSER-DATA` | 75 | evidence | Accessing browser profile data from install script |
| <span id="p-install-gpg-access"></span>`P-INSTALL-GPG-ACCESS` | 70 | evidence | Accessing GPG keyring from install script |
| <span id="p-install-passwd-read"></span>`P-INSTALL-PASSWD-READ` | 65 | evidence | Reading system password files from install script |
| <span id="p-install-base64"></span>`P-INSTALL-BASE64` | 65 | evidence | Base64 decoding in install script (possible payload hiding) |
| <span id="p-install-eval"></span>`P-INSTALL-EVAL` | 55 | evidence | Dynamic code execution via eval in install script |
| <span id="p-install-nohup"></span>`P-INSTALL-NOHUP` | 75 | evidence | nohup with backgrounding in install script (persistent hidden process) |
| <span id="p-install-tmp-exec"></span>`P-INSTALL-TMP-EXEC` | 80 | evidence | Executing from /tmp in install script |
| <span id="p-install-chmod-exec"></span>`P-INSTALL-CHMOD-EXEC` | 80 | evidence | chmod +x followed by execution in install script |
| <span id="p-install-python-exec"></span>`P-INSTALL-PYTHON-EXEC` | 90 | evidence | Python fetch-and-execute in install script |
| <span id="p-install-devnull-bg"></span>`P-INSTALL-DEVNULL-BG` | 75 | evidence | Network/shell command backgrounded with suppressed output in install script |
| <span id="p-install-miner"></span>`P-INSTALL-MINER` | 85 | evidence | Cryptocurrency mining references in install script |
| <span id="p-install-kernel-mod"></span>`P-INSTALL-KERNEL-MOD` | 70 | evidence | Kernel module loading in install script |
| <span id="p-install-env-tokens"></span>`P-INSTALL-ENV-TOKENS` | 65 | evidence | Accessing sensitive environment variables in install script |
| <span id="p-install-ifs"></span>`P-INSTALL-IFS` | 65 | evidence | $IFS used in install script (obfuscation) |
| <span id="p-install-ansi-c-hex"></span>`P-INSTALL-ANSI-C-HEX` | 70 | evidence | ANSI-C hex quoting in install script |
| <span id="p-install-rot13"></span>`P-INSTALL-ROT13` | 65 | evidence | ROT13 encoding in install script |
| <span id="p-install-history-clear"></span>`P-INSTALL-HISTORY-CLEAR` | 75 | evidence | Shell history clearing in install script |
| <span id="p-install-log-clear"></span>`P-INSTALL-LOG-CLEAR` | 80 | evidence | Log clearing in install script |
| <span id="p-install-sudoers-mod"></span>`P-INSTALL-SUDOERS-MOD` | 80 | evidence | Sudoers access in install script |
| <span id="p-install-prompt-command"></span>`P-INSTALL-PROMPT-COMMAND` | 70 | evidence | PROMPT_COMMAND injection from install script |
| <span id="p-install-xdg-autostart"></span>`P-INSTALL-XDG-AUTOSTART` | 60 | evidence | XDG autostart creation from install script |
| <span id="p-npm-hook-node-eval"></span>`P-NPM-HOOK-NODE-EVAL` | 55 | evidence | lifecycle install hook executes inline node code (node -e/--eval) |
| <span id="p-npm-hook-decode"></span>`P-NPM-HOOK-DECODE` | 45 | evidence | lifecycle install hook decodes a base64 payload |
| <span id="p-npm-hook-env-exfil"></span>`P-NPM-HOOK-ENV-EXFIL` | 50 | evidence | lifecycle install hook reads process.env and contacts the network (secret exfiltration) |
| <span id="p-py-setup-exec"></span>`P-PY-SETUP-EXEC` | 42 | evidence | setup.py spawns a subprocess at install time (download-and-execute vector) |
| <span id="p-py-setup-eval-decode"></span>`P-PY-SETUP-EVAL-DECODE` | 55 | evidence | setup.py exec/eval of a base64/hex-decoded payload (dynamic code execution) |
| <span id="p-py-setup-urllib"></span>`P-PY-SETUP-URLLIB` | 40 | evidence | setup.py downloads from the network at install time |
| <span id="p-gem-exec-decode"></span>`P-GEM-EXEC-DECODE` | 55 | evidence | Gemspec/extension hook executes a base64/packed-decoded command |
| <span id="p-gem-post-install-url"></span>`P-GEM-POST-INSTALL-URL` | 30 | context | Gemspec post_install_message references a remote URL |
| <span id="p-cargo-build-process-exec"></span>`P-CARGO-BUILD-PROCESS-EXEC` | 30 | context | build.rs spawns a process at build time (std::process::Command) |
| <span id="p-cargo-build-shell"></span>`P-CARGO-BUILD-SHELL` | 50 | evidence | build.rs invokes a shell at build time (download-and-execute vector) |
| <span id="p-cargo-build-download"></span>`P-CARGO-BUILD-DOWNLOAD` | 45 | evidence | build.rs downloads a remote resource at build time |
| <span id="go-mod-replace-remote"></span>`GO-MOD-REPLACE-REMOTE` | 30 | context | go.mod replace directive redirecting a dependency to a remote source |
| <span id="p-nuget-ps-iex-download"></span>`P-NUGET-PS-IEX-DOWNLOAD` | 55 | evidence | PowerShell IEX of DownloadString (download-and-execute) in NuGet install hook |
| <span id="p-nuget-ps-invoke-expression"></span>`P-NUGET-PS-INVOKE-EXPRESSION` | 35 | context | PowerShell Invoke-Expression in NuGet install hook |
| <span id="p-nuget-ps-encodedcommand"></span>`P-NUGET-PS-ENCODEDCOMMAND` | 55 | evidence | PowerShell base64 -EncodedCommand payload in NuGet install hook |
| <span id="p-nuget-ps-frombase64"></span>`P-NUGET-PS-FROMBASE64` | 38 | context | PowerShell base64 decode of payload in NuGet install hook |
| <span id="p-nuget-msbuild-inline-exec"></span>`P-NUGET-MSBUILD-INLINE-EXEC` | 50 | evidence | MSBuild inline-task code execution via CodeTaskFactory in NuGet .targets/.props |
| <span id="php-composer-curl-pipe"></span>`PHP-COMPOSER-CURL-PIPE` | 55 | evidence | Composer lifecycle script pipes curl/wget to a shell (download-and-execute) |
| <span id="php-composer-php-eval"></span>`PHP-COMPOSER-PHP-EVAL` | 55 | evidence | Composer script invokes php -r with an eval/base64_decode/system payload |
| <span id="maven-pom-exec-plugin"></span>`MAVEN-POM-EXEC-PLUGIN` | 30 | context | POM declares a build plugin that executes arbitrary code/scripts at build time |
| <span id="hex-mix-code-eval"></span>`HEX-MIX-CODE-EVAL` | 50 | evidence | mix.exs evaluates dynamically constructed Elixir at compile time |
| <span id="hex-mix-base64-eval"></span>`HEX-MIX-BASE64-EVAL` | 55 | evidence | mix.exs base64-decodes then executes/evaluates a payload |
| <span id="hex-mix-os-cmd"></span>`HEX-MIX-OS-CMD` | 35 | context | mix.exs invokes Erlang :os.cmd at compile time |
| <span id="dart-hook-curl-pipe"></span>`DART-HOOK-CURL-PIPE` | 55 | evidence | Dart build hook pipes curl output to a shell (download-and-execute) |
| <span id="r-install-download-exec"></span>`R-INSTALL-DOWNLOAD-EXEC` | 55 | evidence | download.file feeding source/eval/system at install time (download-and-execute) |
| <span id="r-install-system"></span>`R-INSTALL-SYSTEM` | 30 | context | shell-out (system/system2/shell) in a CRAN install-time script |
| <span id="jl-build-shell-interp"></span>`JL-BUILD-SHELL-INTERP` | 55 | evidence | build.jl spawns a shell interpreter at Pkg.build time |
| <span id="jl-download-exec"></span>`JL-DOWNLOAD-EXEC` | 55 | evidence | build.jl downloads a remote artefact and include/eval-executes it |
| <span id="p-conan-self-run-shell"></span>`P-CONAN-SELF-RUN-SHELL` | 50 | evidence | conanfile self.run() executing a shell/download command at build time |
| <span id="p-conan-self-run-pipe-shell"></span>`P-CONAN-SELF-RUN-PIPE-SHELL` | 55 | evidence | conanfile self.run() piping fetched output to a shell (download-and-execute) |

## Manifest patterns

122 rules, section `pkgbuild_analysis`, capability `manifest-patterns`. Runs over: The primary manifest: `package.json`, `setup.py`, `pyproject.toml`, `PKG-INFO`, `Cargo.toml`, `*.gemspec` or `composer.json`.

| Rule | Points | Class | Description |
|---|---|---|---|
| <span id="p-curl-pipe"></span>`P-CURL-PIPE` | 90 | evidence | curl output piped to shell (download-and-execute) |
| <span id="p-wget-pipe"></span>`P-WGET-PIPE` | 90 | evidence | wget output piped to shell (download-and-execute) |
| <span id="p-revshell-devtcp"></span>`P-REVSHELL-DEVTCP` | 95 | evidence | Bash reverse shell via /dev/tcp |
| <span id="p-revshell-nc"></span>`P-REVSHELL-NC` | 95 | evidence | Netcat reverse shell |
| <span id="p-revshell-socat"></span>`P-REVSHELL-SOCAT` | 90 | evidence | Socat reverse shell |
| <span id="p-revshell-python"></span>`P-REVSHELL-PYTHON` | 85 | evidence | Python reverse shell pattern |
| <span id="p-eval-base64"></span>`P-EVAL-BASE64` | 85 | evidence | Base64-decoded payload executed via eval |
| <span id="p-base64"></span>`P-BASE64` | 60 | evidence | Base64 decoding (possible payload hiding) |
| <span id="p-eval-var"></span>`P-EVAL-VAR` | 50 | evidence | Dynamic code execution via eval |
| <span id="p-source-remote"></span>`P-SOURCE-REMOTE` | 90 | evidence | Sourcing remote script via process substitution |
| <span id="p-gzip-exec"></span>`P-GZIP-EXEC` | 70 | evidence | Compressed payload piped to shell |
| <span id="p-ssh-access"></span>`P-SSH-ACCESS` | 75 | evidence | Accessing SSH keys |
| <span id="p-browser-data"></span>`P-BROWSER-DATA` | 70 | evidence | Accessing browser profile data |
| <span id="p-gpg-access"></span>`P-GPG-ACCESS` | 65 | evidence | Accessing GPG keyring |
| <span id="p-profile-mod"></span>`P-PROFILE-MOD` | 55 | evidence | Modifying shell profile (persistence) |
| <span id="p-systemd-create"></span>`P-SYSTEMD-CREATE` | 35 | context | Creating/enabling systemd service |
| <span id="p-cron-create"></span>`P-CRON-CREATE` | 45 | evidence | Creating cron job (persistence) |
| <span id="p-ld-preload"></span>`P-LD-PRELOAD` | 60 | evidence | LD_PRELOAD injection |
| <span id="p-passwd-read"></span>`P-PASSWD-READ` | 60 | evidence | Reading system password files |
| <span id="p-discord-webhook"></span>`P-DISCORD-WEBHOOK` | 70 | evidence | Discord webhook URL (data exfiltration channel) |
| <span id="p-url-shortener"></span>`P-URL-SHORTENER` | 60 | evidence | URL shortener (hiding real destination) |
| <span id="p-curl-pipe-python"></span>`P-CURL-PIPE-PYTHON` | 90 | evidence | curl output piped to Python interpreter (download-and-execute) |
| <span id="p-curl-pipe-perl"></span>`P-CURL-PIPE-PERL` | 90 | evidence | curl output piped to Perl interpreter (download-and-execute) |
| <span id="p-wget-pipe-python"></span>`P-WGET-PIPE-PYTHON` | 90 | evidence | wget output piped to Python interpreter (download-and-execute) |
| <span id="p-python-inline"></span>`P-PYTHON-INLINE` | 45 | evidence | Python inline code execution |
| <span id="p-suid-bit"></span>`P-SUID-BIT` | 70 | evidence | Setting SUID/SGID bit (privilege escalation) |
| <span id="p-mkfifo"></span>`P-MKFIFO` | 55 | evidence | Named pipe creation (possible reverse shell component) |
| <span id="p-openssl-client"></span>`P-OPENSSL-CLIENT` | 55 | evidence | OpenSSL client connection (possible encrypted C2 channel) |
| <span id="p-clipboard-read"></span>`P-CLIPBOARD-READ` | 50 | evidence | Clipboard access (possible credential theft) |
| <span id="p-disk-read"></span>`P-DISK-READ` | 60 | evidence | Direct disk device read (data exfiltration) |
| <span id="p-miner-binary"></span>`P-MINER-BINARY` | 70 | evidence | Reference to cryptocurrency mining software |
| <span id="p-stratum-url"></span>`P-STRATUM-URL` | 85 | evidence | Stratum mining protocol URL (cryptocurrency mining) |
| <span id="p-mining-pool"></span>`P-MINING-POOL` | 80 | evidence | Known cryptocurrency mining pool domain |
| <span id="p-crypto-wallet"></span>`P-CRYPTO-WALLET` | 75 | evidence | Cryptocurrency wallet address (Monero/Bitcoin/Ethereum) |
| <span id="p-python-exec-url"></span>`P-PYTHON-EXEC-URL` | 90 | evidence | Python fetch-and-execute (exec with URL fetch) |
| <span id="p-python-dynamic-import"></span>`P-PYTHON-DYNAMIC-IMPORT` | 65 | evidence | Python dynamic import to execute system commands |
| <span id="p-python-exec-compound"></span>`P-PYTHON-EXEC-COMPOUND` | 80 | evidence | Python one-liner with exec() (obfuscated code execution) |
| <span id="p-chmod-exec-chain"></span>`P-CHMOD-EXEC-CHAIN` | 75 | evidence in an install hook, context elsewhere | chmod +x followed by execution (download-chmod-execute chain) |
| <span id="p-wget-chmod-exec"></span>`P-WGET-CHMOD-EXEC` | 85 | evidence in an install hook, context elsewhere | Download followed by chmod +x (download-and-execute preparation) |
| <span id="p-tmp-execution"></span>`P-TMP-EXECUTION` | 70 | evidence in an install hook, context elsewhere | Writing or executing files in /tmp (common malware staging) |
| <span id="p-nohup-background"></span>`P-NOHUP-BACKGROUND` | 55 | evidence | nohup with backgrounding (persistent hidden process) |
| <span id="p-devnull-background"></span>`P-DEVNULL-BACKGROUND` | 65 | evidence | Network/shell command backgrounded with suppressed output |
| <span id="p-sysinfo-recon"></span>`P-SYSINFO-RECON` | 40 | evidence | System information gathering (reconnaissance) |
| <span id="p-printf-hex"></span>`P-PRINTF-HEX` | 60 | evidence | printf with hex escape sequences (obfuscated payload) |
| <span id="p-xxd-decode"></span>`P-XXD-DECODE` | 55 | evidence | xxd reverse (hex to binary decode, possible payload) |
| <span id="p-kernel-module-load"></span>`P-KERNEL-MODULE-LOAD` | 50 | evidence | Kernel module loading (potential rootkit) |
| <span id="p-kernel-module-write"></span>`P-KERNEL-MODULE-WRITE` | 45 | evidence | Writing to kernel module directories |
| <span id="p-pastebin-code"></span>`P-PASTEBIN-CODE` | 75 | evidence | Downloading from paste service in build/package code (mutable untrusted source) |
| <span id="p-dns-exfil"></span>`P-DNS-EXFIL` | 60 | evidence | DNS lookup with variable interpolation (possible DNS exfiltration) |
| <span id="p-curl-post-data"></span>`P-CURL-POST-DATA` | 55 | evidence | curl POST with variable data (possible data exfiltration) |
| <span id="p-archive-exec"></span>`P-ARCHIVE-EXEC` | 55 | evidence | Archive extraction followed by execution (extract-and-execute chain) |
| <span id="p-env-token-access"></span>`P-ENV-TOKEN-ACCESS` | 55 | evidence | Accessing sensitive environment variables (token/credential theft) |
| <span id="p-ifs-obfuscation"></span>`P-IFS-OBFUSCATION` | 60 | evidence | $IFS variable used as command separator (shell obfuscation) |
| <span id="p-ansi-c-hex"></span>`P-ANSI-C-HEX` | 65 | evidence | ANSI-C hex quoting to hide command strings |
| <span id="p-rot13"></span>`P-ROT13` | 60 | evidence | ROT13 encoding/decoding (payload obfuscation) |
| <span id="p-octal-encode"></span>`P-OCTAL-ENCODE` | 55 | evidence | Octal-encoded payload in printf/echo (3+ sequences) |
| <span id="p-rev-exec"></span>`P-REV-EXEC` | 70 | evidence | Reversed string piped to shell (obfuscation) |
| <span id="p-revshell-perl"></span>`P-REVSHELL-PERL` | 85 | evidence | Perl reverse shell (Socket + connect/exec) |
| <span id="p-revshell-ruby"></span>`P-REVSHELL-RUBY` | 85 | evidence | Ruby reverse shell (TCPSocket) |
| <span id="p-revshell-awk"></span>`P-REVSHELL-AWK` | 85 | evidence | Awk reverse shell (/inet/tcp) |
| <span id="p-revshell-lua"></span>`P-REVSHELL-LUA` | 85 | evidence | Lua reverse shell (socket.tcp) |
| <span id="p-revshell-php"></span>`P-REVSHELL-PHP` | 85 | evidence | PHP reverse shell (fsockopen/socket_connect) |
| <span id="p-decompress-exec"></span>`P-DECOMPRESS-EXEC` | 70 | evidence | Decompressed payload piped to shell |
| <span id="p-proc-sub-download"></span>`P-PROC-SUB-DOWNLOAD` | 75 | evidence | Process substitution with download command |
| <span id="p-ruby-exec-url"></span>`P-RUBY-EXEC-URL` | 85 | evidence | Ruby fetch-and-execute |
| <span id="p-perl-exec-url"></span>`P-PERL-EXEC-URL` | 85 | evidence | Perl fetch-and-execute (LWP/HTTP::Tiny + system/exec) |
| <span id="p-dev-udp"></span>`P-DEV-UDP` | 85 | evidence | Bash /dev/udp network connection |
| <span id="p-base32"></span>`P-BASE32` | 60 | evidence | Base32 decoding (payload hiding) |
| <span id="p-openssl-decrypt"></span>`P-OPENSSL-DECRYPT` | 65 | evidence | OpenSSL decryption (encrypted payload) |
| <span id="p-telnet-pipe"></span>`P-TELNET-PIPE` | 70 | evidence | Telnet connection piped to command |
| <span id="p-xdg-autostart"></span>`P-XDG-AUTOSTART` | 55 | evidence | XDG autostart entry creation |
| <span id="p-systemd-user"></span>`P-SYSTEMD-USER` | 50 | evidence | Systemd user service creation (no root required) |
| <span id="p-udev-rule"></span>`P-UDEV-RULE` | 45 | evidence | Udev rule creation |
| <span id="p-at-job"></span>`P-AT-JOB` | 60 | evidence | at job scheduling (deferred execution) |
| <span id="p-prompt-command"></span>`P-PROMPT-COMMAND` | 65 | evidence | PROMPT_COMMAND injection (runs on every prompt) |
| <span id="p-bash-logout"></span>`P-BASH-LOGOUT` | 55 | evidence | .bash_logout modification (runs on session exit) |
| <span id="p-sudoers-mod"></span>`P-SUDOERS-MOD` | 75 | evidence | Sudoers file access/modification |
| <span id="p-polkit-rule"></span>`P-POLKIT-RULE` | 55 | evidence | Polkit rule creation |
| <span id="p-setcap"></span>`P-SETCAP` | 65 | evidence | Linux capability manipulation |
| <span id="p-history-clear"></span>`P-HISTORY-CLEAR` | 70 | evidence | Shell history clearing/suppression |
| <span id="p-log-clear"></span>`P-LOG-CLEAR` | 75 | evidence | System log clearing/truncation |
| <span id="p-pacman-hook"></span>`P-PACMAN-HOOK` | 50 | evidence | Pacman hook creation (unusual for AUR packages) |
| <span id="p-dd-write"></span>`P-DD-WRITE` | 70 | evidence | dd writing to device file |
| <span id="p-alias-override"></span>`P-ALIAS-OVERRIDE` | 65 | evidence | Alias override of common system commands |
| <span id="p-js-eval-decode"></span>`P-JS-EVAL-DECODE` | 55 | evidence | eval() of a base64/hex-decoded payload (dynamic code execution) |
| <span id="p-js-new-function-decode"></span>`P-JS-NEW-FUNCTION-DECODE` | 52 | evidence | new Function() built from a base64-decoded payload (dynamic code execution) |
| <span id="p-js-childproc-decode"></span>`P-JS-CHILDPROC-DECODE` | 50 | evidence | child_process exec/spawn of a base64-decoded command (download-and-execute) |
| <span id="p-js-env-exfil"></span>`P-JS-ENV-EXFIL` | 35 | context | serialises process.env (potential credential/secret exfiltration) |
| <span id="p-js-obfuscator-sig"></span>`P-JS-OBFUSCATOR-SIG` | 25 | context | javascript-obfuscator-style hex identifiers (obfuscated code) |
| <span id="p-js-dynamic-require-net"></span>`P-JS-DYNAMIC-REQUIRE-NET` | 48 | evidence | dynamic require() of a decoded module name (obfuscated dependency load) |
| <span id="p-py-exec-decode"></span>`P-PY-EXEC-DECODE` | 55 | evidence | exec/eval of a decoded/decompressed payload (dynamic code execution) |
| <span id="p-py-compile-exec"></span>`P-PY-COMPILE-EXEC` | 48 | evidence | exec(compile(...)) dynamic code execution |
| <span id="p-py-dynamic-import-decode"></span>`P-PY-DYNAMIC-IMPORT-DECODE` | 50 | evidence | __import__ of a decoded module name (obfuscated import) |
| <span id="p-py-env-exfil"></span>`P-PY-ENV-EXFIL` | 35 | context | reads environment/host info and contacts the network (recon/exfil) |
| <span id="p-ruby-eval-decode"></span>`P-RUBY-EVAL-DECODE` | 55 | evidence | Ruby eval of a base64/packed-decoded payload (dynamic code execution) |
| <span id="p-ruby-open-pipe"></span>`P-RUBY-OPEN-PIPE` | 30 | context | Ruby IO.popen/Open3 subprocess execution |
| <span id="p-ruby-kernel-exec-decode"></span>`P-RUBY-KERNEL-EXEC-DECODE` | 55 | evidence | Ruby system/exec/spawn of a base64/packed-decoded command (OS command injection) |
| <span id="p-rust-include-bytes-decode"></span>`P-RUST-INCLUDE-BYTES-DECODE` | 40 | evidence | embedded byte blob paired with a runtime decoder (obfuscated payload) |
| <span id="p-rust-env-exfil"></span>`P-RUST-ENV-EXFIL` | 35 | context | reads an environment variable then contacts the network (secret exfil) |
| <span id="go-exec-shell"></span>`GO-EXEC-SHELL` | 55 | evidence | exec.Command invoking a shell with -c (arbitrary command execution) |
| <span id="go-syscall-exec"></span>`GO-SYSCALL-EXEC` | 50 | evidence | syscall.Exec/ForkExec direct process replacement/spawn |
| <span id="go-b64-decode-exec"></span>`GO-B64-DECODE-EXEC` | 55 | evidence | base64-decoded payload passed to exec (staged execution) |
| <span id="go-cgo-download"></span>`GO-CGO-DOWNLOAD` | 50 | evidence | cgo directive fetching remote code at build time |
| <span id="go-generate-curl"></span>`GO-GENERATE-CURL` | 45 | evidence | //go:generate runs curl/wget (download-and-run at generate time) |
| <span id="p-nuget-ps-env-exfil"></span>`P-NUGET-PS-ENV-EXFIL` | 38 | context | PowerShell environment-variable exfiltration to network in NuGet package |
| <span id="php-eval-decode"></span>`PHP-EVAL-DECODE` | 55 | evidence | PHP eval() of a base64/gzip/rot13-decoded payload (obfuscated code execution) |
| <span id="php-assert-var"></span>`PHP-ASSERT-VAR` | 45 | evidence | PHP assert() on a variable used as a dynamic code-execution sink |
| <span id="php-create-function"></span>`PHP-CREATE-FUNCTION` | 45 | evidence | PHP create_function() dynamic code construction (eval backdoor vector) |
| <span id="php-shell-exec-var"></span>`PHP-SHELL-EXEC-VAR` | 45 | evidence | PHP OS command execution sink invoked on a variable |
| <span id="php-obfuscation-chain"></span>`PHP-OBFUSCATION-CHAIN` | 45 | evidence | PHP nested gzinflate/str_rot13 obfuscation wrapping a decoded payload |
| <span id="maven-java-runtime-exec"></span>`MAVEN-JAVA-RUNTIME-EXEC` | 35 | context | Java Runtime.getRuntime().exec() spawns an OS process |
| <span id="maven-java-defineclass-decode"></span>`MAVEN-JAVA-DEFINECLASS-DECODE` | 45 | evidence | Base64 decode chained into defineClass/Class.forName (runtime loading of decoded bytecode) |
| <span id="maven-java-urlclassloader-remote"></span>`MAVEN-JAVA-URLCLASSLOADER-REMOTE` | 45 | evidence | URLClassLoader constructed against a remote URL (loads + executes networked code) |
| <span id="hex-src-base64-eval"></span>`HEX-SRC-BASE64-EVAL` | 55 | evidence | base64-decoded blob fed to an executor/evaluator/deserializer (packed BEAM payload) |
| <span id="hex-src-env-exfil"></span>`HEX-SRC-ENV-EXFIL` | 35 | context | reads env/secrets then sends them over an HTTP client (exfil) |
| <span id="dart-process-shell"></span>`DART-PROCESS-SHELL` | 55 | evidence | Dart Process.run/start spawning a shell (command execution) |
| <span id="dart-httpclient-process-exec"></span>`DART-HTTPCLIENT-PROCESS-EXEC` | 50 | evidence | dart:io HttpClient download followed by Process exec (download-and-run) |
| <span id="dart-base64-process"></span>`DART-BASE64-PROCESS` | 50 | evidence | base64-decoded payload passed to Process exec |
| <span id="r-eval-parse-text"></span>`R-EVAL-PARSE-TEXT` | 30 | context | dynamic R code execution via eval(parse(text=)) |
| <span id="r-onload-system"></span>`R-ONLOAD-SYSTEM` | 50 | evidence | R load hook (.onLoad/.onAttach) runs system()/download.file at library load |
| <span id="jl-base64-include-string"></span>`JL-BASE64-INCLUDE-STRING` | 50 | evidence | base64-decoded payload fed to include_string/eval (obfuscated execution) |
| <span id="p-apk-source-raw-ip"></span>`P-APK-SOURCE-RAW-IP` | 45 | evidence | APKBUILD source= points at a raw IP address rather than a hostname |

## GTFOBins

117 rules, section `gtfobins_analysis`, capability `gtfobins`. Runs over: Both the primary manifest and the install scripts. A hit in an install script gets the `IS-` prefix (`IS-G-PIPE`).

| Rule | Points | Class | Description |
|---|---|---|---|
| <span id="g-revshell-node"></span>`G-REVSHELL-NODE` | 85 | evidence | Node.js reverse shell (net.Socket connect) |
| <span id="g-revshell-julia"></span>`G-REVSHELL-JULIA` | 85 | evidence | Julia reverse shell (TCPSocket) |
| <span id="g-revshell-tclsh"></span>`G-REVSHELL-TCLSH` | 85 | evidence | Tcl reverse shell (socket connect) |
| <span id="g-revshell-jjs"></span>`G-REVSHELL-JJS` | 85 | evidence | Java Nashorn/JShell reverse shell (Runtime.exec) |
| <span id="g-revshell-ksh"></span>`G-REVSHELL-KSH` | 85 | evidence | Ksh reverse shell via /dev/tcp or /dev/udp |
| <span id="g-revshell-gdb"></span>`G-REVSHELL-GDB` | 85 | evidence | GDB reverse shell via embedded Python |
| <span id="g-revshell-go"></span>`G-REVSHELL-GO` | 80 | evidence | Go reverse shell (net.Dial) |
| <span id="g-bindshell-socat"></span>`G-BINDSHELL-SOCAT` | 85 | evidence | Socat bind shell (LISTEN + EXEC) |
| <span id="g-bindshell-nc"></span>`G-BINDSHELL-NC` | 90 | evidence | Netcat bind shell (listen + exec) |
| <span id="g-pipe-node"></span>`G-PIPE-NODE` | 90 | evidence | Download piped to Node.js interpreter |
| <span id="g-pipe-ruby"></span>`G-PIPE-RUBY` | 90 | evidence | Download piped to Ruby interpreter |
| <span id="g-pipe-php"></span>`G-PIPE-PHP` | 90 | evidence | Download piped to PHP interpreter |
| <span id="g-pipe-lua"></span>`G-PIPE-LUA` | 90 | evidence | Download piped to Lua interpreter |
| <span id="g-pipe-tclsh"></span>`G-PIPE-TCLSH` | 90 | evidence | Download piped to Tcl interpreter |
| <span id="g-pipe-rscript"></span>`G-PIPE-RSCRIPT` | 90 | evidence | Download piped to R interpreter |
| <span id="g-pipe-julia"></span>`G-PIPE-JULIA` | 90 | evidence | Download piped to Julia interpreter |
| <span id="g-pipe-awk"></span>`G-PIPE-AWK` | 85 | evidence | Download piped to Awk interpreter |
| <span id="g-pipe-jjs"></span>`G-PIPE-JJS` | 90 | evidence | Download piped to Java Nashorn/JShell |
| <span id="g-pipe-ksh"></span>`G-PIPE-KSH` | 90 | evidence | Download piped to Ksh shell |
| <span id="g-pipe-csh"></span>`G-PIPE-CSH` | 90 | evidence | Download piped to C shell |
| <span id="g-pipe-zsh"></span>`G-PIPE-ZSH` | 90 | evidence | Download piped to Zsh shell |
| <span id="g-pipe-fish"></span>`G-PIPE-FISH` | 90 | evidence | Download piped to Fish shell |
| <span id="g-pipe-dash"></span>`G-PIPE-DASH` | 90 | evidence | Download piped to Dash shell |
| <span id="g-alt-pipe-shell"></span>`G-ALT-PIPE-SHELL` | 90 | evidence | Alternative downloader piped to shell |
| <span id="g-tar-checkpoint"></span>`G-TAR-CHECKPOINT` | 85 | evidence | tar --checkpoint-action=exec (arbitrary command execution) |
| <span id="g-zip-exec"></span>`G-ZIP-EXEC` | 75 | evidence | zip -TT command execution |
| <span id="g-gdb-exec"></span>`G-GDB-EXEC` | 55 | evidence | GDB batch mode execution (can run arbitrary commands) |
| <span id="g-vim-shell"></span>`G-VIM-SHELL` | 70 | evidence | Vim/Neovim shell escape via -c flag |
| <span id="g-expect-exec"></span>`G-EXPECT-EXEC` | 55 | evidence | Expect spawn/command execution |
| <span id="g-nsenter"></span>`G-NSENTER` | 55 | evidence | nsenter namespace entry (container escape / privilege escalation) |
| <span id="g-capsh"></span>`G-CAPSH` | 60 | evidence | capsh privilege escalation (capability shell) |
| <span id="g-unshare"></span>`G-UNSHARE` | 55 | evidence | unshare with shell execution (namespace escape) |
| <span id="g-nmap-script"></span>`G-NMAP-SCRIPT` | 55 | evidence | Nmap scripting engine (can execute arbitrary Lua code) |
| <span id="g-ssh-proxycommand"></span>`G-SSH-PROXYCOMMAND` | 50 | evidence | SSH ProxyCommand (arbitrary command execution on connect) |
| <span id="g-pkexec"></span>`G-PKEXEC` | 55 | evidence | pkexec privilege escalation via polkit |
| <span id="g-emacs-exec"></span>`G-EMACS-EXEC` | 55 | evidence | Emacs batch mode shell command execution |
| <span id="g-rlwrap-shell"></span>`G-RLWRAP-SHELL` | 60 | evidence | rlwrap wrapping shell/network tool (interactive reverse shell) |
| <span id="g-sqlite-exec"></span>`G-SQLITE-EXEC` | 55 | evidence | SQLite3 .shell/.system command execution |
| <span id="g-screen-exec"></span>`G-SCREEN-EXEC` | 55 | evidence | GNU Screen keystroke injection (-X stuff) |
| <span id="g-tmux-send"></span>`G-TMUX-SEND` | 50 | evidence | tmux send-keys command injection |
| <span id="g-busybox-shell"></span>`G-BUSYBOX-SHELL` | 65 | evidence | Busybox shell/network subcommand abuse |
| <span id="g-doas"></span>`G-DOAS` | 45 | evidence | doas privilege escalation (sudo alternative) |
| <span id="g-chroot-shell"></span>`G-CHROOT-SHELL` | 50 | evidence | chroot with shell execution |
| <span id="g-docker-run"></span>`G-DOCKER-RUN` | 50 | evidence in an install hook, context elsewhere | Docker/Podman run with volume mount (host filesystem access) |
| <span id="g-systemd-run"></span>`G-SYSTEMD-RUN` | 55 | evidence | systemd-run transient service execution |
| <span id="g-strace-exec"></span>`G-STRACE-EXEC` | 50 | evidence | strace with output to /dev/null (hidden command execution) |
| <span id="g-script-exec"></span>`G-SCRIPT-EXEC` | 45 | evidence | script -c command execution |
| <span id="g-flock-exec"></span>`G-FLOCK-EXEC` | 50 | evidence | flock lock file with suspicious command execution |
| <span id="g-download-aria2c"></span>`G-DOWNLOAD-ARIA2C` | 40 | evidence in an install hook, context elsewhere | aria2c download utility (alternative to curl/wget) |
| <span id="g-download-lwp"></span>`G-DOWNLOAD-LWP` | 45 | evidence in an install hook, context elsewhere | Perl LWP download utility |
| <span id="g-download-tftp"></span>`G-DOWNLOAD-TFTP` | 55 | evidence in an install hook, context elsewhere | TFTP file transfer (unauthenticated, commonly abused) |
| <span id="g-download-finger"></span>`G-DOWNLOAD-FINGER` | 55 | evidence | finger protocol data transfer (GTFOBins exfiltration technique) |
| <span id="g-download-whois"></span>`G-DOWNLOAD-WHOIS` | 55 | evidence | whois as data transfer channel (non-standard port) |
| <span id="g-download-ftp"></span>`G-DOWNLOAD-FTP` | 40 | evidence in an install hook, context elsewhere | Scripted FTP transfer (automated file download) |
| <span id="g-download-smbclient"></span>`G-DOWNLOAD-SMBCLIENT` | 50 | evidence in an install hook, context elsewhere | SMB client scripted file transfer |
| <span id="g-download-scp"></span>`G-DOWNLOAD-SCP` | 35 | context | SCP remote file copy |
| <span id="g-download-rsync"></span>`G-DOWNLOAD-RSYNC` | 35 | context | rsync from remote server |
| <span id="g-download-node"></span>`G-DOWNLOAD-NODE` | 50 | evidence in an install hook, context elsewhere | Node.js remote fetch-eval or npx/npm-exec of a remote URL/VCS spec |
| <span id="g-node-inline"></span>`G-NODE-INLINE` | 30 | install hook only | Node.js inline code execution (dual-use; corroboration only) |
| <span id="g-ruby-inline"></span>`G-RUBY-INLINE` | 30 | install hook only | Ruby inline code execution (dual-use; corroboration only) |
| <span id="g-php-inline"></span>`G-PHP-INLINE` | 30 | install hook only | PHP inline code execution (dual-use; corroboration only) |
| <span id="g-lua-inline"></span>`G-LUA-INLINE` | 30 | install hook only | Lua inline code execution (dual-use; corroboration only) |
| <span id="g-r-inline"></span>`G-R-INLINE` | 30 | install hook only | R inline code execution (dual-use; corroboration only) |
| <span id="g-julia-inline"></span>`G-JULIA-INLINE` | 30 | install hook only | Julia inline code execution (dual-use; corroboration only) |
| <span id="g-java-inline"></span>`G-JAVA-INLINE` | 30 | install hook only | Java Nashorn/JShell inline execution (dual-use; corroboration only) |
| <span id="g-tclsh-inline"></span>`G-TCLSH-INLINE` | 30 | install hook only | Tcl inline heredoc execution (dual-use; corroboration only) |
| <span id="g-gdb-python"></span>`G-GDB-PYTHON` | 55 | evidence | GDB embedded Python execution |
| <span id="g-gnuplot-exec"></span>`G-GNUPLOT-EXEC` | 55 | evidence | gnuplot system() command execution |
| <span id="g-octave-exec"></span>`G-OCTAVE-EXEC` | 55 | evidence | GNU Octave system() command execution |
| <span id="g-guile-exec"></span>`G-GUILE-EXEC` | 55 | evidence | Guile Scheme system() command execution |
| <span id="g-ironsql-exec"></span>`G-IRONSQL-EXEC` | 30 | install hook only | Ruby IRB interactive session with code execution (dual-use; corroboration only) |
| <span id="g-ld-library-path"></span>`G-LD-LIBRARY-PATH` | 50 | evidence | LD_LIBRARY_PATH manipulation (shared library injection) |
| <span id="g-ldconfig-custom"></span>`G-LDCONFIG-CUSTOM` | 50 | evidence | Custom ldconfig configuration (shared library path hijack) |
| <span id="g-tee-sensitive"></span>`G-TEE-SENSITIVE` | 75 | evidence | tee writing to sensitive system file |
| <span id="g-cp-sensitive"></span>`G-CP-SENSITIVE` | 65 | evidence | Copying sensitive authentication files |
| <span id="g-basenc-decode"></span>`G-BASENC-DECODE` | 55 | evidence | Non-standard base encoding decode (payload hiding) |
| <span id="g-hping-exfil"></span>`G-HPING-EXFIL` | 60 | evidence | hping3 packet crafting (data exfiltration / covert channel) |
| <span id="g-cancel-exfil"></span>`G-CANCEL-EXFIL` | 55 | evidence | CUPS cancel command data exfiltration |
| <span id="g-restic-exfil"></span>`G-RESTIC-EXFIL` | 45 | evidence in an install hook, context elsewhere | restic backup to remote (potential data exfiltration) |
| <span id="g-revshell-openssl"></span>`G-REVSHELL-OPENSSL` | 80 | evidence | OpenSSL s_server (encrypted bind shell / C2 listener) |
| <span id="g-bindshell-go"></span>`G-BINDSHELL-GO` | 75 | evidence | Go bind shell (net.Listen) |
| <span id="g-bindshell-lua"></span>`G-BINDSHELL-LUA` | 75 | evidence | Lua bind shell (socket.bind) |
| <span id="g-busybox-wget"></span>`G-BUSYBOX-WGET` | 50 | evidence in an install hook, context elsewhere | Busybox wget alternative downloader |
| <span id="g-busybox-ftpd"></span>`G-BUSYBOX-FTPD` | 70 | evidence | Busybox ftpd (bind FTP server for exfiltration) |
| <span id="g-find-exec"></span>`G-FIND-EXEC` | 60 | evidence | find -exec with shell (GTFOBins command execution) |
| <span id="g-xargs-shell"></span>`G-XARGS-SHELL` | 60 | evidence | xargs executing shell with -c (command injection vector) |
| <span id="g-sed-exec"></span>`G-SED-EXEC` | 65 | evidence | GNU sed e command (executes pattern space as shell command) |
| <span id="g-split-filter"></span>`G-SPLIT-FILTER` | 70 | evidence | split --filter (executes command per output chunk) |
| <span id="g-cpio-rsh"></span>`G-CPIO-RSH` | 70 | evidence | cpio --rsh-command (arbitrary command execution) |
| <span id="g-dc-shell"></span>`G-DC-SHELL` | 55 | evidence | dc calculator shell escape (! command) |
| <span id="g-m4-exec"></span>`G-M4-EXEC` | 60 | evidence | m4 macro processor shell execution (esyscmd/syscmd) |
| <span id="g-ip-netns-exec"></span>`G-IP-NETNS-EXEC` | 55 | evidence | ip netns exec (namespace command execution) |
| <span id="g-gcc-wrapper"></span>`G-GCC-WRAPPER` | 60 | evidence | GCC -wrapper (arbitrary command execution via compiler) |
| <span id="g-cmake-exec"></span>`G-CMAKE-EXEC` | 50 | evidence | CMake command execution (env wrapper or execute_process) |
| <span id="g-psql-shell"></span>`G-PSQL-SHELL` | 60 | evidence | PostgreSQL psql shell escape (\!) |
| <span id="g-dotnet-exec"></span>`G-DOTNET-EXEC` | 50 | evidence | .NET F# interactive or dotnet-script execution |
| <span id="g-tcpdump-exec"></span>`G-TCPDUMP-EXEC` | 65 | evidence | tcpdump -z post-rotation command execution |
| <span id="g-docker-exec"></span>`G-DOCKER-EXEC` | 45 | evidence in an install hook, context elsewhere | Docker/Podman exec into running container |
| <span id="g-docker-cp"></span>`G-DOCKER-CP` | 40 | evidence in an install hook, context elsewhere | Docker/Podman file copy (container boundary crossing) |
| <span id="g-nano-shell"></span>`G-NANO-SHELL` | 55 | evidence | nano -s spell checker shell command substitution |
| <span id="g-ed-shell"></span>`G-ED-SHELL` | 55 | evidence | ed editor shell escape (! command) |
| <span id="g-code-tunnel"></span>`G-CODE-TUNNEL` | 70 | evidence | VS Code tunnel (remote access establishment) |
| <span id="g-download-sftp"></span>`G-DOWNLOAD-SFTP` | 35 | context | SFTP remote file transfer |
| <span id="g-download-sshfs"></span>`G-DOWNLOAD-SSHFS` | 45 | evidence in an install hook, context elsewhere | SSHFS remote filesystem mount (remote file access) |
| <span id="g-ssh-keygen-lib"></span>`G-SSH-KEYGEN-LIB` | 65 | evidence | ssh-keygen -D shared library load (code injection) |
| <span id="g-mysql-lib"></span>`G-MYSQL-LIB` | 55 | evidence | MySQL --default-auth shared library load |
| <span id="g-nginx-lib"></span>`G-NGINX-LIB` | 55 | evidence | nginx load_module (shared library injection) |
| <span id="g-chattr"></span>`G-CHATTR` | 55 | evidence | chattr +i makes files immutable (anti-removal persistence) |
| <span id="g-chown-sensitive"></span>`G-CHOWN-SENSITIVE` | 65 | evidence | chown on sensitive authentication files |
| <span id="g-ln-sensitive"></span>`G-LN-SENSITIVE` | 60 | evidence | Symlink attack on sensitive files |
| <span id="g-mount-bind"></span>`G-MOUNT-BIND` | 55 | evidence | Bind mount (filesystem overlay for privilege escalation) |
| <span id="g-install-suid"></span>`G-INSTALL-SUID` | 70 | evidence | install with SUID/SGID mode bits |
| <span id="g-redis-write"></span>`G-REDIS-WRITE` | 65 | evidence | Redis config set (arbitrary file write via RDB dump) |
| <span id="g-git-extdiff"></span>`G-GIT-EXTDIFF` | 55 | evidence | Git external diff command execution |
| <span id="g-iptables-write"></span>`G-IPTABLES-WRITE` | 40 | evidence | iptables-save arbitrary file write |
| <span id="g-ab-exfil"></span>`G-AB-EXFIL` | 55 | evidence | Apache Bench POST data exfiltration |
| <span id="g-tailscale-exfil"></span>`G-TAILSCALE-EXFIL` | 55 | evidence | Tailscale file copy (VPN-based data exfiltration) |

## Source URLs

10 rules, section `source_url_analysis`, capability `source-url-patterns`. Runs over: The primary manifest.

| Rule | Points | Class | Description |
|---|---|---|---|
| <span id="p-raw-ip-url"></span>`P-RAW-IP-URL` | 50 | evidence; only in a PKGBUILD or install hook | Source URL uses raw IP address instead of domain |
| <span id="p-url-shortener"></span>`P-URL-SHORTENER` | 60 | evidence | Source URL uses URL shortener (hiding real destination) |
| <span id="p-discord-webhook"></span>`P-DISCORD-WEBHOOK` | 70 | evidence | Discord webhook URL (data exfiltration channel) |
| <span id="p-pastebin"></span>`P-PASTEBIN` | 50 | evidence | Source from paste service (untrusted, mutable content) |
| <span id="p-dynamic-dns"></span>`P-DYNAMIC-DNS` | 55 | evidence | Source uses dynamic DNS (common in C2 infrastructure) |
| <span id="p-telegram-bot"></span>`P-TELEGRAM-BOT` | 65 | evidence | Telegram bot API URL (data exfiltration channel) |
| <span id="p-tunnel-service"></span>`P-TUNNEL-SERVICE` | 55 | evidence | Tunnel service URL (obfuscated endpoint) |
| <span id="p-http-source"></span>`P-HTTP-SOURCE` | 15 | context; only in a PKGBUILD or install hook | Plain HTTP source URL (no TLS, MITM risk) |
| <span id="p-filehost-source"></span>`P-FILEHOST-SOURCE` | 45 | evidence | Source from ephemeral/anonymous file hosting (untrusted, mutable content) |
| <span id="p-mega-source"></span>`P-MEGA-SOURCE` | 40 | evidence | Source from MEGA file hosting (encrypted, unverifiable) |
