Created
August 18, 2014 06:28
-
-
Save miaoski/d23ab13066ae9d0dd436 to your computer and use it in GitHub Desktop.
HITCON2014 Tarmful
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
#!/bin/bash | |
for n in `seq 145 -1 1`; do | |
FN=`ls $n` | |
echo "$n -- $FN" | |
echo "$FN" | grep -q bz && tar jfxv "$n/$FN" && continue | |
echo "$FN" | grep -q gz && tar zfxv "$n/$FN" && continue | |
echo "$FN" | grep -q xz && tar Jfxv "$n/$FN" && continue | |
echo "$FN" | grep -i -q zip && unzip "$n/$FN" && continue | |
file "$n/$FN" | grep -q bz && tar jfxv "$n/$FN" && continue | |
file "$n/$FN" | grep -q gz && tar zfxv "$n/$FN" && continue | |
file "$n/$FN" | grep -q xz && tar Jfxv "$n/$FN" && continue | |
file "$n/$FN" | grep -i -q zip && unzip "$n/$FN" && continue | |
break | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment