Hello everyone!
My issue is below - thanks in advance for your advice!
So I wrote a script recently to scan many targets for the complete TCP/UDP ranges. I found that the TCP scans complete without any issue, however the UDP scans start, but never really finish. Additionally, regarding my UDP port scan woes…POSH shell shows something like “Error: 0 targets defined” when I have all of the targets defined inside c:\target_list.txt
My script:
Get-Content c:\target_list.txt | Foreach-Object { write-output “Running TCP port scan using this command: nmap -sS -p 1-65535. It will run TCP scan of all possible TCP ports” `n| Out-File c:"$.csv" }
Get-Content c:\target_list.txt | Foreach-Object { nmap -sS -p 1-65535 $ | Out-File c:"$.csv" -Append}
Get-Content c:\target_list.txt | Foreach-Object { write-output `n | Out-File c:"$.csv" -Append}
Get-Content c:\target_list.txt | Foreach-Object { write-output “Running UDP port scan using this command: nmap -sU -p 1-65535. It will run UDP scan of all possible UDP ports” `n| Out-File c:"$.csv" -Append }
Get-Content c:\target_list.txt | Foreach-Object { nmap -sU -p 1-65535 $ | Out-File c:"$_.csv" -Append}
My target list (example):