catalog.astro (4729B)
1 --- 2 import Base from '../layouts/Base.astro'; 3 import facets from '../data/facets.json'; 4 import allTechniques from '../data/techniques.json'; 5 import indexHash from '../data/index-hash.json'; 6 import { EMPTY_FILTERS, type Technique } from '../lib/techniques'; 7 import { PAGE, renderRow, renderFacets, toListTechnique, totalFacetCounts } from '../lib/render-row'; 8 import { groupTechniques, sortTechniques } from '../lib/catalog-workspace'; 9 import { collectionPage } from '../lib/jsonld'; 10 import { url } from '../lib/url'; 11 import '../styles/catalog.css'; 12 import '../styles/workspace.css'; 13 const rows = allTechniques as unknown as Technique[]; 14 const groups = groupTechniques(sortTechniques(rows, 'tool')); 15 const description = 'Find commands by operating system, access, execution context and service. Configure documented templates and save useful techniques.'; 16 --- 17 <Base title="Catalog — DÆMONBins" description={description} jsonLd={collectionPage(Astro.site, '/catalog', 'Catalog — DÆMONBins', description)}> 18 <div class="workbench wrap" data-catalog data-index-url={url(`data/${indexHash.file}`)}> 19 <header class="workbench__heading"> 20 <div><p class="eyebrow">01 / THE COMMAND CATALOG</p><h1>Find your next command<span>.</span></h1><p>Know what you have. Find what applies.</p></div> 21 <div class="workbench__stats"><strong>{facets.counts.techniques.toLocaleString()}</strong> techniques <span>/</span> <strong>{facets.counts.tools}</strong> tools</div> 22 </header> 23 <div class="workbench__search"> 24 <label class="sr-only" for="catalog-query">Search commands, tools and prerequisites</label> 25 <span aria-hidden="true">⌕</span><input id="catalog-query" data-cat-search type="search" placeholder="Search tools, commands, access or ATT&CK…" autocomplete="off" /> 26 <button data-cat-clear type="button">Clear</button> 27 </div> 28 <div class="workbench__toolbar"> 29 <button data-filters-toggle type="button" aria-expanded="false" aria-controls="catalog-filters">Filters</button> 30 <button data-cat-new type="button" aria-pressed="false">DÆMON authored</button> 31 <button data-bookmarks-only type="button" aria-pressed="false">Saved <span data-bookmark-count>0</span></button> 32 <label>Sort <select data-sort><option value="tool">Tool A–Z</option><option value="source">Collection</option><option value="reviewed">Recently reviewed</option></select></label> 33 <label><input type="checkbox" data-group checked /> Group by tool</label> 34 <details class="display-options"><summary>Display</summary><div> 35 <label>Density <select data-density><option value="comfortable">Comfortable</option><option value="compact">Compact</option></select></label> 36 <label>Command size <select data-font><option value="13">13px</option><option value="15">15px</option><option value="17">17px</option></select></label> 37 <label><input type="checkbox" data-wrap /> Wrap commands</label> 38 <label><input type="checkbox" data-motion /> Reduce motion</label> 39 </div></details> 40 <button data-save-view type="button">Save view</button> 41 <label>Views <select data-views><option value="">Choose a saved view</option></select></label> 42 <button data-delete-view type="button" hidden>Delete view</button> 43 </div> 44 <div data-active-filters class="active-filters" aria-label="Active filters"></div> 45 <p class="workbench__status" data-workspace-status role="status"></p> 46 <div class="workbench__body"> 47 <aside id="catalog-filters" class="workbench__filters"><div class="filter-heading"><h2>Refine results</h2><span>OR within · AND across</span></div><div data-cat-facets set:html={renderFacets(EMPTY_FILTERS, totalFacetCounts(rows))}></div></aside> 48 <section class="workbench__results" aria-label="Command results"> 49 <div class="workbench__result-heading"><p data-cat-count aria-live="polite">{rows.length.toLocaleString()} techniques · {groups.length} tools</p><span>REFERENCE / COPY / CONFIGURE</span></div> 50 <div data-cat-results class="cat__results" set:html={groups.slice(0, PAGE).map(g => renderRow(toListTechnique(g[0]), g.map(toListTechnique))).join('')}></div> 51 <button class="cat__more" data-cat-more type="button">Show more tools</button> 52 <noscript><p>Search and configuration need JavaScript. Browse <a href={url('loobins')}>macOS</a>, <a href={url('gtfobins')}>Linux</a>, <a href={url('lolbas')}>Windows</a> or <a href={url('wadcoms')}>AD tools</a> for complete static references.</p></noscript> 53 </section> 54 <aside id="catalog-inspector" class="inspector" aria-label="Technique details" hidden></aside> 55 </div> 56 </div> 57 <script>import '../scripts/catalog';</script> 58 </Base>