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
ReportIndexModal.astroAstro70 lines4.8 KiBraw download
---
import lock from '../data/report-index-lock.json';
import { url } from '../lib/url';
---
<dialog id="report-index-dialog" class="report-index plate" aria-labelledby="report-index-title"
  data-pagefind-ignore data-digest={lock.plaintextSha256} data-recipient={lock.recipient} data-sheet-base={url('sheets/')}>
  <div class="report-index__heading">
    <h2 id="report-index-title">☧ CPTS · ordered posts</h2>
    <button type="button" data-report-index-close aria-label="Close tool index" autofocus>Close ×</button>
  </div>
  <div class="report-index__body">
    <p class="report-index__status" data-report-index-status role="status" aria-live="polite">Locked</p>
    <div data-report-index-auth>
      <p>Unlock with your Main_Key through local GPG.</p>
      <details class="report-index__setup">
        <summary>Start the local GPG helper</summary>
        <p>In your cheatsheet checkout, run:</p>
        <pre><code>npm run unlock:helper</code></pre>
        <p>Open the link it prints, or paste its pairing code below. Keep the terminal open until GPG finishes.</p>
      </details>
      <form>
        <label for="report-index-token">Helper pairing code</label>
        <input id="report-index-token" type="password" data-report-index-token autocomplete="off" spellcheck="false" required maxlength="48" />
        <button type="submit" data-report-index-unlock>Unlock with GPG</button>
      </form>
      <details class="report-index__setup">
        <summary>Import an index you already decrypted</summary>
        <p><a href={url('encrypted/report-index.gpg')} download="report-index.gpg" data-astro-reload>Download the encrypted index</a>, then decrypt with GPG:</p>
        <pre><code>gpg --output report-index.json --decrypt report-index.gpg</code></pre>
        <label for="report-index-file">Choose your decrypted JSON once to save access:</label>
        <input id="report-index-file" type="file" accept=".json,application/json" data-report-index-file />
      </details>
    </div>
    <button type="button" data-report-index-lock hidden>Lock this browser</button>
    <p class="report-index__hint">Your private key stays in GPG. The decrypted index is saved in this browser so you can reopen it after navigation, refreshes and restarts. Lock this browser or clear this site's browser data to remove the saved index. Nothing is uploaded.</p>
    <div data-report-index-results></div>
  </div>
</dialog>
<script>
  import '../scripts/report-index';
</script>
<style is:global>
  .report-index {
    padding: 0; margin: auto; width: min(740px, calc(100% - 2rem)); max-height: calc(100dvh - 2rem);
    border: 1px solid var(--rule-hi); background: var(--base); color: var(--text);
    overflow: auto; overscroll-behavior: contain; line-height: 1.6;
  }
  .report-index::backdrop { background: color-mix(in srgb, var(--base) 88%, transparent); }
  .report-index__heading { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 1rem; border-bottom: 1px solid var(--rule); position: sticky; top: 0; z-index: 1; background: var(--base); }
  .report-index__heading h2 { font-size: 1.2rem; margin: 0; }
  .report-index__heading button { color: var(--text); white-space: nowrap; }
  .report-index__body { padding: 1rem; }
  .report-index p { margin: 0 0 0.8rem; }
  .report-index a { color: var(--foam); text-decoration: underline; text-underline-offset: 0.2em; }
  .report-index__status, .report-index code, .report-index__number { font-family: var(--font-term); }
  .report-index__setup { margin-bottom: 1rem; }
  .report-index [hidden] { display: none !important; }
  .report-index pre { padding: 0.75rem; margin-block: 0.5rem; background: var(--surface); overflow: auto; }
  .report-index input { display: block; width: 100%; margin-top: 0.6rem; color: var(--text); background: var(--surface); border: 1px solid var(--rule-hi); padding: 0.65rem; }
  .report-index form button, .report-index [data-report-index-lock] { background: var(--surface); border: 1px solid var(--rule-hi); padding: 0.5rem; color: var(--text); margin-block: 0.8rem; cursor: pointer; }
  .report-index__hint, .report-index small { color: var(--subtle); font-size: 0.85rem; }
  .report-index__list { list-style: none; padding: 0; margin: 1.2rem 0 0; }
  .report-index__list li { display: grid; grid-template-columns: 3.5rem minmax(0, 1fr); gap: 0.8rem; padding: 0.9rem 0; border-top: 1px solid var(--rule); overflow-wrap: anywhere; }
  .report-index__list p { margin: 0.4rem 0; font-size: 0.9rem; }
  .report-index__number { color: var(--iris); }
  .report-index :focus-visible { outline: 2px solid var(--foam); outline-offset: 3px; }
  .mast .report-index-trigger { font-size: 1.2rem; padding: 0; }
  .report-index-link { color: var(--text); text-decoration: underline; text-underline-offset: 0.2em; }
  @media (max-width: 360px) { .mast .mast__row { gap: 4px; } .mast .mast__actions { gap: 4px; flex-shrink: 0; } }
</style>