Created
June 28, 2023 18:28
-
-
Save lebowitz/2fab7fc3ad184798aa2d643f6d78f1bb to your computer and use it in GitHub Desktop.
Find Sql Servers On A Network
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$nets = ('10.10.10.0/24'); | |
foreach($subnet in $nets) { | |
$fn = "$($subnet.Replace('/','_')).txt" | |
c:\installs\nmap\nmap.exe $subnet -p T:1433 --min-parallelism 4 -Pn -oG $fn | Out-Null | |
gc $fn | select-string open | |
} | |
# DONE | |
# 10.11.75.0/24 | |
# 10.10.2.14/24 | |
# 10.10.25.0/24 | |
# 10.10.27.0/24 | |
# 10.0.0.0/24 | |
# 10.0.1.0/24 | |
# 10.0.7.0/24 | |
# 10.0.10.0/24 | |
# 10.0.100.0/24 | |
# 10.1.10.0/24 | |
# 10.10.23.0/24 | |
# 10.10.224.0/24 | |
# 10.10.254.0/24 | |
# 10.10.255.0/24 | |
# 10.11.64.0/24 | |
# 192.168.10.0/24 | |
#'192.168.50.0/24', | |
#'192.168.51.0/24', | |
#'192.168.60.0/24', | |
#'192.168.199.0/24', | |
#'192.168.200.0/24', | |
#'192.168.202.0/24', | |
#'192.168.223.0/24', | |
#'192.168.248.0/24' | |
# TODO |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment