wip script network scanner

This commit is contained in:
silversword411 2021-09-02 10:33:25 -04:00
parent 403762d862
commit 1c5e736dce
1 changed files with 18 additions and 0 deletions

View File

@ -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