Commit Graph

61 Commits

Author SHA1 Message Date
CPunch 81360a8072 Re-added lboxconfig.h 2022-05-16 17:23:45 -05:00
CPunch 7175e2ec00 Win: winpersist.c now uses obfuscation
- The API was switched to force Ascii versions of the winapi
2022-05-16 11:02:56 -05:00
CPunch 7f587f3df2 Bot: windows builds no longer open a console 2022-05-15 18:14:29 -05:00
CPunch 134f1fee37 Bot: add VMBoxGen as a dependency 2022-05-15 15:27:54 -05:00
CPunch f649ca4a56 Win: Static builds & fixed winpersist.c 2022-05-14 13:24:20 -05:00
CPunch c4fc1a1fe6 misc. refactoring, updated comments and minor documentation 2022-05-10 21:03:23 -05:00
CPunch e3a1f51d60 added 'LAIKA_OBFUSCATE' cmake option
- if defined, enables LAIKA_BOX obfuscation for variables
- new macros (LAIKA_BOX_SKID_START & LAIKA_BOX_SKID_END), become no-ops if LAIKA_OBFUSCATE is undefined
- TODO: use cmake to automate the generation of lboxconfig.h
2022-05-10 20:28:54 -05:00
CPunch 71db213261 Implemented VMBoxes, linux persistence related strings are obfuscated, added VMBoxGen tool
- lboxconfig.h holds obfuscated data, which is generated by VMBoxGen
- linpersist.c now uses obfuscated strings
2022-05-09 16:41:01 -05:00
CPunch 63e36d1ebb Bot: small shell.[ch] + native refactor
- `struct sLaika_shell` is now a shared struct, `struct sLaika_RAWshell` is the native implementation with `struct sLaika_shell` as it's first member
2022-05-08 01:21:37 -05:00
CPunch 7d96f3252c Major shell packet refactoring
- can now open multiple shells per peer (change LAIKA_MAX_SHELLS)
- more sanity checking for public keys (new peers with duplicate keys are killed
- misc. refactoring, added cnc/cpeer.[ch]
2022-05-07 20:09:42 -05:00
CPunch f90c99ce64 Bot: Strip symbols 2022-05-01 14:21:44 -05:00
CPunch 64f7e40fa0 Windows: Persistence via windows registry 2022-04-22 17:20:31 -05:00
CPunch e80f007df9 Bot: Minor refactoring, tell cnc if failed to open shell 2022-04-20 10:23:00 -05:00
CPunch c3c42e298f Windows: use COMSPEC environment variable to grab the shell
- shells on windows are now opened from the COMSPEC env variable
- cnc will now ignore malformed shell packets from bots instead of killing them
2022-04-20 10:10:44 -05:00
CPunch cfe633f1d5 Windows: Added registry manipulation boilerplate 2022-04-18 17:05:26 -05:00
CPunch 34dd36fb67 Windows: implemented laikaB_markRunning() & laikaB_unmarkRunning()
- use Sleep() for LAIKA_PERSISTENCE in main()
- use Mutex for checking existing LaikaBots
- switched to TEXT() for win32 strings
2022-04-16 23:54:07 -05:00
CPunch 231881c960 Bot: Minor laikaB_freeShell refactoring 2022-04-16 23:08:21 -05:00
CPunch b60203d3f2 Linux: implemented laikaB_markRunning() & laikaB_unmarkRunning()
- switched to file locks as that's more discreet
    - tied to LAIKA_PERSISTENCE being defined
2022-04-16 22:56:05 -05:00
CPunch dac99ddd85 Bot: Only run shell task when shell is open
- since the shell task is only ran when the shell is open, i decreased the delta to 50ms. this should improve latancy while improving performance for 99% of the time. yay!
2022-04-14 12:11:29 -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 2fe297eb0e Missing semicolon 2022-04-11 12:01:59 -05:00
CPunch 59c01d422b More resilient persistence
- bot will keep trying to connect if it failed to connect to the CNC or if the bot was killed
- if crontab isn't installed the bot will still run
2022-04-10 15:45:30 -05:00
CPunch bb6e489945 check if installed in crontab before installing 2022-04-08 12:51:03 -05:00
CPunch 2fb0ef29a6 Added CMake flag for enabling persistence 2022-04-07 19:04:42 -05:00
CPunch 412418ec0a Added crontab persistence, disabled by default with LAIKA_NOINSTALL
- undefine LAIKA_NOINSTALL in persist.h to enable persistence
- windows persistence is still unimplemented
2022-04-07 18:11:58 -05:00
CPunch 56fb305ef2 Implemented linpersist.c:laikaB_checkRoot(), fixed Shell config argument 2022-04-06 15:22:01 -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 b6bd8b2518 Bot persistence boilerplate 2022-04-04 12:12:37 -05:00
CPunch 541e75f183 Switched Shell & Bot to use laikaP_flushOutQueue()
- they both now have handlers for onPollFail
2022-03-24 18:03:08 -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 26a1977609 Fixed Windows Shell detection for shell closing
- updated demo.gif
2022-03-18 17:46:28 -05:00
CPunch 7e9597902f Added line-conversions for shells 2022-03-17 23:49:25 -05:00
CPunch 6f60c7a5b7 Added OSTYPE, added OS info to handshake & peer-related packets 2022-03-17 23:05:18 -05:00
CPunch 4833dea67f Added Windows Bot client
- Shells 'work' but line endings aren't converted yet so pressing enter doesn't work lol
2022-03-17 18:22:26 -05:00
CPunch e2537efb3f Added LAIKA_CNC_IP & LAIKA_CNC_PORT to cmake config 2022-03-15 13:05:11 -05:00
CPunch 6a5afb18a0 CMake: Require C11 for each target 2022-03-14 01:11:13 -05:00
CPunch 2cf7ab52ab Added util library to bot's CMakeList.txt target_link_libraries() 2022-03-14 00:53:32 -05:00
CPunch 9432aaf594 Minor cmake refactoring 2022-03-14 00:51:11 -05:00
CPunch e1ce053aa8 Added termsize 'cols & rows' to SHELL_OPEN packets 2022-03-07 15:16:46 -06:00
CPunch 12f0e47ab0 added docs to bot.c 2022-03-05 20:46:35 -06:00
CPunch 0c2d4968d9 Refactored LAIKAPKT_HANDSHAKE_REQ, laikaS_acceptFrom
- added inet member to peer structs
2022-03-04 20:17:03 -06:00
CPunch 8ab3033bf3 Added 'shell' command to LaikaShell
- another major refactoring
2022-03-02 10:38:16 -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 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 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 85d6cdcba1 refactored laikaS_*Packet functions, added debugging output 2022-02-03 20:51:32 -06:00
CPunch 5fe72e9eb0 laikaS_endInPacket() bug fix
- sock->inCount was not properly set
2022-02-03 16:46:12 -06:00