3. Invoke-Command: This cmdlet is mostly used by ethical hackers and penetration testers. using invoke-command we can execute command on local and remote systems. In later blog series we will use Invoke-Command in Depth.
PowerShell for Ethical Hackers Blog Series
Part2: Understanding PowerShell Basics Commands
Hello All, Today we will see why understanding PowerShell basics is important as a ethical hacker or a penetration testing, as all we know basics is most important part for gaining advance knowledge. So, same in my blogpost we are going to learn Powershell from basics today i am going to show you usage of commands in powershell which we will use later in Hacking 😃😄
NOTE: I am going to present only those cmdlets which are useful in penetration testing.
What is Cmdlet?
A cmdlet is a lightweight command that is used in the Windows PowerShell environment. The Windows PowerShell runtime invokes these cmdlets within the context of automation scripts that are provided at the command line. The Windows PowerShell runtime also invoke them programmatically through Windows PowerShell APIs.
Example: "Get-Command, Get-Process" is a Cmdlet.
You can read more about Cmdlet here: Cmdlet Overview
1. Get-LocalUser: This cmdlet is used for listing local user in windows system but only from those which are not in AD environment. if you want to list AD User you have to use Get-ADUser.
2. Get-ItemProperty: This cmdlet is used for view the results in registry as we all know understanding the registry hives and keys are most important in Post Exploitation Part. we can extract so much juicy information from windows registry. in this example, we are going to extract the Browser History related to Internet Explorer from Windows Registry .
PowerShell Cmdlet for Internet Explorer History:
Get-ItemProperty -path registry::'HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\TypedURLs'
Extracted URLs |
3. Invoke-Command: This cmdlet is mostly used by ethical hackers and penetration testers. using invoke-command we can execute command on local and remote systems. In later blog series we will use Invoke-Command in Depth.
In this example we are executing powershell script on remote computers this script will export Internet Explorer history and save it in CSV file.
Thats all for this Post. Stay Tuned for next blog post till then Happy Hacking 😊😉
#HappyHacking #Blogger #Security #Learner
Comments
Post a Comment