summaryrefslogtreecommitdiff
path: root/live/hdb.html
diff options
context:
space:
mode:
authorCarson Fleming <cflems@cflems.net>2025-01-24 20:57:54 -0500
committerCarson Fleming <cflems@cflems.net>2025-01-24 20:57:54 -0500
commit20e78c828e3995371a5ed29f3f53514370b7c152 (patch)
treee8d738d41be5cb9c657babf66facb8ef7459abab /live/hdb.html
downloadpk-20e78c828e3995371a5ed29f3f53514370b7c152.tar.gz
host docs here now
Diffstat (limited to 'live/hdb.html')
-rw-r--r--live/hdb.html105
1 files changed, 105 insertions, 0 deletions
diff --git a/live/hdb.html b/live/hdb.html
new file mode 100644
index 0000000..31986c6
--- /dev/null
+++ b/live/hdb.html
@@ -0,0 +1,105 @@
+<!DOCTYPE html>
+<html lang="en">
+ <head>
+ <meta charset="utf-8" />
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
+ <meta name="author" content="Carson Fleming" />
+ <meta name="description" content="Harness encrypted client-server communication, asynchronous command distribution, terminal emulation, and support for unlimited clients and controllers with Penguin's Kiss, the ultimate tool to manage remotely controlled devices with security and convenience." />
+ <link rel="icon" type="image/x-icon" href="/favicon.ico" />
+ <link rel="stylesheet" type="text/css" href="/css/control.css" />
+ <title>Hosts Database | Docs | Penguin&apos;s Kiss</title>
+ <link rel="canonical" href="https://c2.pkctl.org/hdb" />
+ </head>
+ <body>
+ <header id="banner">
+ <a id="banner-logo" href="/">
+ <img id="logo-img" src="/img/banner.webp" alt="Penguin&apos;s Kiss Banner" />
+ </a>
+ <div id="banner-buttons">
+ <a class="button" href="https://github.com/cflems/pk">GitHub</a>
+ <a class="button" href="https://github.com/cflems/pk/releases">Download</a>
+ </div>
+ </header>
+ <div id="page">
+ <nav id="navigation">
+ <h3 class="nav-heading"><a href="/">About PK</a></h3>
+ <ul class="nav-section">
+ <li><a href="/#download">Downloading</a></li>
+ <li><a href="/#build">Building</a></li>
+ <li><a href="/#precompiled">Precompiled</a></li>
+ </ul>
+ <h3 class="nav-heading"><a href="/client">Client Config</a></h3>
+ <ul class="nav-section">
+ <li><a href="/client#tts">Time to Sleep</a></li>
+ <li><a href="/client#bits">RSA Bits</a></li>
+ </ul>
+ <h3 class="nav-heading"><a href="/server">Server Config</a></h3>
+ <ul class="nav-section">
+ <li><a href="/server#install">Installing</a></li>
+ <li><a href="/server#pkctl">PKCTL Usage</a></li>
+ <li><a href="/server#keygen">Host Key Generation</a></li>
+ <li><a href="/server#users">Local Users</a></li>
+ </ul>
+ <h3 class="nav-heading"><a href="/hdb">Hosts Database</a></h3>
+ <ul class="nav-section">
+ <li><a href="/hdb#format">Format</a></li>
+ <li><a href="/hdb#keys">Keys Section</a></li>
+ <!-- Routes here soon. :) -->
+ </ul>
+ <h3 class="nav-heading"><a href="/commands">Command Reference</a></h3>
+ <ul class="nav-section">
+ <li><a href="/commands#beacon">beacon</a></li>
+ <li><a href="/commands#delbeacon">delbeacon</a></li>
+ <li><a href="/commands#nbeacons">nbeacons</a></li>
+ <li><a href="/commands#lbeacons">lbeacons</a></li>
+ <li><a href="/commands#nscreen">nscreen</a></li>
+ <li><a href="/commands#ncli">ncli</a></li>
+ <li><a href="/commands#lcli">lcli</a></li>
+ <li><a href="/commands#lq">lq</a></li>
+ <li><a href="/commands#cq">cq</a></li>
+ <li><a href="/commands#show-serverkey">show-serverkey</a></li>
+ <li><a href="/commands#pty">pty</a></li>
+ <li><a href="/commands#refresh-hdb">refresh-hdb</a></li>
+ <li><a href="/commands#tunnel">tunnel</a></li>
+ <li><a href="/commands#die">die</a></li>
+ <li><a href="/commands#shell">Shell Commands</a></li>
+ <li><a href="/commands#target">Targeting</a></li>
+ </ul>
+ </nav>
+ <div id="content">
+ <p>Now that we&apos;ve generated our host key and gotten our server up and running, its
+ time to publish its public key in a hosts database file so that it can be retrieved
+ by clients. The TL;DR for this section is to create a file that looks like this:</p>
+ <pre>{"keys": {"&lt;server ip&gt;": {"n": &lt;number n that python spit out&gt;, "e": 65537}}}</pre>
+ <p>and upload it to the web somewhere. You can then supply this URL to your clients as
+ your hosts database. Literally even a PasteBin will work if you use the raw file
+ URL.</p>
+ <section id="format">
+ <h3>Format</h3>
+ <p>The hosts database is essentially just a JSON object in which the PK client will
+ look for specific keys to retrieve information. The basic skeleton looks like
+ this:</p>
+ <pre>{"keys": {&lt;keys section&gt;}}</pre>
+ </section>
+ <section id="keys">
+ <h3>Keys Section</h3>
+ <p>The keys section is just a mapping from server IPs to key objects, which in
+ turn are just a way of representing RSA public keys. The keys section supports
+ multiple server IPs, but currently only one public key per server IP. Its
+ skeleton looks like the following:</p>
+ <pre>{"0.1.2.3": {&lt;key object&gt;}, "255.255.255.255": {&lt;key object&gt;}}</pre>
+ <h4>Key Objects</h4>
+ <p>A key object is just a modulus and a public exponent, both of which are integers.
+ The modulus is at key <code>n</code> and the public exponent is at key
+ <code>e</code>. The public exponent is optional and defaults to
+ <code>65537</code> if not supplied. These values can be pulled directly from
+ <code>/etc/pk/server_key.json</code>, but it is important to delete the
+ <code>d</code> key and its value, as this information needs to remain secret.
+ </p>
+ <p>The format of a key object is as follows:</p>
+ <pre>{"n": 3043289324798327498257285749857984257249857245, "e": 12345}</pre>
+ </section>
+ </div>
+ </div>
+ </body>
+</html>