SlideShare a Scribd company logo
1 of 58
Download to read offline
Modern Evasion
Techniques
a.k.a - How to Concatenate Strings
Jason Lang - @curi0usJack
PowerShell, Macros, CSharp
Proofpoint, Mimecast
Palo Alto, Fortinet. Cisco.
Most of them.
Anti-Virus Evasion
Payload Customization
Inline Control Workarounds
NG Email Controls
4
3
1
2
Topics
Thank you:
@Bandrel
@jarsnah12
@slobtresix0
@midnite_runr
msf/empire devs
About
• 10+ years full time InfoSec
• Sr Consultant @ TrustedSec
• Specialties: Active Directory, Development (C#
Python PowerShell)
• Hobbies: Woodworking, Beekeeping, Fly Fishing
Jason Lang @curi0usJack
PAUSE
blue harder
Inline Controls
• Defined: A network layer control that performs real-
time threat prevention
• Two biggest contenders: Palo Alto, Fortinet.
• My testing was performed with a fully licensed, up-to-
date Palo Alto, as well as a Cisco 5500 with FirePower
Meterpreter (stock)
Test Cases
Empire
Pupy Custom Meterpreter
•windows/x64/meterpreter/reverse_https
•Default certificate
•Port 443
•Empire 2.1
•Default Certificate
•Standard stager
•Port 443
•obfs3 transport
•Defaults
•Port 443
•Custom C# code
•Whatever I wanted
Victim Machines: Windows 7/10 x64.
Windows Defender
Cisco Configuration
9
• Rules: Blocking all the things
• SSL Decryption: ON
Cisco Configuration
10
https://www.cisco.com/c/en/us/td/docs/security/firepower/60/configuration/guide/
fpmc-config-guide-v60/Access_Control_Using_Intrusion_and_File_Policies.html
Cisco Configuration
11
MAX DETECTION MODE:
PA Configuration
12
• Vuln Protection: All the things
set to reset_both
• Wildfire: ON
• SSL Decryption
Meterpreter Results
13
• With SSL Decryption
• Session Opened/Closed
• Without SSL Decryption
Results were the same for the Custom C# Meterpreter.
Pupy Results
14
• With SSL Decryption
• Without SSL Decryption
Win10 Defender ^^
Empire Lulz
A story in screenshots
Empire Lulz
After running our launcher…
Empire Lulz
Empire Lulz
Nah… this shouldn’t work…there’s no way…
A minor server change:
Empire Lulz
Inline Evasions
• If you must use msf, use auxiliary/gather/
impersonate_ssl
Inline Evasions
Inline Evasions
Inline Evasions
• Pay attention to Decryption/Detection patterns.
• Favor Empire/Pupy over MSF if you are getting
detected. Change all defaults.
• Change your template**.
• Hope you’re working with a Cisco firewall.
** https://www.blackhillsinfosec.com/modifying-metasploit-x64-template-for-av-evasion/
Email Controls
• Defined: Anything that stops my phish from getting to
the inbox
• Examples: Proofpoint, Mimecast, Google spam filters
Email Controls
Thanks to @CaseyCammilleri for all the shells!
Email Controls
Email Controls
Email Controls
Email Controls
Apache mod_rewrite to the rescue!
Email Controls
Add to /etc/apache2/sites-enabled/000-default.conf
Email Controls
Create /var/www/html/.htaccess
Moar awesome redteam infrastructure guidance here:
https://bluescreenofjeff.com/
Email Controls
Email Controls
Thanks for the tip @slobtresix0!
Email Controls
haha AV
https://gist.github.com/curi0usJack/971385e8334e189d93a6cb4671238b10
Email Controls
^ Shell from JOHNNYSPC (Wildfire) ^
Email Controls
Email Controls
Email Controls
Email Controls
Email Controls
Email Controls
Email Controls
Q: What if Google is blocking on the
recipient’s side?
Email Controls
A: You forgot this.
^^ Correct SPF Record for sending via O365 ^^
Email Workarounds
1. Obfuscate your payload (generally the most basic will do)
2. Set SPF/DKIM Records
3. Use links instead of attachments
4. mod_rewrite is your friend
5. Check the phish with isnotspam.com
6. Don’t trip threshold alerts. Send targeted phish slowly
Anti-Virus
Anti-Virus
• First things first thing’s first: Understand current state
• Test payloads against Virus Total
• Focused on the major players: Symantec, McAfee, Trend,
Windows Defender, Cylance
Anti-Virus
Type Template Args/Notes Detections Major Player
Binary (x86) No None 51/64 Yes
Binary (x64) No None 41/64 Yes
Binary (x64) Yes None 16/62 Yes
Binary (x64) Yes Custom C# 6/64 Yes (MS)
Binary (x64) Yes C#, -e xor -i 4 3/64 Yes (MS)
Binary (x64) Yes
C#, -e
zutto_dekiru
2/64 No
PowerShell No Unicorn 1/56 No
Binary (x64) Yes Ebowla 0/64 No
AV Evasion #1 - Custom C# 1
49
• Receives msfvenom -f csharp
output
• Easily modified to suit needs
• Basic exe detection: 6/64
AV Evasion #1 - Custom C# 2
50
• Runs powershell code
without powershell.exe
Demo:
C# Payload Generation
AV Evasion #1 - Custom C# 2
• AV Vendors are simply searching for strings
• Remove all comments
• Change function names / param names
• Concatenate your encoded commands
AV Evasion #2 - PowerShell
AV Evasion #2 - PowerShell
powershell -W 1 -c “. .Invoke-Minicars.ps1; Invoke-Minicars -GimmeCreds”
https://gist.github.com/curi0usJack/adbf34bd402f28138388bd6e266da961
AV Evasion #3 - Ebowla
55
• Encrypts payload with target
env variable
• Self decrypts on execution
• Basic exe detection: 0/64
• https://github.com/Genetic-
Malware/Ebowla
Demo:
Chaining it together
Payload Gen -> Evasion -> Delivery Vehicle
Tools
1. MSF/Empire - You should know where these are at. =)
2. Pupy - https://github.com/n1nj4sec/pupy
3. Unicorn - https://github.com/trustedsec/unicorn
4. Ebowla - https://github.com/Genetic-Malware/Ebowla
5. Luckystrike - https://github.com/curi0usJack/luckystrike
6. C# Demo Extras
1. https://github.com/curi0usJack/psfire
2. https://github.com/curi0usJack/custompayload
Thank you! =)

More Related Content

What's hot

What's hot (20)

Audit
AuditAudit
Audit
 
Defcon 22-colby-moore-patrick-wardle-synack-drop cam
Defcon 22-colby-moore-patrick-wardle-synack-drop camDefcon 22-colby-moore-patrick-wardle-synack-drop cam
Defcon 22-colby-moore-patrick-wardle-synack-drop cam
 
I hunt sys admins 2.0
I hunt sys admins 2.0I hunt sys admins 2.0
I hunt sys admins 2.0
 
Awesome_fuzzing_for _pentester_red-pill_2017
Awesome_fuzzing_for _pentester_red-pill_2017Awesome_fuzzing_for _pentester_red-pill_2017
Awesome_fuzzing_for _pentester_red-pill_2017
 
Get-Help: An intro to PowerShell and how to Use it for Evil
Get-Help: An intro to PowerShell and how to Use it for EvilGet-Help: An intro to PowerShell and how to Use it for Evil
Get-Help: An intro to PowerShell and how to Use it for Evil
 
Workshop: PowerShell for Penetration Testers
Workshop: PowerShell for Penetration TestersWorkshop: PowerShell for Penetration Testers
Workshop: PowerShell for Penetration Testers
 
Pwning with powershell
Pwning with powershellPwning with powershell
Pwning with powershell
 
Attack on the Core
Attack on the CoreAttack on the Core
Attack on the Core
 
From P0W3R to SH3LL
From P0W3R to SH3LLFrom P0W3R to SH3LL
From P0W3R to SH3LL
 
Stealthy, Hypervisor-based Malware Analysis
Stealthy, Hypervisor-based Malware AnalysisStealthy, Hypervisor-based Malware Analysis
Stealthy, Hypervisor-based Malware Analysis
 
'Malware Analysis' by PP Singh
'Malware Analysis' by PP Singh'Malware Analysis' by PP Singh
'Malware Analysis' by PP Singh
 
Advanced Weapons Training for the Empire
Advanced Weapons Training for the EmpireAdvanced Weapons Training for the Empire
Advanced Weapons Training for the Empire
 
Invoke-CradleCrafter: Moar PowerShell obFUsk8tion & Detection (@('Tech','niqu...
Invoke-CradleCrafter: Moar PowerShell obFUsk8tion & Detection (@('Tech','niqu...Invoke-CradleCrafter: Moar PowerShell obFUsk8tion & Detection (@('Tech','niqu...
Invoke-CradleCrafter: Moar PowerShell obFUsk8tion & Detection (@('Tech','niqu...
 
PowerShell for Cyber Warriors - Bsides Knoxville 2016
PowerShell for Cyber Warriors - Bsides Knoxville 2016PowerShell for Cyber Warriors - Bsides Knoxville 2016
PowerShell for Cyber Warriors - Bsides Knoxville 2016
 
Introducing PS>Attack: An offensive PowerShell toolkit
Introducing PS>Attack: An offensive PowerShell toolkitIntroducing PS>Attack: An offensive PowerShell toolkit
Introducing PS>Attack: An offensive PowerShell toolkit
 
Invoke-Obfuscation nullcon 2017
Invoke-Obfuscation nullcon 2017Invoke-Obfuscation nullcon 2017
Invoke-Obfuscation nullcon 2017
 
The Hunter Games: How to Find the Adversary with Event Query Language
The Hunter Games: How to Find the Adversary with Event Query LanguageThe Hunter Games: How to Find the Adversary with Event Query Language
The Hunter Games: How to Find the Adversary with Event Query Language
 
Adventures in Asymmetric Warfare
Adventures in Asymmetric WarfareAdventures in Asymmetric Warfare
Adventures in Asymmetric Warfare
 
PowerShell for Penetration Testers
PowerShell for Penetration TestersPowerShell for Penetration Testers
PowerShell for Penetration Testers
 
Obfuscating The Empire
Obfuscating The EmpireObfuscating The Empire
Obfuscating The Empire
 

Similar to Modern Evasion Techniques

Power on, Powershell
Power on, PowershellPower on, Powershell
Power on, Powershell
Roo7break
 

Similar to Modern Evasion Techniques (20)

InSpec For DevOpsDays Amsterdam 2017
InSpec For DevOpsDays Amsterdam 2017InSpec For DevOpsDays Amsterdam 2017
InSpec For DevOpsDays Amsterdam 2017
 
MLSEC 2020
MLSEC 2020MLSEC 2020
MLSEC 2020
 
DevOpsDaysRiga 2017: Mandi Walls - Building security into your workflow with ...
DevOpsDaysRiga 2017: Mandi Walls - Building security into your workflow with ...DevOpsDaysRiga 2017: Mandi Walls - Building security into your workflow with ...
DevOpsDaysRiga 2017: Mandi Walls - Building security into your workflow with ...
 
InSpec Workflow for DevOpsDays Riga 2017
InSpec Workflow for DevOpsDays Riga 2017InSpec Workflow for DevOpsDays Riga 2017
InSpec Workflow for DevOpsDays Riga 2017
 
OSDC 2017 | Building Security Into Your Workflow with InSpec by Mandi Walls
OSDC 2017 | Building Security Into Your Workflow with InSpec by Mandi WallsOSDC 2017 | Building Security Into Your Workflow with InSpec by Mandi Walls
OSDC 2017 | Building Security Into Your Workflow with InSpec by Mandi Walls
 
Clonedigger-Python
Clonedigger-PythonClonedigger-Python
Clonedigger-Python
 
OSDC 2017 - Mandi Walls - Building security into your workflow with inspec
OSDC 2017 - Mandi Walls - Building security into your workflow with inspecOSDC 2017 - Mandi Walls - Building security into your workflow with inspec
OSDC 2017 - Mandi Walls - Building security into your workflow with inspec
 
Adding Security to Your Workflow with InSpec (MAY 2017)
Adding Security to Your Workflow with InSpec (MAY 2017)Adding Security to Your Workflow with InSpec (MAY 2017)
Adding Security to Your Workflow with InSpec (MAY 2017)
 
NSC #2 - D3 02 - Peter Hlavaty - Attack on the Core
NSC #2 - D3 02 - Peter Hlavaty - Attack on the CoreNSC #2 - D3 02 - Peter Hlavaty - Attack on the Core
NSC #2 - D3 02 - Peter Hlavaty - Attack on the Core
 
Wielding a cortana
Wielding a cortanaWielding a cortana
Wielding a cortana
 
[HES2013] Virtually secure, analysis to remote root 0day on an industry leadi...
[HES2013] Virtually secure, analysis to remote root 0day on an industry leadi...[HES2013] Virtually secure, analysis to remote root 0day on an industry leadi...
[HES2013] Virtually secure, analysis to remote root 0day on an industry leadi...
 
New features in Ruby 2.5
New features in Ruby 2.5New features in Ruby 2.5
New features in Ruby 2.5
 
BSIDES-PR Keynote Hunting for Bad Guys
BSIDES-PR Keynote Hunting for Bad GuysBSIDES-PR Keynote Hunting for Bad Guys
BSIDES-PR Keynote Hunting for Bad Guys
 
RIoT (Raiding Internet of Things) by Jacob Holcomb
RIoT  (Raiding Internet of Things)  by Jacob HolcombRIoT  (Raiding Internet of Things)  by Jacob Holcomb
RIoT (Raiding Internet of Things) by Jacob Holcomb
 
Practical IoT Exploitation (DEFCON23 IoTVillage) - Lyon Yang
Practical IoT Exploitation (DEFCON23 IoTVillage) - Lyon YangPractical IoT Exploitation (DEFCON23 IoTVillage) - Lyon Yang
Practical IoT Exploitation (DEFCON23 IoTVillage) - Lyon Yang
 
Enemy at the gates: vulnerability research in embedded appliances
Enemy at the gates: vulnerability research in embedded appliances Enemy at the gates: vulnerability research in embedded appliances
Enemy at the gates: vulnerability research in embedded appliances
 
EMBA - Firmware analysis DEFCON30 demolabs USA 2022
EMBA - Firmware analysis DEFCON30 demolabs USA 2022EMBA - Firmware analysis DEFCON30 demolabs USA 2022
EMBA - Firmware analysis DEFCON30 demolabs USA 2022
 
Fuzzing - Part 1
Fuzzing - Part 1Fuzzing - Part 1
Fuzzing - Part 1
 
Power on, Powershell
Power on, PowershellPower on, Powershell
Power on, Powershell
 
Building Security into Your Workflow with InSpec
Building Security into Your Workflow with InSpecBuilding Security into Your Workflow with InSpec
Building Security into Your Workflow with InSpec
 

Recently uploaded

the Husband rolesBrown Aesthetic Cute Group Project Presentation
the Husband rolesBrown Aesthetic Cute Group Project Presentationthe Husband rolesBrown Aesthetic Cute Group Project Presentation
the Husband rolesBrown Aesthetic Cute Group Project Presentation
brynpueblos04
 
Girls in Mahipalpur (delhi) call me [🔝9953056974🔝] escort service 24X7
Girls in Mahipalpur  (delhi) call me [🔝9953056974🔝] escort service 24X7Girls in Mahipalpur  (delhi) call me [🔝9953056974🔝] escort service 24X7
Girls in Mahipalpur (delhi) call me [🔝9953056974🔝] escort service 24X7
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
February 2024 Recommendations for newsletter
February 2024 Recommendations for newsletterFebruary 2024 Recommendations for newsletter
February 2024 Recommendations for newsletter
ssuserdfec6a
 
KLINIK BATA Jual obat penggugur kandungan 087776558899 ABORSI JANIN KEHAMILAN...
KLINIK BATA Jual obat penggugur kandungan 087776558899 ABORSI JANIN KEHAMILAN...KLINIK BATA Jual obat penggugur kandungan 087776558899 ABORSI JANIN KEHAMILAN...
KLINIK BATA Jual obat penggugur kandungan 087776558899 ABORSI JANIN KEHAMILAN...
Cara Menggugurkan Kandungan 087776558899
 

Recently uploaded (15)

Exploring Stoic Philosophy From Ancient Wisdom to Modern Relevance.pdf
Exploring Stoic Philosophy From Ancient Wisdom to Modern Relevance.pdfExploring Stoic Philosophy From Ancient Wisdom to Modern Relevance.pdf
Exploring Stoic Philosophy From Ancient Wisdom to Modern Relevance.pdf
 
the Husband rolesBrown Aesthetic Cute Group Project Presentation
the Husband rolesBrown Aesthetic Cute Group Project Presentationthe Husband rolesBrown Aesthetic Cute Group Project Presentation
the Husband rolesBrown Aesthetic Cute Group Project Presentation
 
Girls in Mahipalpur (delhi) call me [🔝9953056974🔝] escort service 24X7
Girls in Mahipalpur  (delhi) call me [🔝9953056974🔝] escort service 24X7Girls in Mahipalpur  (delhi) call me [🔝9953056974🔝] escort service 24X7
Girls in Mahipalpur (delhi) call me [🔝9953056974🔝] escort service 24X7
 
SIKP311 Sikolohiyang Pilipino - Ginhawa.pptx
SIKP311 Sikolohiyang Pilipino - Ginhawa.pptxSIKP311 Sikolohiyang Pilipino - Ginhawa.pptx
SIKP311 Sikolohiyang Pilipino - Ginhawa.pptx
 
Goregaon West Escorts 🥰 8617370543 Call Girls Offer VIP Hot Girls
Goregaon West Escorts 🥰 8617370543 Call Girls Offer VIP Hot GirlsGoregaon West Escorts 🥰 8617370543 Call Girls Offer VIP Hot Girls
Goregaon West Escorts 🥰 8617370543 Call Girls Offer VIP Hot Girls
 
Dadar West Escorts 🥰 8617370543 Call Girls Offer VIP Hot Girls
Dadar West Escorts 🥰 8617370543 Call Girls Offer VIP Hot GirlsDadar West Escorts 🥰 8617370543 Call Girls Offer VIP Hot Girls
Dadar West Escorts 🥰 8617370543 Call Girls Offer VIP Hot Girls
 
Social Learning Theory presentation.pptx
Social Learning Theory presentation.pptxSocial Learning Theory presentation.pptx
Social Learning Theory presentation.pptx
 
Pokemon Go... Unraveling the Conspiracy Theory
Pokemon Go... Unraveling the Conspiracy TheoryPokemon Go... Unraveling the Conspiracy Theory
Pokemon Go... Unraveling the Conspiracy Theory
 
February 2024 Recommendations for newsletter
February 2024 Recommendations for newsletterFebruary 2024 Recommendations for newsletter
February 2024 Recommendations for newsletter
 
Emotional Freedom Technique Tapping Points Diagram.pdf
Emotional Freedom Technique Tapping Points Diagram.pdfEmotional Freedom Technique Tapping Points Diagram.pdf
Emotional Freedom Technique Tapping Points Diagram.pdf
 
KLINIK BATA Jual obat penggugur kandungan 087776558899 ABORSI JANIN KEHAMILAN...
KLINIK BATA Jual obat penggugur kandungan 087776558899 ABORSI JANIN KEHAMILAN...KLINIK BATA Jual obat penggugur kandungan 087776558899 ABORSI JANIN KEHAMILAN...
KLINIK BATA Jual obat penggugur kandungan 087776558899 ABORSI JANIN KEHAMILAN...
 
Call Girls In Mumbai Just Genuine Call ☎ 7738596112✅ Call Girl Andheri East G...
Call Girls In Mumbai Just Genuine Call ☎ 7738596112✅ Call Girl Andheri East G...Call Girls In Mumbai Just Genuine Call ☎ 7738596112✅ Call Girl Andheri East G...
Call Girls In Mumbai Just Genuine Call ☎ 7738596112✅ Call Girl Andheri East G...
 
Colaba Escorts 🥰 8617370543 Call Girls Offer VIP Hot Girls
Colaba Escorts 🥰 8617370543 Call Girls Offer VIP Hot GirlsColaba Escorts 🥰 8617370543 Call Girls Offer VIP Hot Girls
Colaba Escorts 🥰 8617370543 Call Girls Offer VIP Hot Girls
 
2023 - Between Philosophy and Practice: Introducing Yoga
2023 - Between Philosophy and Practice: Introducing Yoga2023 - Between Philosophy and Practice: Introducing Yoga
2023 - Between Philosophy and Practice: Introducing Yoga
 
March 2023 Recommendations for newsletter
March 2023 Recommendations for newsletterMarch 2023 Recommendations for newsletter
March 2023 Recommendations for newsletter
 

Modern Evasion Techniques