GithubHelp home page GithubHelp logo

dotbatmanno / psget-domain-mailinfo Goto Github PK

View Code? Open in Web Editor NEW
12.0 1.0 2.0 52 KB

PowerShell script to get domain mail info and control status such as MX, SPF, DKIM, DMARC and StartTLS.

License: GNU General Public License v3.0

PowerShell 100.00%
powershell powershell-script spf dkim dmarc nullmx domains security mail defensive-security

psget-domain-mailinfo's People

Contributors

dotbatmanno avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

psget-domain-mailinfo's Issues

Specify which DNS server to use

The script will not be able to report the correct information if the site has split-dns or you have a need to check records from regional DNS servers.

A command line or configuration file option should be available to specify which DNS server to send the requests to.

Add Spoofable flag and graph

[Feature request proposed by colleague]

Add check to claim that a domain is Spoofable

  • This test should be on by default, but also be disabled with the flag -CheckSpoofable 0

  • Output should have a flag for IsSpoofable.

  • Another graph should be created.

Flag should be True if any of the following conditions are met:

  • Lack of an SPF or DMARC record
  • SPF record never specifies ~all, -all
  • DMARC policy is set to p=none or is nonexistent

bc7c6325-a1e0-41b3-a708-0e4c3fcb4919

Fails to check DMARC policy if there is no MX record

The script skips checking for DMARC, and possibly other policies, if there is no MX record.
This could be considered a bug, however the script does say #N/A rather than None.

This default of not checking should be highlighted to users. If possible consider adding an option to force checking of specific / all policies, regardless of MX records.

To recreate the issue run the script against any domain that has a DMARC policy but no MX record.
The domain this was noticed for was coronavirus.gov, see https://internet.nl/mail/coronavirus.gov/399588/.

Tweet_SPFPolicy_Coronavirus gov

Fully implement StartTLS support

The documentation needs to be updated to demonstrate the StartTLS testing.

Should also add the testing of StartTLS as an (optional) command line parameter.

Does not handle multi-line TXT records

If the queried TXT record is broken over multiple lines the script will not concatenate the parts into one string.

Reproducing the issue
Query a domain that has a TXT record, e.g. SPF, that is long and broken over multiple lines.

Expected behavior
The script should join all lines of the returned TXT record into one string.

Add scoring to output

Use a CSV file to define the score to give, this allows for customization by user.

Combine existence of records with strength of records to give total score.

SPF Qualifier | Policy   | Protection
-----------------------------------
+all          | Pass     | None
~all          | Softfail | Weak
-all          | Fail     | Strong

SPF, DKIM and DMARC existence could score as shown below:

SPF_DKIM_DMARC      | Protection
-------------------------------------
False, False, False | None
False, False, True  | None
False, True, False  | Weak
False, True, True   | Weak
True, False, False  | Weak
True, False, True   | Strong
True, True, False   | Strong
True, True, True    | Strong

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.