pablodav / burp_server_reports

helpful reports for burp backup and restore
MIT License
9 stars 0 forks source link

email_outdated does not fully read email_from #13

Closed roms2000 closed 7 years ago

roms2000 commented 7 years ago

When I use /usr/bin/burp-reports -c /etc/burp/burp-reports.conf --report email_outdated the "from user" is not correctly set.

Here is the email_notification section :

[email_notification]
smtp_port = 25
foot_notes = A sample notes
email_to = me@free.fr
smtp_password =
smtp_login =
smtp_mode = normal
email_from = burp-reports@mydomain.com
subject = burp report from jupiter.mydomain.com
smtp_server = localhost

And here is the postfix log : août 23 12:51:23 jupiter.cmydomain.com postfix/smtpd[28565]: NOQUEUE: reject: RCPT from localhost[127.0.0.1]: 504 5.5.2 <u>: Sender address rejected: need fully-qualified address; from=<u> to=<me@free.fr> proto=ESMTP helo=<jupiter.mydomain.com>

Its like if Burp Report is only reading the 2nd letter of email_from.

roms2000 commented 7 years ago

Well, in file burp_reports/lib/email.py :

    def compose_email(self):
        # Define variables to use

        text_content = self.msg
        preferred_encoding = 'iso-8859-1'
        text_encoding = 'iso-8859-1'
        # date = email.utils.formatdate(time.time(), localtime=True)
        # Compose the email in payload, mail_from, rcpt_to, msg_id

        payload, mail_from, rcpt_to, msg_id = pyzmail.compose_mail(
            self.sender,
            self.recipients,
            self.subject,
            preferred_encoding,
            (text_content, text_encoding),
            html=None,
            attachments=self.attachments)

        return payload, mail_from, rcpt_to, msg_id

should be replace with :

    def compose_email(self):
        # Define variables to use

        text_content = self.msg
        preferred_encoding = 'iso-8859-1'
        text_encoding = 'iso-8859-1'
        # date = email.utils.formatdate(time.time(), localtime=True)
        # Compose the email in payload, mail_from, rcpt_to, msg_id

        payload, mail_from, rcpt_to, msg_id = pyzmail.compose_mail(
            (self.sender, self.sender),
            self.recipients,
            self.subject,
            preferred_encoding,
            (text_content, text_encoding),
            html=None,
            attachments=self.attachments)

        return payload, mail_from, rcpt_to, msg_id

Please note (self.sender, self.sender) instead of self.sender

pablodav commented 7 years ago

Great!

So seems only exactly this is required:

line 88:

https://github.com/pablodav/burp_server_reports/blob/master/burp_reports/lib/email.py#L88

from:

self.sender,

to:

(self.sender, self.sender),

right?

Will add this change and perform the tests.

I'm using this in prod environment and haven't noticed the error, it is working fine as it is but will try it and if nothing fails will add to next release.

Thanks!

roms2000 commented 7 years ago

Yes, it's right. Version of my pyzmail and pyzmail36 is 1.0.3

pablodav commented 7 years ago

fixed and uploaded to pypi as new version 1.2.6