def GoSend(group):
pages = api.pages.get()
for page in pages:
if (page.name == 'test'):
toSendPage = page
templates = api.templates.get()
for template in templates:
if (template.name == 'Key'):
toSendTemplate = template
senders = api.smtp.get()
for sender in senders:
if (sender.name == 'UWP keygen'):
toSendSmtp = sender
# toSendGroup = [Group(name=group.name)]
# toSendPage = Page(name='test')
# toSendTemplate = Template(name='Key')
# toSendsmtp = SMTP(name='UWP keygen')
toSendUrl = "<redacted>"
campaign = Campaign(
name=group.name, groups=group, page=toSendPage,
template=toSendTemplate, smtp=toSendSmtp, url=toSendUrl)
result = api.campaigns.post(campaign)
debug("[*] {} GoSend complete".format(ln()))
return result
I am getting the following error :
.
.
.
File "/usr/local/lib/python3.7/dist-packages/gophish/api/campaigns.py", line 20, in post
return super(API, self).post(campaign)
File "/usr/local/lib/python3.7/dist-packages/gophish/api/api.py", line 92, in post
raise Error.parse(response.json())
gophish.models.Error: Invalid JSON structure
I am facing a problem with invalid JSON structure
I am getting the following error :