7 Keypairs
cpunk edited this page 2022-09-20 13:29:38 -05:00

Each build of Laika (cnc, bot && shell) is tied to a 'central keypair.' This keypair is used by the cnc server to authenticate themselves with each bot. The keypair is defined as a macro in lib/include/lconfig.h.in.

There is a default keypair used for testing/"first build" purposes. They're defined as

  • LAIKA_PUBKEY : 40d5534aca77d1f5ec2bbe79dd9d0f52a78148918f95814404cefe97c34c5c27
  • LAIKA_PRIVKEY : 90305aa77023d1c1e03265c3b6af046eb58d6ec8ba650b0dffed01379feab8cc

Please do NOT deploy public-facing cnc servers with these. Since the keys are public in these docs, anyone can trivially connect and deploy commands.

Generating keypairs

After compiling the target, an output binary called genKey will be produced. This is a simple wrapper for libsodium to generate keypairs.

$ ./bin/genKey

Note: on windows, genKey will be located in winbin

You should receive output that looks like:

[~] Generated keypair!
[~] public key: 40d5534aca77d1f5ec2bbe79dd9d0f52a78148918f95814404cefe97c34c5c27
[~] private key: 90305aa77023d1c1e03265c3b6af046eb58d6ec8ba650b0dffed01379feab8cc

Passing keypairs back to Laika

These keypairs will then need to be passed back to cmake, you'll need to re-build the whole target using these keys. Start by cleaning the build and output directories.

$ rm -rf bin build

Now re-build Laika, but passing your keypair to cmake

$ cmake -B build -DLAIKA_PUBKEY=997d026d1c65deb6c30468525132be4ea44116d6f194c142347b67ee73d18814 -DLAIKA_PRIVKEY=1dbd33962f1e170d1e745c6d3e19175049b5616822fac2fa3535d7477957a841 -DCMAKE_BUILD_TYPE=MinSizeRel &&\
    cmake --build build