Minor syntax errors but yes this is a port scan made in powershell. Correct syntax would be:
$p = @(80, 110, 25)
$network = "192.168.0"
$range = 1..254
$ErrorActionPreference = 'SilentlyContinue'
foreach ($add in $range) {
foreach ($x in $p) {
$ip = "$network.$add"
$socket = New-Object System.Net.Sockets.TcpClient
try {
$socket.Connect($ip, $x)
if ($socket.Connected) {
Write-Output "$ip port $x open"
}
$socket.Close()
} catch {}
}
}
upvoted 4 times
...
This section is not available anymore. Please use the main Exam Page.PT0-002 Exam Questions
Log in to ExamTopics
Sign in:
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.
Upvoting a comment with a selected answer will also increase the vote count towards that answer by one.
So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.
throughthefray
7 months, 3 weeks ago