Added Level 12.0 ~ 12.1 of KernelSecurity in PwnCollege

This commit is contained in:
Jack Ren
2024-10-03 18:54:15 +08:00
parent f507def800
commit 5537ec2174
2 changed files with 96 additions and 0 deletions

View File

@@ -0,0 +1,17 @@
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <string.h>
#include <sys/ioctl.h>
#include <fcntl.h>
#include <unistd.h>
int main(int argc, char* argv[]) {
int fd = open("/home/hacker/KernelSecurity/Level12.0/output.txt", O_WRONLY | O_APPEND | O_CREAT, 0644);
for (int i = 1; i < argc; i++) {
write(fd, argv[i], strlen(argv[i]));
write(fd, "\n", 1);
}
close(fd);
return 0;
}