chrismaddalena / Goreport

A Python script to collect campaign data from Gophish and generate a report
BSD 3-Clause "New" or "Revised" License
180 stars 50 forks source link

'NoneType' object is not iterable (I used EvilGoPhish) #40

Open kpomeroy1979 opened 3 months ago

kpomeroy1979 commented 3 months ago

Hello there,

I am using an alternative GoPhish project called "EvilGoPhish". Ive never had an issue with the Goreport using the regular GoPhish software and this is the first time I've tried to generate a report after running a phishing campaign using EvilGoPhish.

We recently ran a phishing campaign and I wanted to generate a report. The campaign has been 'completed' in EvilGoPhish. When I run the following command I get an error 'NoneType' object is not iterable.

Total Targets: 56 Emails Sent: 0 IPs Seen: 42

Total Opened Events: 0 Total Click Events: 48 Total Submitted Data Events: 9

Individuals Who Opened: 42 Individuals Who Clicked: 42 Individuals Who Entered Data: 2 Individuals Who Reported the Email: 0

Any ideas? Could it have something to do with the EvilGoPhish vs GoPhish setup?

[+] A total of 1 campaign IDs have been provided for processing. [+] GoReport will process the following campaign IDs: 4 [+] Now fetching results for Campaign ID 4 (1/1). [+] Success! [!] Looks like campaign ID 4 does not exist! Skipping it... [+] Building the report -- you selected a Word/docx report. [+] Looking for the template.docx to be used for the Word report. [+] Template was found -- proceeding with report generation... L.. Word reports can take a while if you had a lot of recipients.

[+] Finished writing high level summary... [!] There was a problem processing campaign ID 4! L.. Details: 'NoneType' object is not iterable

chrismaddalena commented 3 months ago

It's hard to say what the issue is from the available information. If everything works as expected with Gophish, it's possible EvilGophish does something different. The error suggests there's something the script expects to get from the API that shouldn't be empty or None, but the result is None and an error raises when Goreport tries to iterate over it. The script tries to iterate over different results after it prints [+] Finished writing high level summary..., so the problem probably lies with one of the results in one of those for loops. It's been a long time since I've looked at Gophish, so I don't know if anything has changed.