Showing posts with label Mehul Revankar. Show all posts
Showing posts with label Mehul Revankar. Show all posts

Tuesday, June 27, 2017

Petya/NotPetya Ransomware Detection for the Modern Enterprise

A new version of the Petya malware is spreading through the European Union, primarily in Ukraine and Russia. It has already impacted many organizations, both large and small, and has compromised systems at Ukraine’s central bank, its state telecommunications company, municipal metro, and Kiev’s Boryspil International Airport.

Background

Petya is powered by Shadow Brokers exploits, which were leaked earlier this year, and appears to be a straightforward ransomware program. Once it has infected a computer, the virus encrypts each computer to a private key, rendering it unusable until the system is decrypted. The ransomware leverages a couple of vulnerabilities to quickly spread across the organization. It first leverages CVE-2017-0199, a vulnerability in Microsoft Office documents, which enables the execution of a malicious HTA file. The malware then infects systems that are vulnerable to MS17-010 and spreads laterally across the infrastructure.

Note: The Petya malware creates a scheduled task which reboots up to one hour after infection. If the task is removed before execution, it does not reschedule, buying you some time.

Similar to the WannaCry ransomware that infected systems globally earlier this year, Petya takes advantage of known vulnerabilities that already have patches. In a world where malware threats arise every day, chasing daily threats is not advised. Organizations everywhere and of every size need a more strategic approach to proactively manage security threats (and protect themselves and their customers) by implementing good cyber hygiene practices, including regular patching, updates, backups, and continuous monitoring.

How Tenable can help

Patch vulnerabilities

Tenable customers should immediately patch systems vulnerable to CVE-2017-0199 and MS17-010 if you haven’t already done so. Tenable.io™ Vulnerability Management has the following four plugins, released earlier this year, to detect vulnerable systems:

Plugin ID

Plugin Title/Comments

Exploits

99285

KB4015551: Windows Server 2012 Standard April 2017 Cumulative Update

CVE-2017-0199

99304

KB4015549: Windows 7 and Windows 2008 R2 April 2017 Cumulative Update

CVE-2017-0199

97737

MS17-010: Security Update for Microsoft Windows SMB Server (4013389)

ETERNALBLUE

ETERNALCHAMPION ETERNALROMANCE ETERNALSYNERGY

WannaCry

EternalRocks

97833

MS17-010: Security Update for Microsoft Windows SMB Server (4013389) uncredentialed check

ETERNALBLUE

ETERNALCHAMPION ETERNALROMANCE ETERNALSYNERGY WannaCry

EternalRocks

Malware scan

Tenable customers can use the Malware Scan Policy in Tenable.io™ or SecurityCenter™ to detect machines infected with Petya, and the results will be reported under plugin 59275:

Plugin 59275 output

YARA detection

Tenable customers can also use YARA rules to identify infected systems through the Malicious File Detection Using YARA Nessus plugin.

Here’s a sample rule from Kaspersky which can be used with Nessus to detect the Petya malware :

Sample YARA rule for Nessus to detect Petya

Dashboards

The Petya dashboard uses all the available methods mentioned above to consolidate the data for easy understanding of the systems most likely affected or at risk from the malware. The components bring in netstats from Nessus and the Nessus Network Monitor, and also display the content related to missing patches associated with SMB vulnerabilities.

Wrap-up

Most ransomware exploits well-known vulnerabilities that already have patches available. Implementing a proactive security program that includes regular patching and system updating is one of the best strategies you can use to prevent malware from infecting your systems. Make it a regular habit to patch and protect.

For more information

  • Learn more about Tenable.io, the first vulnerability management platform for all modern assets
  • Get a free 60-day trial of Tenable.io

Many thanks to the Tenable research team for their contributions to this blog.



from Petya/NotPetya Ransomware Detection for the Modern Enterprise

Wednesday, May 24, 2017

WannaCry 2.0: Detect and Patch EternalRocks Vulnerabilities Now

A new network worm dubbed EternalRocks is making the news this week as the successor to the WannaCry ransomware. EternalRocks leverages some of the same vulnerabilities and exploit tools as WannaCry but is potentially more dangerous because it exploits seven NSA tools that were released as part of the ShadowBrokers dump for infection instead of two used by WannaCry. So EternalRocks has the potential to spread faster and infect more systems. EternalRocks is currently dormant and isn’t doing anything nefarious such as encrypting hard drives. But EternalRocks could be easily weaponized in an instant, making the need for preventive action urgent.

Why EternalRocks may be bigger than WannaCry

WannaCry used only two of the SMB exploit tools: ETERNALBLUE and DOUBLEPULSAR. EternalRocks leverages seven NSA SMB exploit tools to locate vulnerable systems:

  • ETERNALBLUE
  • DOUBLEPULSAR
  • ETERNALCHAMPION
  • ETERNALROMANCE
  • ETERNALSYNERGY
  • SMBTOUCH
  • ARCHITOUCH

EternalRocks does not have a kill-switch which helped curtail WannaCry and mitigate the ransomware damage.

The clock is ticking with EternalRocks; take advantage of the Tenable detection tools now before any damage is inflicted on your systems.

Tenable solutions

Nessus plugins for SMBv1 and MS17-010

All of the vulnerabilities exploited by the EternalRocks worm were patched by Microsoft earlier this year as part of MS17-010. Tenable released several Nessus plugins to look for unpatched systems or systems that could be vulnerable by having SMBv1 running.

Plugin ID Nessus Plugin Description

96982

Server Message Block (SMB) Protocol Version 1 Enabled (uncredentialed check)

The system has been found to be vulnerable to SMBv1 attacks using uncredentialed checks. The Shadow Brokers group reportedly has an exploit that affects SMB, and the current WannaCry ransomware is using this exploit.

97086

Server Message Block (SMB) Protocol Version 1 Enabled

This plugin is similar to 96982, but the vulnerability is detected using credentials. The system has been confirmed vulnerable to SMBv1 attacks used by WannaCry and vulnerabilities described by Shadow Brokers. Credentialed checks are more accurate and provide mode details.

97737

MS17-010: Security Update for Microsoft Windows SMB Server (4013389) (ETERNALBLUE) (ETERNALCHAMPION) (ETERNALROMANCE) (ETERNALSYNERGY)

Credentialed plugin to detect MS017-010 (detects the patch is missing)

97833

MS17-010: Security Update for Microsoft Windows SMB Server (4013389) (ETERNALBLUE) (ETERNALCHAMPION) (ETERNALROMANCE) (ETERNALSYNERGY) (uncredentialed check)

Remote plugin to detect the MS017-010 vulnerability

99439

SMB Server DOUBLEPULSAR Backdoor / Implant Detection

This uncredentialed plugin detects if the DOUBLEPULSAR implant exists on the remote Windows

Host

Malware detection plugin

Tenable can also detect if the remote host is infected by EternalRocks worm through its malware detection plugin.

Here’s an example of an EternalRocks hash detected with the Malicious Process Detection plugin ID 59275:

EternalRocks hash detected with plugin #59275

Yara Detection

Tenable customers can also use YARA rules to identify infected systems through the Malicious File Detection Using Yara Nessus plugin.

Here’s a sample rule which can be used with Nessus to detect the EternalRocks worm:

Sample YARA rule for EternalRocks

SecurityCenter dashboard

The WannaCry Vulnerability Detection dashboard has been updated to include information about EternalRocks. The filters did not require updating, so if you have the WannaCry Vulnerability Detection dashboard, you are all set. If you have not installed the previous dashboard, you can now download the Detecting WannaCry and EternalRocks dashboard.

Detecting WannaCry and EternalRocks dashboard

Patch, don’t panic

We are fortunate to have some time to detect and patch EternalRocks vulnerabilities before they are exploited. There’s no need for a panic attack, but take time today to protect your systems.

If you don’t patch soon, there might be reason to panic later. One of the things EternalRocks does is that it leaves the DOUBLEPULSAR implant unprotected, which means other threat actors could leverage EternalRocks infected machines for their own intents and purposes.

Make it a habit to patch regularly and often. The single best thing you can do to protect your networks against malware attacks, worms and ransomware is to patch the known vulnerabilities; this is low-hanging fruit with a big return.

For more information

Many thanks to Tyler Coumbes, Cody Dumont and the Tenable research team for their contributions to this blog.



from WannaCry 2.0: Detect and Patch EternalRocks Vulnerabilities Now

Thursday, January 5, 2017

GRIZZLY STEPPE Detection with SecurityCenter

Governments and businesses around the world are always potential targets for spear phishing campaigns and APTs like GRIZZLY STEPPE. On December 29, 2016 the U.S. Department of Homeland Security (DHS) and Federal Bureau of Investigation (FBI) released a Joint Analysis Report (JAR-16-20296) which included technical details about activity tied to exploitation and the eventual compromise of systems within the United States. The U.S. government is referring to this malicious cyber threat as GRIZZLY STEPPE. The Joint Analysis Report includes GRIZZLY STEPPE indicators of compromise such as a YARA rule and suspicious IP addresses and DNS names. Global organizations must be vigilant about detecting these latest indicators of compromise. SecurityCenter® can easily scan for these indicators and alert on any detections.

How does GRIZZLY STEPPE work?

GRIZZLY STEPPE follows a familiar attack pattern. It targets unsuspecting users with a spear phishing campaign, enticing them to click on a malicious link. As soon as the link is clicked, malicious code is delivered and executed, establishing persistent remote access to that system via a Remote Access Tool (RAT), typically in the form of a web shell.

Once a persistent connection has been established, the next step usually involves escalating privileges and enumerating Active Directory accounts, leading to all sorts of nefarious activity.

Indicators of compromise

The Joint Analysis Report released by DHS and FBI included many Indicators of Compromise (IOCs) which organizations can use to assess if their systems have been compromised. The chief indicator among them is a YARA rule which detects a PHP web shell which was used as part of the GRIZZLY STEPPE campaign.

Here’s the YARA rule :

rule PAS_TOOL_PHP_WEB_KIT
{
meta:
   description = "PAS TOOL PHP WEB KIT FOUND" 
strings:
   $php = "<?php"
   $base64decode = /\='base'\.\(\d+\*\d+\)\.'_de'\.'code'/ 
   $strreplace = "(str_replace("
   $md5 = ".substr(md5(strrev("
   $gzinflate = "gzinflate"
   $cookie = "_COOKIE"
   $isset = "isset"
condition:
   (filesize > 20KB and filesize < 22KB) and
   #cookie == 2 and
   #isset == 3 and
   all of them
}

Tenable’s YARA pattern detection

Last year Tenable released SecurityCenter functionality to look for malicious files based on textual and binary patterns as defined by a YARA rule. You can use this functionality to detect the malicious PAS PHP web shell identified in the Joint Analysis Report on Windows systems. Here is a sample scan based on the GRIZZLY STEPPE YARA rule:

Create a Yara scan policy

  1. Click Scans -> Policies -> Add.
  2. Select Malware Scan.
  3. Enter a scan name.
  4. Click Malware and enable File System Scanning.
  5. Select the desired Directories and upload the Yara Rules File.
  6. Click Submit.
  7. Create and run a scan using the new policy.

YARA scan in SecurityCenter

You can also run a similar YARA scan in Nessus®. Refer to Threat Hunting with YARA and Nessus for instructions on creating a YARA scan in Nessus®.

Suspicious IP/DNS event analysis with SecurityCenter

In addition to the YARA rule, the Joint Analysis Report also included IP addresses and DNS names tied to malicious actors related to the GRIZZLY STEPPE campaign. While many false positives have been reported with these IP addresses and DNS names, you may still want to scan for them or use new more reliable sources if they become available. Using SecurityCenter, you can define a custom Watchlist asset list to look for any events within your organization which are tied to these suspicious IP addresses as follows:

Create a new asset list

  1. Click Assets -> Add -> Custom -> Watchlist.
  2. Create a file containing the IP addresses.
  3. Assign a name to the asset list, such as Grizzly Steppe IPs.
  4. Click Submit.

Analyze events

  1. Click Analysis -> Events.
  2. Configure Event Analysis to include Destination Asset and Source Asset.
  3. Select Grizzly Steppe IPs as the asset to watch.
  4. Select a timeframe of events to monitor.
  5. Click Apply All, and review the events.

SecurityCenter Event Analysis



Follow similar steps to create assets for malicious DNS names, with the caveat that you may get many false positives.

In addition to Watchlists, you can also add custom IPs, URLs or domains to the built-in threat detection in LCE®. This is done by creating custom files in the LCE plugins directory. Refer to the Tenable Community Discussion for more details.

Protecting your systems

Review activity to and from any suspicious IP addresses related to GRIZZLY STEPPE, especially if it appears to be performing a vulnerability scan. For any public facing Windows systems, run a scan with the YARA signature listed above and review any activity that might indicate a compromise.



Thanks to Rich Walchuck, John Chirhart and Andrew Flick for their contributions to this blog.



from GRIZZLY STEPPE Detection with SecurityCenter