> For the complete documentation index, see [llms.txt](https://cybersecurity-cloud-and-it-notes.gitbook.io/kyles-cybersecurity-cloud-and-it-gitbook/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://cybersecurity-cloud-and-it-notes.gitbook.io/kyles-cybersecurity-cloud-and-it-gitbook/hack-the-box/academy/introduction-to-windows-command-line/introduction.md).

# Introduction

#### Introduction: Meet Your Windows Command Line Superpowers! 🖥️✨

Windows has two secret weapons built into every host: **CMD.exe** and **PowerShell**. These command-line tools are like the Swiss Army knives of the operating system. Here’s what they bring to the table:

* **Direct OS Access**: No middleman, just you and the system.
* **Automation Galore**: Say goodbye to repetitive tasks.
* **Granular Control**: Tweak, manage, and rule your computer like the king/queen of the digital jungle. 👑

***

#### What’s in it for You?

In this module, you’ll learn how to become a master of Windows command-line wizardry:

* **Admins**: Unlock skills to manage Windows systems efficiently and tackle anything thrown your way.
* **Pentesters**: Dive into built-in tools, third-party scripts, and sneaky tricks to:
  * 🔍 **Recon**: Gather intelligence like a pro spy.
  * 💥 **Exploit**: Uncover and leverage vulnerabilities.
  * 📤 **Exfiltrate**: Move data like a digital ninja.

***

Think of this module as your **power-up** for future HTB Academy adventures. You’re not just learning command-line skills—you’re building the foundation for advanced hacking, defending, and system administration. 💡 Ready to level up? Let’s go! 🚀

***

***

#### Command Prompt vs. PowerShell: The Ultimate Showdown! ⚔️💻

Let’s break down the key differences between **Command Prompt** (the OG) and **PowerShell** (the newer, cooler kid on the block). Spoiler: PowerShell is like CMD’s way more talented cousin. 🙃

***

#### **Key Comparison Table**

| **Feature**               | **PowerShell** 🛠️                                       | **Command Prompt** 📜                      |
| ------------------------- | -------------------------------------------------------- | ------------------------------------------ |
| **Introduced**            | 2006 (fresh and modern-ish)                              | 1981 (old but gold)                        |
| **Commands Supported**    | Runs batch commands *and* PowerShell cmdlets             | Only runs batch commands                   |
| **Aliases**               | Supports command aliases (shortcuts, yay!)               | No aliases allowed 😢                      |
| **Piping Output**         | Cmdlet output can be passed to other cmdlets (teamwork!) | Outputs can’t work together—sad solo vibes |
| **Output Type**           | All output is an object (fancy and versatile)            | Outputs are plain text (simple and static) |
| **Execution Style**       | Runs cmdlets in sequence via scripts                     | Commands run one at a time (slow grind)    |
| **Scripting Environment** | Has an Integrated Scripting Environment (ISE)            | Nope, none of that scripting luxury        |
| **Programming Libraries** | Built on .NET framework, so it’s library-rich 📚         | No library access, sorry!                  |
| **Cross-Platform**        | Works on Linux systems too! 🐧                           | Stuck on Windows forever 🖼️               |

***

#### **TL;DR: Why Care?**

* **Command Prompt**: Great for quick, basic tasks. Reliable, but very limited.
* **PowerShell**: A scripting powerhouse that can do *everything* CMD can do and so much more. It’s the multitool you want for complex tasks, automation, and advanced system administration.

***

PowerShell is the obvious winner if you need versatility and power. CMD, while trusty, feels like typing on a typewriter in a world of laptops. Which one will you choose to conquer your next challenge? 👑

***

***

#### Scenario: Becoming the Ultimate Command Line Ninja 🥷💻

Imagine this:\
You’re a **system administrator** by day, but you’ve got a dream—to become a pentesting powerhouse. 💪 But before you can impress your manager and earn that coveted spot with the Internal Red Team, you need to prove your worth.

***

#### The Mission

To level up your skills, you’ll dive into **Windows Command Line Interfaces**—both the trusty **CMD** and the ultra-flexible **PowerShell**. Your goal? To master these tools so thoroughly that no one can deny your place among the elite!

***

#### How This Module Helps 🛠️

Through hands-on practice and guided lessons, you’ll learn:

* The ins and outs of CMD and PowerShell.
* How these tools can solve real-world admin tasks *and* aid in pentesting.
* Techniques to handle reconnaissance, automation, and beyond.

***

By the end of this module, you’ll be equipped with the knowledge and skills to walk into that meeting, drop some command-line wizardry, and secure your title as a **Certified Command Line Ninja**. The Red Team won’t know what hit them. 🥷🔥

Are you ready to crush it? Let’s go! 🚀

<figure><img src="/files/mHFE5x6bcGCdXokAbTSo" alt=""><figcaption></figcaption></figure>

#### **Connection Instructions: Let’s Get Connected! 🔗💻**

In this module, you’ll be working with **Windows hosts** using a pure **Command Line Interface (CLI)**. The connection method? **SSH** only. Follow these steps to connect and get started!

***

#### **How to Connect via SSH**

1️⃣ **Command Format**: Use the following syntax to initiate the connection:

```bash
ssh htb-student@<IP-Address>
```

Replace `<IP-Address>` with the target host’s IP provided in the lab.

2️⃣ **First-Time Connection**:

* You’ll be prompted to **accept the host’s certificate**. Type `yes` to proceed.

3️⃣ **Authentication**:

* Enter the **user password** when prompted.

***

#### **What Happens After Logging In?**

Once authenticated, you’ll have full command-line access to the target system and can begin completing lab exercises.

***

#### **Pro Tip: Save Time!**

* **Reuse Connections**: Use tools like `tmux` or `screen` to manage multiple SSH sessions efficiently.
* **Remember Credentials**: Use an SSH key or password manager for convenience (if allowed by the lab setup).

***

Now you’re ready to dive into the CLI and start tackling the challenges like a pro! 🕵️‍♂️✨
