Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
3 changes: 1 addition & 2 deletions public/.well-known/security.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
Contact: mailto:security@darknode.ai
Contact: https://darknode.ai/contact
Expires: 2027-10-31T23:59:59.000Z
Preferred-Languages: en
Canonical: https://darknode.ai/.well-known/security.txt
Policy: https://darknode.ai/contact
Policy: https://darknode.ai/acceptable-use#report-security
2 changes: 2 additions & 0 deletions public/css/console.css
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,8 @@ body.app .svc-menu .svc-card .side-item.active{color:var(--txt)!important;font-w
.mt-in{width:100%;background:var(--bg,var(--card2));border:1px solid var(--line);border-radius:9px;color:var(--txt);font:inherit;font-size:.9rem;padding:9px 11px;outline:none;box-sizing:border-box}
.mt-field-row .mt-in{flex:1;min-width:120px;width:auto}
.mt-field-row .mt-sel,.mt-field-row input[type=number].mt-in{flex:0 1 auto;max-width:100%}
.mt-hint{flex-basis:100%;font-size:.75rem;line-height:1.45;color:var(--mut);white-space:normal;overflow-wrap:anywhere}
@media(max-width:560px){.mt-field-row .mt-lbl{flex-basis:100%}}
.mt-in:focus{border-color:var(--acc);box-shadow:0 0 0 1px color-mix(in srgb,var(--acc) 45%,transparent)}
.mt-ta{min-height:120px;resize:vertical;font-family:var(--font-mono,ui-monospace,monospace);font-size:.85rem;line-height:1.5}
.mt-sel{cursor:pointer}
Expand Down
4 changes: 4 additions & 0 deletions public/css/landing-polish.css
Original file line number Diff line number Diff line change
Expand Up @@ -95,3 +95,7 @@ html body.landing #nav-start { display: inline-flex !important; align-items: cen
html body.landing #nav-signin,
html body.landing #nav-start { height: 36px !important; }
}
/* "Page not found" for a path that is neither a public page nor an app page */
html body.landing .dn-notfound .wrap { max-width: 640px; margin: 0 auto; padding: 14vh 24px 16vh; box-sizing: border-box; }
html body.landing .dn-notfound h1 { font-size: 2rem; margin: 0 0 12px; color: rgb(15, 23, 42); }
html body.landing .dn-notfound p { margin: 0 0 24px; color: rgb(63, 63, 70); line-height: 1.6; overflow-wrap: anywhere; }
2 changes: 1 addition & 1 deletion public/css/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ body.landing #view{max-width:none;padding:0;margin:0}
.os-ed-sz{margin-left:auto;font-size:.66rem;font-weight:700;letter-spacing:.06em;color:var(--mut);font-variant-numeric:tabular-nums}
.os-ed-tag{font-size:.56rem;font-weight:800;letter-spacing:.1em;text-transform:uppercase;color:var(--bg);background:var(--acc);border-radius:999px;padding:2px 7px}
.os-ed-d{font-size:.76rem;line-height:1.5;margin:0;flex:1}
.os-ed .dlapp-cmd code{font-size:.68rem;padding:7px 8px;white-space:pre;overflow-x:auto;word-break:normal}
.os-ed .dlapp-cmd code{font-size:.68rem;padding:7px 8px;white-space:pre-wrap;overflow-wrap:anywhere;word-break:normal;cursor:copy}
.dlapp-card{display:block;text-align:center;background:var(--card);border:1px solid var(--line);border-radius:12px;padding:22px 16px;text-decoration:none;color:var(--txt)}
.dlapp-card:hover{border-color:var(--acc);transform:translateY(-2px)}
.dlapp-os{font-weight:800;font-size:1.05rem}
Expand Down
12 changes: 11 additions & 1 deletion public/js/address-intel.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
// Parallel lookups against GreyNoise, AbuseIPDB, Shodan, VirusTotal, crt.sh, DNS, plus
// saved IPsum / ThreatFox / URLhaus snapshot files (not live queries), community reports,
// a hosting-ASN tag, "My IP" and a bulk IP check.
import { dnFetchJSON } from "/js/net.js";

var esc = function(s) {
return String(s == null ? "" : s).replace(/[&<>"']/g, function(c) {
Expand Down Expand Up @@ -263,7 +264,8 @@ function fetchDNSRecords(domain, type) {
}

function fetchCertTransparency(domain) {
return fetchJSON("https://crt.sh/?q=" + encodeURIComponent(domain) + "&output=json");
// crt.sh sends no CORS headers, so it is fetched through the Darknode edge proxy
return dnFetchJSON("https://crt.sh/?q=" + encodeURIComponent(domain) + "&output=json", { timeout: 25000, max: 2000000 });
}

// Hosting / datacenter networks by ASN. Being on this list is CONTEXT, not a verdict:
Expand Down Expand Up @@ -541,6 +543,8 @@ function renderNetworkPanel(data, shodan, reverseDNS) {
return html;
}

var IP_ONLY_NA = "IP-only source, not applicable to domains. Investigate the domain's IP address to check it here.";

function renderReputationPanel(results) {
var html = '<div class="ai-panel-body">';

Expand All @@ -560,6 +564,8 @@ function renderReputationPanel(results) {
'</div>';
} else if (results.greynoise_err) {
html += panelUnavailable(results.greynoise_err);
} else if (results.ip_only_na) {
html += panelUnavailable(IP_ONLY_NA);
} else {
html += panelLoading();
}
Expand All @@ -583,6 +589,8 @@ function renderReputationPanel(results) {
html += panelUnavailable(results.abuseipdb_err);
} else if (results.abuseipdb_nokey) {
html += panelNeedsKey("AbuseIPDB");
} else if (results.ip_only_na) {
html += panelUnavailable(IP_ONLY_NA);
} else {
html += panelLoading();
}
Expand Down Expand Up @@ -902,6 +910,8 @@ function runInvestigation(input, type, container) {
}

var keys = getApiKeys();
// GreyNoise and AbuseIPDB look up IP addresses only, so a domain or URL never queries them.
if (!ip) results.ip_only_na = true;

// Build panels structure
var panelOrder = [];
Expand Down
2 changes: 1 addition & 1 deletion public/js/api-fuzzer.js
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ export function renderAPIFuzzer(container) {
tab: 'builder',
method: 'GET',
url: '',
headers: [{ key: 'Content-Type', val: 'application/json' }, { key: 'Authorization', val: '' }],
headers: [{ key: 'Content-Type', val: 'application/json' }],
bodyType: 'json',
body: '',
fuzzTarget: 'param',
Expand Down
25 changes: 23 additions & 2 deletions public/js/auth.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ import "/js/net.js?v=20261011a";
import "/js/scroll-top.js?v=20260926a";
import "/js/shortcuts.js";
import "/js/mobile-nav.js";
import { consoleHTML, directoryHTML, wireConsole, labelOf as navLabel, groupOf as navGroup, recentSecs as navRecent, favSecs as navFavs, RETIRED } from "/js/console-nav.js?v=20261029d";
import { consoleHTML, directoryHTML, wireConsole, labelOf as navLabel, groupOf as navGroup, recentSecs as navRecent, favSecs as navFavs, RETIRED, NAV as CONSOLE_NAV } from "/js/console-nav.js?v=20261029d";
import { isAppPath } from "/js/deck/routes.js?v=1";
// Only the tool count is needed here; the manifest carries ids/names/categories without the
// tool code (js/tools/*), which loads when the Toolbox opens.
import { TOOL_META as _MINI_TOOLS } from "/js/tools-manifest.js?v=20261006a";
Expand Down Expand Up @@ -727,8 +728,17 @@ function showLanding() {
loadLanding().then(m => m.renderLanding(view, {
onGetStarted: () => renderAuth("signup"),
onSignIn: () => renderAuth("signin"),
isAppPath: (p) => isAppPath(p, appSecs()),
}));
}
// Every section/tool id the signed-in app routes, from the routers' own registries: the console
// catalog (with mini-tools and retired ids, whose old links still route) and the tool blurbs,
// which list the Deck's own tools. The landing shows "Page not found" for anything else.
let _appSecs = null;
function appSecs() {
if (!_appSecs) _appSecs = new Set([...CONSOLE_NAV.flatMap((g) => g.items.map((i) => i.sec)), ...RETIRED, ...Object.keys(SIDE_DESC)]);
return _appSecs;
}

// ---------- Google Identity Services: in-page FedCM / One Tap bubble ----------
// Shows the native "Sign in to darknode.ai with google.com" chooser inside the page
Expand Down Expand Up @@ -1813,7 +1823,18 @@ function renderApp(user) {
+ 'html[data-embed] body.app.dn-embed :is(.btn:not(.ghost,.danger,.github),button[style*="background:#00aaff"],button[style*="background:#00d4ff"]):not(#dn-x):not(#dn-y):not(#dn-z){color:#fff!important}'
// (three id-not()s outrank aws.css, which pins its skin with two)
// let the Deck's own page tone show through behind every tool (ink or cyber)
+ 'html[data-embed] body.app.dn-embed:not(#dn-x):not(#dn-y):not(#dn-z),html[data-embed] body.app.dn-embed :is(#app,#view,.app-shell,.app-main):not(#dn-x):not(#dn-y):not(#dn-z){background:transparent!important}';
+ 'html[data-embed] body.app.dn-embed:not(#dn-x):not(#dn-y):not(#dn-z),html[data-embed] body.app.dn-embed :is(#app,#view,.app-shell,.app-main):not(#dn-x):not(#dn-y):not(#dn-z){background:transparent!important}'
// the Deck inverts this frame, so the pro theme's hard-coded dark code panels would land
// light (and each inner code chip black): give them light values that invert to dark ink
+ 'body.dn-embed :is(.dl-cmd,.api-code-block,pre.code-block):not(#dn-x){background:#ecebe7!important;color:#1f1e1c!important;border:1px solid #d6d4cf!important}'
+ 'body.dn-embed :is(.dl-cmd,.api-code-block,pre.code-block) :is(code,.mono,pre):not(#dn-x){background:transparent!important;color:inherit!important;padding:0;border-radius:0}'
+ 'body.dn-embed .api-code-block pre:not(#dn-x){padding:14px 16px}'
+ 'body.dn-embed .api-code-header:not(#dn-x){background:#e2e0db!important;color:#5d5a55!important;border-bottom:1px solid #d6d4cf!important}'
+ 'body.dn-embed :is(.api-code-copy,.code-block .cb-copy):not(#dn-x){background:#fff!important;color:#3f3d3a!important;border:1px solid #d6d4cf!important}'
+ 'body.dn-embed pre.code-block.cta-cmd:not(#dn-x){padding-right:72px!important}'
+ 'body.dn-embed .dl-cmd .stat-l:not(#dn-x){color:#6a6762!important}'
// a dark scrim inverts to light grey; a light one inverts to the Deck's dark scrim
+ 'body.dn-embed .dn-modal-ov:not(#dn-x){background:rgba(245,244,241,.6)!important}';
document.head.appendChild(st);
const fl = document.createElement("link"); fl.rel = "stylesheet"; fl.href = "https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Source+Serif+4:opsz,wght@8..60,400;8..60,500&display=swap"; document.head.appendChild(fl);
}
Expand Down
8 changes: 4 additions & 4 deletions public/js/cookie-inspector.js
Original file line number Diff line number Diff line change
Expand Up @@ -474,8 +474,8 @@ function exampleText() {

// ── render ──
export function renderCookieInspector(main) {
function toast(msg) {
if (typeof window.showToast === "function") window.showToast(msg);
function toast(msg, type) {
if (typeof window.showToast === "function") window.showToast(msg, type);
}

main.innerHTML = CK_CSS +
Expand Down Expand Up @@ -637,9 +637,9 @@ export function renderCookieInspector(main) {
if (navigator.clipboard && navigator.clipboard.writeText) {
navigator.clipboard.writeText(lastReport).then(
function () { toast("Report copied to clipboard"); },
function () { toast("Copy failed — select the text manually"); });
function () { toast("Copy failed — select the text manually", "error"); });
} else {
toast("Clipboard unavailable — select the text manually");
toast("Clipboard unavailable — select the text manually", "error");
}
};
}
2 changes: 1 addition & 1 deletion public/js/cors-tester.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export function renderCorsTester(container) {

h += '<div class="card">';
h += '<div style="display:flex;gap:8px;margin-bottom:10px;">';
h += '<input id="cors-url" style="flex:1;" placeholder="https://api.example.com/endpoint" data-on-keydown="if(event.key===\'Enter\')_corsTest()">';
h += '<input id="cors-url" style="flex:1;" placeholder="https://api.example.com" data-on-keydown="if(event.key===\'Enter\')_corsTest()">';
h += '<button class="btn" data-on-click="_corsTest()">Test</button>';
h += '</div>';

Expand Down
4 changes: 2 additions & 2 deletions public/js/darknet-radar.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ function _drRenderVictims(list) {
if (v.group) h += '<span style="color:var(--warn);font-size:12px;border:1px solid var(--warn);padding:1px 6px;border-radius:2px;">' + esc(v.group) + '</span>';
h += '</div>';
h += '<div style="display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:4px 16px;font-size:12px;color:var(--txt-2);line-height:1.6;">';
if (v.activity) h += '<div><span style="color:var(--mut);">Sector:</span> ' + esc(v.activity) + '</div>';
if (v.activity && !/^(not found|n\/a|unknown)$/i.test(String(v.activity).trim())) h += '<div><span style="color:var(--mut);">Sector:</span> ' + esc(v.activity) + '</div>';
if (v.country) h += '<div><span style="color:var(--mut);">Country:</span> ' + esc(v.country) + '</div>';
if (v.attackdate) h += '<div><span style="color:var(--mut);">Attack:</span> ' + esc(_drFmtDate(v.attackdate)) + '</div>';
if (v.discovered) h += '<div><span style="color:var(--mut);">Discovered:</span> ' + esc(_drFmtDate(v.discovered)) + '</div>';
Expand Down Expand Up @@ -141,7 +141,7 @@ async function _drLoadTab(key) {
panel.innerHTML = _drLoading();
try {
if (key === 'victims') st.data = await dnFetchJSON(RANSOM_VICTIMS_URL, { timeout: 25000 });
else if (key === 'groups') st.data = await dnFetchJSON(RANSOM_GROUPS_URL, { timeout: 25000 });
else if (key === 'groups') st.data = await dnFetchJSON(RANSOM_GROUPS_URL, { timeout: 25000, max: 2000000 }); // the full groups feed is ~850 KB
else if (key === 'kev') { var d = await loadKevCatalog(); st.data = d.vulnerabilities; }
st.error = '';
} catch (err) {
Expand Down
14 changes: 14 additions & 0 deletions public/js/dataprotect/phish-engine.js
Original file line number Diff line number Diff line change
Expand Up @@ -223,10 +223,22 @@ export function analyzeUrl(raw) {

// a brand's own address in the path or query (evil.example/https://paypal.com/) makes the link read as the brand's
if (!look.exact) { const inPath = BRANDS.find((b) => b.length >= 4 && new RegExp("(^|[^a-z0-9-])" + b + "\\.(com|net|org)\\b").test(decodeSafe(out.path).toLowerCase())); if (inPath) out.reasons.push({ w: 1, t: `The path mentions "${inPath}" but the link goes to "${reg}".` }); }
// open redirect: a redirect-style parameter that sends the visitor on to another site, so the
// link shows a trusted domain but lands somewhere else (?next=//evil.example, ?url=https://...)
for (const [k, v] of u.searchParams) {
if (!REDIRECT_PARAM.test(k)) continue;
const val = String(v).trim();
if (!/^([a-z][a-z0-9+.-]*:)?[/\\]{2}/i.test(val)) continue;
let dest = ""; try { dest = new URL(val.replace(/\\/g, "/"), u).hostname.toLowerCase(); } catch (_) { continue; }
// landing on a brand's own site is not where the danger is (a phishing page often sends the victim back there)
if (dest && registrableDomain(dest) !== reg && !lookalike(dest).exact) { out.reasons.push({ w: 2, t: `The "${k}" parameter forwards the visitor to ${dest}, a different site: an open-redirect pattern that borrows the first domain's trust.` }); break; }
}

out.severity = sevFromWeight(sumWeight(out.reasons));
out.lookalike = look;
return out;
}
const REDIRECT_PARAM = /^(next|url|uri|redirect|redirect_?ur[il]|redir|return|return_?to|return_?url|returnurl|continue|dest|destination|goto|go|target|to|r|u|out|forward|rurl|link|callback_?url|success_?url)$/i;

function decodeSafe(s) { try { return decodeURIComponent(s || ""); } catch (_) { return String(s || ""); } }
function sumWeight(reasons) { return reasons.reduce((a, r) => a + r.w, 0); }
Expand Down Expand Up @@ -517,6 +529,8 @@ export function selfTest() {
T("impersonation flagged", a.lookalike.impersonation && a.severity !== "info");
const b = analyzeUrl("https://paypa1.com");
T("typosquat flagged", b.lookalike.near && b.lookalike.brand === "paypal");
T("open redirect flagged", analyzeUrl("https://example.com/login?next=//evil.example").reasons.some((r) => /open-redirect/.test(r.t)));
T("same-site redirect not flagged", !analyzeUrl("https://example.com/login?next=https://www.example.com/a").reasons.some((r) => /open-redirect/.test(r.t)));
const c = analyzeUrl("https://github.com/x/y");
T("benign url low", c.severity === "info" || c.severity === "low");
const d = analyzeUrl("http://user:pass@198.51.100.9/login");
Expand Down
Loading
Loading