This tool was developed by Serafin Cepeda @ Kulkan Security to validate the SPF, DKIM and DMARC setup of the domains provided following Security Industry standards and, if issues are detected, it provides an structured report in an easy to read output format.
The following libraries were used in this project:
| Library | Purpose |
|---|---|
| dnspython | DNS toolkit for Python, used to query the DNS Records. |
| colorama | ANSI Escape Character sequences for adding color to the console output. |
| tabulate | Pretty-print for representing data in tables with Python. |
| cryptography | Cryptography functions for Python, used for parsing and validating DKIM Keys. |
First, it is recommended to create a Python virtual environment to install the dependencies:
$ python -mvenv venv
$ . ./venv/bin/activate
$ pip install -r requirements.txt
Once the dependencies are installed, you can simply run:
$ python mxchecksec.py --help
usage: mxchecksec.py [-h] [--file FILE] [--dkim-selectors DKIM_SELECTORS [DKIM_SELECTORS ...]] [--dns-server DNS_SERVER] [--no-color] [domains [domains ...]]
MXCheckSec - Email security validation tool
Validates SPF, DKIM, and DMARC records for given domains based on Security Industry testing standards,
and provides a report in an easy to read output format.
Version: 1.0.0 - Developed by Serafin Cepeda @ Kulkan Security [www.kulkan.com] - Penetration testing by creative minds.
positional arguments:
domains Domain(s) to analyze
optional arguments:
-h, --help show this help message and exit
--file FILE, -f FILE File containing list of domains (one per line)
--dkim-selectors DKIM_SELECTORS [DKIM_SELECTORS ...], -s DKIM_SELECTORS [DKIM_SELECTORS ...]
Custom DKIM selectors to check (in addition to common ones)
--dns-server DNS_SERVER, -d DNS_SERVER
Custom DNS server to use for queries (e.g., 8.8.8.8, 1.1.1.1)
--no-color Disable colored output
Examples:
mxchecksec.py example.com
mxchecksec.py example.com google.com microsoft.com
mxchecksec.py -f domains.txt
mxchecksec.py example.com -s custom
mxchecksec.py example.com -s selector1 selector2 mycompany
mxchecksec.py example.com -d 8.8.8.8
mxchecksec.py example.com --dns-server 1.1.1.1
