Learn Windows Command Line Basics | TryHackMe Walkthrough
The post provides a comprehensive walkthrough of the Windows Command Line Room on TryHackMe, aimed at teaching essential Windows command-line skills for system and network management.
Overview
- Objective: Learn foundational Windows commands to manage system information, networking, and processes.
Topics Covered:
- System information retrieval.
- Networking configuration and diagnostics.
- Monitoring and troubleshooting network connections.
Tasks and Commands
1. Retrieving System Information
Commands:
systeminfo
:- Displays detailed information about the system, including OS version, processor, BIOS, and network configurations.
ver
:- Provides the Windows version in a concise format.
Use Cases:
- Check system specs.
- Identify if the machine is virtualized (look for Hyper-V indicators in
systeminfo
output).
Examples:
- OS Version: Found under
OS Version
insysteminfo
. - Hostname: Found under
Host Name
insysteminfo
.
2. Networking Commands
Inspect Network Configuration:
ipconfig
:- Displays IP address, subnet mask, and default gateway.
ipconfig /all
:- Provides detailed information, including DHCP and DNS servers.
Example:
- Default Gateway: Found under
Ethernet adapter
inipconfig /all
.
Domain Name Lookup:
nslookup <domain>
:- Queries the DNS server to retrieve the IP address of a domain.
Example:
- Query TryHackMe’s IP:
nslookup tryhackme.com
Check Connectivity:
ping <domain>
:- Sends ICMP packets to test if a host is reachable.
- Note: Some hosts may block ICMP responses, leading to timeouts even if reachable.
Tracing Network Paths:
tracert <domain>
:- Identifies the route packets take to reach a destination.
- Useful for diagnosing network issues, such as dropped packets or unreachable hosts.
3. Monitoring Network Connections
Netstat Overview:
- Displays active and listening network connections, including associated processes and ports.
Common Flags:
-a
: Shows all connections and listening ports.-b
: Displays processes associated with each connection.-o
: Includes process IDs.-n
: Shows numerical addresses instead of resolving names.
Example:
- Identify a listening process:
netstat -aon
Analyzing Output:
- Local Address: The machine’s IP address and port.
- Foreign Address: The remote host’s IP address and port.
- Process ID: Useful for linking connections to specific processes.
Practical Use Case:
- Identify malicious activity:
- Look for unfamiliar listening ports or connections to suspicious foreign addresses.
- Use the process ID to correlate with running tasks.
Practical Exercises
Finding System Information:
Question: What is the OS version?
- Use
systeminfo
orver
.
Question: What is the hostname?
- Found under
Host Name
insysteminfo
.
Networking:
Question: What is the gateway IP?
- Use
ipconfig /all
and check theDefault Gateway
.
Network Monitoring:
Question: Which process is listening on port 3389?
- Use
netstat -b
and identifyTermService
as the process on port 3389 (RDP service).
Key Takeaways
System Management:
- The
systeminfo
andver
commands are powerful tools for gathering system specifications quickly.
Network Diagnostics:
- Tools like
ipconfig
,nslookup
, andping
help troubleshoot network connectivity issues.
Security Insights:
- Use
netstat
to monitor network activity and identify potential malicious processes.
Let me know if you need more details or assistance with specific commands!
Room answers
Room answers can be found here.