Analyse a forensic target (such as a directory) to find and report files found and not found from CIRCL hashlookup public service - https://circl.lu/services/hashlookup/
Use one and only one approach for string interpolation.
What?
All but one interpolation tasks for strings are solved per f-strings.
The requests get call uses the good all format method on strings for construction of the address parameter.
How?
This is just a proposal with single line scope that shall ease maintenance and thus maybe a diff is enough to either implement or kindly ignore the change suggested:
diff --git a/bin/hashlookup-analyser.py b/bin/hashlookup-analyser.py
index f59dfec..e9e1845 100644
--- a/bin/hashlookup-analyser.py
+++ b/bin/hashlookup-analyser.py
@@ -36,7 +36,7 @@ if not args.dir:
def lookup(value=None):
if value is None:
return False
- r = requests.get('https://hashlookup.circl.lu/lookup/sha1/{}'.format(value), headers=headers)
+ r = requests.get(f'https://hashlookup.circl.lu/lookup/sha1/{value}', headers=headers)
return r.json()
Why?
Use one and only one approach for string interpolation.
What?
All but one interpolation tasks for strings are solved per
f-strings
. The requests get call uses the good all format method on strings for construction of the address parameter.How?
This is just a proposal with single line scope that shall ease maintenance and thus maybe a diff is enough to either implement or kindly ignore the change suggested: