CryptoLock(Variant) repair script

Use this script to search for files that have .encrypted appended to their name and replace them with a version from shadow copy

This powershell script will create the symlink given the ShadowCopy name you provide, it will then search the folder specified and replace all effected files removing the encrypted versions.

 

This script is modified version from here – https://rcmtech.wordpress.com/2016/01/27/restore-malware-encrypted-files-from-vss-snapshots/

Function New-SymLink ($link, $target)
{
#if (test-path -pathtype container $target)
#{
$command = "cmd /c mklink /d"
#}
#else
#{
#    $command = "cmd /c mklink"
#}

invoke-expression "$command $link $target"
}
Function Remove-SymLink ($link)
{
if (test-path -pathtype container $link)
{
$command = "cmd /c rmdir"
}
else
{
$command = "cmd /c del"
}

invoke-expression "$command $link"
}

# Before running this script:
# Use: vssadmin list shadows to find the latest unencrypted shadow copy - see the date & time they were created
# Record the Shadow Copy Volume, and use this to create a symbolic link:
# Create a folder to hold the symbolic link: md C:\VSS
# Then use: cmd /c mklink /d C:\VSS\67 \\?\GLOBALROOT\Device\HarddiskVolumeShadowCopy1555\
# You need to add a trailing backslash to the Shadow Copy Volume name produced by vssadmin.
# Once done, remove the symbolic link by using: cmd /c rd C:\VSS\67

# This is the path on the file server that got encrypted:
$EncryptedPath = "E:\File Shares\"
# This is the path to your shadow copy symbolic link:
$VSSPath = "c:\vsstemp\"
# File extension that the encrypted files have:
$Extension = ".encrypted"
# File name (minus extension) used for the "How to get your stuff unencrypted" files:
$RecoverFileFilter = "HOW_TO_RESTORE_FILES"

#Be sure to inlcude the trailing \
$VSSName="\\?\GLOBALROOT\Device\HarddiskVolumeShadowCopy250\"
#The folder to be used temporarily to mount the VSS snapshot

Remove-SymLink( $VSSPath )
New-SymLink($VSSPath,$VSSName)

$FileList = Get-ChildItem -LiteralPath $EncryptedPath -Filter *$Extension -Recurse -Force
$TotalFiles = $FileList.Count
Write-Host ("Found "+$TotalFiles)
$Counter = 0
foreach($EncryptedFile in $FileList){
$DestFileName = $EncryptedFile.FullName.Replace($Extension,"")
#$VSSFileName = $DestFileName.Replace("F:\",$VSSPath)
#Strip the first 3 characters from the full path and replace it with the temporary VSS path
$StrippedName=$DestFileName.Substring(3,$DestFileName.Length-3)
$VSSFileName = "$VSSPath$StrippedName"

try{
# Use LiteralPath to prevent problems with paths containing special characters, e.g. square brackets
Copy-Item -LiteralPath $VSSFileName -Destination $DestFileName -ErrorAction Stop
Remove-Item -LiteralPath $EncryptedFile.FullName -Force
}
catch{
$Error[0]
}
Write-Progress -Activity "Fixing" -Status $DestFileName -PercentComplete ($Counter/$TotalFiles*100)
$Counter++
}
Write-Progress -Activity "Fixing" -Completed
Write-Host "Done recoverying files. Now cleaning up."

$RecoveryFileList = Get-ChildItem -LiteralPath $EncryptedPath -Filter *$RecoverFileFilter* -Recurse
foreach($RecoveryFile in $RecoveryFileList){
try{
Remove-Item -LiteralPath $RecoveryFile.FullName -force -ErrorAction Stop
}
catch{
$Error[0]
}
}

HP Blade system commands (C7000)

Hard reset power to a blade(Undocumented?)

This will reset the power to the blade instantly, effectively removing it from the chassis and re-inserting it
reset server x

 

Original article – http://h20564.www2.hp.com/hpsc/doc/public/display?docId=mmr_kc-0115524

 

Factory Reset an iLO using Onboard administrator

Where 6 = Blade bay #

HPONCFG 6 << @

<RIBCL VERSION="2.0">
  <LOGIN USER_LOGIN="Dontcare" PASSWORD="UsingAutologin">
                <RIB_INFO MODE="write">
                                <FACTORY_DEFAULTS/>
    </RIB_INFO>
  </LOGIN>
</RIBCL>

@

 

Original Article – http://community.hpe.com/t5/HPE-BladeSystem-Server-Blades/BL460c-G7-blade-Factory-Reset-to-Default-Settings/td-p/5596175

Backspace in HP\Comware switches

Crtl+H

http://www.myteneo.net/blog/-/blogs/hp-comware-can-t-backspace-in-iterm/