WarCon22 - Modern Initial Access and Evasion Tactics
WarCon22 - Modern Initial Access and Evasion Tactics
WarCon22 - Modern Initial Access and Evasion Tactics
Mariusz Banach
Red Team Operator at ING Tech Poland
@mariuszbit, github/mgeeky
beacon>
whoami
Agenda
» A Few Phishing Tricks
» Evasion In-Depth
» Delivery
» Exploitation
» Installation
» Exfiltration
Disclaimer
» Initial Access & Evasion tactics effectiveness is very Company/vendor specific
» Quite hard to maintain absolute 0% detection rate in Mature, Highly Secured Environments
» This talk shares my insights into engagements delivered with following Security Stacks:
» McAfee AV
» BlueCoat Proxy
PHISHING
Phishing
» Banger tricks:
» Ride-to-Left-Override-Like-Its-90s
» Domain Warm Up
» Phish to Persist
» instead of Phish to Access (Matt Graeber @SpecterOps)
» JSE, JS – JScript
» XSL - XML
» Allows multiple scripts („jobs”) and combination of languages within a single file
XSL
JS
Initial Access »
» lnk – Link
» Often detected
Initial Access »
» via GetObject
» Can be detected
SCT
Initial Access »
» File Dropping-based
» DotNetToJS
» XSL
» pub - Publisher
» Lesser detected
Rise of
Containerized
Malware
Containerized Malware
» Starting with 7 Feb 2022, Microsoft
» 7zip*
» CAB
» VHD / VHDX
» Attachments are commonly used feature to package multiple docs into a single PDF
» We’ve seen Customers using PDFs with 10+ attached resources – on a daily basis
Web Browser
The Beauty of
HTML Smuggling
Endpoint
HTML Smuggling – Deadly Effective
• Clouds
• Storage Services: S3, Blobs
Delivery - Evasions
» HTML Smuggling + delay + Anti-Sandbox capabilities
Exploitation
» Office Document gets executed
Exploitation - Evasions
» DotNetToJS from VBA
» Scheduled Tasks
» COM Hijacking
» DLL Side-Loading
Installation
» KILLER EVASION:
» BEWARE OF USING COBALT STRIKE , EMPIRE, SILENTTRINITY, COVENANT, METASPLOIT
» Better - Develop In-House Mythic C2 Implant (no time wasted for UI)
Installation
» Prefer DLLs over EXEs
» Indirect Execution FTW!
» Microsoft Defender For Endpoint EDR has this ASR prevalence rule -> not that effective against DLLs
Installation
» Obfuscate your Implants:
» Use my ProtectMyTooling
Installation
» Inject into:
» DOS Stub
» Additional PE Section
» Manifest
» Version Info
» PE Checksum, Timestamp
Evasion In-Depth »
Installation
» PE Backdooring strategy:
» Insert Shellcode in the middle of .text
» Change OEP
» … or better hijack branching JMP/CALL
1. Time-Delayed Execution to timeout emulation & make AV Timeout & Transit into Behavioral analysis
2. Run Shellcode only when correct decryption key acquired – see image below
4. Use Parent PID Spoofing wherever applicable Nighthawk shellcode loader decryption key
recovery options:
5. Prefer staying Inprocess / Inline
Installation - Evasions
» Patchless AMSI + ETW Evasion (via HWBP + DR0..DR3)
» Modules Refreshing
» Indirect Execution -> jump to shellcode thread via System Library Gadgets
» Mattermost
» Asana
» Github
» JIRA
» Discord, Slack
» OneDrive
» MSSQL
» LDAP
» Printer Jobs
Evasion In-Depth »
Exfiltration
» Always in-memory ZIP / Compress files before exfiltrating
» OneDrive
» SharePoint
» Google Drive
» Forget about attachments in 2022, URLs are the primary viable vector
» Email Delivery-wise:
» GoPhish on VM1
» Google Suite / any other decent quality email suite as a next-hop forwarder
• Frequency – extremely low yields best results: keep it 4-5 emails every few hours.
• Payload Delivery-wise:
• Landing Page equipped with Anti-Sandbox
» VBA Stomping no longer has significant impact on detection potential, therefore not required
» Among different VBA Strategies – File Droppers, DotNetToJS, XSL TransformNode are killing machines
Initial Access – Bullet Points
» HTML Smuggling
» That drops ISO, IMG, Macro-enabled Office docs (yup, they still keep on rolling)
» ISO/IMG/other-containers merely effective against extensions-blacklisting
» DotNetToJScript flavoured
» Pure In-Memory execution
» Ironically bypasses Defender’s ASR rule:
» “Block office applications from injecting into other processes”
» XSL TransformNode
» Pure In-Memory execution
» super effective, not signatured, low IOC surface, lesser known
Installation – Bullet Points
↘
@mariuszbit / mb@binary-offensive.com
https://mgeeky.tech
https://github.com/mgeeky