From 1c5e736dcefaf3760c611831b2ba27a031bf39f7 Mon Sep 17 00:00:00 2001 From: silversword411 Date: Thu, 2 Sep 2021 10:33:25 -0400 Subject: [PATCH] wip script network scanner --- scripts_wip/Win_Network_Scan.ps1 | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 scripts_wip/Win_Network_Scan.ps1 diff --git a/scripts_wip/Win_Network_Scan.ps1 b/scripts_wip/Win_Network_Scan.ps1 new file mode 100644 index 00000000..7060e5ac --- /dev/null +++ b/scripts_wip/Win_Network_Scan.ps1 @@ -0,0 +1,18 @@ +# https://github.com/knk90 +# Installs Angry IP scanner using choco, runs a scan of the network and then uninstalls it + +choco.exe install angryip -y +$PSDefaultParameterValues['*:Encoding'] = 'ascii' +$ips = get-netipaddress -AddressFamily ipv4 | select-object ipaddress +foreach ($i in $ips) { + $split = $i.ipaddress.Split(".") + $startrange = $split[0] + "." + $split[1] + "." + $split[2] + "." + "1" + $endrange = $split[0] + "." + $split[1] + "." + $split[2] + "." + "254" + $command = "`"c:\Program Files\Angry IP Scanner\ipscan.exe`" -f:range " + $startrange + " " + $endrange + " -s -q -o c:\programdata\ipscanoutput.txt`"" + if ($startrange -notlike "*127.0*") { + $command | Out-file -Encoding ASCII c:\programdata\ipscan.bat + c:\programdata\ipscan.bat + type c:\programdata\ipscanoutput.txt + } +} +choco.exe uninstall angryip -y \ No newline at end of file