基于可信的电子邮件最佳实践扫描域并返回数据

trustymail的Python项目详细描述


值得信赖的邮件

最新版本生成状态覆盖状态总警报语言等级: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]

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.

检查了什么?

对于给定的域,mx记录,spf记录(txt),dmarc(txt,at _已选中dmarc.<;domain>;)和对starttls的支持。如果使用的解析程序能够识别dnssec,也可以检查dnssec的资源记录。

results.csv中返回以下值:

域和重定向信息

  • -正在扫描的域!
  • 基本域-域的基本域。例如,对于 域sub.example.gov,基本域将是 example.gov。通常这是二级域,但是 trustymail将下载并加入公共后缀 计算基域时列出
  • live-域实际上是在DNS中发布的。

邮件发送

  • MX记录-如果发现MX记录至少包含 单一邮件服务器。
  • mx记录dnssec-一个布尔值,指示 DNS记录受DNSSEC保护。
  • 邮件服务器-MX记录中的主机列表。
  • <代码>已测试邮件服务器端口-已测试SMTP和 启动TLS支持。
  • 域支持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 resultsdmarc results on base domain的 适用的DMARC政策。
  • DMARC子域策略-基于任何策略的裁决 在的dmarc resultsdmarc results on base domain中找到 适用的相关DMARC子域策略。
  • DMARC策略百分比 根据dmarc结果,遵循dmarc策略
  • dmarc聚合报表uri-dmarc聚合报表的列表 域指定的uri。
  • DMARC鉴证报告uri-DMARC鉴证报告列表 域指定的uri。
  • dmarc具有聚合报表uri-一个布尔值,指示 dmarc结果包含ruauri,它告诉收件人到哪里 发送DMARC聚合报告。
  • dmarc具有鉴证报告uri-一个布尔值,指示 dmarc结果包含rufuri,该uri告诉收件人到哪里 发送DMARC法医报告。
  • DMARC报告地址接受错误-一个布尔值,即 如果聚合中列出的一个或多个域和 法医报告uri并不表示它接受dmarc报告 来自正在测试的域。

  • 语法错误-当 分析SPF记录。
  • 调试信息-遇到的任何其他警告或错误的列表, 例如DNS失败。在确定如何 trustymail得出了结论,对于bug来说是必不可少的 报告。

公共域

该项目位于世界各地的公共DOMA中< < / > >

该项目在美国属于公共领域,并且 通过以下方式放弃世界范围内作品的版权和相关权利: cc0 1.0通用公共域 奉献精神

所有对该项目的贡献将在CC0下发布 奉献精神。提交请求即表示您同意遵守 放弃版权权益。

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java将特定于语言环境的字符串转换为BigDecimal的最佳方法   java生成的数字在下降的水平上增加   java如何验证列表中的元素是否按字母顺序排序   java无法使用Jintellitype包com。梅洛器皿   java Hibernate显示来自JComboBox的记录   java更改模拟器屏幕分辨率?   java如何从可移动/辅助SD卡中删除文件   java检查在MySQL中插入时数据库中是否存在给定的用户名   java如何替换线程。无限循环中的sleep()?   java如何从数据库中获取一列的字符串数据作为数组数据   将内容存储在缓冲区中的java   java ControllerAdvice不处理引发的异常   Java Maven问题   java NullPointerException试图从方法返回2D对象数组时   这个简单的Java代码有什么问题?   java如何删除或访问pom文件中插件的构建时间戳   java销售收据,多选(if/else),while循环,客户更改选择的能力   Java:基于字符串的加载类方法   java OrientDB服务器部分忽略OrientDB_HOME