repositories

daemon-sec-cheatsheet

The cheatsheet vault for operators: AD, enumeration, exploitation, priv-esc, web, DFIR

clonegit clone https://git.daemon-sec.xyz/daemon-sec-cheatsheet.git
[...slug].astroAstro63 lines2.9 KiBtoo large to serve raw — clone the repo
---
import ContourField from '../../components/ContourField.astro';
import { render } from 'astro:content';
import Base from '../../layouts/Base.astro';
import Toc from '../../components/Toc.astro';
import HackTricksCredit from '../../components/HackTricksCredit.astro';
import { hackTricksBySection, hackTricksHref, prevNext, type HackTricksPage } from '../../lib/hacktricks';
import { url } from '../../lib/url';

export async function getStaticPaths() {
  const paths: any[] = [];
  for (const section of await hackTricksBySection()) {
    for (const entry of section.items) {
      const { prev, next } = prevNext(section.items, entry);
      paths.push({
        params: { slug: hackTricksHref(entry).replace(/^hacktricks\//, '') },
        props: { entry, prev, next, sectionTitle: section.title },
      });
    }
  }
  return paths;
}

interface Props { entry: HackTricksPage; prev?: HackTricksPage; next?: HackTricksPage; sectionTitle: string }
const { entry, prev, next, sectionTitle } = Astro.props;
const { Content, headings } = await render(entry);
---
<Base title={`${entry.data.title} — HackTricks — DÆMON//SEC`} description={`${sectionTitle} reference adapted from HackTricks under CC BY-NC 4.0.`}>
  <div class="wrap">
    <nav class="breadcrumb" style="margin-top:1.5rem;">
      <a href={url('')}>~</a><span class="sep">/</span>
      <a href={url('hacktricks')} style="color:var(--gold)">hacktricks</a><span class="sep">/</span>
      <a href={url(`hacktricks/section/${entry.data.sectionSlug}`)} style="color:var(--gold)">{entry.data.sectionSlug}</a>
    </nav>

    <header class="sheet-head plate signal-hero" data-pagefind-meta="category:HackTricks">
      {/* The contour field, in the plate's night values. The eyebrow and the
          title are one clearing that hugs its words, so the lines run
          beside the type, not under it. */}
      <ContourField />
      <span class="grain grain--local" aria-hidden="true"></span>
      <span class="scanlines" aria-hidden="true"></span>
      <div class="sheet-head__block" data-contour-clear>
        <p class="eyebrow" style="color:var(--gold)">// HackTricks · {sectionTitle}</p>
        <h1 class="sheet-title" data-pagefind-meta="title">{entry.data.title}</h1>
      </div>
    </header>

    <HackTricksCredit section={sectionTitle} sourceUrl={entry.data.sourceUrl} sha={entry.data.sha} />

    <div class="sheet-layout">
      <article class="prose" data-pagefind-body>
        <Content />
      </article>
      <Toc headings={headings} />
    </div>

    <nav class="prevnext" aria-label="Pagination">
      {prev ? <a href={url(hackTricksHref(prev))} style="--acc:var(--gold)"><span class="dir">← Prev</span><strong>{prev.data.title}</strong></a> : <span></span>}
      {next ? <a class="nx" href={url(hackTricksHref(next))} style="--acc:var(--gold)"><span class="dir">Next →</span><strong>{next.data.title}</strong></a> : <span></span>}
    </nav>
  </div>
</Base>