-
Notifications
You must be signed in to change notification settings - Fork 30
/
hackmon.h
48 lines (40 loc) · 1.12 KB
/
hackmon.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
/*-
* xnumon - monitor macOS for malicious activity
* https://www.roe.ch/xnumon
*
* Copyright (c) 2017-2019, Daniel Roethlisberger <[email protected]>.
* All rights reserved.
*
* Licensed under the Open Software License version 3.0.
*/
#ifndef HACKMON_H
#define HACKMON_H
#include "auevent.h"
#include "procmon.h"
#include "logevt.h"
#include "sys.h"
#include "config.h"
#include "attrib.h"
#include <sys/types.h>
typedef struct {
uint64_t recvd;
uint64_t procd;
uint64_t ooms;
} hackmon_stat_t;
typedef struct {
logevt_header_t hdr;
audit_proc_t subject;
audit_proc_t object;
pid_t objectpid; /* if != 0, object is unset */
image_exec_t *subject_image_exec;
image_exec_t *object_image_exec;
const char *method; /* "ptrace" or "task_for_pid" */
} process_access_t;
void hackmon_taskforpid(struct timespec *, audit_proc_t *, audit_proc_t *,
pid_t) NONNULL(1,2);
void hackmon_ptrace(struct timespec *, audit_proc_t *, audit_proc_t *,
pid_t) NONNULL(1,2);
void hackmon_init(config_t *) NONNULL(1);
void hackmon_fini(void);
void hackmon_stats(hackmon_stat_t *) NONNULL(1);
#endif