Skip to content

SpiderFoot automates OSINT for threat intelligence and mapping your attack surface.

Log console output even if json output is selected, and verify the output format chosen.

smicallefe8abcefde62f
diff --git a/sf.py b/sf.py
index 71b9353d..629dc67c 100755
--- a/sf.py
+++ b/sf.py
@@ -147,7 +147,7 @@ def main():
log.setLevel(logging.INFO)
sfConfig['_debug'] = False
- if args.q or args.o == "json":
+ if args.q:
log.setLevel(logging.NOTSET)
sfConfig['__logging'] = False
@@ -341,6 +341,9 @@ def start_scan(sfConfig, sfModules, args):
sfp__stor_stdout_opts['_requested'] = args.F.split(",")
sfp__stor_stdout_opts['_showonlyrequested'] = True
if args.o:
+ if args.o not in ["tab", "csv", "json"]:
+ log.error("Invalid output format selected. Must be 'tab', 'csv' or 'json'.")
+ sys.exit(-1)
sfp__stor_stdout_opts['_format'] = args.o
if args.t:
sfp__stor_stdout_opts['_requested'] = args.t.split(",")