alphasec
PowerShell protip 0043
in 𝕏

Get-NetIPAddress -AddressState Preferred|select IPAddress,InterfaceAlias - wyświetl aktywne interfejsy sieciowe i ich IP

tty1 · powershell
PS> Get-NetIPAddress -AddressState Preferred|select IPAddress,InterfaceAlias
#Powershell#RedTeam#Recon#Administration#Windows

Ten oneliner warto mieć w worku onelinerów rekonesansowych. Istotnym jest tutaj AddressState, którego wartość Preferred oznacza, że adres IP jest prawidłowy i gotowy do użycia. Wszystkie możliwe wartości, za dokumentacją:

-- Invalid. IP address configuration information for addresses that are not valid and will not be used.

-- Tentative. IP address configuration information for addresses that are not used for communication, as the uniqueness of those IP addresses is being verified.

-- Duplicate. IP address configuration information for addresses for which a duplicate IP address has been detected and the current IP address will not be used.

-- Deprecated. IP address configuration information for addresses that will no longer be used to establish new connections, but will continue to be used with existing connections.

-- Preferred. IP address configuration information for addresses that are valid and available for use.
Get-NetIPAddress -AddressState Preferred|select IPAddress,InterfaceAlias - wyświetl aktywne interfejsy sieciowe i ich IP

Przydatne linki

https://docs.microsoft.com/en-us/powershell/module/nettcpip/get-netipaddress dokumentacja cmdletu Get-NetIPAddress web ↗
← poprzedni protip 0042 ••• Wszystkie protipy następny → protip 0044
// subskrybuj

Nowe protipy prosto na maila.

Mięsiste jednolinijkowce i triki z prawdziwych zleceń. Zero spamu, zero teorii. Wypisujesz się jednym kliknięciem.

wersja newslettera: