Created
October 24, 2017 13:05
-
-
Save achateigner/0e7eb18f682424a69dfdf6ca212f7603 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
excelRemoveProtection(){ | |
echo "Usage: exelRemoveProtection fichier.xlsx" | |
unzip "$1" -d tmp | |
cd tmp/xl/worksheets/ | |
for i in "$(ls *.xml)" ; do | |
sed -i 's/Protection password="[A-Za-z0-9]*"/Protection password=""/' $i | |
echo "Hacked $i" | |
done | |
cd .. | |
sed -i 's/Protection workbookPassword="[A-Za-z0-9]*"/Protection workbookPassword=""/' workbook.xml | |
cd .. | |
zip -r "../$1" * | |
cd .. | |
rm -r tmp | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment