By using this site, you agree to the Privacy Policy and Terms of Use.
Accept
Security Parrot - Cyber Security News, Insights and ReviewsSecurity Parrot - Cyber Security News, Insights and Reviews
Notification
Latest News
OpenAI may use Associated Press archive for AI training
July 14, 2023
EU users can hold conversations with Google Bard from training set
July 14, 2023
Aptos, the new default font for Microsoft Office
July 14, 2023
BlackLotus UEFI bootkit sources published on GitHub
July 14, 2023
Hackers from the XDSpy cyber-espionage group attacked Russian organizations on behalf of the Ministry of Emergency Situations
July 14, 2023
Aa
  • News
  • Tutorials
  • Security InsiderComing Soon
  • Expert InsightComing Soon
Reading: Subject to resurrection! Restoring files to NTFS using PowerShell
Share
Security Parrot - Cyber Security News, Insights and ReviewsSecurity Parrot - Cyber Security News, Insights and Reviews
Aa
Search
  • News
  • Tutorials
  • Security InsiderComing Soon
  • Expert InsightComing Soon
Follow US
Security Parrot - Cyber Security News, Insights and Reviews > News > Subject to resurrection! Restoring files to NTFS using PowerShell
News

Subject to resurrection! Restoring files to NTFS using PowerShell

Last updated: 2023/06/06 at 11:00 AM
Security Parrot Editorial Team Published June 6, 2023
Share
SHARE

Recovering Deleted Files from NTFS v3.1 File System

Today, there are plenty of software solutions for recovering deleted files from various file systems. However, to get the most out of these tools, it is important to understand the theoretical foundations of recovering deleted information in the NTFS v3.1 file system. In this article, we will take a closer look at the practical way to manually recover files using PowerShell.

Theory

The NTFS file system is based on the “everything is a file” principle. The file has a certain set of attributes, of which the most important are $STANDARD_INFO, $FILE_NAME, and $DATA. The $STANDARD_INFO and $FILE_NAME attributes contain timestamps, while the $DATA attribute stores the contents of the resident file. In the case of non-resident files, there are “links” to the contents of the file scattered across sectors, called data runs or segments. Segments are a sequence of clusters that store the contents of a non-resident file, and as the mentioned “references” in the $DATA attribute, the number of the initial cluster and the number of clusters following are used.
All file attributes are stored in the File Record of the Master File Table ( $mft ). This is the most important service file, since it contains information about all files and directories on the volume. With only the $mft file on hand, you can build a history of file-related events, and in some cases, restore files.
Another important service file is the free space map $BitMap. With its help, all used and unused clusters are tracked.

Practice

Now that we have brushed up on the theoretical foundations of recovering deleted information in the NTFS v3.1 file system, let’s take a closer look at the practical way to manually recover files using PowerShell.
The first step is to create a folder to store the recovered files. This is done using the New-Item cmdlet:
New-Item -Path C:\RecoveredFiles -ItemType Directory
The next step is to use the Get-ChildItem cmdlet to get the list of all files in the specified folder. This cmdlet will return the list of all files, including the deleted ones.
Get-ChildItem -Path C:\RecoveredFiles
The third step is to use the Get-Content cmdlet to get the content of the deleted files. This cmdlet will return the content of the deleted files.
Get-Content -Path C:\RecoveredFiles\*
The fourth step is to use the Set-Content cmdlet to write the content of the deleted files to a new file. This cmdlet will write the content of the deleted files to a new file.
Set-Content -Path C:\RecoveredFiles\RecoveredFile.txt -Value (Get-Content -Path C:\RecoveredFiles\* -Raw)
The fifth and final step is to use the Move-Item cmdlet to move the recovered files to the desired location. This cmdlet will move the recovered files to the desired location.
Move-Item -Path C:\RecoveredFiles\RecoveredFile.txt -Destination C:\RecoveredFiles\RecoveredFiles
By following these steps, you can manually recover deleted files from the NTFS v3.1 file system using PowerShell.
Conclusion
Recovering deleted files from the NTFS v3.1 file system is a complex process that requires knowledge of the theoretical foundations of the file system. However, with the help of PowerShell, it is possible to manually recover deleted files from the NTFS v3.1 file system. By following the steps outlined in this article, you can easily recover deleted files from the NTFS v3.1 file system.

Weekly Updates For Our Loyal Readers!

Security Parrot Editorial Team June 6, 2023
Share this Article
Facebook Twitter Email Copy Link Print

Archives

  • July 2023
  • June 2023
  • May 2023
  • April 2023
  • February 2023
  • October 2022
  • September 2022
  • August 2022
  • July 2022
  • June 2022
  • May 2022
  • April 2022
  • March 2022
  • February 2022
  • January 2022
  • December 2021
  • November 2021
  • October 2021
  • September 2021
  • August 2021
  • July 2021
  • June 2021
  • May 2021
  • April 2021
  • March 2021
  • February 2021
  • January 2021
  • December 2020
  • November 2020
  • October 2020
  • September 2020
  • August 2020
  • July 2020

You Might Also Like

News

OpenAI may use Associated Press archive for AI training

July 14, 2023
News

EU users can hold conversations with Google Bard from training set

July 14, 2023
News

Aptos, the new default font for Microsoft Office

July 14, 2023
News

BlackLotus UEFI bootkit sources published on GitHub

July 14, 2023

© 2022 Parrot Media Network. All Rights Reserved.

  • Home
  • Parrot Media Group
  • Privacy Policy
  • Terms and Conditions
Join Us!

Subscribe to our newsletter and never miss our latest news, podcasts etc..

Zero spam, Unsubscribe at any time.

Removed from reading list

Undo
Go to mobile version
Welcome Back!

Sign in to your account

Lost your password?