基于可信的电子邮件最佳实践扫描域并返回数据
trustymail的Python项目详细描述
值得信赖的邮件
trustymail
是评估
域的DNS。它还检查域的mx中列出的邮件服务器
starttls支持的记录。它将结果保存为csv或json格式。
开始
trustymail
可以作为模块安装,也可以直接从
存储库。
作为模块安装
TrustyMail
可以直接通过PIP安装:
pip install trustymail
然后可以直接运行:
trustymail [options] example.com
直接运行
要从存储库本地运行该工具,而不安装,请首先 安装要求:
pip install -r requirements.txt
然后运行cli:
python scripts/trustymail [options] example.com
使用Docker(可选)
./run [opts]
注意:如果输入以 对于给定的域,mx记录,spf记录(txt),dmarc(txt,at
_已选中dmarc.<;domain>;)和对starttls的支持。如果使用的解析程序能够识别dnssec,也可以检查dnssec的资源记录。 在opts
是传递给trustymail的参数
。例如,对于
域用法和示例
trustymail [options] INPUT
trustymail dhs.gov
trustymail --output=homeland.csv --debug cisa.gov dhs.gov us-cert.gov usss.gov
trustymail agencies.csv
.csv
结尾,则将从csv读取域。猪瘟病毒
输出将始终写入磁盘,默认为results.csv
选项
-h --help Show this message.
-o --output=OUTFILE Name of output file. (Default results)
-t --timeout=TIMEOUT The DNS lookup timeout in seconds. (Default is 5.)
--smtp-timeout=TIMEOUT The SMTP connection timeout in seconds. (Default
is 5.)
--smtp-localhost=HOSTNAME The hostname to use when connecting to SMTP
servers. (Default is the FQDN of the host from
which trustymail is being run.)
--smtp-ports=PORTS A comma-delimited list of ports at which to look
for SMTP servers. (Default is '25,465,587'.)
--no-smtp-cache Do not cache SMTP results during the run. This
may results in slower scans due to testing the
same mail servers multiple times.
--mx Only check mx records
--starttls Only check mx records and STARTTLS support.
(Implies --mx.)
--spf Only check spf records
--dmarc Only check dmarc records
--debug Output should include error messages.
--dns=HOSTNAMES A comma-delimited list of DNS servers to query
against. For example, if you want to use
Google's DNS then you would use the value --dns-hostnames='8.8.8.8,8.8.4.4'. By default the DNS configuration of the host OS (/etc/resolv.conf) is used. Note that the host's DNS configuration is not used at all
if this option is used.
--psl-filename=FILENAME The name of the file where the public suffix list
(PSL) cache will be saved. If set to the name of
an existing file then that file will be used as
the PSL. If not present then the PSL cache will
be saved to a file in the current directory called
public_suffix_list.dat.
--psl-read-only If present, then the public suffix list (PSL)
cache will be read but never overwritten. This
is useful when running in AWS Lambda, for
instance, where the local filesystem is read-only.
检查了什么?
results.csv中返回以下值:
域和重定向信息
域
-正在扫描的域!基本域
-域的基本域sub.example.gov
,基本域将是
example.gov
。通常这是二级域,但是
trustymail
将下载并加入公共后缀
计算基域时列出。
live
-域实际上是在DNS中发布的。邮件发送
MX记录
-如果发现MX记录至少包含 单一邮件服务器。mx记录dnssec
-一个布尔值,指示 DNS记录受DNSSEC保护。邮件服务器
-MX记录中的主机列表。域支持smtp
-如果且仅当任何邮件服务器 在与域关联的MX记录中指定支持SMTP。域支持SMTP结果
-邮件服务器和端口的列表 支持SMTP的组合。域支持starttls
-如果且仅当全部邮件时为true 支持SMTP的服务器也支持starttls。域支持starttls结果
-邮件服务器和 支持starttls的端口组合。
SPF记录
-是否找到SPF记录。spf record dnssec
-一个布尔值,指示 DNS记录受DNSSEC保护。有效的SPF
-找到的SPF记录语法是否正确, 根据RFC 4408。spf结果
-找到的任何spf记录的文本表示 对于域。
dmarc
DMARC记录
-无论是否找到DMARC记录,均为true/false。dmarc record dnssec
-一个布尔值,指示是否 DNS记录受DNSSEC保护。有效的dmarc
-找到的dmarc记录是否在语法上 正确。dmarc results
-查询时发现的dmarc记录 DNS.基域上的dmarc记录
,基域上的dmarc记录dnssec
,基域上的有效dmarc记录
,基域上的dmarc结果
-与上述定义相同,但返回 基本域。这在DMARC中很重要,因为如果没有 域中的DMARC记录,基本域(或"组织 域",根据RFC 7489),是 检查并应用。DMARC政策
-基于dmarc results
和dmarc results on base domain
的 适用的DMARC政策。DMARC子域策略
-基于任何策略的裁决 在的dmarc results
和dmarc results on base domain
中找到 适用的相关DMARC子域策略。DMARC策略百分比 根据
dmarc结果,遵循
dmarc策略
dmarc聚合报表uri
-dmarc聚合报表的列表 域指定的uri。DMARC鉴证报告uri
-DMARC鉴证报告列表 域指定的uri。dmarc具有聚合报表uri
-一个布尔值,指示dmarc结果
包含rua
uri,它告诉收件人到哪里 发送DMARC聚合报告。dmarc具有鉴证报告uri
-一个布尔值,指示dmarc结果
包含ruf
uri,该uri告诉收件人到哪里 发送DMARC法医报告。DMARC报告地址接受错误
-一个布尔值,即 如果聚合中列出的一个或多个域和 法医报告uri并不表示它接受dmarc报告 来自正在测试的域。
等
语法错误
-当 分析SPF记录。调试信息
-遇到的任何其他警告或错误的列表, 例如DNS失败。在确定如何trustymail
得出了结论,对于bug来说是必不可少的 报告。
公共域
该项目位于世界各地的公共DOMA中< < / > >
该项目在美国属于公共领域,并且 通过以下方式放弃世界范围内作品的版权和相关权利: cc0 1.0通用公共域 奉献精神
所有对该项目的贡献将在CC0下发布 奉献精神。提交请求即表示您同意遵守 放弃版权权益。