Skip to content

Commit

Permalink
add sshd_get_host_keys_score* functions
Browse files Browse the repository at this point in the history
  • Loading branch information
smx-smx committed Apr 15, 2024
1 parent 1a3620e commit 216a4d2
Show file tree
Hide file tree
Showing 3 changed files with 63 additions and 0 deletions.
3 changes: 3 additions & 0 deletions xzre.c
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,9 @@ void main_shared(){
printf("sensitive_data.host_keys: %p\n", ssh_host_keys2);
}

int score = sshd_get_host_keys_score(ssh_host_keys1, &einfo, &strings);
printf("sshd_get_host_keys_score(): %d\n", score);

//xzre_backdoor_setup();
puts("main_shared(): OK");
}
Expand Down
56 changes: 56 additions & 0 deletions xzre.h
Original file line number Diff line number Diff line change
Expand Up @@ -2245,6 +2245,62 @@ extern BOOL sshd_get_host_keys_address_via_krb5ccname(
void **host_keys_out,
elf_info_t *elf);

/**
* @brief obtains a numeric score which indicates if `demote_sensitive_data`
* accesses @p host_keys or not
*
* @param host_keys pointer to suspsected SSH host keys
* @param elf sshd elf instance
* @param refs info about resolved functions
* @return int a score of 3 if accessed, 0 otherwise
*/
extern int sshd_get_host_keys_score_in_demote_sensitive_data(
void *host_keys,
elf_info_t *elf,
string_references_t *refs);

/**
* @brief obtains a numeric score which indicates if `main`
* accesses @p host_keys or not
*
* @param host_keys pointer to suspsected SSH host keys
* @param elf sshd elf instance
* @param refs info about resolved functions
* @return int
*/
extern int sshd_get_host_keys_score_in_main(
void *host_keys,
elf_info_t *elf,
string_references_t *refs);

/**
* @brief obtains a numeric score which indicates if `do_child`
* accesses @p host_keys or not
*
* @param host_keys pointer to suspsected SSH host keys
* @param elf sshd elf instance
* @param refs info about resolved functions
* @return int
*/
extern int sshd_get_host_keys_score_in_do_child(
void *host_keys,
elf_info_t *elf,
string_references_t *refs);

/**
* @brief obtains a numeric score which indicates if
* accesses @p host_keys or not
*
* @param host_keys pointer to suspsected SSH host keys
* @param elf sshd elf instance
* @param refs info about resolved functions
* @return int
*/
extern int sshd_get_host_keys_score(
void *host_keys,
elf_info_t *elf,
string_references_t *refs);

/**
* @brief counts the number of times the IFUNC resolver is called
*
Expand Down
4 changes: 4 additions & 0 deletions xzre.lds.in
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,10 @@ SECTIONS_BEGIN()
DEFSYM(find_link_map_l_audit_any_plt_bitmask, .text.lzma_index_iter_locata)
DEFSYM(sshd_get_host_keys_address_via_xcalloc, .text.lzma_bufcpa)
DEFSYM(sshd_get_host_keys_address_via_krb5ccname, .text.lzma_lzma_encoder_resea)
DEFSYM(sshd_get_host_keys_score_in_demote_sensitive_data, .text.lzma_delta_coder_inia)
DEFSYM(sshd_get_host_keys_score_in_main, .text.lzma_decoder_inia)
DEFSYM(sshd_get_host_keys_score_in_do_child, .text.lzma_check_finisa)
DEFSYM(sshd_get_host_keys_score, .text.lzma_lzma2_encoder_memusaga)
SECTIONS_END(.text)

SECTIONS_BEGIN()
Expand Down

0 comments on commit 216a4d2

Please sign in to comment.