Ransomware Hit a File Share Synced to SharePoint? Recovery Steps
A ransomware infection on one computer can quickly become a Microsoft 365 problem.
The ransomware encrypts files that are available locally.
Those files happen to belong to a SharePoint library synchronised through OneDrive.
OneDrive sees the encrypted files as ordinary changes.
It uploads them.
Other employees then begin seeing:
encrypted documents
unfamiliar filename extensions
ransom-note files
renamed folders
thousands of unexpected modifications
SharePoint itself may never have been directly compromised.
The synchronisation system simply copied changes made by the infected computer.
That creates an important recovery rule:
Do not start restoring SharePoint until you have stopped the system that is uploading the damage.
Microsoft specifically recommends immediately stopping OneDrive synchronisation or disconnecting mapped drives connected to the affected SharePoint library following ransomware.
Step 1: Stop Synchronisation Immediately
On every suspected affected computer:
pause or quit OneDrive
disconnect mapped SharePoint drives
disconnect the device from Wi-Fi and Ethernet
use your endpoint-security platform to isolate the device where available
tell the user not to reconnect it
Closing File Explorer is not enough.
OneDrive normally continues operating in the background.
If several users are reporting encrypted files, assume there could be more than one compromised endpoint until you prove otherwise.
One clean SharePoint restore can be ruined by a second infected computer reconnecting and synchronising encrypted files again.
Step 2: Treat It as a Security Incident, Not a Sync Problem
Do not focus only on damaged documents.
Determine how the ransomware reached the environment.
Possible routes include:
phishing
malicious download
compromised Microsoft 365 account
remote-access software
unpatched computer
compromised administrator credentials
vulnerable application
Containment may require:
disabling compromised accounts
revoking Microsoft 365 sessions
resetting credentials from a trusted device
checking MFA methods
isolating other endpoints
reviewing security alerts
checking administrative activity
Do not reconnect the original computer merely because antivirus says:
Threat removed.
Ransomware incidents can involve credential theft, persistence and data exfiltration as well as file encryption.
For seriously compromised systems, rebuilding from a known-clean state may be safer than trying to prove every malicious component has been removed.
Step 3: Establish When the Attack Actually Started
Do this before restoring data.
You need the last known-good point.
Record:
earliest encrypted file
first unusual file extension
earliest ransom note
affected user
affected endpoint
affected SharePoint library
OneDrive activity
security alerts
sign-in events
bulk modification/deletion activity
Do not simply use:
“The employee noticed it at 9:15.”
Encryption may have started at:
02:43.
Your recovery point should normally precede the first malicious modification, not the first support call.
SharePoint’s version history is specifically designed to preserve earlier file states and Microsoft explicitly identifies ransomware as one of the scenarios it can help recover from.
Step 4: Work Out How Much Was Actually Affected
Determine whether the ransomware affected:
one file
one folder
one SharePoint document library
several libraries
several sites
individual OneDrive accounts
Teams files
local file shares
This determines the recovery method.
Do not restore an entire library because three documents were damaged.
Equally, do not manually restore 4,000 individual versions when the whole document library can be rolled back.
Look for:
identical modification times
mass renaming
new extensions
ransom-note filenames
mass deletions
activity concentrated around one account or device
Microsoft lists mass modification, corrupted files, new extensions and ransom-note files among the indicators of ransomware affecting a SharePoint library.
Step 5: Choose the Smallest Recovery Method That Solves the Problem
There are several useful layers of recovery.
Option 1: Restore Individual File Versions
For a handful of affected files:
1. Open the SharePoint library.
2. Find the file.
3. Open Version history.
4. Find the last known-good version.
5. Choose Restore.
Microsoft confirms that restoring an earlier version makes that content the new current version rather than simply deleting all subsequent history.
This works well for:
5 corrupted files.
It is not a sensible recovery method for:
5,000 corrupted files.
Option 2: Use the SharePoint Recycle Bin
If ransomware or malicious scripts deleted content, check:
first-stage SharePoint Recycle Bin
second-stage/site collection Recycle Bin
Microsoft currently retains deleted SharePoint items across these Recycle Bin stages for a total of 93 days from the original deletion date.
If an item has been removed from the first-stage bin, a site collection administrator may still be able to recover it from the second-stage bin.
This is particularly useful for:
deleted folders
deleted documents
content removed during a wider incident
Option 3: Restore the Entire SharePoint Library
When ransomware has changed hundreds or thousands of files, use SharePoint's library recovery capability rather than restoring documents individually.
Go to the affected library and use:
Settings > Restore this library
Select a point immediately before the malicious activity began.
Microsoft's Files Restore capability can take a document library back to a point within the previous 30 days, and Microsoft specifically identifies ransomware, corruption and mass deletion as scenarios for this feature.
This is one of the strongest built-in Microsoft 365 ransomware recovery tools.
But there is a major consequence:
it reverses legitimate activity too.
Step 6: Understand What a 30-Day Library Restore Actually Does
Suppose ransomware started at:
10:14 Tuesday
and you restore the library to:
10:13 Tuesday.
That protects you from the ransomware changes.
But it can also reverse legitimate work created afterwards.
That might include:
new documents
legitimate edits
renamed files
moved folders
deletions
Before a broad rollback:
tell the affected teams
stop users editing the library
identify important legitimate work created after the chosen recovery point
record the exact restore time
record who authorised the rollback
Do not treat point-in-time restoration as:
“restore only the bad files.”
It is broader than that.
Step 7: Restore OneDrive Separately Where Necessary
Not everything users think of as “SharePoint” necessarily lives in one SharePoint library.
Files in standard Teams channels normally belong to the team's SharePoint site.
Files shared through chats may instead reside within users' OneDrive storage.
So a ransomware event may require both:
SharePoint library recovery
and:
OneDrive recovery.
OneDrive also provides a restore capability for mass changes during the previous 30 days.
Identify the actual data location before beginning recovery.
Step 8: Keep Every Sync Client Disconnected
This is one of the most important steps.
Do not restore the SharePoint library and immediately tell everyone:
“You can turn OneDrive back on now.”
Use this sequence instead:
1. Contain the ransomware.
2. Stop synchronisation.
3. Recover the SharePoint/OneDrive data.
4. Validate recovery through the browser.
5. Rebuild or properly clean affected endpoints.
6. Remove known-corrupted local sync copies where necessary.
7. Connect one controlled test computer.
8. Watch the synchronisation behaviour.
9. Reconnect remaining devices gradually.
Microsoft’s guidance starts ransomware recovery by stopping sync precisely because an infected endpoint can continue uploading damaging changes.
The same principle applies after recovery.
Do not reintroduce the original source of corruption.
Step 9: Validate the Recovery Before Declaring Success
Do not judge recovery by:
“The ransom notes have disappeared.”
Open representative:
Word files
Excel files
PDFs
images
recently edited documents
older documents
Check:
permissions
folder structure
Teams access
sharing
OneDrive synchronisation
applications that depend on those documents
Ask actual business owners:
Is the information complete and usable?
A technically successful restore that leaves last month's finance workbook corrupted is not a successful recovery.
Step 10: Check for Data Theft Too
Modern ransomware is frequently not limited to encryption.
Attackers may steal information before encrypting it.
So restoring files does not close the incident.
Investigate whether the attacker accessed or exfiltrated:
customer data
employee information
financial records
credentials
confidential documents
That may trigger obligations involving:
customers
insurers
legal advisers
regulators
depending on what happened.
What If the Ransomware Attack Is Older Than 30 Days?
The built-in SharePoint library restore window is not unlimited.
If the incident sits outside the 30-day Files Restore window, investigate:
Individual version history
Older versions may still exist depending on the library's version-history configuration.
Microsoft emphasises that version-history retention directly affects recovery capability.
Recycle Bin
Deleted content may still exist within SharePoint's 93-day deletion-retention window.
Microsoft 365 Backup
Microsoft now explicitly recommends Microsoft 365 Backup as another recovery option for ransomware and other BCDR scenarios.
Independent Microsoft 365 backup
A properly designed third-party backup can provide:
additional retention
independent recovery points
separate administrative controls
Microsoft Support
Microsoft's current ransomware guidance says SharePoint maintains backups of content for an additional 14 days beyond actual deletion, and an administrator may be able to request restoration from Microsoft Support within that specific window when normal recovery methods are unavailable.
Treat that as a last-resort escalation path, not your everyday backup strategy.
SharePoint Version History Is Valuable — but It Is Not Your Entire Backup Strategy
Microsoft now describes version history as an integral part of SharePoint and OneDrive's built-in data protection and specifically highlights malicious activity such as ransomware as a recovery use case.
That makes it extremely valuable.
But relying entirely on:
sync + version history + Recycle Bin
still creates limitations around:
retention
administrative mistakes
recovery windows
recovery independence
For important business data, assess whether a separate Microsoft 365 backup service is appropriate.
The question should be:
“Could we recover from the ransomware scenario we actually face?”
not:
“Does Microsoft have a Recycle Bin?”
After Recovery: Fix Why the Attack Worked
Once the business is operational again, review:
endpoint detection and response
Windows patching
application patching
local administrator rights
phishing protection
email attachment protection
MFA
privileged accounts
OneDrive/SharePoint version settings
backup
restore testing
employee awareness
Do not conclude:
“OneDrive sync caused the ransomware, so we'll stop using OneDrive.”
Synchronisation was the mechanism through which the encrypted changes reached SharePoint.
The real security problem was the ransomware compromise.
SharePoint's versioning and Files Restore capabilities may ultimately be what allows the business to recover.
The Ransomware-to-SharePoint Recovery Order
If a synchronised file share is hit by ransomware, use this order:
1. Stop OneDrive synchronisation immediately.
2. Isolate compromised endpoints.
3. Investigate other potentially infected computers.
4. Secure compromised identities.
5. Establish the earliest malicious change.
6. Identify exactly which libraries and OneDrives are affected.
7. Use individual versions for isolated damage.
8. Use Recycle Bin for deleted content.
9. Use 30-day library/OneDrive restore for mass corruption.
10. Keep all endpoints disconnected during restoration.
11. Validate recovered data through Microsoft 365.
12. Rebuild or properly clean affected computers.
13. Reconnect one test sync client.
14. Monitor it.
15. Gradually reconnect other trusted devices.
16. Investigate possible data theft.
17. Strengthen security and backup controls.
The most important rule is:
Stop the source of the malicious changes before restoring the destination.
How Hamilton Group Can Help
Hamilton Group can help businesses respond when ransomware reaches Microsoft 365 through OneDrive or SharePoint synchronisation.
We can assist with:
ransomware containment
Microsoft Defender
endpoint investigation
Microsoft 365 compromise
SharePoint recovery
OneDrive recovery
Microsoft 365 Backup
backup strategy
clean device rebuilds
Conditional Access
MFA
post-incident security hardening
A SharePoint restore can recover documents.
A proper incident response needs to make sure the machine or account that damaged them cannot simply do it again.
Visit hgmssp.com or call 01423 438 953 to discuss ransomware recovery and Microsoft 365 security.
0 comments
- Be the first to comment.