2019-05-11 09:19:25 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
2019-05-27 05:31:57 +00:00
|
|
|
set -e -x
|
|
|
|
|
2019-05-11 09:19:25 +00:00
|
|
|
# Download URLhaus database
|
2019-05-27 06:29:08 +00:00
|
|
|
wget https://urlhaus.abuse.ch/downloads/text/ -O ../src/URLhaus.txt
|
2019-05-11 09:19:25 +00:00
|
|
|
|
|
|
|
# Download Cisco Umbrella 1 Million
|
|
|
|
wget https://s3-us-west-1.amazonaws.com/umbrella-static/top-1m.csv.zip -O top-1m.csv.zip
|
|
|
|
|
|
|
|
cp ../src/exclude.txt .
|
2019-05-27 06:29:08 +00:00
|
|
|
|
|
|
|
## Clean up URLhaus.txt
|
|
|
|
cat ../src/URLhaus.txt | \
|
|
|
|
# Convert DOS to Unix line ending
|
|
|
|
dos2unix | \
|
2019-05-28 00:29:02 +00:00
|
|
|
# Remove comment
|
2019-05-28 01:03:07 +00:00
|
|
|
sed 's/^#.*//g' | \
|
2019-05-27 06:29:08 +00:00
|
|
|
# Remove http(s)://
|
2019-05-28 03:02:08 +00:00
|
|
|
cut -f 3- -d '/' | \
|
|
|
|
# Remove www.
|
2019-05-27 06:29:08 +00:00
|
|
|
sed 's/^www\.//g' | \
|
2019-05-28 00:29:02 +00:00
|
|
|
sort -u > urlhaus.txt
|
2019-05-28 03:02:08 +00:00
|
|
|
|
|
|
|
## Parse domain and IP address only
|
|
|
|
cat urlhaus.txt | \
|
|
|
|
cut -f 1 -d '/' | \
|
|
|
|
cut -f 1 -d ':' | \
|
|
|
|
sort -u > urlhaus-domains.txt
|