Created
January 17, 2020 06:59
-
-
Save powerexploit/8ab380ad0290028f9a1efe6333683a5a to your computer and use it in GitHub Desktop.
Os Detection With TTL
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#TTlOs.psm1 | |
#< | |
# Ping scanner with os detection according with ttl value. | |
# Test-connection is a type of function in powershell uses as a ping command. | |
#> | |
# | |
function PsPing | |
{ | |
param($ip) | |
Process | |
{ | |
$os = (Test-Connection -Count 1 $ip).ResponseTimeToLive | |
if ($os -lt 65 ) | |
{ | |
write-host -f yellow "Target is running on Linux Machine according to TTL value ${os}" | |
} | |
elseif($os -gt 64 -and $os -lt 129) | |
{ | |
write-host -f green "Target is running on Window Based Machine according to TTL value ${os}" | |
} | |
else | |
{ | |
Write-host -f blue "Target running on cisco." | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment