FreeBSD rtld 0day exploit

King Cope publish local exploit ini ke FD-Lists. [[email protected] ~/hack]$ uname -a FreeBSD begok.xxxx.de 7.0-STABLE FreeBSD 7.0-STABLE #1: Fri Mar 27 11:24:51 WIT 2009 [email protected]:/usr/obj/usr/src/sys/BEGOK i386 [[email protected] ~/hack]$ ./fbsd-local-2009.sh fbsd-local-2009.sh FreeBSD local r00t zeroday by Kingcope November 2009 env.c: In function 'main': env.c:5: warning: incompatible implicit declaration of built-in function 'malloc' env.c:9: warning: incompatible implicit declaration of built-in function 'strcpy' env.c:11: warning: incompatible implicit declaration of built-in function 'execl' 8:35 /libexec/ld-elf.so.1: environment corrupt; missing value for /libexec/ld-elf.so.1: environment corrupt; missing value for /libexec/ld-elf.so.1: environment corrupt; missing value for /libexec/ld-elf.so.1: environment corrupt; missing value for /libexec/ld-elf.so.1: environment corrupt; missing value for ALEX-ALEX # id uid=1007(bofh) gid=1007(bofh) euid=0(root) groups=1007(bofh) Publikasi ini jelas akan langsung dimanfaatkan dengan cepat oleh para hacker/cracker yang bisa mendapatkan akses local ke mesin-mesin FreeBSD. Rasanya belum ada patch untuk saat ini. So, go wild guys? :p. ** Thanks buat temon untuk testing exploitnya, as currently I don’t have FBSD to test....
Read More of FreeBSD rtld 0day exploit

Typo bugs fmtmsg() on FreeBSD!

FreeBSD hacker juga manusia :P. Hal tersebut terbukti pada sebuah kesalahan kecil yang dibuat oleh developer FreeBSD pada file /usr/src/lib/libc/gen/fmtmsg.c, khususnya yang ada pada fungsi printfmt(). 01    /* 02     * Returns NULL on memory allocation failure, otherwise returns a pointer to 03     * a newly malloc()'d output buffer. 04     */ 05    static char * 06    printfmt(char *msgverb, long class, const char *label, int sev, 07        const char *text, const char *act, const char *tag) 08    { 09            size_t size; 10            char *comp, *output; 11            const char *sevname; 12 13            size = 32; 14        ... 15            if (text != MM_NULLTXT) 16                    size += strlen(text); 17            if (text != MM_NULLACT) 18                    size += strlen(act); 19       ... 20            if ((output = malloc(size)) == NULL) 21       ... 22            return (output); 23    } Seperti diketahui, fmtmsg adalah sebuah sebuah routines yang menghandle display message pada standard error dan atau system console. Berdasarkan manual page dari fmtmsg itu sendiri, kita bisa men-trigger bugs yang dimaksud dengan code sederhana seperti berikut: #include int main(int argc, char * argv[]) { fmtmsg(MM_UTIL | MM_PRINT, "BSD:ls", MM_ERROR, "illegal option -- z", MM_NULLACT, "BSD:ls:001"); return 0; } dan hasilnya… # gcc -o fmtbugs fmtbugs.c # ./fmtbugs Segmentation fault (core dumped) Ok, kenapa bisa kondisi Segfault terjadi?. Hal tersebut terjadi karena pada saat variable “MM_NULLACT” di check apakah bernilai NULL atau tidak, developer FreeBSD ‘tidak sengaja’ mengambil argument ‘text’ yang pada contoh code diatas bernilai “illegal option — z” dan tentunya akan terjadi segmentation fault karena mengambil nilai yang salah. Seharusnya nilai yang diambil adalah argument ‘act’ yang pada contoh code diatas bernilai MM_NULLACT. Info bugs ini di ambil dari link XORL blog dan FreeBSD Official site....
Read More of Typo bugs fmtmsg() on FreeBSD!