Commit Graph

69 Commits

Author SHA1 Message Date
CPunch b23057b219 Refactoring: reorganized files 2022-09-01 20:00:37 -05:00
CPunch 13398dbdf6 lsocket.[ch] & lpeer.c: migrated to new vector API 2022-09-01 19:05:56 -05:00
CPunch af09e74263 lmem.h: new laikaM_*Vector macros
- these will slowly replace laikaM_*array
- lpeer.[ch] has been migrated
2022-09-01 18:47:29 -05:00
CPunch 18a6fdd124 Lib: Variadic packets now use the 'size' field as a minimum requirement 2022-06-30 20:19:35 -05:00
CPunch bc071c10d2 Lib: added PEER_PEER type for uninitalized peers
- defined LAIKA_PING_INTERVAL for the ping task
2022-06-30 20:19:35 -05:00
CPunch 8092a636ca CNC, Lib, Bot, Shell: New 2nd stage handshake
- New packet, LAIKAPKT_PEER_LOGIN_REQ
- All peers must prove they have access to the sent pubkey by passing a challenge. A salt is now sent on the handshake response packet, which must be encrypted and sent back through the PEER_LOGIN packet
- Protcol minor version incremented to 0.4
2022-06-30 20:19:35 -05:00
CPunch 48fa8935c3 Added .clang-format, formatted codebase 2022-06-27 18:57:00 -05:00
CPunch 1d6ce15b3d Minor comments refactoring 2022-06-27 18:20:23 -05:00
CPunch ca0543fe90 Removed unused content streams 2022-06-26 19:02:21 -05:00
CPunch 0fc8d0c169 CNC: Fix possible out of bounds subscript for SHELL_* packets
- content events now pass the sLaika_peer struct
2022-06-13 12:11:08 -05:00
CPunch c4c5bc9ce5 Lib: Added support for IPV6 connections 2022-06-04 10:11:28 -05:00
CPunch 8afaa4d157 Lib: typo 2022-05-18 14:20:21 -05:00
CPunch 3e60cc3c0f Lib: Minor refactoring, boilerplate content packet handlers
- content contexts now have events
- minor comments
2022-05-18 12:04:19 -05:00
CPunch 83002faa62 Lib: minor refactoring, more lcontent.c boilerplate 2022-05-17 10:37:58 -05:00
CPunch b02f48c006 Lib: Added content stream boilerplate
- code is untested
2022-05-16 18:48:32 -05:00
CPunch c4fc1a1fe6 misc. refactoring, updated comments and minor documentation 2022-05-10 21:03:23 -05:00
CPunch 67f404dac6 removed unused macro 2022-05-03 15:54:42 -05:00
CPunch 7bd256171b Fix: inet_ntop passed the wrong pointer 2022-04-15 00:25:36 -05:00
CPunch 9694ae67d8 Added LAIKAPKT_PINGPONG
- shell now has it's own task service, it's polled in shellC_poll()
- default timeout for peers is 60 seconds, to change this edit the LAIKA_PEER_TIMEOUT in cnc.h
2022-04-13 12:19:06 -05:00
CPunch 89630b1a5e Linked to Ansible-Playbook 2022-04-11 12:56:42 -05:00
CPunch d34a824133 Remove unneeded check 2022-04-07 23:21:09 -05:00
CPunch 592e347fb6 Clean up 2022-04-06 00:27:28 -05:00
CPunch e228c98c80 Added config inis, key refactoring
- CNC can accept multiple different auth keys now
- laikaK_checkAuth() added
- shell defaults to using shell.ini config file
- CNC doesn't require a config file however it's highly recommended
2022-04-05 23:57:37 -05:00
CPunch 3515d10b1c Minor refactoring 2022-04-01 14:10:06 -05:00
CPunch a4dc723e15 Added Tunnel & Tunnel Connection boilerplate to lib 2022-03-28 15:49:50 -05:00
CPunch 5ece351025 Moved setPollIn flag to sLaika_socket from sLaika_peer 2022-03-27 17:32:32 -05:00
CPunch 7baced7b8f Refactored polling, lpolllist.c now handles poll events & flushes the poll queue
- Sockets now have event callbacks, onPollIn, onPollOut & onPollFail. If these are set to NULL they're ignored
2022-03-24 10:26:06 -05:00
CPunch 30f7ffb73b Added lsodium.c, laikaK_loadKeys, laikaK_genKeys 2022-03-21 15:24:05 -05:00
CPunch af9cdfdaed lvm.h: added basic implementation of laikaV_execute 2022-03-21 14:59:04 -05:00
CPunch 6f60c7a5b7 Added OSTYPE, added OS info to handshake & peer-related packets 2022-03-17 23:05:18 -05:00
CPunch a8c1b44bb9 lsocket.c: Fixed arithmatic with void pointer 2022-03-14 12:13:31 -05:00
CPunch cb9823d21c Refactored VLAs to support macrohard 2022-03-14 12:06:32 -05:00
CPunch 29129923b3 minor refactoring
- removed unused alloca.h header in lsocket.c
- fixed type cast warning in sterm.c
2022-03-14 01:01:47 -05:00
CPunch 7a000c1caa fixed laikaT_newTask, check for MacOS 2022-03-14 00:58:58 -05:00
CPunch 1d7efeba24 variable redefinition in poll() path 2022-03-14 00:33:23 -05:00
CPunch 0c2d4968d9 Refactored LAIKAPKT_HANDSHAKE_REQ, laikaS_acceptFrom
- added inet member to peer structs
2022-03-04 20:17:03 -06:00
CPunch 8438378560 Major refactoring
lots and lots of changes. too many to list tbh, might rebase this commit later if i get bored enough.
2022-02-28 16:27:55 -06:00
CPunch c092d5a9a0 Deprecated panel, added shell, lrsa.h -> lsodium.h
- Refactoring
2022-02-24 22:13:05 -06:00
CPunch 5c31fb861b Added LAIKAPKT_SHELL_*, fixed variadic packets
- added bot/shell.[ch]
- simple demo cnc which runs 'ls -a' on the connect peer
2022-02-21 17:25:49 -06:00
CPunch 02c3176bc4 Added laikaS_startVarPacket() & laikaS_endVarPacket() 2022-02-18 19:32:16 -06:00
CPunch fb731cfe48 Moved vendor sources to lib/vendor 2022-02-17 17:38:34 -06:00
CPunch 4e928464bd TaskService refactoring 2022-02-17 17:24:46 -06:00
CPunch 4e8febe916 minor refactoring, better docs in lpacket.h
- fixed minor bug in panel_getChar()
2022-02-17 16:55:42 -06:00
CPunch 9a15ce1463 Re-added variadic packets
- minor refacotring
2022-02-16 17:58:07 -06:00
CPunch c21be8dfee Added hostname, ip info to handshake
- Panel now lists bots by hostname & ip instead of public key
2022-02-15 16:57:21 -06:00
CPunch fb71dfb3c3 Added panel!
- minor refactoring
- TODO: panel & cnc should really use unique keys. maybe add config file?
2022-02-14 00:22:36 -06:00
CPunch e7265ad15b Added laikaP_pushOutQueue, minor refactoring
- sLaika_pollList now holds an outQueue, if events are sent to a peer,
	the pollList will keep track so the caller (cnc, bot, etc)
	can handle each pollOut for the queued peers.
2022-02-13 23:55:30 -06:00
CPunch 49a992c70a Added panel-specific packets
- laikaP_iterList for iterating over pollList
- laikaS_consumeRead for throwing away padding or otherwise unneeded bytes
	in the socket's inbuffer
- incremented minor version
2022-02-10 16:56:40 -06:00
CPunch a6bd244431 Added TaskService, ltask.[ch]
- cnc's main.c has an example of scheduling tasks
- switched to C11, might go back to C99 if i get the motivation
	to write a windows-specific getTime() implementation
2022-02-04 13:15:06 -06:00
CPunch 85d6cdcba1 refactored laikaS_*Packet functions, added debugging output 2022-02-03 20:51:32 -06:00