societe-generale / swordphish-awareness

Swordphish Phishing Awareness Tool
https://societe-generale.github.io/swordphish-awareness/
GNU General Public License v3.0
220 stars 51 forks source link

Problem resuming failed campaign #13

Open zkikvidze opened 5 years ago

zkikvidze commented 5 years ago

Hi,

I encoutered problem when using Swordphish and was not able to solve it by myself, so i am reporting it here.

After i started my campaign for large number of targets, in the middle of sending emails, Swordphish just stopped to send new ones, so most of the targets did not receive emails.

I found that file swordphish_celery_worker.log contains error about this issue:


[2019-10-21 07:52:00,933: ERROR/ForkPoolWorker-2] Task Main.tasks.start_campaign[162a590a-8383-4657-ae04-2dc79e69ea31] raised unexpected: SMTPSenderRefused(421, b'4.4.1 Connection timed out', 'REDACTED')

Traceback (most recent call last):

  File "/home/swordphish/.virtualenvs/swordphish/lib/python3.6/site-packages/celery/app/trace.py", line 382, in trace_task

    R = retval = fun(*args, **kwargs)

  File "/home/swordphish/.virtualenvs/swordphish/lib/python3.6/site-packages/celery/app/trace.py", line 641, in __protected_call__

    return self.run(*args, **kwargs)

  File "/home/swordphish/swordphish/Main/tasks.py", line 59, in start_campaign

    campaign.start()

  File "/home/swordphish/swordphish/Main/models.py", line 587, in start

    attachment_content

  File "/home/swordphish/swordphish/Main/models.py", line 547, in __sendemailwithattachment

    email.send(fail_silently=False)

  File "/home/swordphish/.virtualenvs/swordphish/lib/python3.6/site-packages/django/core/mail/message.py", line 294, in send

    return self.get_connection(fail_silently).send_messages([self])

  File "/home/swordphish/.virtualenvs/swordphish/lib/python3.6/site-packages/django/core/mail/backends/smtp.py", line 110, in send_messages

    sent = self._send(message)

  File "/home/swordphish/.virtualenvs/swordphish/lib/python3.6/site-packages/django/core/mail/backends/smtp.py", line 126, in _send

    self.connection.sendmail(from_email, recipients, message.as_bytes(linesep='\r\n'))

  File "/usr/lib/python3.6/smtplib.py", line 867, in sendmail

    raise SMTPSenderRefused(code, resp, from_addr)

smtplib.SMTPSenderRefused: (421, b'4.4.1 Connection timed out', 'REDACTED') 

As the error says, Swordphish received 'Connection timed out' from email server and after this, it just stopped to send new emails.

I was noy able to continue sending emails manually. It would be great if that was possible.

Hope someone can fix this issue.

Thank you for creating such a great software!

Heat-Miser commented 5 years ago

Hello,

indeed it's not trivial to resume a campaign, it can be done using Django's shell but there is not such feature in the tool.

Have you been able to identify the problem that lead to this timeout ?

I keep this issue open and I'll think about adding such feature.

zkikvidze commented 5 years ago

No, unfortunately i was not able to determine root cause. probably email server got 'ddosed'.

If you ll tell me hint to how to resume campaign from django shell, i will be very happy.

Thank you very much!

On Mon, 21 Oct 2019, 14:54 Heat Miser, notifications@github.com wrote:

Hello,

indeed it's not trivial to resume a campaign, it can be done using Django's shell but there is not such feature in the tool.

Have you been able to identify the problem that lead to this timeout ?

I keep this issue open and I'll think about adding such feature.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/certsocietegenerale/swordphish-awareness/issues/13?email_source=notifications&email_token=AAHZKYOI3TBVDXKWCRDGKETQPWC65A5CNFSM4JCYXQZ2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEBZ5G2Q#issuecomment-544461674, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAHZKYN36XNORTXVMF574ADQPWC65ANCNFSM4JCYXQZQ .