code wiki / _hdl_build / nx_web_harden.nx
nx_web_harden.nx
buildroot/runtime/_hdl_build/nx_web_harden.nx
about
nx_web_harden.nx -- "90s-NEUTRAL" attack-vector neutralizer. The balance current tools miss: ad blockers STRIP
ads (site loses revenue + hostile sites detect the block and wall you); sandboxes BLOCK the page (dead). We do
neither -- we RENDER the site and its ads intact (display impressions still fire, the operator still gets paid)
and remove ONLY the weaponization:
* forced downloads -- programmatic <a download>.click() and clicks/navigations to a binary payload
* popunders/popups -- window.open() -> inert decoy (site believes it opened one)
* navigate-to-binary -- location.assign/replace to .exe/.apk/... no-op
* beforeunload hijack -- the "are you sure you want to leave" nav-trap, silenced
* meta-refresh-to-payload + meta-CSP -- http-equiv neutralized so the parser ignores it
Injected as the FIRST <script> in <head> so it wins before the page's own scripts run, in the user's REAL
browser (Chrome/Firefox) -- so this is ordinary, fully-supported browser JS. license_tier: ORIGINAL
dependencies 1 imports · 2 importers
imports: nx_syscalls.nx
imported by: nx_archive_daemon.nxnx_web_harden_gate.nx
structs
| none |
consts
| none |
functions
| 14 | func wh_slen(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} return n } |
| 15 | func wh_put(dst: *u8, off: i64, s: *u8) -> i64 { var i: i64=0; while s[i]!=(0 as u8){dst[off]=s[i];off=off+1;i=i+1} return off } |
| 16 | func wh_lc(c: i64) -> i64 { if c>=65 { if c<=90 { return c+32 } } return c } called by 1: wh_ci_at |
| 18 | func wh_ci_at(src: *u8, slen: i64, pos: i64, lit: *u8, litlen: i64) -> i64 |
| 25 | func wh_ci_find(src: *u8, slen: i64, lit: *u8, litlen: i64, from: i64) -> i64 |
| 32 | func wh_build_preamble(out: *u8, cap: i64) -> i64 |
| 59 | func wh_copy_scrub(out: *u8, off: i64, cap: i64, src: *u8, s: i64, e: i64) -> i64 |
| 75 | func wh_neutralize(out: *u8, cap: i64, body: *u8, blen: i64, pre: *u8, prelen: i64) -> i64 |