DEV Community

Cover image for Powershell For Hackers - Part 1

Posted on • Updated on

Powershell For Hackers - Part 1

Alt Text
Welcome back my aspiring hackers this is a series of Powershell Which Will Explain to You the power of command lines! So Let's Get Started!!
As you all know for being a professional hacker(white, black) you need to be proficient in Linux & its flavors. There are some reasons for this.
[!0]Linux is an open-source operating system & most of the hacking tools are built-in Linux.
[!1]The Terminal of Linux has full control over the operating system besides cmd.exe in windows.
For these couple of reasons, we as a hacker/pen-tester believe that Linux provides us a good environment for our penetration testing tasks but In recent years, Microsoft seems to have gained religion in terms of the advantage of the command line and terminal in Linux. Finally, now it seems they understand the strengths and advantages of the command line, and as a response, then it comes windows powershell.

What is Powershell?

Alt Text
PowerShell is a task-based command-line shell and scripting language built on. NET. PowerShell helps system administrators and power-users rapidly automate tasks that manage operating systems (Linux, macOS, and Windows) and processes. PowerShell commands let you manage computers from the command line.
note: For more details about the history of powershell visit Wikipedia

Cmdlet In Powershell?

Alt Text
Cmdlets are specialized commands in the PowerShell environment that implement specific functions. Cmdlets are similar to commands in the Linux terminal.
One of the key differences between Windows PowerShell and the BASH shell in Linux is that Microsoft has developed cmdlets (command lets) for PowerShell. The cmdlets are single commands that accomplish sometimes more complex tasks similar to functions. These cmdlets take the form of verb-noun, such as "get-help".

Powershell Commands vs Linux Terminal Command :

There are some major commands those are the same in Linux & as well as powershell, but they both have their advantages in the field of pen-testing for example cat command is used in Linux for reads data from the file and gives their content as output, this command also works in powershell.

Windows PowerShell
Copyright (C) Microsoft Corporation. All rights reserved.

Loading personal and system profiles took 703ms.
C:\windows\system32> cat

cmdlet Get-Content at command pipeline position 1
Supply values for the following parameters:
Enter fullscreen mode Exit fullscreen mode

Get-help In Powershell ?

Get help in one of the important & basic commands in power-shell, especially if you want to use powershell as a hacking framework or tool this command will be very helpful for you. Get-help lets you find out whole help info about any particular command with detailed examples.
note: For example, there is a command in PowerShell 'invoke-psnmap' a nmap wrapper as a port scanner & you don't know how to use this particular one so will use 'get-help'.

Windows PowerShell
Copyright (C) Microsoft Corporation. All rights reserved.

Loading personal and system profiles took 908ms.
C:\Users\HP> get-help invoke-psnmap

Enter fullscreen mode Exit fullscreen mode

Alt Text

This is part one of 'power-shell for pen-tester' series with some basic information about powershell its commands thanks for visiting this blog.
In the next part I will explain some important commands in power-shell which will help you to execute your penetration task in easy with window without using Linux.

Its a series only for learners in hacking so enjoy & support me
follow me on github,twitter & checkout
Alt Text

Top comments (0)