aboutsummaryrefslogtreecommitdiff
path: root/archival/tar_symlink_attack
blob: 35455f2000cff376517e69909f84972b2c0384f3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#!/bin/sh
# Makes "symlink attack" tarball (needs GNU tar for --append)

true >anything.txt
tar cvf tar_symlink_attack.tar anything.txt
rm anything.txt

ln -s /tmp symlink
tar --append -f tar_symlink_attack.tar symlink
rm symlink

mkdir symlink
echo BUG >symlink/bb_test_evilfile
tar --append -f tar_symlink_attack.tar symlink/bb_test_evilfile
rm symlink/bb_test_evilfile
rmdir symlink