-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathscanmail.sh
executable file
·51 lines (42 loc) · 898 Bytes
/
scanmail.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
#!/bin/bash
###
# This is the InfoSec automated Outlook PST examination script v 0.1
# created by Kevin T. Neely
#
# -= Version History =-
#
# 0.2
# - now takes a directory as argument and analyzes all PSTs in the dir.
#
# 0.1 Initial Version
# - must specify one PST
# - extracts PST to a temporary space
# - scans the PST with ClamAV
# Test for the arguments
function testargs {
if [ $1 ] && [ $2 ]
then
echo "Extracting PST..."
else
echo "This script takes two arguments:"
echo "1) The directory containing the PST"
echo "2) The destination for the extracted data"
echo " "
echo "Usage: scanmail.sh /path/to/pst /tmp/maildata"
echo " "
exit
fi
}
FILES=$2/*.pst
function extractmail {
/usr/bin/readpst -SDq -o $2 $f
}
function scandata {
clamscan -r --infected $2
}
for f in ${FILES}
do
extractmail
#testargs
extractmail
scandata