Windows: Difference between revisions

From Cheatsheet
Jump to navigationJump to search
m (Patrick moved page Powershell to Windows without leaving a redirect)
No edit summary
Line 1: Line 1:
[[Category:Cheatsheet]]
[[Category:Cheatsheet]]


== Checks ==
== Important applications ==
=== SSH ===
* MobaxTerm - https://mobaxterm.mobatek.net/
* Putty & Puttygen - https://www.chiark.greenend.org.uk/~sgtatham/putty/latest.html
 
== Powershell ==
=== Checks ===
* https://azega.org/list-open-ports-using-powershell/
* https://azega.org/list-open-ports-using-powershell/


Line 21: Line 27:
</syntaxhighlight>
</syntaxhighlight>


== Commands ==
== Common ===
==== Commands ====
<syntaxhighlight lang='bash'>
# Open User Management
lusrmgr.msc
</syntaxhighlight>
 
==== Tasks ====
https://learn.microsoft.com/en-us/windows-server/administration/server-core/server-core-servicing
 
<syntaxhighlight lang='bash'>
<syntaxhighlight lang='bash'>
# Open User Management
# Open User Management
Line 27: Line 42:
</syntaxhighlight>
</syntaxhighlight>


== Network ==
=== Network ===
<syntaxhighlight lang='bash'>
<syntaxhighlight lang='bash'>
# Add a route for a specific network
# Add a route for a specific network

Revision as of 08:21, 8 September 2023


Important applications

SSH

Powershell

Checks

# List open ports and related IP-addresses
Get-NetTCPConnection

# "To show only the listening ports we need to filter for all items in the Listen state with the remote address of 0.0.0.0"
get-nettcpconnection | where {($_.State -eq "Listen") -and ($_.RemoteAddress -eq "0.0.0.0")}

# "You can add additional fields like the process ID for each port. Changing the fields from the default requires selecting each one you want and then piping to ft (format-table)."
get-nettcpconnection | where {($_.State -eq "Listen") -and ($_.RemoteAddress -eq "0.0.0.0")} | Select LocalAddress,LocalPort,RemoteAddress,RemotePort,State,OwningProcess | ft

# "This example will get the name of the process associated with each item."
get-nettcpconnection | where {($_.State -eq "Listen") -and ($_.RemoteAddress -eq "0.0.0.0")} | select LocalAddress,LocalPort,RemoteAddress,RemotePort,State,@{Name="Process";Expression={(Get-Process -Id $_.OwningProcess).ProcessName}} | ft

# Test the network-connection to a specific IP and port
Test-NetConnection -ComputerName 192.168.200.20 -InformationLevel "Detailed" -Port 443

Common =

Commands

# Open User Management
lusrmgr.msc

Tasks

https://learn.microsoft.com/en-us/windows-server/administration/server-core/server-core-servicing

# Open User Management
lusrmgr.msc

Network

# Add a route for a specific network
route add 192.168.15.0 mask 255.255.255.0 192.168.15.1

# Delete a route for a specific network
route delete 192.168.15.0 mask 255.255.255.0 192.168.15.1