-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsystest.c
More file actions
127 lines (126 loc) · 2.92 KB
/
systest.c
File metadata and controls
127 lines (126 loc) · 2.92 KB
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
#include <time.h>
#include <stdio.h>
#include <sys/mount.h>
#include <fcntl.h>
#include <sys/ioctl.h>
#include <sys/uio.h>
#include <ustat.h>
#include <sys/swap.h>
#include <sys/vfs.h>
#include <sys/io.h>
#include <sys/file.h>
#include <sys/mman.h>
#include <sys/select.h>
#include <sys/quota.h>
#define _GNU_SOURCE /* See feature_test_macros(7) */
#include <signal.h>
#include <poll.h>
#include <sys/epoll.h>
#include <sys/sendfile.h>
#include <sys/syscall.h>
#include <linux/aio_abi.h>
#include <sys/inotify.h>
#include <sys/mman.h>
int main(){
mknod ("/home/mohammad/Desktop/mknod", 'b',0);
lseek (2,2,2);
fstat(0,NULL);
mount(NULL,NULL,NULL,0,NULL);
faccessat(0,NULL,0,0);
//nice(-100); Converts to getpriority() sand setpriority()
dup(-100);
int test[2] ={1,2};
pipe(test);
umount("/home/nothing");
ioctl(-1,-1000);
fcntl(-1,-1);
umask(0777);
chroot(NULL);
dup2(-100,-200);
readlink("/sss",NULL,6);
readlinkat(-10,"/sss",NULL,6);
swapon("/sssss",-100);
swapoff("/sssssss");
truncate("/sssss",100);
ftruncate(-1000,-100);
chmod ("/ddddd",100);
fchmod(-1000,100);
fchmodat(-1000,"/sss",-100,-100);
statfs("/ss",NULL);
fstatfs(-100,NULL);
ioperm(-10000,-100000,-100000);
iopl(-1000);
fsync(-1000);
fdatasync(-1000);
quotactl(-100,NULL,-100,NULL);
chdir(NULL);
fchdir(-100);
lseek(-100,10,-10);
select (-10,NULL,NULL,NULL,NULL);
flock (-100,-100);
msync(NULL,100,100);
readv(-10,NULL,-10);
writev(-10,NULL,-10);
preadv(-10,NULL,-10,-10);
pwritev(-10,NULL,-10,-10);
poll(NULL,-10,-10);
pread(-10,NULL,-10,-10);
pwrite(-10,NULL,-10,-10);
sendfile(-10,-10,NULL,-10);
stat(NULL,NULL);
lstat(NULL,NULL);
chown(NULL,-100,-100);
fchown(-10,-10,-10);
lchown(NULL,-10,-10);
// setfsuid harmful
// setfsgid harmful
// pivot_root(NULL,NULL);
syscall(SYS_readahead,-10, 0,NULL,NULL,-10);
syscall(SYS_io_setup);
syscall(SYS_io_destroy);
syscall(SYS_io_getevents);
syscall(SYS_io_submit);
syscall(SYS_io_cancel);
posix_fadvise(-100,-10,-10,-10);
epoll_create(-10);
epoll_create1(-19);
epoll_ctl(-100,-100,-1000,NULL);
epoll_wait(-100,NULL,-100,-100);
epoll_pwait(-100,NULL,-100,-10,NULL);
syscall(SYS_ioprio_get);
syscall(SYS_ioprio_set);
inotify_add_watch(-10,NULL,-10);
inotify_rm_watch(-100,-100);
unlinkat(-10,NULL,-10);
renameat(-10,NULL,-10,NULL);
rename(NULL,NULL);
link(NULL,NULL);
linkat(-10,NULL,-10,NULL,-10);
symlinkat(NULL,-10,NULL);
symlink(NULL,NULL);
readlink(NULL,NULL,10);
readlinkat(-10,NULL,NULL,-10);
chmod(NULL,777);
fchmod(-10,777);
fchmodat(-10,NULL,777,-1);
access(NULL,-10);
syscall(SYS_sync_file_range);
syscall(SYS_splice);
syscall(SYS_tee);
syscall(SYS_open);
syscall(SYS_creat);
syscall(SYS_openat);
syscall(SYS_mkdir);
syscall(SYS_mkdirat);
syscall(SYS_mknod);
syscall(SYS_mknodat);
syscall(SYS_chown);
syscall(SYS_fchown);
syscall(SYS_lchown);
syscall(SYS_fchownat);
return 0;
}