# Windows Basics

The system environment variable for the Windows directory

```
%windir%
```

Local User and Group Management

```
lusrmgr.msc
```

System Configuration utility

```
msconfig
```

The command for Windows Troubleshooting

```
C:\Windows\System32\control.exe /name Microsoft.Troubleshooting
control.exe
```

Computer Management

```
compmgmt
```

System Information. *Windows includes a tool called Microsoft System Information (Msinfo32.exe).  This tool gathers information about your computer and displays a comprehensive view of your hardware, system components, and software environment, which you can use to diagnose computer issues.*

* Hardware Resources
* Components
* Software Environment

```
msinfo32
```

Another method to view environment variables is `Control Panel > System and Security > System > Advanced system settings > Environment Variables` OR `Settings > System > About > system info > Advanced system settings > Environment Variables`.

Resource Monitor

```
resmon
```

* CPU
* Disk
* Network
* Memory

Registry Editor

```
regedit
regedt32.exe
```

**Essential Commands**

```
hostname
whoami
ipconfig
ipconfig /?   //getting help
netstat
net user
```

### RDP

```
xfreerdp /v:10.129.13.110 /u:htb-student /p:Academy_student_AD! /size:1024x768 /smart-sizing:1600x1200
```

### RDP with share folder

```
xfreerdp /v:10.129.33.49 /u:johanna /p:1231234! /size:1024x768 /smart-sizing:1600x1200 +clipboard /drive:share,//home/htb-ac-618469/Desktop
```

### Check open Ports

You can do it by running `ss -tunlp` (or `netstat` on older systems)

```
tbfcapp@tbfc-devqa01:~$ ss -tulpn                                                                                                       
Netid         State          Recv-Q         Send-Q                      Local Address:Port                    Peer Address:Port         
Process                                                                                                                                 
udp           UNCONN         0              0                                 0.0.0.0:53                           0.0.0.0:*            
udp           UNCONN         0              0                      10.48.178.154%ens5:68                           0.0.0.0:*            
tcp           LISTEN         0              32                                0.0.0.0:21212                        0.0.0.0:*            
tcp           LISTEN         0              151                             127.0.0.1:3306                         0.0.0.0:*            
```

### Recursively search for files

```
dir C:\Windows\System32\*.txt /s /b
```

* `dir` → list files
* `C:\Windows\System32\*.txt` → match **all `.txt` files** in `System32`
* `/s` → **search recursively** through all subdirectories
* `/b` → **bare format** (full paths only, no headers or extra info)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://notes.cavementech.com/pentesting-quick-reference/windows-basics.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
