mail_to_misp icon indicating copy to clipboard operation
mail_to_misp copied to clipboard

Fake SMTP

Open vedd3r opened this issue 5 years ago • 4 comments

Hi guys,

I'm trying to setup mail2misp fake smtp to act as a spamtrap. However, following the README to setup a spamtrap I was presented with 2 errors when I ran sudo python3 fake_smtp.py:

  1. missing aiosmtpd - which I rectified by using pip3 install aiosmtpd.
  2. Once aiosmtpd was installed, I re-ran the sudo command again and was presented with the below error:

misp@dev002:/usr/local/src/mail_to_misp$ ln -s mail_to_misp_config.py fake_smtp_config.py misp@dev002:/usr/local/src/mail_to_misp$ ls -l fake_smtp_config.py lrwxrwxrwx 1 misp misp 22 Sep 16 06:46 fake_smtp_config.py -> mail_to_misp_config.py misp@dev002:/usr/local/src/mail_to_misp$ sudo python3 fake_smtp.py Traceback (most recent call last): File "fake_smtp.py", line 62, in binpath = config.binpath AttributeError: module 'fake_smtp_config' has no attribute 'binpath' misp@dev002:/usr/local/src/mail_to_misp$

Any thoughts? I saw the fake_smtp_config.py-sample and created a symlink name fake_smtp_config.py pointing to the sample file. It ran but I can only see port 2525 listening on localhost but not port 25 (assuming it will use the smtp port to listen and catch incoming emails). Any pointers?

Thanks

vedd3r avatar Sep 16 '19 06:09 vedd3r

Looks like your config doesn't contain binpath or the config file doesn't exist. Can you double check?

rommelfs avatar Sep 18 '19 13:09 rommelfs

for (1) please feel free to create a pull request with your fix in the requirements file.

rommelfs avatar Sep 18 '19 13:09 rommelfs

@rommelfs Apologies for the late response as I was pretty busy the past weeks.

I've used another approach by redirecting the emails using postfix aliases instead. That solved the problem except that the behavior when changing spamtrap = True in the mail2misp config, it does not process the links/urls and add them as url object. I would assume it has something related to when setting the spamtrap parameter to True, it should treat all url/links as Network activity/url instead of External analysis/link.

m2m_config

misp_entry

Should I close this one and create a new issue?

vedd3r avatar Oct 09 '19 15:10 vedd3r

Added aiosmtp.

SteveClement avatar Oct 01 '21 03:10 SteveClement