Exploiting PATH Variable

Important considerations

  1. What folders are located under $PATH
    • echo $PATH
  2. Does your current user have write privileges for any of these folders?
    • find / -writable 2>/dev/null | cut -d "/" -f 2 | sort -u
    • Can pipe to grep for specific folder names
  3. Can you modify $PATH?
    • export PATH=/tmp:$PATH
  4. Is there a script/application you can start that will be affected by this vulnerability?
    • Create scripts/binaries in PATH locations that will be called by root scripts