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

change bash line size to 256 bytes #55

Merged
merged 1 commit into from
May 4, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions kern/bash_kern.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

struct event {
u32 pid;
u8 line[80];
u8 line[MAX_DATA_SIZE_BASH];
u32 retval;
char comm[TASK_COMM_LEN];
};
Expand Down Expand Up @@ -60,4 +60,4 @@ int uretprobe_bash_retval(struct pt_regs *ctx){
sizeof(struct event));
}
return 0;
}
}
3 changes: 2 additions & 1 deletion kern/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
#define MAX_DATA_SIZE_OPENSSL 1024 * 4
#define MAX_DATA_SIZE_MYSQL 256
#define MAX_DATA_SIZE_POSTGRES 256
#define MAX_DATA_SIZE_BASH 256

// enum_server_command, via
// https://dev.mysql.com/doc/internals/en/com-query.html COM_QUERT command 03
Expand All @@ -35,4 +36,4 @@ const volatile u64 target_pid = 0;
char __license[] SEC("license") = "Dual MIT/GPL";
__u32 _version SEC("version") = 0xFFFFFFFE;

#endif
#endif
11 changes: 10 additions & 1 deletion user/event_bash.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,19 @@ import (
"golang.org/x/sys/unix"
)

/*
u32 pid;
u8 line[MAX_DATE_SIZE_BASH];
u32 retval;
char comm[TASK_COMM_LEN];
*/

const MAX_DATA_SIZE_BASH = 256

type bashEvent struct {
module IModule
Pid uint32
Line [80]uint8
Line [MAX_DATA_SIZE_BASH]uint8
Retval uint32
Comm [16]byte
}
Expand Down