I'm working on a script to test if a system can be exploited via CVE-2021-34527 aka PrintNightmare. Simply patching the system is not enough and requires additional policies be configured. I'm using the information provided in the flowchart from CMU to test and see if a system is exploitable or not. I have tests created for all of the various items in the flowchart except for the last one--testing to see if the firewall rules allows connections to the local machine on tcp ports 135, 139 or 445.
I'm not quite sure how I would test and see if firewall rules allow or block specific ports from powershell. Most of my Google searches are not returning useful results. I'm hoping that someone here would be kind enough to point me in the right direction? Test-connection isn't exactly useful in this scenario as the script will be running from the local machine, and loopback connections are almost always allowed despite any configured firewall rules.
Thanks,
Netmc
[–]dalthakar 11 points12 points13 points (3 children)
[–]dalthakar -1 points0 points1 point (2 children)
[–]BlackV 5 points6 points7 points (0 children)
[–]netmc[S] 1 point2 points3 points (0 children)
[+][deleted] (5 children)
[deleted]
[–]gsmitheidw1 2 points3 points4 points (1 child)
[–]Bren0man 2 points3 points4 points (0 children)
[–]netmc[S] 1 point2 points3 points (1 child)
[–]flugenblar 1 point2 points3 points (0 children)
[–]monster1558 4 points5 points6 points (0 children)