aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2022-11-06Remove file extension from proone-txtrec execsHEADmasterDavid Timber
2022-11-06Improve proone-txtrec ...David Timber
- Use getopt - Add 'dnsmasq' hook
2022-11-05Do not load empty DH param data ...David Timber
- Let the library set up forward secrecy if not used
2022-11-05Doc and source comment spelling checkDavid Timber
2022-10-18Fix broken bootstrap.shDavid Timber
2022-10-18Update copyright noticeDavid Timber
2022-10-18Add yaml.h, hostinfod bug fix, compilation settingDavid Timber
- Add yaml helper functions - Add yaml test tool proone-yamlls - Add yaml test doc - Refactor hostinfod with yaml.h - Fix bug in hostinfod where specifying verbosity results in config error - Add C flag '-Werror=implicit-function-declaration' - Update doxygen template
2022-10-18Move vscode settings to /.vscode/settings.jsonDavid Timber
2022-06-02Refactor build-all.sh ...David Timber
- Separate config vars - Employ sensible format for target build spec - Mandate no argument
2022-06-02Reformat python scripts to PEP 257 docstrDavid Timber
2022-06-02Doc and final touches ...David Timber
- Add .settings.json for doxygen settings - Add /doc/impl.md - Doc and change usage of /bootstrap.sh - Add notes to docs - Add 7-bit char machine check - Normailise description for init and free functions - Doc rest of source code - Remove unused function: prne_str_shift_spaces()
2021-12-14Doc progress, reimpl txtrec scripts in Python ...David Timber
* Delete prne_own_recon_param() as it served no purpose
2021-12-06Documentation progress, bug fix, interface changeDavid Timber
* Update vscode settings for Doxygen * Fix mem leak in prne_index_bin_archive() * Fix bug where errno is not set in prne_htbt_parse_args() * Change names of parameter to prne_htbt_cp_hover() * Add template for Doxygen comment blocks
2021-11-13Doc progress, improve prne_mbedtls_pth_handle() ..David Timber
* Add param to prne_mbedtls_pth_handle() for returning return value from the function or poll().
2021-11-06Add more callbacks for fork() event, doc progressDavid Timber
* Add fork.prepare(), fork.parent() and fork.child() to match with pthread_atfork(), which makes more sense * Code documentation progress
2021-10-31Code doc progressDavid Timber
2021-10-30Code documentation and bug fixes ...David Timber
* Add convenience function prne_sfree_str() * Use prne_sfree_str() to scrub off sensitive data * Making the brute force login vector optional BNE param cred_dict can be null * Use O_EXCL when creating temporary files * Fix bug where bne_cb_uptime() returns the up time of the child process, not the parent
2021-10-25Documentation progress, brought back m68kDavid Timber
2021-10-16Documentation progress: /doc/fmts.mdDavid Timber
2021-10-05Documentation progressDavid Timber
2021-09-11The Heartbeat Protocol documentation progressDavid Timber
2021-09-11Use prne_htbt_gen_msgid() to unify msg_id gen algoDavid Timber
* Add PRNE_HTBT_MSG_ID_NOTIFY for protocol error w/o associated msg_id * Remove PRNE_HTBT_MSG_ID_MAX(wrong value)
2021-08-31MIT LicenseDavid Timber
2021-08-18Documentation progress ...David Timber
2021-08-17Bitfield: assume bits out of range are unsetDavid Timber
2021-08-17Impl full IPv6 support ...David Timber
* Use different strategy for discovering IPv6 hosts on the network * Multicast IPv6 packet with bogus destination options to get ICMPv6 responses(type 4, code 2) * Send SYN packets to the hosts responds to the packet to confirm that they have target ports open * Add full scope_id support * Fix potential infinite loop when receiving raw packets
2021-08-16Protocol change: change hostinfo uptime ...David Timber
* Change hostinfo parent_uptime and child_uptime to uint32_t (138 years is a long time)
2021-08-14build scripts ...David Timber
* Add readelf output for symbol size analysis * Add symbol size parser scripts * Add templates/symbol-size.fodt for generating hardcopy of extsymsize.sh output
2021-08-14Fix bne ...David Timber
* Don't clean up the upload dir after a successful launch * upload guard * clean up the upload dir and the lock file only when the lock file is still present after the shell dies * suppress stdout and stderr so they don't interfere bne_sh
2021-08-14Fix bne ...David Timber
* Wrong args to prne_start_bin_rcb_compat() made ba with 1 missing arch (that of parent) in the next generation of exec. Blame eea0a9fbbf1aff1eac1f17914d5c116de98e1d93 * proone-pack: add os string to suffix of output files
2021-08-13Impl bne ...David Timber
* Add upload lock mechanism to prevent multiple instances trying to infect the same host simultaneously * Add "upload guard". The upload guard cleans up the lock file and the upload directory in the event of upload failure * Fix bug in bne_vssh_flush_f() * prne_strzero() accepts NULL * Fix Proone: missing prne_dvault_reset() calls
2021-08-12Recon: use ICMPv6 echo instead of random SYN ...David Timber
* proone-htbtclient: mlock() tls password * Recon * Send ICMPv6 echo requests to discover IPv6 hosts in the link-local network * Check OS code as the implementation is heavily os-dependent * Fix wrong II_UPDATE values * Fix sending wrong number of SYN packets
2021-08-10Impl M2M binary update ...David Timber
* Use getopt in proone-bne * Call pth_yield() where necessary * htbt: truncate downloaded binary if actual size of data transfered is less than alloc_len * prne_rcb_param.self is not optional as proone-bne uses nybin * Add --vercmp option for proone-bne to test M2M bin update * Refactor proone-htbtclient * Protocol change: prne_htbt_bin_meta.alloc_len is now size_t * Add convenience functions: prne_realloc_str(), prne_redup_str()
2021-08-09Impl proone-htbtclient txtrec mode ...David Timber
* Relocate /src/data/proto/txtrec-*.sh to /src
2021-08-09Protocol and build system change ...David Timber
* Use autoheader * Add --enable-minmem * Add OS code. Bin archive and protocol changed accordingly * Add instance flags in hostinfo frame. Bitfield util added for this * Add org_id in hostinfo for lineage record * SQL schema change: store integer value of hostinfo arch and os * Remove config.c * prne_index_nybin() now sets errno * Instance ids are now preserved for lineage record * Proone: remove arguments after init * Fix bug in prne_htbt_ser_bin_meta(): alloc_len is not checked
2021-08-06htbt and protocol overhaul ...David Timber
* htbt overhaul * Abandon async slv io. slv io is now synchronous * htbt_do_cmd() * w/ detach flag: set up closed pipes for stdio * Create new pg for child and kill the pg on error * Do waitpid() w/ timeout * Wait for child spawn w/ timeout * Always reap child * Add fork cb for clean up code(to unmask signals, deinit libs) * Protocol overhaul * Use stdio frames to transfer binary data for PRNE_HTBT_OP_UP_BIN and PRNE_HTBT_OP_RUN_BIN op * bin_meta bin_size -> alloc_len. This is an optional field now * Fix protocol * detach flag of cmd_head not being (de)serialised * cmd_head (d)ser funcs not setting actual correctly * Proone: call setsid() on daemonisation * Fix compilation error caused by missing <errno.h>
2021-07-25Impl htbt M2M binary update and bug fixes ...David Timber
* Change signature of tmpfile() cb * Add PRNE_DATA_KEY_VER_MAT * Add prne_try_alloc_iobuf() * Fix htbt: don't run cncp when both resolv and cnc_txtrec are not passed * Impl upbin cb on proone-bne * Fix proone-htbtclient: content of status frame was discarded * htbt is now responsible for setting FD_CLOEXEC on temp files * Changes in mttools for valgrind run * Add proone-test_iobuf * Fix event leak in resolv * src/test-resolv.sh: run proone-resolv on valgrind * Add prne_cmp_uuid_asc() and prne_cmp_uuid_desc() for version matrix *
2021-07-22Fix proone ...David Timber
* Fix missing feature: renaming downloaded exec to the value of PRNE_DATA_KEY_EXEC_NAME
2021-07-22Impl proone-htbtclientDavid Timber
2021-07-22Impl PRNE_HTBT_OP_RCB ...David Timber
* Parameterize prne_start_bin_rcb() args * Change value of PRNE_ARCH_NONE to 0 to use it over the wire (problem arises deserialising) * tostr() and fstr() functions set errno to EINVAL * Run bne without binary archive to support same-arch infection
2021-07-21Impl proone-htbtclient upbin, bug fixes ...David Timber
* Add prne_start_bin_rcb_compat() * PRNE_HTBT_OP_NY_BIN -> PRNE_HTBT_OP_UP_BIN. "nybin" is now the name of the file format * htbt * Fix broken hover redirection (HTBT_LMK_HOVER removed) * HTBT_MAIN_REQ_Q_SIZE * Impl PRNE_HTBT_OP_NOOP response * Fix PRNE_HTBT_OP_SOLICIT is always sent with id 1 * proone * Fix bugs caused by not scrubbing the shared global memory * Fix exec() fail when upbin request with args * Removed do_recombination() as it's not efficient. Now the authoritive end has to do the recombination * PRNE_HTBT_OP_RCB, PRNE_HTBT_STATUS_SUB reserved for future impl
2021-07-19Impl proone-htbtclient nybin commandDavid Timber
2021-07-19Fix htbt hang, fix proone-hostinfo crash bug ...David Timber
* Fix htbt hang bug - stagnant data in ssl ctx buffer not flushed * Add pending_f() abstraction for mbedtls_ssl_check_pending() * Call read_f() when pending_f() returns true * Add macro functions: prne_is_nberr() and prne_mbedtls_is_nberr() * read_f() and write_f() will always set errno to EAGAIN in the event of MBEDTLS_ERR_SSL_WANT_READ and MBEDTLS_ERR_SSL_WANT_WRITE * proone-hostinfo: fix crash bug when program init is not successful * launch.json: Ignore SIGPIPE to hostinfod
2021-07-19Fix resolv ...David Timber
* Fix mbedtls_ssl_read() is not called repeatedly until no data is returned * Impl exit code of proone-resolv * Add test for resolv
2021-07-14Impl proone-htbtclient, htbt bugfixes ...David Timber
* htbt * Fix stdout-stderr round-robin sending algo in htbt_relay_child() * Fix logic error and crash bug in htbt_slv_srv_bin() * Impl proone-htbtclient runcmd command * Change signature of prne_htbt_set_cmd()
2021-07-12Impl proone-htbtclient, fix htbt ...David Timber
* Fix bug where htbt slv ctx loops when the connection stays on. This bug has not been found earlier because the test connections shutdown write channel * Fix bug where errno is not properly set when htbt_main_do_connect() fails * Add test for protocol enums * proone-htbtclient: impl hover command
2021-07-12Impl proone-htbtclient, bugfix, --enable-mttoolsDavid Timber
* Remove --enable-hostinfod and add --enable-mttools, which enables hostinfod and htbtclient * Change PRNE_HTBT_PROTO_PORT so that the macro can be used in another macro expression(for help message) * Add prne_mbedtls_perror() * proone-htbtclient: implement hostinfo command * proone-htbthost * Add --hostcred option * Response with status frame on ENOMEM * htbt: add prne_htbt_serrc_tostr() and prne_htbt_gen_msgid() * Add prne_ctoupper(), prne_ctolower(), prne_cisspace(), prne_cisprint() * The added functions are the locale-independent equivalent of their POSIX counterparts * Remove Use of the POSIX functions * Add test unit
2021-07-07Documentation in progress.David Timber
2021-07-07Refactor: impl prne_mbedtls_verify_alp()David Timber
2021-04-26Tweak and bug fixDavid Timber
* Increase socket operation timeout of htbt and resolv * htbt: use of term "jitter" * htbt: Fix bug where debug print is not suppresses when `PRNE_VERBOSE < PRNE_VL_DBG0` * Fix crash bug caused by SIGPIPE * Proone: `sleep(1)` when fork fails