Friday, January 3, 2025

PowerShell Get-FileHash

PowerShell Get-FileHash

เรียนรู้วิธีใช้คำสั่ง Microsoft PowerShell Get-FileHash โดยใช้ PowerShell ซึ่งจะใช้ได้กับไฟล์ทุกประเภท ไม่ว่าจะเป็น exe, msi, docx, pdf, iso และอื่นๆ

วิธีทำ  hash Checksum บน Windows (ไม่ต้องใช้แอพ)

Computes the hash value for a file by using a specified hash algorithm.

Download picture  SHA1: 9bcddbdc6e669ce7b3aaf031699fadcfed3eb6eb

PS#Get-FileHash D:\Lab\Hash\PIC1.jpg | Format-List

การใช้ Power Shell

1. กดWindows+Rเพื่อเปิดกล่องRun

2. พิมพ์powershel l แล้วคลิกตกลง

3. หน้าต่าง Windows PowerShell จะเปิดขึ้น

4. รันคำสั่งต่อไปนี้:


PowerShell Get-FileHash

Examples 1: Compute the hash value for a file

This example uses the Get-FileHash cmdlet to compute the hash value for the /etc/apt/sources.list file. The hash algorithm used is the default, SHA256. The output is piped to the Format-List cmdlet to format the output as a list.

Get-FileHash /etc/apt/sources.list | Format-List Algorithm : SHA256 Hash : 3CBCFDDEC145E3382D592266BE193E5BE53443138EE6AB6CA09FF20DF609E268 Path : /etc/apt/sources.list

Example 2: Compute the hash value for a file

Compute the hash value for a PowerShell.exe file:
PS C:\> Get-FileHash $pshome\powershell.exe | Format-List
Algorithm : SHA256
Hash      : 6A785ADC0263238DAB3EB37F4C185C8FBA7FEB5D425D034CA9864F1BE1C1B473
Path      : C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe

Example 3: Compute the hash value for an ISO file

This example uses the Get-FileHash cmdlet and the SHA384 algorithm to compute the hash value for an ISO file that an administrator has downloaded from the internet. The output is piped to the Format-List cmdlet to format the output as a list.

Get-FileHash C:\Users\user1\Downloads\Contoso8_1_ENT.iso -Algorithm SHA384 | Format-List Algorithm : SHA384 Hash : 20AB1C2EE19FC96A7C66E33917D191A24E3CE9DAC99DB7C786ACCE31E559144FEAFC695C58E508E2EBBC9D3C96F21FA3 Path : C:\Users\user1\Downloads\Contoso8_1_ENT.iso


Parameters

-Algorithm

Specifies the cryptographic hash function to use for computing the hash value of the contents of the specified file or stream. A cryptographic hash function has the property that it is infeasible to find two different files with the same hash value. Hash functions are commonly used with digital signatures and for data integrity. The acceptable values for this parameter are:

  • SHA1
  • SHA256
  • SHA384
  • SHA512
  • MD5

อ่านเพิ่มเติม:

หมายเหตุ:เนื้อหาในเว็บไซต์นี้มีขึ้นเพื่อวัตถุประสงค์ในการให้ข้อมูล  เผยแพร่ความรู้และให้โอกาสในการค้นคว้าหาข้อมูลเพื่อการศึกษา   บุคคลที่สนใจโดยทั่วไป รวมถึงนักเรียน นิสิต นักศึกษา  ในการเรียนรู้เท่านั้น

* หากมีข้อมูลข้อผิดพลาดประการใด ขออภัยมา ณ ที่นี้ด้วย  รบกวนแจ้ง Admin เพื่อแก้ไขต่อไป
ขอบคุณครับ

#WINDOWSFORENSIC #COMPUTERFORENSICS #DFIR #FORENSICS #DIGITALFORENSICS #COMPUTERFORENSIC #INVESTIGATION #CYBERCRIME #FRAUD


No comments:

Post a Comment

Digital Forensics:Windows Forensics with Belkasoft

Digital Forensics:Windows Forensics with Belkasoft Photo credit : belkasoft   Belkasoft เป็นผู้นำระดับโลกในด้านการตรวจพิสูจน์หลักฐานดิจิทัลแ...