How To - Crypto Process
How To - Crypto Process
765137662.docx
Version Control
1.7 DR Help File Script clean-up – XenApp and RDS Added a Not to this section of Appendix to explain the
servers switches used and order of Script
Body of Document Modified all sections contained in the Body of the document
to reflect changes that have been seen in the behaviour of the
New Crypto Style outbreak and to be more specific with the
process steps.
1.8 DR Clean Up Phase – IMC Engineer Modified introduction to point mention Shadows copies
solution.
Introduction
Due to the large Number of Crypto Locker/Wall style outbreak’s among our clients this document was
written to show all HIT support teams the process to follow when a customer has had their files encrypted
by a Ransomware style outbreak.
There are three main method that Crypto Locker/Wall can enter an organisation
The first and most prevalent is via an e-mail.
o These e-mails are usually from a Parcel delivery service stating that they have tried to
deliver a parcel to the recipient but they were not able to contact them.
o These e-mail will always contain a link that take the user to an external website where they
are instructed to download a file that will give them Instructions on when and where they
can collect the parcel.
o This file then installs the Ransomware on the users machine or in there Citrix session and
starts encrypting files that the users has access to on the local and network attached drives
The Seconds version is from hijacking website that the users may visit
o These website may come up in a search or the URL manually typed
o When the website is visits a script run in the background to install the Ransomware on the
device or in the session
The Third and latest version comes in the form of a word document that contains macros, after
allowing the macro to run in the document the file become infected
Depending on the variant that has affect the clients will depend on the types of file that have been effected
though as a rule all user file types are normally encrypted, these include but are not limited to files with the
following extensions:-
NOTE: Not all variant will encrypt all these types of file some have been know not to encrypt Image, Text,
XML, HTM/L type file other have been known to encrypt these type of file even though they will create
them in the process.
In most case the Ransomware will not encrypt System file as these are required for the Computer to boot, It
has also been seen that different variant will place entries on the affected Computer that will inform the user
of the encrypted files and how they can pay to get them unencrypted, if this occurs on a Citrix or terminal
server this will need to be cleaned up manually. Investigating the “RUN” section of the computer registry will
assist let you know what is being run and where the files being run are located. It can also write a registry
key to re-run the Ransomware applications over the PC and Network again, but in most cases just add a key
that point to an EXE file in the Documents directory that reminds the users upon log on to pay the ransom.
b. Inform the Service desk and get them to perform the tasks as listed above
c. Inform the Service Delivery manager of the Outbreak
5. Write and run the initial RoboCopy Script to move the Help Instructions to a location that can be used to
determine the extent of the Outbreak, this folder will also be valuable in determining what need to be
restored, all script are to be stored in the folder C:\harbourit\scripts
a. The drive that these file can be moved to can be the C Drive of the server that is having the new Disk
attached, if this drive has not been affected
b. The Drive should contain a minimum of 15 GB free Space.
c. If there are existing script in the location review and edit as needed
d. For an example of the instruction clean-up script please see the Appendix section of this document.
e. All script should be run if Possible from a console session and in an Administrator version of
Command Prompt or PowerShell
6. The base variant of the outbreak will need to be determined so that the correct clean-up process can be
followed.
a. There are Three main behaviour that have been observed when an outbreak has affected a client
i. One variant type will usually rename the file with and extension that can be easily
determined and there for they can be moved to allow restore without overwriting, These are
mostly different Crypto Locker Style Variant’s
ii. One Variant type will not rename the file, this seems to have become the main type of
outbreak.
iii. One Variant type renames the file but does not use a use the same extension for each of the
file this makes clean up much harder. This is mostly the CryptoWall 4.0 Variant
NOTE: For both the later 2 variants after completion of the help file scan a script will need to be written to
move the entire share location affected to the temp drive location. This is so that any files that have
been updated and not encrypted are in a location that can be recovered from if needed.
7. If running the Scripts over the C Drive of the server the C:\User or C:\Documents and Setting folder will need to
be excluded. See the Appendix A for the exclusion switches
NOTE: In most cases you will not need to run the script over the C Drive of a server unless the users actually
logged directly on the servers
8. To differentiate between the Help and Encrypted file all Help files should be placed in a folder call
“Instructions_yyyymmdd”
NOTE: In most cases you will not need to run the script over the C Drive of a server unless the users actually
logged directly on the servers
NOTE: There may be some folders under C:\Users\All Users that the script is not able to clean-up, to resolve
this issue you will need to browse to the Directory location and set the Server Administrators as the
owner of the files, if the script is still not able to move the file then they will need to be manually moved
or deleted.
Based on the information you will need to determine the risks here and advise the SDM the outcomes of
your findings to update the customer.
The only way to recover files that are affect by the above method is to pay the ransom, there is however an
opportunity to decrypt one small file through the Ransom Portal.
1. The Data will need to be restored from the last successful backup before the data was effected, if this is an
incremental backup then you will need to include all the last full and all preceding Incremental in the restore
Job
a. This is determined by the date of the Help Files that are put in the encrypted directories. As the user’s
home drive is normally the first to be encrypted then this is the best place to look.
b. It is however recommended that you do a quick check randomly on other encrypted locations to
ensure that you have the best date and time.
2. To determine the location that need to be restored you will need to reference the location that the Help
Instruction have been moved to.
a. This can be done looking at the directory structure created by the Help file clean up script
i. For a smaller outbreak it may be easier just to restore the 3rd or 4th Directory layer
ii. For an outbreak that renames file it may be easier to just restore the entire share location,
unless the share location is very large, in this case it is better to split the directories into
multiple Jobs, this will ensure that the restore completed quicker.
3. There is a possibility that file that have not been encrypted and modified are over written by doing this is the
full directory path has not been discovered.
4. If the variant has renamed the files you will need to determine if the restore can be run at the same time as
the clean-up, in most cases this will not be possible especially if the affected file are extensive.
a. If this is not possible the restore may need to be scheduled for a later time or the next day.
NOTE: This should be a time that is far enough away to ensure that there is enough space on the destination
server else the restore will fail, when the drive runs out of space
This script will remove the Crypto Help files to a new location so that a restore path can be determined.
__________________________________________________________________
RoboCopy Switches that can be used
/S = Subdirectories except empty ones
/MOV = Move File (copy to new location and delete from destination)
/TEE = Display to screen (not used if run as schedule task)
/LOG+ = Log to file with append to end of file for each running
/LOG = Log to file overwrite file for each running
/COPYALL = Copy all the Attributes including security and ownership – Need to be Run Under credentials that are an
Administrator of the Source Locations
/XD = Switch to exclude an entire directory from being scanned
/XF = Switch to exclude files from being scanned you can also use wildcards
__________________________________________________________________
Please remove the { & } as they are not needed below. eg. SET SRCDRV=F
:START
SET DATE={Enter_Date_in_Reverse_order_ie_YYYYMMDD}
SET SRCSVR={\\ServerName\Drive$}
SET SRCDRV={Drive Letter}
SET DSTSVR={\\ServerName\Drive$ or Drive Letter}
SET FILENAME={Enter the Help File name, if Multiple file are created with different extensions use filename.*}
This script will remove the Crypto Help files to a new location so that a restore path can be determined.
__________________________________________________________________
RoboCopy Switches that can be used
/S = Subdirectories except empty ones
/MOV = Move File (copy to new location and delete from destination)
/TEE = Display to screen (not used if run as schedule task)
/LOG+ = Log to file with append to end of file for each running
/LOG = Log to file overwrite file for each running
/COPYALL = Copy all the Attributes including security and ownership – Need to be Run Under credentials that are an
Administrator of the Source Locations
/XD = Switch to exclude an entire directory from being scanned
/XF = Switch to exclude files from being scanned you can also use wildcards
__________________________________________________________________
Please remove the { & } as they are not needed below. eg. SET SRCDRV=F
:START
SET DATE={Enter_Date_in_Reverse_order_ie_YYYYMMDD}
SET SRCSVR={\\ServerName\Drive$}
SET SRCDRV1={Drive Letter1}
SET SRCDRV2={Drive Letter2}
SET SRCDRV3={Drive Letter3}
SET SRCDRV4={Drive Letter4}
SET DSTSVR={\\ServerName\Drive$ or Drive Letter}
SET FILENAME={Enter the Help File name, if Multiple file are created with different extensions use filename.*}
REM _____________________________________________________________________________
REM By using the START in front of the Line a new Command windows will be started for each script
REM the Command window will automatically close wen the script has finished.
REM _____________________________________________________________________________
This script will remove the Encrypted files to a new location so that a restore path can be determined.
__________________________________________________________________
RoboCopy Switches that can be used
/S = Subdirectories except empty ones
/MOV = Move File (copy to new location and delete from destination)
/TEE = Display to screen (not used if run as schedule task)
/LOG+ = Log to file with append to end of file for each running
/LOG = Log to file overwrite file for each running
/COPYALL = Copy all the Attributes including security and ownership – Need to be Run Under credentials that are an
Administrator of the Source Locations
/XD = Switch to exclude an entire directory from being scanned
/XF = Switch to exclude files from being scanned you can also use wildcards
__________________________________________________________________
Please remove the { & } as they are not needed below. eg. SET SRCDRV=F
:START
SET DATE={Enter_Date_in_Reverse_order_ie_YYYYMMDD}
SET SRCSVR={\\ServerName\Drive$}
SET SRCDRV= {Drive Letter}
SET DSTSVR={\\ServerName\Drive$ or Drive Letter}
SET FILENAME={Enter the Help File name, if Multiple file are created with different extensions use filename.*}
This script will remove the Encrypted files to a new location so that a restore path can be determined.
__________________________________________________________________
RoboCopy Switches that can be used
/S = Subdirectories except empty ones
/MOV = Move File (copy to new location and delete from destination)
/TEE = Display to screen (not used if run as schedule task)
/LOG+ = Log to file with append to end of file for each running
/LOG = Log to file overwrite file for each running
/COPYALL = Copy all the Attributes including security and ownership – Need to be Run Under credentials that are an
Administrator of the Source Locations
/XD = Switch to exclude an entire directory from being scanned
/XF = Switch to exclude files from being scanned you can also use wildcards
__________________________________________________________________
Please remove the { & } as they are not needed below. eg. SET SRCDRV=F
:START
SET DATE={Enter_Date_in_Reverse_order_ie_YYYYMMDD}
SET SRCSVR={\\ServerName\Drive$}
SET SRCDRV1={Drive Letter1}
SET SRCDRV2={Drive Letter2}
SET SRCDRV3={Drive Letter3}
SET SRCDRV4={Drive Letter4}
SET DSTSVR={\\ServerName\Drive$ or Drive Letter}
SET FILENAME={Enter the Help File name, if Multiple file are created with different extensions use filename.*}
REM _____________________________________________________________________________
REM By using the START in front of the Line a new Command windows will be started for each script
REM the Command window will automatically close wen the script has finished.
REM _____________________________________________________________________________
@echo off
Goto START
This script will remove the Crypto Help files to a new location so that a restore path can be determined.
__________________________________________________________________
RoboCopy Switches that can be used
/S = Subdirectories except empty ones
/MOV = Move File (copy to new location and delete from destination)
/TEE = Display to screen (not used if run as schedule task)
/LOG+ = Log to file with append to end of file for each running
/LOG = Log to file overwrite file for each running
/COPYALL = Copy all the Attributes including security and ownership – Need to be Run Under credentials that
are an Administrator of the Source Locations
/XD = Switch to exclude an entire directory from being scanned
/XF = Switch to exclude files from being scanned you can also use wildcards
__________________________________________________________________
Please remove the { & } as they are not needed below. eg. SET SRCDRV=F
:START
SET DATE={Enter_Date_in_Reverse_order_ie_YYYYMMDD}
SET SRCSVR={Enter_Server_Name_Here}
SET DSTSVR={\\ServerName\Drive$ or Drive Letter}
SET FILENAME={Enter the Help File name, if Multiple file are created with different extensions use filename.*}
This addition will need to be added to the script prior to the Log creation section to exclude these folder
from being scanned – See Appendix C for how to clean up these folders
/XD “Documents and Settings” /XD Users /XD ProgramData /XD $Recycle.BIN
Thus the entire line would look like this:
NOTE: The number of excluded file type listed, this script needed to be a targeted move as some of the
excluded files had been added to the directory since the outbreak had occurred as HIT was not informed
until 2 days after the outbreak had occurred
@echo off
Goto START
This script will remove the Encrypted files to a new location so that a restore path can be determined.
__________________________________________________________________
RoboCopy Switches that can be used
/S = Subdirectories except empty ones
/MOV = Move File (copy to new location and delete from destination)
/TEE = Display to screen (not used if run as schedule task)
/LOG+ = Log to file with append to end of file for each running
/LOG = Log to file overwrite file for each running
/COPYALL = Copy all the Attributes including security and ownership – Need to be Run Under credentials that
are an Administrator of the Source Locations
/XD = Switch to exclude an entire directory from being scanned
/XF = Switch to exclude files from being scanned you can also use wildcards
__________________________________________________________________
:START
SET SRCSVR=D:\T1\fin1\data\finprod\attachments
SET SRCDRV=D
SET DSTSVR=\\AHCFS1\W$
SET FILENAME=*.*
REM Note: The excluded file types Listed below are specific to this running of the script and where used
REM as not all the files that where in the source directory where encrypted.
NOTE: This script has Job that will start, when it was actually run 4 of the lines where REM(arked) out. This
script also uses the /XD switch to exclude specific directories as no temp disk was available.
@echo off
Goto START
This script will remove the Encrypted files to a new location so that a restore path can be determined.
__________________________________________________________________
RoboCopy Switches that can be used
/S = Subdirectories except empty ones
/MOV = Move File (copy to new location and delete from destination)
/TEE = Display to screen (not used if run as schedule task)
/LOG+ = Log to file with append to end of file for each running
/LOG = Log to file overwrite file for each running
/COPYALL = Copy all the Attributes including security and ownership – Need to be Run Under credentials that
are an Administrator of the Source Locations
/XD = Switch to exclude an entire directory from being scanned
/XF = Switch to exclude files from being scanned you can also use wildcards
__________________________________________________________________
Please remove the { & } as they are not needed below. eg. SET SRCDRV=F
:START
SET SRCSVR=E:\DATA\PBC
SET SRCDRV=E\DATA\PBC
SET SRCSVR1=E:\DATA\Users Data\PBC-Users\reneeh
SET SRCDRV1=E\DATA\Users Data\PBC-Users\reneeh
SET SRCSVR2=E:\DATA\Roaming Profiles\reneeh.v2
SET SRCDRV2=E\DATA\Roaming Profiles\reneeh.v2
SET DSTSVR=E:
SET FILENAME=*.*
SET FOLDER1=PBC - Business
SET FOLDER2=PBC - Financial
SET FOLDER3=PBC - Payroll
SET FOLDER4=PBC - Production
SET FOLDER5=PBC - Shared
SET FOLDER6="PP & WV - Financial"
Once this has been completed it may be possible to re enable the user account.
Local User Profile Clean-up
To clean up the profile folder under C:\Users folder on the XenApp or RDS server you will need to remove
the User profiles from the server using the correct documented process.
For some variant’s you will need to log on to the XenApp or RDS server that the users who caused the
outbreak and check the “C:\Users\All Users” and “C:\Users\Public” folders and see if there are any help file
on the server, a new script has been created to perform this clean up (see Appendix A).