Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions modules/report.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import os
import pandas as pd
import json
from colorama import init, Fore, Style

# Initialize colorama
Expand Down Expand Up @@ -32,6 +33,14 @@ def write_to_excel(data, file_name="output.xlsx"):
else:
pd.DataFrame(data).to_excel(file_name, index=False)

def output_json(results):
output = []
for result in results:
output.append(result)
print(json.dumps(output))




def printer(**kwargs):
"""Utility function to print the results of DMARC, SPF, and BIMI checks in the original format."""
Expand Down
5 changes: 4 additions & 1 deletion spoofy.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,14 +107,15 @@ def main():
parser.add_argument(
"-o",
type=str,
choices=["stdout", "xls"],
choices=["stdout", "xls", "json"],
default="stdout",
help="Output format: stdout or xls (default: stdout).",
)
parser.add_argument(
"-t", type=int, default=4, help="Number of threads to use (default: 4)"
)


args = parser.parse_args()

if args.d:
Expand Down Expand Up @@ -142,6 +143,8 @@ def main():
if args.o == "xls" and results:
report.write_to_excel(results)
print("Results written to output.xlsx")
elif args.o == "json" and results:
report.output_json(results)

for _ in range(len(threads)):
domain_queue.put(None)
Expand Down