/** * nologin.c * sample tool that giving shell access for specific uid only * made by ev1lut10n */ #include <stdio.h> #include <stdlib.h> #include <unistd.h> int main() { int uid = getuid(); /**579,531,578,580**/ int s = 0; if(uid == 0) { printf("sorry no root access allowed here"); } else { switch(uid) { case 579: s = 1; break; case 531: s = 1; break; case 578: s = 1; break; case 580: s = 1; break; default: printf("\n[-] no shell access !\n"); } } if(s == 1) { execve("/bin/sh", 0, 0); } return 0; }
Ok, jadi kode di atas sebenarnya bisa dibuat sederhana seperti ini:
#include <stdio.h> #include <unistd.h> int main() { switch(getuid()) { case 0: printf("sorry no root access allowed here\n"); break; case 579: case 531: case 578: case 580: execve("/bin/sh", 0, 0); break; default: printf("[-] no shell access !\n"); break; } return 0; }
Ok, sekian dan terima kasih.
2 comments:
nah hayo siapa itu yang nulis kode nya, harusnya terima kasih ini sama bang problem, itung2 di ajarin gtu .
emang dah bang problem paling kece :D
Post a Comment
Mari-mari sini kita kasih gratis buat komennya kakaaaak...