diff options
author | We-unite <3205135446@qq.com> | 2024-07-26 15:20:45 +0800 |
---|---|---|
committer | We-unite <3205135446@qq.com> | 2024-07-26 15:20:45 +0800 |
commit | b765715b4795ce4bc8940c7b1a1092a78550de94 (patch) | |
tree | 2e81f5f914b59f332e54d6802c942224d5f37ff6 /old | |
parent | fc61a4a525846fa31ee2288df4e82f745bb39c95 (diff) | |
download | godo-b765715b4795ce4bc8940c7b1a1092a78550de94.tar.gz godo-b765715b4795ce4bc8940c7b1a1092a78550de94.zip |
The 1st prompt to record file changed by process
To record it, we must listen to open/write and several syscalls,
and now I've add open into the 2nd coroutine. In syscall open,
what we should do is to judge the permission flag (the 2nd param
in the syscall), to find out if it can write to the file. If so,
the exit code is its file descriptor, and when write is called, the
audit shows only file descriptor but no file name.
So the next step is to add things into 3rd coroutine, to make the
whole program running again, and find out bugs.
Diffstat (limited to 'old')
-rwxr-xr-x | old/au.sh | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/old/au.sh b/old/au.sh new file mode 100755 index 0000000..66da315 --- /dev/null +++ b/old/au.sh | |||
@@ -0,0 +1,24 @@ | |||
1 | #!/bin/bash | ||
2 | |||
3 | ########################################################################## | ||
4 | # File Name : au.sh | ||
5 | # Encoding : utf-8 | ||
6 | # Author : We-unite | ||
7 | # Email : weunite1848@gmail.com | ||
8 | # Created Time : 2024-07-25 17:56:49 | ||
9 | ########################################################################## | ||
10 | |||
11 | set -e | ||
12 | |||
13 | if [ $EUID -ne 0 ]; then | ||
14 | echo -e "Please run as root/sudo" | ||
15 | exit 1 | ||
16 | fi | ||
17 | |||
18 | auditctl -D | ||
19 | |||
20 | fileSyscall="open write creat unlink mkdir rmdir chmod fchmod chown fchown lchown flock" | ||
21 | for syscall in $fileSyscall; do | ||
22 | auditctl -a exit,always -F arch=b64 -S $syscall | ||
23 | done | ||
24 | |||