Skip to main content

Posts

How to close a Process run by a specific User using PowerShell

Hi Geeks, Today we are going to learn how to close or kill a process run by a specific user. Lets take an example, there are 2 different users : Admin and TestUser , Now Admin and TestUser both are logged into the same machine and performing some important task in Internet Explorer. If Admin does this : Get-Process -Name “iexplorer” It will get all the list of Internet Explorer process run by both Admin as well as TestUser. Now Admin wants to Kill or Stop the Processes which are being executed by him only. So in order to perform this task you can to use the GETOWNER Method. Full Script : Hope you all enjoyed the post, Do Like , Share and comment if you have any query related to this.

How to take Snapshot of the screen using PowerShell

Hi Guys, Welcome to the Powershell Tips and Trick section. Today one of the follower of my page The Powershell Geek asked me how to take Snapshot of the Screen using PowerShell. Before beginning let me tell you , few months back one of my friend got the same requirement from our client i.e. Login to a website, then performing certain tasks and once done take snapshots as a proof that its done successfully. So here’s the Code, its already available in Technet anyways. CODE : OUTPUT IMAGE FILE : So now you can keep the code in between your script or where ever required to take the Snapshot. Hope you all enjoyed it, do Like and Share. Source : Technet

Error Handling Tips in PowerShell

Hi Geeks, We all know the ways to handle error in scripting or programming languages i.e Try, Catch, Finally and so on. The same thing can also be done in PowerShell. Example : Try { $a = 1/0 } Catch { Write-Host “Got Exception” } But suppose your script is too long and you want your Error should be handled in such a way that you can know exactly what caused the error and at which path or line number. So to do so PowerShell provides some cool properties as given below : To Catch the Complete Exception -> $_.Exception To Find the exact Error Line number -> $_.InvocationInfo.ScriptLineNumber To only get the Exception Message -> $_.Exception.Message So will look like this : Try {           Your Script Goes here  } Catch {         $Exception = $_.Exception         $Line = $_.InvocationInfo.ScriptLineNumber         $Message = $Exception.Message } FINAL OUTPUT :                                                             Hope yo

Simplest way to Hack IBM BladeCenter Management Devices

Hi Everyone, Today I will show you the simplest way to hack IBM BladeCenter devices whose password has not been changed i.e. using the default credentials. Before beginning this tutorial you should know the default credentials used by most IBM BladeCenter devices : Username : USERID ; Password : PASSW0RD (it’s Zero not O) So lets begin, Step 1 : Click on the Link to open Shodan website -> Shodan.io About Shodan , Shodan is a very powerful tool which helps to find different vulnerable network devices and helps us to gather ample amount of information about a network. Step 2 : Once the Url is loaded, type /private/main.php in the search box which will basically help you to get multiple IBM Management console list available publically . See the image below for reference. Step 3 : It will list lots and lots of Vulnerable devices,now just try out your luck . Some or more devices might be using the default credentials. I got one!! Step 4 : Once you g

How to add multiple contents in a HTML Report using Powershell

Hey Geeks, Today em gonna show you how to add multiple contents like CPU Utilization, Disk check, Services Check etc. into a single HTML Report file. Few days back I got this requirement to add multiple contents into a single report file and once the report generation is done send a mail. So lets learn how to achieve this through Powershell. Powershell provides two properties for this PRECONTENT & POSTCONTENT ,so whatever you want to add should be kept in Pre Content and finally we can merge it using Post Content. Further you can also use Add-Content , Append or Out-File to do the same. But in this example I will show you Pre Content and Post Content. Sample 1 : How to Add contents  $Services = gwmi -Class Win32_Service -ComputerName $Server -Credential $Cred |?{$_.name -match ‘Test’} | Select Name,State | Select -last 4 | ConvertTo-HTML -AS Table -Fragment -PreContent ‘<h2>Services Report</h2>’| Out-String Sample 2 : How to Merge all the contents

How to customize the Powershell Prompt

By default when you open up Powershell console, you will get a screen as shown below : so today we are going to learn how to replace the PS C:\windows\system32> with any thing lets say I ♥ PowerShell.  So lets learn how to do it. STEP 1 :  We are going to modify the Powershell Profile for this. So open PowerShell as Administrator & give the below command :  Test-Path $Profile If it return True that means Powershell profile is created, if it's False then create the powershell profile by executing the below comand :  New-Item -Path $PROFILE -Type File -Force STEP 2 : Since the Profile is now created, now open the profile in Notepad i.e.  notepad $Profile STEP 3 : Now Copy-Paste the below function in that file and Save it. You can the change the content as per your choice. If any message or warning comes then change the encoding type while saving (Since I am using a Heart Shape by default ANSI Encoding will not s

How to Zip and UnZip files using PowerShell

Today we are going to Learn all about Compressing and Decompressing a file using Powershell. So lets get started. Powershell 5.0 have lots of features added to its feather. One of them is Zipping and Unzipping . Powershell 5.0 contains 2 functions by default for Zipping and Unzipping a file i.e. Compress-Archive and Expand-Archive Syntax : Zip   :   Compress-Archive -path <Source_File_Path> -DestinationPath <Destination_File> Unzip : Expand-Archive -path <Zip_file_path_to_Extract> -DestinationPath <Destination_path_where_to_Extract>   >_ If you are using Powershell version below 5.0 then you can achieve the same by Calling a Class. ZIP - FILE Add-Type -Assembly "System.IO.Compression.FileSystem" ; [System.IO.Compression.ZipFile]::CreateFromDirectory("E:\The Powershell Geek", "E:\sample.zip") UNZIP -FILE Add-Type -Assembly "System.IO.Compression.FileSystem" [System.IO.Compression.ZipFil

Execution Policy in Powershell

How to get and set the Execution Policy Execution Policy in Powershell Execution Policy in Powershell helps to determine the type of scripts that can run on a particular system.  There are different types of Execution Policy in Powershell : 1. RESTRICTED It is the default execution policy in Powershell. It means it doesn't allow any Powershell script(*.ps1) to execute by default. In order to provide security, Microsoft suggests Restricted policy by default so that none of malicious code can be executed by double clicking or running it.  2. ALL SIGNED  All the Scripts should have a digital signature from a trusted publisher, then only you will be able to execute the Script else Script will not be executed. This is applicable for the local scripts also which you write of your own, you will need to assign a certificate to it example Self Signed Certificate . 3. REMOTE SIGNED Local script files doesn't need any signature( they can be executed) but script

How To Hack WAP or WPA2 WiFi Security Fully Explained

As Compared to WEP WiFi Hacking as explained on our previous tutorial, WPA/WPA2 is quite difficult and time consuming because of its Security. Cracking the password sometimes depends on your luck and success is not guaranteed. ..:: How to launch a Dictionary Attack on WPA Handshake ::.. You might get lucky and your nearest WiFi password may be based on a common dictionary word or number sequence. In such a case, you may succeed with a dictionary attack. Step 1: Enable monitor mode on wireless interface #airmon-ng start wlan0 This will start the monitor mode. Step 2: Take note of the nearest WiFi networks. #airodump-ng mon0 Step 3: Take note of the channel of your target network, dump packets from that channel and save them to a local capture file. #airodump-ng -c6 mon0 -w capture_file Step 4: Wait for WPA handshake capture At this point, you can use 'aireplay-ng' to de-authenticate an associated legitimate client from the network. The point

How To Hack WEP WiFi Security Fully Explained

Hello Friends, Today We are going to learn the methods to hack any WEP WiFi by cracking its Password. WiFi Security mostly contains WEP, WPA or WPA2 Psk Security. Out of which WEP is the weakest and the easiest to hack while WPA and WPA2 contains advance Encryption Security. In this tutorial we will cover WEP Hacking. Things Required -> Backtrack or Kali Linux ..:: WEP Cracking ::.. No doubt, WEP is the easiest to crack .Here's how to crack WEP: Step 1 : First we need to start the Monitoring Mode. Many people may face the no interface issues while giving the command airmon-ng so check the solution here -> http://sh.st/cXO1I #airmon-ng start wlan0 Notice that the monitor mode is enabled on mon1 on wlan0 ,take note of this. We will need this interface later on. Step 2 : Now Start dumping data packets with airodump #airodump-ng mon1 You'll see all the WiFi Channels available in your area. Here we see different security like WEP, WPA and WPA

Resolution Airmon-ng showing No Interface

Today we are going to show you all a solution for the most common Error people face while performing Airmon-ng i.e. there will be no interface as shown below : So how to fix this issue? Step 1 : Before starting Make sure that you have Internet connection on your Backtrack or Kali Linux machine.If you are using  VM then make sure your VM network adapter is Bridged with the Physical Network. Step 2 : Next Click here : http://linuxwireless.org/download/compat-wireless-2.6/  and Download  compat-wireless-2010-06-26-p.tar.bz2  file on your Backtrack or Kali Machine. Step 3 : After downloading we have to extract the file since its in compressed form(*.tar).so to extract it Go to the path where you have saved that file and then give the command : tar -jxvf compat-wireless-2010-06-26-p.tar.bz2 Step 4 : After extracting go to that folder that is created after extraction, and give the command > make unload  and then make load   (for loading the new interface) and now you

How to hack VP-ASP Shopping websites and get all the Database details

Hello Friends, Today we are going to learn how to hack VP-ASP cart of a Shopping website and download all their Database details like Customer details, Credit card details, Product details etc. So some basic idea before starting the Tutorial,  What we are going to do here? Firstly we will hack a shopadmin website then we will download the database file which will be in the form of *.mdb. This database file contains all the client details like credit card information and also login name and passwords. How to do this ? Note : This tutorial is tested on "VP-ASP Shopping Cart Version:5.00" Step 1 : First thing to do is to find VP-ASP 5.00 Sites, to do this -> Go to Google.com -> Type "VP-ASP Shopping Cart 5.00"[ Without Quotes ] . See the image for reference  Step 2 : In this tutorial, we are going to target www.surfstats.com  You can also select your website which is having "shopdisplaycategories.asp","sho