1
0
mirror of https://github.com/CPunch/Laika.git synced 2024-12-21 18:40:08 +00:00
6 CNC setup
cpunk edited this page 2022-09-20 13:29:02 -05:00

While testing, sometimes it's nice to try it in a more 'real' environment (or you're using this project for red-teaming). Before deploying the default LaikaCNC target to a public-facing VPS, we'll need to make some changes.

Generate a good keypair

Make sure you have a unique, self-generated keypair. You can do that by following this.

Pass port && ip back to cmake

This step can be combined with the compilation after you generated your keypair. Just set the LAIKA_CNC_IP and LAIKA_CNC_PORT configs in cmake, like so:

cmake -B build -DLAKA_CNC_IP=127.0.0.1 -DLAIKA_CNC_PORT=13337

Make shell keypair

This keypair is unique per 'admin' user. Generate another keypair and update shell.ini && server.ini

Replace the pre-existing keypair with your newly generated key!!

Example shell.ini

; replace these!!!!
[auth]
public-key = 2d89362e935f96ab967938a279c786958cd4d2f5e6a05c8e2cdee916042f8700
private-key = a8e25e49ffb13b2e1beb90b15ce3a4f1f037e2409af822aab138cdbd9927c468

Example server.ini

; example of multiple 'admin' shells
[auth]
public-key-entry: 2d89362e935f96ab967938a279c786958cd4d2f5e6a05c8e2cdee916042f8700
public-key-entry: 452bcab368ddfad70e557d725a76a2590ce5ca4e56fcc26083f8484cb4696479
public-key-entry: abe611142327104b7a333a4883257f47b7a5dd1ab35ce02b15686b654de79e42

Deployment

Note that the CNC target expects 'server.ini' to be in the working directory. If you need to more this file for whatever reason, the ini config path can be passed to the server as a command line argument. Eg:

$ ./bin/LaikaCNC /root/server.ini