chrismaddalena/Goreport

Error with campaign ID when generating report

Closed this issue · 15 comments

[+] A total of 1 campaign IDs have been provided for processing.
[+] GoReport will process the following campaign IDs: 88
[+] Now fetching results for Campaign ID 88 (1/1).
[!] There was a problem fetching this campaign ID's details. Make sure your URL and API key are correct. Check HTTP vs HTTPS!
L.. Details: super() takes at least 1 argument (0 given)
[+] Success!
[!] Looks like campaign ID None does not exist! Skipping it...
[!] There was a problem processing campaign ID 88!
L.. Details: 'NoneType' object has no attribute 'timeline'

Any suggestions on how to fix this?
btw, both url and id are correct and im running http.

Hi Chris,

I experience the same issue here, please help to fix this.

Hey Chris,

Getting the same issue, please help!

Facing same issue , kindly guide to resolve
Thanks

I am using version 0.9.0. I even tried to copy the database to the older version op Gophish, where Goreport used to work in the past, and that didn't work as well. Perhaps it has something to do with campaigns that have been conducted via the latest version?

I traced the issue to error :
urllib3.exceptions.LocationParseError: Failed to parse: https://:3333/api/campaigns/

the solution was :

python3 -m pip install --upgrade urllib3

I traced the issue to error :
urllib3.exceptions.LocationParseError: Failed to parse: https://:3333/api/campaigns/

the solution was :

python3 -m pip install --upgrade urllib3

Thanks for the suggestion but it did not work for me. Hope that @chrismaddalena can fix this issue.

I am also facing the same issue.

[+] A total of 1 campaign IDs have been provided for processing.
[+] GoReport will process the following campaign IDs: 5
[+] Now fetching results for Campaign ID 5 (1/1).
[!] There was a problem fetching this campaign ID's details. Make sure your URL and API key are correct. Check HTTP vs HTTPS!
L.. Details: Failed to parse: https://:3333/api/campaigns/5
[+] Success!
[!] Looks like campaign ID None does not exist! Skipping it...
[!] There was a problem processing campaign ID 5!
L.. Details: 'NoneType' object has no attribute 'timeline'

Okay, so I did some debugging.
The error is triggered here: https://github.com/chrismaddalena/Goreport/blob/master/lib/goreport.py#L433

@kpomeroy1979, did you ran it over HTTP instead of HTTPS? I am digging in the code and I think there is something about that.

@kpomeroy1979 , just tested, it has no effect... I have no idea why it's failing

I followed the trace and I ended up at: https://github.com/chrismaddalena/Goreport/blob/master/lib/goreport.py#L230
This is where the error occurs.

Error code when I put that command outside the try function (to get some actual debug info):

  File "/usr/lib/python3/dist-packages/requests/models.py", line 380, in prepare_url
    scheme, auth, host, port, path, query, fragment = parse_url(url)
  File "/usr/lib/python3/dist-packages/urllib3/util/url.py", line 392, in parse_url
    return six.raise_from(LocationParseError(source_url), None)
  File "<string>", line 2, in raise_from
urllib3.exceptions.LocationParseError: Failed to parse: http://phishysite.com:3333/api/campaigns/23

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "GoReport.py", line 94, in <module>
    parse_options()
  File "/usr/lib/python3/dist-packages/click/core.py", line 764, in __call__
    return self.main(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/click/core.py", line 717, in main
    rv = self.invoke(ctx)
  File "/usr/lib/python3/dist-packages/click/core.py", line 956, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/lib/python3/dist-packages/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/click/decorators.py", line 17, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "GoReport.py", line 91, in parse_options
    gophish.run(id, combine, complete)
  File "/root/tools/Goreport/lib/goreport.py", line 228, in run
    print(self.api.campaigns.get(campaign_id=CAM_ID))    
  File "/usr/local/lib/python3.8/dist-packages/gophish/api/campaigns.py", line 15, in get
    return super(API, self).get(resource_id=campaign_id)
  File "/usr/local/lib/python3.8/dist-packages/gophish/api/api.py", line 88, in get
    return self.request("GET",
  File "/usr/local/lib/python3.8/dist-packages/gophish/api/api.py", line 58, in request
    response = self.api.execute(method, endpoint, json=body)
  File "/usr/local/lib/python3.8/dist-packages/gophish/client.py", line 24, in execute
    response = requests.request(
  File "/usr/lib/python3/dist-packages/requests/api.py", line 61, in request
    return session.request(method=method, url=url, **kwargs)
  File "/usr/lib/python3/dist-packages/requests/sessions.py", line 516, in request
    prep = self.prepare_request(req)
  File "/usr/lib/python3/dist-packages/requests/sessions.py", line 449, in prepare_request
    p.prepare(
  File "/usr/lib/python3/dist-packages/requests/models.py", line 314, in prepare
    self.prepare_url(url, params)
  File "/usr/lib/python3/dist-packages/requests/models.py", line 382, in prepare_url
    raise InvalidURL(*e.args)
requests.exceptions.InvalidURL: Failed to parse: http://phishysite.com:3333/api/campaigns/23

This is as far my knowledge goes... If somebody has an idea, feel free.
This issue might be related:
https://stackoverflow.com/questions/58444298/requests-exceptions-invalidurl-failed-to-parse

Okay I found the fix!

git clone git://github.com/urllib3/urllib3.git
python3 setup.py install

Have a nice weekend guys!