In this Page , There are many scripts and commands that i posted here for Network Enumeration using powershell.
Test your windows-server machines and Enumerate your server using this commands !
if that doesnt work !
(netsh wlan show profiles) -match "All User Profile\s*: (.*)" | %{(netsh wlan show profile $_.trim() key=clear)} | Select-String "Key Content" | ForEach-Object {$_ -replace "Key Content\s*: ", ""}
To Display only Keys :
(netsh wlan show profile name=wifi-name key=clear) | Select-String "Key Content" | ForEach-Object { $_.ToString().Split(":")[1].Trim() }
Display only Wifi-Keys
IF IT DOES NOT WORK TRY THESE SIMPLE COMMAND ( Everyone Knows :)
netsh wlan show profile Name=* Key=clear
GET ALL PROFILE NAMES WITH PASSWORDS .
(netsh wlan show profiles) | Select-String "\:(.+)$" | %{$name=$_.Matches.Groups[1].Value.Trim(); $_} | %{(netsh wlan show profile name="$name" key=clear)} | Select-String "Key Content\W+\:(.+)$" | %{$pass=$_.Matches.Groups[1].Value.Trim(); $_} | %{[PSCustomObject]@{ PROFILE_NAME=$name;PASSWORD=$pass }} | Format-Table –AutoSize | Out-String -OutVariable dataCaptured
Get-NetAdapter | Select-Object Name, InterfaceDescription, Status, MacAddress, LinkSpeed, MediaType, DriverVersion, DriverDate, PhysicalMediaType, Virtual | Format-Table
Explanation :
The Command Get-NetAdapter
retrieves the adapter name, description, status, MAC address, link speed, media type, driver version, driver date, physical media type, and whether the adapter is virtual.
Get-NetAdapter -Name Ethernet | Select-Object Name, InterfaceDescription, Status, MacAddress, LinkSpeed, MediaType, DriverVersion, DriverDate, PhysicalMediaType, Virtual | Format-Table
Get-NetTCPConnection | Select-Object LocalAddress, LocalPort, RemoteAddress, RemotePort, State | Format-Table
Explanation :
This Get-NetTCPConnection
retrieves information about active TCP connections on the local computer.
Get-NetUDPEndpoint | Select-Object LocalAddress, LocalPort, RemoteAddress, RemotePort | Format-Table
Explanation :
This Get-NetUDPEndpoint
retrieves information about active UDP endpoints on the local computer.
Get-NetTCPSetting | Select-Object TcpWindowSize
Explanation :
This query retrieves information about the TCP settings on the local computer
Get-NetIPConfiguration | Select-Object InterfaceAlias, IPAddress, IPv6Address, PrefixLength, DefaultGateway | Format-Table
Explanation :
This query displays the IP address, subnet mask, and default gateway for all network adapters on the local computer
Get-NetNeighbor | Select-Object IPAddress, LinkLayerAddress, InterfaceIndex | Format-Table
Explanation:
This will display the MAC address and interface index for all neighbors.
Get-NetRoute | Select-Object DestinationPrefix, Netmask, NextHop, InterfaceAlias | Format-Table
Explanation:
This will display the destination network, netmask, and next hop address for all routes.
GET-NetTCPConnection | Where-Object -Property State -Match Listen | measure
To list the no of Ports Listening ..!
Get-Service | Where-Object {$_.Status -eq 'Running' -and $_.StartType -eq 'Auto' -and $_.DisplayName -like '*Network*'} | Select-Object DisplayName, Status, StartType | Format-Table
Explanation:
This command will list all running network-related services and display their display name, status, and start type.
Test your machine connectivity to a network resource by performing a ping and a traceroute using Test-NetConnection
Test-NetConnection -ComputerName 192.168.1.100
Explanation:
This will perform a ping and a traceroute to the remote system and display the results.
You can also use the Test-NetConnection cmdlet to test the connectivity to a remote system by its hostname . To do that
Test-NetConnection -ComputerName remote-system.example.com
Additionally, you can use the -Port parameter with Test-NetConnection to test connectivity to a specific port on a remote system . To do that
Test-NetConnection -ComputerName remote-system.example.com -Port 80
Explanation:
This is an example to test the connectivity to port 80 on a remote system, you can use the above Command
Get-NetNeighbor | Select-Object IPAddress, LinkLayerAddress | Format-Table
Explanation:
This will display the IP addresses and MAC addresses of all neighbors on the local network.
Get-NetAdapter | Select-Object Name, InterfaceDescription, Status, LinkSpeed | Format-Table
Explanation:
This command will display the name, interface description, status, and link speed of all network adapters on the local computer
Get-NetFirewallRule | Select-Object DisplayName, Action, Direction, Enabled
Get-NetFirewallRule | Where-Object {$_.Enabled -eq 'True' -and $_.DisplayName -like '*Network*'} | Select-Object DisplayName, Description, Enabled | Format-Table
Explanation:
This command will display the name, description, and enabled status of all firewall rules related to network traffic.
Get-NetIPInterface | Select-Object Name, InterfaceIndex, InterfaceMetric | Format-Table
Explanation:
This command will display the name, interface index, and interface metric of all IP interfaces on the local computer.
Get-NetAdapterStatistics | Select-Object Name, BytesSent, BytesReceived, PacketsSent, PacketsReceived, Errors | Format-Table
Explanation:
This command will display the bytes sent and received, packets sent and received, and errors for all network adapters on the local computer.
Get-NetTCPSetting | Select-Object *
Explanation:
See the maximum number of concurrent connections, the maximum initial window size, and the maximum retransmission time.
Get-NetTCPConnection | Select-Object LocalAddress, LocalPort, RemoteAddress, RemotePort, State, OwningProcess | Format-Table
Explanation:
display's the local and remote IP addresses and ports, the state, and the process ID (PID) of all current TCP connections, you can use:
Get-NetUDPEndpoint | Select-Object LocalAddress, LocalPort, RemoteAddress, RemotePort | Format-Table
Explanation : This will display the local and remote addresses and ports for all active UDP endpoints.
Get-NetAdapter | Select-Object Name, InterfaceDescription, Status, MacAddress, LinkSpeed, MediaType, DriverVersion, DriverDate, PhysicalMediaType, Virtual | Format-Table
Explanation:
This script retrieves the adapter name, description, status, MAC address, link speed, media type, driver version, driver date, physical media type, and whether the adapter is virtual. You can modify the Select-Object and Format-Table parameters to retrieve and display different fields.
Get-NetAdapter -Name Ethernet | Select-Object Name, InterfaceDescription, Status, MacAddress, LinkSpeed, MediaType, DriverVersion, DriverDate, PhysicalMediaType, Virtual | Format-Table
Explaination:
This will only display information for the Ethernet adapter.
Get-NetIPConfiguration | Select-Object InterfaceAlias, IPAddress, IPv6Address, PrefixLength, DefaultGateway | Format-Table
Explaination:
This command is used to display the IP address, subnet mask, and default gateway for all network adapters on the local computer
Get-NetNeighbor | Select-Object IPAddress, LinkLayerAddress, InterfaceIndex | Format-Table
Explain:
This will display the MAC address and interface index for all neighbors.
Get-Service | Where-Object {$_.Status -eq 'Running' -and $_.StartType -eq 'Auto' -and $_.DisplayName -like '*Network*'} | Select-Object DisplayName, Status, StartType | Format-Table
Explain:
This is to list all running network-related services on local computer
Get-NetFirewallRule | Where-Object {$_.Enabled -eq 'True' -and $_.DisplayName -like '*Network*'} | Select-Object DisplayName, Description, Enabled | Format-Table
Explain :
The command display the name, description, and enabled status of all firewall rules related to network traffic.
Get-NetIPInterface | Select-Object Name, InterfaceIndex, InterfaceMetric | Format-Table
Explain :
This command will display the name, interface index, and interface metric of all IP interfaces on the local computer.
Get-NetAdapterStatistics | Select-Object Name, BytesSent, BytesReceived, PacketsSent, PacketsReceived, Errors | Format-Table
Explain :
This command will display the bytes sent and received, packets sent and received, and errors for all network adapters on the local computer.
Get-NetTCPSetting | Select-Object *
Explain :
This command will display the current values of all TCP settings, including the maximum number of concurrent connections, the maximum initial window size, and the maximum retransmission time.
Get-NetRoute | Select-Object DestinationPrefix, PrefixLength, NextHop, RouteMetric, InterfaceIndex | Format-Table
Explain :
This will display the network destination, network mask, gateway, and interface index for all routes in the routing table.
Get-NetTCPConnection | Where-Object { $_.State -eq 'Established' } | Select-Object LocalAddress, LocalPort, RemoteAddress, RemotePort, State
Get Active connection Information about Addresses and its Ports
Get-NetNeighbor | Select-Object ifIndex, IPAddress, LinkLayerAddress, State
Get arp table
Get-DnsClient | Select-Object InterfaceAlias, ConnectionSpecificSuffix, ServerAddresses
Get DNS Client Settings from Powershell