2020-11-17 10:31:08 -05:00
|
|
|
#!/bin/bash
|
2023-12-28 18:14:28 -05:00
|
|
|
#License: CC0
|
2021-07-21 13:44:19 -04:00
|
|
|
#Description: Hypatia conversion script for https://github.com/eset/malware-ioc (BSD-2-Clause)
|
2020-11-17 10:31:08 -05:00
|
|
|
|
2020-07-25 09:21:38 -04:00
|
|
|
processHashes() {
|
|
|
|
local name=$(basename $1);
|
|
|
|
if [ -f $1/samples.$2 ]; then
|
2023-12-16 22:32:39 -05:00
|
|
|
dos2unix $1/samples.$2
|
2020-07-25 09:21:38 -04:00
|
|
|
while IFS= read -r line
|
|
|
|
do
|
2023-12-21 23:26:19 -05:00
|
|
|
echo "$line" >> ./eset.$2;
|
2020-07-25 09:21:38 -04:00
|
|
|
done < "$1/samples.$2";
|
|
|
|
fi;
|
|
|
|
}
|
|
|
|
export -f processHashes;
|
|
|
|
|
|
|
|
find . -maxdepth 2 -mindepth 1 -type d -exec bash -c 'processHashes "{}" md5 hdb' \;
|
|
|
|
find . -maxdepth 2 -mindepth 1 -type d -exec bash -c 'processHashes "{}" sha1 hsb' \;
|
|
|
|
find . -maxdepth 2 -mindepth 1 -type d -exec bash -c 'processHashes "{}" sha256 hsb' \;
|