nmap.Powershell.포트스캔(1...999).특정ip
보안, 해킹, Hacking, nmap, exploit반응형
1...999 | ForEach-Object {
$port = $_
$tcpClient = New-Object System.Net.Sockets.TcpClient
$connectTask = $tcpClient.BeginConnect("123.456.789.012", $port, $null, $null)
$waitHandle = $connectTask.AsyncWaitHandle
$result = $waitHandle.WaitOne(300) # 300 milliseconds = 0.3 seconds
$waitHandle.Close()
if ($result -eq $true) {
$tcpClient.EndConnect($connectTask)
Write-Output "Port $port is open."
}
else
{
Write-Output "Port $port is closed."
}
$tcpClient.Close()
}
반응형
'보안, 해킹, Hacking, nmap, exploit' 카테고리의 다른 글
nmap.기본 (0) | 2022.11.18 |
---|---|
2022-548.kalilinux.searchsploit.wordpress (0) | 2022.11.08 |
kalilinux.설치.Notebook (0) | 2022.11.01 |
kalilinux.설치.VMWare (0) | 2022.06.20 |