tar_symlink_attack 386 B

12345678910111213141516
  1. #!/bin/sh
  2. # Makes "symlink attack" tarball (needs GNU tar for --append)
  3. true >anything.txt
  4. tar cvf tar_symlink_attack.tar anything.txt
  5. rm anything.txt
  6. ln -s /tmp symlink
  7. tar --append -f tar_symlink_attack.tar symlink
  8. rm symlink
  9. mkdir symlink
  10. echo BUG >symlink/bb_test_evilfile
  11. tar --append -f tar_symlink_attack.tar symlink/bb_test_evilfile
  12. rm symlink/bb_test_evilfile
  13. rmdir symlink