-
Notifications
You must be signed in to change notification settings - Fork 314
/
Copy pathcheck_png.sh
executable file
·143 lines (114 loc) · 3.56 KB
/
check_png.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
#!/bin/bash
FILE=$1
TMP_FILE=/tmp/out
RED='\033[0;31m'
NO_COLOR='\033[0m'
check_result_file() {
RESULT_FILE=$1
if [ ! -f "$RESULT_FILE" ]; then
echo "Nothing found..."
return
fi
SIZE=`stat -c %s "$RESULT_FILE"`
if [ ! "`file $RESULT_FILE`" = "$RESULT_FILE: data" ] && [ $SIZE -ge 1 ]; then
echo ""
echo -e "${RED}Found something!!!${NO_COLOR}"
echo "Result size: $SIZE (type: '`file $RESULT_FILE`')"
echo "--------------"
head -n 20 $RESULT_FILE
echo "--------------"
else
echo ""
echo "Probably no result..."
echo "Result size: $SIZE (type: '`file $RESULT_FILE`')"
fi
rm $RESULT_FILE
}
echo
echo "#################################"
echo "########## PNG CHECKER ##########"
echo "#################################"
echo "Checking file $FILE"
echo
file $FILE
echo "identify $FILE:"
identify -verbose $FILE
echo
echo "##############################"
echo "########## exiftool ##########"
echo "##############################"
exiftool $FILE
echo
echo "#############################"
echo "########## binwalk ##########"
echo "#############################"
binwalk $FILE
echo
echo "################################"
echo "########## stegdetect ##########"
echo "################################"
stegdetect $FILE
echo
echo "#############################"
echo "########## strings ##########"
echo "#############################"
strings $FILE | head -n 20
echo "..."
strings $FILE | tail -n 20
echo
echo "###########################"
echo "########## zsteg ##########"
echo "###########################"
echo
echo "Watch out for red output. This tool shows lots of false positives..."
zsteg $FILE -a
echo
echo "###############################"
echo "########## openstego ##########"
echo "###############################"
openstego extract -sf $FILE -p "''" -xf $TMP_FILE
check_result_file $TMP_FILE
echo
echo "#################################"
echo "########## stegano-lsb ##########"
echo "#################################"
for ENCODING in UTF-8 UTF-32LE; do
echo "- stegano-lsb (encoding $ENCODING)"
stegano-lsb reveal --input $FILE -e $ENCODING -o $TMP_FILE
check_result_file $TMP_FILE
done
echo
echo "#####################################"
echo "########## stegano-lsb-set ##########"
echo "#####################################"
# TODO: check why stegano is so buggy...
# - geneators not working: ackermann ackermann_naive (require arguments - how to parse?)
for GENERATOR in composite eratosthenes fermat fibonacci identity log_gen mersenne triangular_numbers; do
# generator 'carmichael' left out since it is slow
for ENCODING in UTF-8 UTF-32LE; do
echo "- stegano-lsb-set (generator $GENERATOR | encoding $ENCODING)"
stegano-lsb-set reveal --input $FILE -e $ENCODING -g $GENERATOR -o $TMP_FILE
check_result_file $TMP_FILE
done
done
echo
echo "#################################"
echo "########## stegano-red ##########"
echo "#################################"
stegano-red reveal --input $FILE
echo
echo "##############################"
echo "########## LSBSteg ##########"
echo "##############################"
# seems to fail most of the time we did not encode something with it
# no file will be created in these cases
LSBSteg decode -i $FILE -o $TMP_FILE 2>/dev/null
check_result_file $TMP_FILE
echo
echo "##################################"
echo "########## stegoVeritas ##########"
echo "##################################"
UUID=`cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1`
TMP_DIR=/data/stegoVeritas/$UUID
mkdir -p $TMP_DIR
stegoveritas $FILE -out $TMP_DIR -meta -imageTransform -colorMap -trailing