---
import Base from '../layouts/Base.astro';
import HeroLoop from '../components/HeroLoop.astro';
import Marquee from '../components/Marquee.astro';
import Operator from '../components/Operator.astro';
import SectionHeader from '../components/SectionHeader.astro';
import RecordRow from '../components/RecordRow.astro';
import Callout from '../components/Callout.astro';
import { CATEGORIES, categoryOf } from '../lib/taxonomy';
import { allSheets, categoryCounts, sheetHref, isReportGuide } from '../lib/sheets';
import { payloadsByTopic } from '../lib/payloads';
import { internalBySection, internalRootPages } from '../lib/internal';
import { hackTricksBySection } from '../lib/hacktricks';
import { url } from '../lib/url';
const sheets = await allSheets();
const counts = await categoryCounts();
const total = sheets.length;
const domains = CATEGORIES.filter((c) => (counts[c.slug] ?? 0) > 0).length;
const payloadTopics = await payloadsByTopic();
const payloadPages = payloadTopics.reduce((n, g) => n + g.count, 0);
const internalSections = await internalBySection();
const internalRoot = await internalRootPages();
const internalPages = internalSections.reduce((n, g) => n + g.count, 0) + internalRoot.length;
const hackTricksSections = await hackTricksBySection();
const hackTricksPages = hackTricksSections.reduce((n, g) => n + g.count, 0);
// Latest sheet date, for the operator readout.
const latest = sheets
.map((s) => s.data.updated)
.filter((d): d is string => !!d)
.sort()
.at(-1);
const updatedLabel = latest ? `${latest.slice(0, 7).replace('-', '.')} · latest` : '2026 · current';
// ── Hero: six flagship shelves, one accent each (a designed showcase; the
// full taxonomy is in the shelves grid below). Real routes + counts. ──
const HERO = [
{ slug: 'active-directory', accent: 'pine' },
{ slug: 'enumeration', accent: 'love' },
{ slug: 'exploitation', accent: 'gold' },
{ slug: 'privilege-escalation', accent: 'foam' },
{ slug: 'web', accent: 'iris' },
{ slug: 'dfir', accent: 'rose' },
];
const heroShelves = HERO.map((h, i) => {
const c = categoryOf(h.slug);
return { n: String(i + 1).padStart(2, '0'), label: c.tag, path: url(h.slug), accent: h.accent, desc: c.blurb };
});
// ── Manifest band lanes ──
const laneTitles = [
{ n: '01', title: 'DΛΣMӨП', accent: 'iris' },
{ n: '02', title: 'Cheatsheets', accent: 'foam' },
{ n: '03', title: 'Offline search', accent: 'gold' },
{ n: '04', title: 'Copy-ready', accent: 'pine' },
{ n: '05', title: `${CATEGORIES.length} shelves`, accent: 'love' },
{ n: '06', title: 'Zero fluff', accent: 'rose' },
];
const laneMeta = [
{ tag: 'Sys', text: 'Open notebook', accent: 'iris' },
{ tag: 'Search', text: 'Pagefind · offline', accent: 'love' },
{ tag: 'Sheets', text: `${total} · curated`, accent: 'foam' },
{ tag: 'Theme', text: 'Three palettes · two modes', accent: 'gold' },
{ tag: 'Field', text: 'AD · web · privesc', accent: 'pine' },
{ tag: 'Mirror', text: 'Three upstream trees', accent: 'love' },
{ tag: 'Doctrine', text: 'Terse, not thin', accent: 'rose' },
];
// ── Index rows: recent sheets, bucketed for the client-side filter ──
const byDate = [...sheets].sort((a, b) => (b.data.updated ?? '').localeCompare(a.data.updated ?? ''));
// Recent, but spread across shelves: cap 3 per category so one busy shelf
// (the CPTS workflow, freshest by date) does not fill the whole index and the
// Sheets / Workflow filters both have rows.
const perCat: Record<string, number> = {};
const recentRaw: typeof byDate = [];
for (const entry of byDate) {
const c = entry.data.category;
perCat[c] = (perCat[c] ?? 0) + 1;
if (perCat[c] > 3) continue;
recentRaw.push(entry);
if (recentRaw.length >= 24) break;
}
const recent = recentRaw
.map((entry, i) => {
const cat = categoryOf(entry.data.category);
const bucket = entry.data.category === 'pentest-workflow' ? 'workflow' : 'sheets';
const metaVal = entry.data.updated ? entry.data.updated.replace(/-/g, '.') : entry.data.difficulty.toUpperCase();
const tags = entry.data.tags.slice(0, 2).join(' · ');
return {
href: url(sheetHref(entry)),
n: String(i + 1).padStart(2, '0'),
title: entry.data.title,
reportGuide: isReportGuide(entry),
kind: cat.tag,
accent: cat.accent,
meta: metaVal,
excerpt: entry.data.description || `${cat.title} — terse, tested, kept current.`,
tagline: [cat.title, tags].filter(Boolean).join(' · '),
bucket,
};
});
// ── Shelves grid: the full taxonomy ──
const shelfCards = CATEGORIES.map((cat, i) => ({
n: String(i + 1).padStart(2, '0'),
slug: cat.slug,
label: cat.title,
accent: cat.accent,
count: counts[cat.slug] ?? 0,
}));
// ── Mirrors manifest: the two swisskyrepo trees + their largest sub-trees ──
const topPayloads = [...payloadTopics].sort((a, b) => b.count - a.count).slice(0, 2);
const topInternal = [...internalSections].sort((a, b) => b.count - a.count).slice(0, 2);
const mirrorRows = [
{ n: '01', path: 'payloads/', count: payloadPages },
{ n: '02', path: 'internal/', count: internalPages },
{ n: '03', path: 'hacktricks/', count: hackTricksPages },
{ n: '04', path: `payloads/${topPayloads[0]?.slug ?? ''}/`, count: topPayloads[0]?.count ?? 0 },
{ n: '05', path: `internal/${topInternal[0]?.slug ?? ''}/`, count: topInternal[0]?.count ?? 0 },
{ n: '06', path: `hacktricks/section/${hackTricksSections[0]?.slug ?? ''}/`, count: hackTricksSections[0]?.count ?? 0 },
];
---
<Base>
<!-- 1 · Hero loop -->
<HeroLoop shelves={heroShelves} name="DΛΣMӨП-RΣF" tagline="DÆMON//SEC · Cheatsheet vault" />
<!-- 2 · Manifest band -->
<Marquee titles={laneTitles} meta={laneMeta} manifest={String(CATEGORIES.length).padStart(2, '0')} />
<!-- 3 · Operator band -->
<Operator sheets={total} domains={domains} mirrors={3} updated={updatedLabel} />
<section class="archive" aria-label="Start learning pentesting">
<Callout label="Start here">
<a href={url('sheets/pentest-workflow/pentesting-basics-and-attacks')}>Pentesting: How Attacks Work</a>
— learn the foundations, follow interactive diagrams, and connect the attacks from DAEMONSEC write-ups to their tools.
</Callout>
</section>
<!-- 4 · Index -->
<section id="index" class="dsection" data-index>
<SectionHeader
eyebrow="Reference transmissions"
title="Terse, tested, kept current."
intro={`${total} sheets across ${domains} shelves, each stripped to the commands that matter.`}
tone="iris"
/>
<div class="filters">
<button type="button" class="pill" data-filter="all" aria-pressed="true">All</button>
<button type="button" class="pill" data-filter="sheets" aria-pressed="false">Sheets</button>
<button type="button" class="pill" data-filter="workflow" aria-pressed="false">Workflow</button>
<a class="pill" href={url('sheets')}>All sheets ↗</a>
<a class="pill" href={url('payloads')}>Payloads ↗</a>
<a class="pill" href={url('internal')}>Internal ↗</a>
<a class="pill" href={url('hacktricks')}>HackTricks ↗</a>
<span class="filters__count" data-shown>10 shown</span>
</div>
<div class="index-list">
{recent.map((r) => (
<RecordRow
href={r.href}
n={r.n}
title={r.title}
reportGuide={r.reportGuide}
kind={r.kind}
accent={r.accent}
meta={r.meta}
excerpt={r.excerpt}
tagline={r.tagline}
bucket={r.bucket}
/>
))}
</div>
<button type="button" class="show-more" data-more hidden>
<span data-more-label>Show more</span><span>↓</span>
</button>
<div class="index-foot">
<span data-foot>Showing 10 of {total} sheets</span>
<a href={url('sheets')}>Browse all {total} sheets ↗</a>
</div>
</section>
<!-- 5 · Shelves grid (the full taxonomy — "pick your vector") -->
<section id="shelves" class="dsection">
<SectionHeader
eyebrow="Shelves / taxonomy"
title="Pick your vector."
intro={`${CATEGORIES.length} shelves, grouped by how you actually reach for them.`}
tone="pine"
/>
<div class="shelves-grid">
{shelfCards.map((s) => (
<a class="shelf" href={url(s.slug)} style={`--acc: var(--${s.accent});`}>
<span class="shelf__top"><span>{s.n}</span><span>{s.count} {s.count === 1 ? 'sheet' : 'sheets'}</span></span>
<span class="shelf__title">{s.label}</span>
</a>
))}
</div>
</section>
<!-- 6 · Mirrors band (the upstreamed repos — swisskyrepo) -->
<section id="mirrors" class="mirrors bleed" aria-labelledby="mirrors-title">
<span class="mirrors__scrim" aria-hidden="true"></span>
<div class="archive mirrors__inner">
<div>
<span class="mirrors__eyebrow">Third party / mirrored</span>
<h2 id="mirrors-title" class="mirrors__title">Some trees are borrowed.</h2>
<p class="mirrors__body">
Three directories are generated from upstream security references: swisskyrepo's
PayloadsAllTheThings and InternalAllTheThings, plus an attributed selection from
HackTricks — mirrored because the official site has gotten harder to read on its own
terms, buried under ads and AI-generated filler. Same content, read clean, searchable
offline, and every page still links back to its exact source. Attribution, modification
notes, and licences live on the credits page.
</p>
<dl class="mirrors__dl">
<div><dt>Trees</dt><dd>03</dd></div>
<div><dt>Licence</dt><dd><span class="mirrors__chip">Upstream</span></dd></div>
<div><dt>Sync</dt><dd>Scheduled</dd></div>
<div><dt>Edits</dt><dd>None</dd></div>
</dl>
<a class="mirrors__cta" href={url('credits')}>Read the credits →</a>
</div>
<div class="mirror-panel">
<div class="mirror-panel__head"><span>Mirror manifest // upstream</span><span class="lic">swisskyrepo</span></div>
{mirrorRows.map((m) => (
<div class="mirror-row"><span class="n">{m.n}</span><span class="path">{m.path}</span><span class="count">{m.count} files</span></div>
))}
</div>
</div>
</section>
<!-- 7 · Scope callout -->
<div class="archive" style="padding-top:80px;">
<Callout tone="warning" label="Scope">
Authorised testing, CTFs and education only. HackTricks-derived pages are also restricted to
non-commercial use under CC BY-NC 4.0. Know your scope, and get permission first,
before you touch a system.
</Callout>
</div>
<div style="height:96px"></div>
</Base>
<script>
// Index filter pills — client-side by bucket, with a show-more cap. The
// Payloads / Internal pills are real links (they navigate); All / Sheets /
// Workflow filter the visible rows. Progressive: rows are all rendered, so
// the index is complete with JS off.
function initIndexFilters() {
const root = document.querySelector('[data-index]') as HTMLElement | null;
if (!root || root.dataset.bound) return;
root.dataset.bound = '1';
const CAP = 10;
const rows = [...root.querySelectorAll<HTMLElement>('.rec')];
const pills = [...root.querySelectorAll<HTMLButtonElement>('button[data-filter]')];
const shown = root.querySelector<HTMLElement>('[data-shown]');
const foot = root.querySelector<HTMLElement>('[data-foot]');
const more = root.querySelector<HTMLElement>('[data-more]');
const moreLabel = root.querySelector<HTMLElement>('[data-more-label]');
let filter = 'all', expanded = false;
const apply = () => {
const matching = rows.filter((r) => filter === 'all' || r.dataset.bucket === filter);
rows.forEach((r) => { r.hidden = true; });
const visible = expanded ? matching : matching.slice(0, CAP);
visible.forEach((r) => { r.hidden = false; });
if (shown) shown.textContent = `${visible.length} shown`;
if (foot) foot.textContent = `Showing ${visible.length} of ${matching.length} ${filter === 'all' ? 'entries' : filter}`;
if (more && moreLabel) {
const rem = matching.length - visible.length;
more.hidden = rem <= 0;
moreLabel.textContent = `Show ${Math.min(CAP, rem)} more — ${rem} remaining`;
}
pills.forEach((p) => p.setAttribute('aria-pressed', String(p.dataset.filter === filter)));
};
pills.forEach((p) => p.addEventListener('click', () => { filter = p.dataset.filter || 'all'; expanded = false; apply(); }));
more?.addEventListener('click', () => { expanded = true; apply(); });
apply();
}
document.addEventListener('astro:page-load', initIndexFilters);
if (document.readyState !== 'loading') initIndexFilters();
else document.addEventListener('DOMContentLoaded', initIndexFilters);
</script>