@profullstack/threatcrush 0.13.80 → 0.13.82

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -102,6 +102,7 @@ threatcrush tui # Interactive dashboard (htop for security)
102
102
  threatcrush action-center # Fleet-wide detections, host health and queued actions (login required)
103
103
  threatcrush scan ./src # Scan code for vulnerabilities & secrets
104
104
  threatcrush scan . --format sarif --output out.sarif --fail-on critical,high
105
+ sudo threatcrush scan --host # Rootkit / host integrity scan of this machine (alias: host-scan)
105
106
  threatcrush pentest URL # Quick web security checks against a URL
106
107
  threatcrush init # Auto-detect services, generate config
107
108
  threatcrush status # Show daemon status & loaded modules
@@ -110,6 +111,46 @@ threatcrush store # Browse the module marketplace
110
111
  threatcrush update # Upgrade the CLI using the supported path
111
112
  ```
112
113
 
114
+ ### Host integrity / rootkit scan
115
+
116
+ `threatcrush scan --host` (alias `--localhost`, or `threatcrush host-scan`) checks
117
+ the machine it runs on instead of a code tree. It only reads: it never installs,
118
+ deletes or fixes anything.
119
+
120
+ ```bash
121
+ sudo threatcrush scan --host # every check, text report
122
+ sudo threatcrush host-scan --json > host-scan.json # machine-readable
123
+ sudo threatcrush host-scan --since 3d --deny-keys ./stolen-keys.txt
124
+ sudo threatcrush host-scan --checks ssh-keys,persistence,uid0-accounts
125
+ sudo threatcrush host-scan --skip-checks rkhunter,chkrootkit,suid-sgid # the slow ones
126
+ ```
127
+
128
+ | Check | Fails when | Warns when |
129
+ |---|---|---|
130
+ | `package-integrity` | `dpkg --verify` / `rpm -Va` says a binary in `/bin` `/sbin` `/usr/bin` `/usr/sbin`, a PAM module (`lib*/security`) or a shared object differs from its package | other `/usr/lib` files differ, packaged binaries are missing (config files are ignored) |
131
+ | `rkhunter` | a warning names a rootkit, trojan or backdoor | any other rkhunter warning; rkhunter is not installed (install command printed) |
132
+ | `chkrootkit` | a command is `INFECTED` and its binary does **not** match its package | `INFECTED` but the binary verifies against its package (e.g. rust-coreutils false positives); unpackaged suspicious files; not installed |
133
+ | `hidden-processes` | `unhide quick` finds a hidden PID, or (without unhide) a PID answers `stat()` but is missing from `/proc` or from `ps` | |
134
+ | `kernel-modules` | a module has an initstate in `/sys/module` but is missing from `/proc/modules`, or a loaded module is not from `/lib/modules/$(uname -r)` | |
135
+ | `ld-preload` | `/etc/ld.so.preload` exists | |
136
+ | `suspicious-exe` | | a process runs a `(deleted)` executable or one under `/tmp`, `/dev/shm`, `/var/tmp` (deleted after a package upgrade is common, so this is a warning) |
137
+ | `ssh-keys` | a key in any `authorized_keys` (root, every account home, `/home/*`, honouring `AuthorizedKeysFile`) matches `--deny-keys` | a key has no `command=` and no `from=`; the same key appears more than once |
138
+ | `sshd-config` | | `sshd -T` shows `PermitRootLogin` other than `no`, or `PasswordAuthentication yes` |
139
+ | `docker-containers` | | a running container is `--privileged`, `--pid=host`, or bind-mounts `/` or the Docker socket |
140
+ | `docker-group` | | anyone is in the `docker` group (docker group == root) |
141
+ | `persistence` | | a file under `/etc/cron*`, `/var/spool/cron`, `/etc/systemd/system`, `~/.config/systemd`, `/etc/pam.d`, `/etc/ssh/sshd_config.d`, `/etc/sudoers.d`, `/etc/profile.d`, `authorized_keys` and similar changed inside `--since` (default `7d`) |
142
+ | `uid0-accounts` | an account other than `root` has uid 0 | |
143
+ | `suid-sgid` | | a setuid/setgid file on the root filesystem is not owned by any package (container storage and snaps are skipped) |
144
+
145
+ The exit code is 1 when any check fails, 2 on bad arguments, 0 otherwise.
146
+ `--json` prints `{ host, kernel, root, summary: {pass, warn, fail, skip}, skipped, checks: [{ id, status, reason, items, partial, install }] }`.
147
+ `--deny-keys` takes one entry per line: a full public key line, a bare base64
148
+ key blob, or a `SHA256:` fingerprint.
149
+
150
+ Run it as root. Without root, `rkhunter`, `chkrootkit` and `sshd-config` are
151
+ skipped and listed as such, and checks that could only read part of the system
152
+ (other users' keys, other users' processes) are marked `[partial]`.
153
+
113
154
  ### CIS evidence report export
114
155
 
115
156
  Export the current `harden` findings as Markdown, JSON, or PDF:
@@ -161,6 +202,7 @@ threatcrush store publish https://github.com/you/my-module # Publish your own
161
202
  | `network-monitor` | Inbound connections to your listening ports — port scans, SYN floods |
162
203
  | `dns-monitor` | Resolver logs (systemd-resolved, dnsmasq, bind, Pi-hole) — DNS tunneling, DGA detection |
163
204
  | `threatcrush scan` | Vulnerabilities, secrets, dependency CVEs (OSV.dev, with `--deps`) |
205
+ | `threatcrush scan --host` | Rootkit / host integrity scan: package file integrity, rkhunter, chkrootkit, hidden processes and kernel modules, `ld.so.preload`, SSH keys, Docker, recent persistence, SUID outside packages |
164
206
  | `threatcrush pentest` | Header, CORS, cookie, SQL-error, path-traversal and HTTP-method checks |
165
207
  | auto-defend | Bans via fail2ban, nftables or iptables |
166
208
  | alerts | Slack, Discord, email, webhook, PagerDuty |
package/dist/daemon.js CHANGED
@@ -20748,6 +20748,8 @@ var TorExitBlockEnforcer = class {
20748
20748
  opts;
20749
20749
  timer = null;
20750
20750
  applied = false;
20751
+ /** Set once if nft is not installed here; stops retrying and logging. */
20752
+ unavailable = false;
20751
20753
  runNft;
20752
20754
  log;
20753
20755
  intervalMs;
@@ -20763,6 +20765,7 @@ var TorExitBlockEnforcer = class {
20763
20765
  }
20764
20766
  /** Apply (or tear down) the block to match the current setting and list. */
20765
20767
  async sync() {
20768
+ if (this.unavailable) return;
20766
20769
  if (!this.opts.enabled()) {
20767
20770
  await this.teardown();
20768
20771
  return;
@@ -20776,6 +20779,11 @@ var TorExitBlockEnforcer = class {
20776
20779
  }
20777
20780
  this.applied = true;
20778
20781
  } catch (err) {
20782
+ if (err.code === "ENOENT") {
20783
+ this.unavailable = true;
20784
+ this.log("[tor] nft is not installed; the proactive Tor exit block is unavailable on this host");
20785
+ return;
20786
+ }
20779
20787
  this.log(`[tor] could not apply the proactive Tor exit block: ${err.message}`);
20780
20788
  }
20781
20789
  }
@@ -23130,7 +23138,7 @@ async function runDaemon() {
23130
23138
  sshIntrusion.start();
23131
23139
  const torBlock = new TorExitBlockEnforcer({
23132
23140
  exits: torExits,
23133
- enabled: () => remediation.blockTorSsh && firewallAdapter.name === "nftables",
23141
+ enabled: () => remediation.blockTorSsh,
23134
23142
  log: logLine
23135
23143
  });
23136
23144
  torBlock.start();