Skip to content

Instantly share code, notes, and snippets.

@mustafakirimli
Created January 13, 2019 11:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mustafakirimli/83735fab732b73693cc193c786dac204 to your computer and use it in GitHub Desktop.
Save mustafakirimli/83735fab732b73693cc193c786dac204 to your computer and use it in GitHub Desktop.
Create recursive zip file to test email security solutions whether blocking recursively zipped files
#!/bin/bash
REC_COUNT=40
echo "This script gonna create a zip file and make it ${REC_COUNT} times zipped resursively"
sleep 2
echo "test content" > test0.txt
zip -r test0.zip test0.txt
for i in $(seq 1 $REC_COUNT)
do
zip -r "test${i}.zip" "test$(($i-1)).zip"
echo "zipping $i times"
done
echo "Creating final zip file"
mv "test${REC_COUNT}.zip" final-test-file.zip
echo "Cleaning up temp files"
rm -f test*
echo "Your ${REC_COUNT} times zipped file created: final-test-file.zip"
echo "Done!"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment