-
Notifications
You must be signed in to change notification settings - Fork 14
/
run.sh
24 lines (16 loc) · 840 Bytes
/
run.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/bin/sh
echo "[i] Log data in $DATA_DIR/$( date +"%Y-%m-%d")_$1.amass.out"
# Collect data
/bin/amass enum --passive -d $1 -json $DATA_DIR/$( date +"%Y-%m-%d")_$1.amass.json.out
# Extract from json results
jq -M .name $DATA_DIR/$( date +"%Y-%m-%d")_$1.amass.json.out | sed "s/\"//g" | tr -d '\015' | tee -a $DATA_DIR/$( date +"%Y-%m-%d")_$1.amass.out
# sort results
sort -u $DATA_DIR/$( date +"%Y-%m-%d")_$1.amass.out -o $DATA_DIR/$( date +"%Y-%m-%d")_$1.amass.out
# delete tmp file
rm $DATA_DIR/$( date +"%Y-%m-%d")_$1.amass.json.out
# Consolidate with existing results
echo [i] colsolidate results in $DATA_DIR/$( date +"%Y-%m-%d")_$1.out
cat $DATA_DIR/$( date +"%Y-%m-%d")_$1.amass.out >> $DATA_DIR/$( date +"%Y-%m-%d")_$1.out
sort -u $DATA_DIR/$( date +"%Y-%m-%d")_$1.out -o $DATA_DIR/$( date +"%Y-%m-%d")_$1.out
# done
exit 0