chrismaddalena/Goreport

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

Opened this issue · 1 comments

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.

  • The goreport.config file has the correct API which I can access when GoReport references the API Authorization Endpoint.
    The API Authorization endpoint is: https://xxxxxxxxxx.com:65333/api/campaigns/?api_key=bc7xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
  • Campaign ID # 4 does indeed exist
  • I can see in the logs that the request to the API endpoint is successful
    time="2024-08-02T09:39:02-06:00" level=info msg="X.X.X.X - - [02/Aug/2024:09:39:02 -0600] "GET /api/campaigns/4 HTTP/1.1" 200 12447 "" "python-requests/2.24.0""
  • The --format quick seems to work as it displays the stats to the console, but it still says "looks like Campaign ID 4 does not exist" although it does
    Status: Completed
    Created: 15:36:33 on 2024-08-01
    Started: 15:34:00Z on 2024-08-01
    Completed: 14:57:06 on 2024-08-02

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

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.