Hans5958

WannaCry - What is it? How to prevent it?

May 14th, 2017
482
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.18 KB | None | 0 0
  1. WannaCry, also known as WannaCrypt, WanaCrypt0r 2.0, Wanna Decryptor, wcrypt, is a ransomware program that targets Microsoft Windows software. It's just a normal ransomware that encrypts files for a cash, but what makes is famous is the virus is spreading so fast like a wildfire. It infects over 230,000 computer in 99 countries.
  2.  
  3. This ransomware uses EternalBlue exploit, which a leaked exploit on Server Message Block feature. This exploit is actually patched in March 2017, but most users don't care about it until this happends. This ransomware demands $300 worth of bitcoin. It also has 23 languages of the message.
  4.  
  5. A security researcher accidentally triggering a "kill switch" by registering a domain that hardcoded on the malware. The malware actually checks that domain. If the malware failes to connect that domain, it starts to encrypt your files. (eventually the next version has no kill switch)
  6. Microsoft patches the exploit (MS17-010). Microsoft patches all Windows, including the outdated ones, which is unusual.
  7.  
  8. On this kind-of-article, I will show you the mitigation steps to prevent WannaCry infects your computer.
  9.  
  10. ---------
  11. MITIGATION STEPS:
  12. All steps are important! If you can't do some of this steps, just skip and do the other one! Each step is powerfull!
  13. Most of these steps requires Administrator previleges!
  14.  
  15. 1. Update your Windows
  16.  
  17. Windows Vista, Windows Server 2008, Windows 7, Windows Server 2008 R2, Windows 8.1, Windows Server 2012, Windows Server 2012 R2, Windows RT 8.1, Windows 10, Windows Server 2016
  18. https://technet.microsoft.com/en-us/library/security/ms17-010.aspx
  19.  
  20. Windows Server 2003 SP2, Windows XP SP2, Windows XP Embedded SP3, Windows 8,
  21. https://blogs.technet.microsoft.com/msrc/2017/05/12/customer-guidance-for-wannacrypt-attacks/
  22.  
  23. 2. Forbid ports
  24.  
  25. Run this commands on an elevated Command Prompt.
  26. netsh advfirewall firewall add rule dir=in action=block protocol=TCP localport=135 name="PreventWannaCry Block_TCP-135"
  27. netsh advfirewall firewall add rule dir=in action=block protocol=TCP localport=445 name="PreventWannaCry Block_TCP-445"
  28. netsh advfirewall firewall add rule dir=in action=block protocol=TCP localport=139 name="PreventWannaCry Block_TCP-139"
  29. netsh advfirewall firewall add rule dir=in action=block protocol=TCP localport=3389 name="PreventWannaCry Block_TCP-3389"
  30.  
  31. 3. Disable SMBv1
  32.  
  33. Windows 7, Windows Server 2008 R2, Windows Vista, and Windows Server 2008
  34. Method 1
  35. 1. Open PowerShell
  36. 2. Run this command.
  37. Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Services\LanmanServer\Parameters" SMB1 -Type DWORD -Value 0 -Force
  38. 3. Restart your computer
  39.  
  40. Method 2
  41. 1. Open regedit
  42. 2. Go to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\LanmanServer\ParametersRegistry
  43. 3. Find SMB1, and modify its value to 0.
  44. 4. Close it.
  45. 5. Restart your computer
  46.  
  47. Windows 8 and Windows Server 2012
  48. Run this command on PowerShell.
  49. Set-SmbServerConfiguration -EnableSMB1Protocol $false
  50. No restart needed.
  51.  
  52. Windows 8.1/Windows Server 2012 R2 and later
  53. Method 1
  54. 1. Press Win+R, enter "optionalfeatures", then click Run
  55. 2. Untick "SMB1.0/CIFS File Sharing Support" and click OK
  56. 3. Restart your computer.
  57.  
  58. Method 2
  59. Run this command on an elevated Command Prompt.
  60. dism /online /norestart /disable-feature /featurename:SMB1Protocol
  61.  
  62. Method 3
  63. Run this command on PowerShell.
  64. Disable-WindowsOptionalFeature -Online -FeatureName smb1protocol
  65.  
  66. 4. Use an Antivirus. Windows Defender is OK, but it's recommended to install other antivirus.
  67.  
  68. 5. Do backups. Save all your files in a seperated disk. (including online storages, external hard disks, flash drives, CD/DVD's, etc)
  69.  
  70. ----------
  71.  
  72. Affected file extensions.
  73.  
  74. .der, .pfx, .key, .crt, .csr, .p12, .pem, .odt, .ott, .sxw, .stw, .uot, .3ds, .max, .3dm, .ods, .ots, .sxc, .stc, .dif, .slk, .wb2, .odp, .otp, .sxd, .std, .uop, .odg, .otg, .sxm, .mml, .lay, .lay6, .asc, .sqlite3, .sqlitedb, .sql, .accdb, .mdb, .dbf, .odb, .frm, .myd, .myi, .ibd, .mdf, .ldf, .sln, .suo, .cpp, .pas, .asm, .cmd, .bat, .ps1, .vbs, .dip, .dch, .sch, .brd, .jsp, .php, .asp, .java, .jar, .class, .mp3, .wav, .swf, .fla, .wmv, .mpg, .vob, .mpeg, .asf, .avi, .mov, .mp4, .3gp, .mkv, .3g2, .flv, .wma, .mid, .m3u, .m4u, .djvu, .svg, .psd, .nef, .tiff, .tif, .cgm, .raw, .gif, .png, .bmp, .jpg, .jpeg, .vcd, .iso, .backup, .zip, .rar, .tgz, .tar, .bak, .tbk, .bz2, .PAQ, .ARC, .aes, .gpg, .vmx, .vmdk, .vdi, .sldm, .sldx, .sti, .sxi, .602, .hwp, .snt, .onetoc2, .dwg, .pdf, .wk1, .wks, .123, .rtf, .csv, .txt, .vsdx, .vsd, .edb, .eml, .msg, .ost, .pst, .potm, .potx, .ppam, .ppsx, .ppsm, .pps, .pot, .pptm, .pptx, .ppt, .xltm, .xltx, .xlc, .xlm, .xlt, .xlw, .xlsb, .xlsm, .xlsx, .xls, .dotx, .dotm, .dot, .docm, .docb, .docx, .doc
  75.  
  76. The file extensions that the malware is targeting contain certain clusters of formats including:
  77.  
  78. 1. Commonly used office file extensions (.ppt, .doc, .docx, .xlsx, .sxi).
  79. 2. Less common and nation-specific office formats (.sxw, .odt, .hwp).
  80. 3. Archives, media files (.zip, .rar, .tar, .bz2, .mp4, .mkv)
  81. 4. Emails and email databases (.eml, .msg, .ost, .pst, .edb).
  82. 5. Database files (.sql, .accdb, .mdb, .dbf, .odb, .myd).
  83. 6. Developers’ sourcecode and project files (.php, .java, .cpp, .pas, .asm).
  84. 7. Encryption keys and certificates (.key, .pfx, .pem, .p12, .csr, .gpg, .aes).
  85. 8. Graphic designers, artists and photographers files (.vsd, .odg, .raw, .nef, .svg, .psd).
  86. 9. Virtual machine files (.vmx, .vmdk, .vdi).
  87.  
  88. ----------
  89. References:
  90.  
  91. https://technet.microsoft.com/en-us/library/security/ms17-010.aspx
  92. https://support.microsoft.com/id-id/help/4013389/title
  93. https://support.microsoft.com/id-id/help/2696547/how-to-enable-and-disable-smbv1,-smbv2,-and-smbv3-in-windows-vista,-windows-server-2008,-windows-7,-windows-server-2008-r2,-windows-8,-and-windows-server-2012
  94. https://www.windows-commandline.com/run-command-windows-features-turn-on-off/
  95. https://stackoverflow.com/questions/43952057/how-to-protect-from-wcrypt-wanna-cry
  96. http://blog.talosintelligence.com/2017/05/wannacry.html
  97. https://securelist.com/blog/incidents/78351/wannacry-ransomware-used-in-widespread-attacks-all-over-the-world/
  98. https://thehackernews.com/2017/05/wannacry-ransomware-cyber-attack.html
  99. https://en.wikipedia.org/wiki/WannaCry_cyber_attack
Advertisement
Add Comment
Please, Sign In to add comment