SlideShare una empresa de Scribd logo
1 de 60
Descargar para leer sin conexión
Bypass firewalls, application white lists, secure remote desktops in 20 seconds 
Zoltan Balazs 
DEF CON 22, 2014
root@kali:~# whoami 
Zoltán Balázs
root@kali:~# whoami
root@kali:~# whoami 
AV testing 
AVbypass
root@kali:~# whoami 
OSCP: Occasional Satire Captain Punk 
CISSP: Certified Interspecie-ialSheep Shearing Professional 
CPTS: Certified Pajama Toaster Specialist 
MCP: Microsoft Certified Psychopath 
OSWP: Official Sexiest Weasel Popstar 
CHFI: Chronic Hopeless Flux Incompetent 
I’mNOT a CEH 
CyberLympics@2012 CTF 
2nd runnersup–gula.sh 
Creatorof theZombieBrowser Toolkit 
https://github.com/Z6543/ZombieBrowserPack
Hungary
I love hacking
How do you hack high security systems?
How do you hack high security systems when you are not Tom Cruise?
The mission 
I’m a spy(with low budget) 
I want access to a hardened secure RDP (remote desktop) server 
E.g. server contains confidential documents 
I need persistent C&C access to the RDP server 
To upload/download files 
Interactive remote code execution
The solution (in an ideal world) 
Infected 
workstation 
Secure remote 
desktop server 
1. Infect client’s 
desktop 
2. Steal RDP password 
3. Connect to RDP 
4. Drop malware 
5. Command and Control 
6. Profit
The challenges 
RDP server is not reachable from the Internet 
Directly … 
Two factor authentication is used to access the RDP server 
No access to the token seeds ;) 
Drive mapping disabled – no direct file copy 
Restrictive hardware firewall 
Allows workstation -> server TCP port 3389 IPv4 only 
Application white list is used on the RDP server 
M$ Applocker in my case with default policy 
Firewall, port 3389 allowed only
Is this realistic? 
Similar environment at a client 
•Had no time to hack it
Infected workstationSecure remote desktop serverTarget CompanyThe InternetAttackerFirewall, port 3389 allowed only
“In hacking, there is no such thing as impossible. 
Only things that are more challenging.”
Alreadyachieved 
I have remote code execution with C&C on a user’s workstation 
I have access to a test RDP server 
I know how the files on the server look like, what services are installed 
This is Spartaaaapost-exploitation
Why should you care about this? 
Red team/pentester 
•New tools 
Blue team 
•New things to look for during log analysis/incident response 
Policy maker/business 
•Funny pictures
Divideet impera! 
Dividetheproblemintosmallerpiecesand rulethemall, onebyone 
1.dropmalwareintotheRDP server 
2.executeanycodeonRDP server 
3.elevatetoadminprivileges 
4.bypasshardwarefirewall
Divideet impera! 
Dividetheproblemintosmallerpiecesand rulethemall, onebyone 
1.dropmalwareintotheRDP server –> newshinytool 
2.executeanycodeonRDP server –> nothingnewhere 
3.elevatetoadminprivileges–> nothingnew, no 0day foryou 
4.bypasshardwarefirewall-> newshinytool
1. Drop malware into RDP server
1. DropmalwareintoRDP server 
Malware waits for the user to connect to RDP server 
Createsscreenshot(or new animation), show in foreground 
Optionallyblocksuser keyboard, mouse ~20 seconds 
Usesthekeyboardand theclipboard–simulates user 
1.StartsM$ Wordon RDP server 
2.Dropsencoded ASCII payload 
3.CreatesMacrocode 
4.Macrowritesbinary 
5.Macro starts binaries
Alternative usage of “user simulator” 
1.Add directory to be excluded from AV scans 
use the AV GUI! 
only if the user has the privileges and no UAC 
2.Install new trusted root certification authority and accept warning –and MiTMSSL connections 
CA pinning does not stop 
this attack 
The AV is alive. 
Nope, Chuck Testa™
2. What is Applocker?
2. Executeanycode, bypassApplocker 
„AppLockercan only control VBScript, JScript, .bat files, .cmdfiles and Windows PowerShell scripts. It does not control all interpreted code that runs within a host process, for example Perl scripts and macros. 
Applications could contain flagsthat are passed to functions that signal AppLockertocircumvent the rulesand allow another .exe or .dll file to be loaded. 
The administratoron the local computer can modify the AppLockerpolicies defined in the local GPO.”
Executeanycode, bypassApplocker 
Load DLL withWord Macro! 
Even shellcodeexecution is possible! 
http://blog.didierstevens.com/2008/06/05/bpmtk- how-about-srp-whitelists/ 
Private Declare PtrSafeFunction LoadLibraryLib "kernel32" Alias "LoadLibraryA" (ByVallpLibFileNameAs String) As Long 
hLibrary= LoadLibrary(outputdir+ "hack_service.dll")
3. Elevatetoadmin
3. Elevatetoadmin 
Why do I need admin? 
•It is needed for the last phase, hardware firewall bypass 
Possibilities 
•Local privesc zero day for Win 2012 
•Exploit unpatched vulnerability 
•Exploit vulnerable 3rdparty program service 
•Etc. 
Processes started with admin (or higher) privileges are not restricted by AppLocker!
Elevatetoadmin-Service exploit 
C:> accesschk.exe–l mvulnservice.exe 
[0] ACCESS_ALLOWED_ACE_TYPE: NT AUTHORITYTERMINAL SERVER USER 
FILE_APPEND_DATA 
FILE_EXECUTE 
FILE_READ_ATTRIBUTES 
FILE_READ_DATA 
FILE_READ_EA 
FILE_WRITE_ATTRIBUTES 
FILE_WRITE_DATA 
FILE_WRITE_EA 
SYNCHRONIZE 
READ_CONTROLs 
C:> scsdshowmyvulnservice 
D:(A;;CCLCSWRPWPDTLOCRRC;;;SY) 
(A;;CCDCLCSWRPWPDTLOCRSDRCWDWO;;;BA)(A;;CCLCSWLOCRRCRPWP;;;IU)(A;;CCLCSWLOCRRC;;;SU)
Elevatetoadmin-Service exploit 
C:> accesschk.exe–l mvulnservice.exe 
[0] ACCESS_ALLOWED_ACE_TYPE: NT AUTHORITYTERMINAL SERVER USER 
FILE_APPEND_DATA 
FILE_EXECUTE 
FILE_READ_ATTRIBUTES 
FILE_READ_DATA 
FILE_READ_EA 
FILE_WRITE_ATTRIBUTES 
FILE_WRITE_DATA 
FILE_WRITE_EA 
SYNCHRONIZE 
READ_CONTROLs 
C:> scsdshowmyvulnservice 
D:(A;;CCLCSWRPWPDTLOCRRC;;;SY) 
(A;;CCDCLCSWRPWPDTLOCRSDRCWDWO;;;BA)(A;;CCLCSWLOCRRCRPWP;;;IU)(A;;CCLCSWLOCRRC;;;SU) 
Allow 
Service start 
Service stop 
Interactivelyloggedonuser
Quiz
Quiz 
What’s the name of the company which published the first paper about packet filter firewalls in 1988?
Quiz 
What’s the name of the company which published the first paper about packet filter firewalls in 1988? 
The company developed VAX
Quiz 
What’s the name of the company which published the first paper about packet filter firewalls in 1988? 
Digital 
Equipment 
Corporation
4. Bypass hardware firewall 
Restrictive firewall 
•No Bind shell 
•No Reverse shell 
•No covert channel 
•DNS, ICMP, IPv6, UDP, proxy 
•No shell!!! 
In a different scenario 
•TCP socket reuse shell possible (not persistent) 
•Webshell(lame) possible 
•But not in this case (no exploit, no webserver)
4. Bypass hardware firewall 
First (bad) idea 
After malware dropped, 
mark every packet to be special 
•start with magic bytes 
and let akernel network filter driver select the packets 
Problem 
•Every (hacker) application has to be rewritten, or rerouted through a custom wrapper proxy (both server and client side)
Bypass HW firewall –second idea 
Use TCP source port! 
•E.g. port 1337 is always special 
Limitations 
•NAT from the attacker side 
•But who cares? 
Bypassing hardware firewallsLinux 
UsecodeatKernel level(withroot) 
if ((tcp_source_port === 1337) && (tcp_dest_port === 22)) then: 
redirect to bind shellon port 31337 
iptables-t nat-A PREROUTING -p tcp--dport22-- sport 1337-j REDIRECT --to-ports 31337
Attacker or infected workstationFirewall, port 3389 allowed onlySecure remote desktop serverSrc port 1337Dst port 3389Dst port 3389Dst port 31337
Bypassing hardware firewalls on Windows x64 
Installing a kernel driver in Windows x64 is not trivial 
•Trusted signed driver is needed 
Thanks to basil for WinDivertproject (and Nemea Software Development) 
•Trusted signed kernel driver already included! 
•You can interface with the kernel driver 
Alternatively, patchguardbypass could be used 
http://www.codeproject.com/Articles/28318/Bypassing- PatchGuard 
Uroburosrootkit –Bring Your Own Vuln 
Install root CA first with user simulator ;)
How to set TCP source port for meterpreterbind shell (or any program)? 
Netcat(Nmapbuild) to da rescue! 
ncat-kl 4444 -c 
"ncat-p 1337 RDP.SER.VER.IP 3389"
Demo
Alternative usage of “hwfwbypass” 
You have admin on webserver 
but persistent outbound C&C is blocked 
Instead of local port forward, use netcatto port forward to other machines in the DMZ 
Backdoor traffic to hide your 
communication inside the 
legit network traffic
The solution–as a whole 
Malware waits for the user to login to RDP with 2FA 
Create screenshot from user desktop 
Put screenshot on the screen 
Disable keyboard/mouse 
Drop malware by simulating user keyboard events + clipboard for large (ASCII) data transfer 
Start WORD, create new macro code 
Bypass application whitelist using DLL loading from Word macro code
The solution 
Escalate privileges to admin (vulnerable service) 
Install hwfwbypass.exe with kernel driver 
Dropmeterpreter 
Profit!
Demo
Demo 2 –as seen by the user
Lessons learned for red team 
You have twonew tools for your post exploitation 
•tool to drop malware into the remote desktop 
•If you have admin on a Windows server, you can bypass/fool hardware firewalls using my driver
Lessons learned for the blue team 
Every additional layer of security can still be bypassed 
Restricted remote desktop is a real interface for malware infection 
Use application/protocol aware (NG) firewall instead of port based ones 
Can be bypassed ;) 
Don’t trust your firewall logs 
blindly
Code release now?
References 
http://reqrypt.org/windivert.html 
http://inputsimulator.codeplex.com/-modified 
http://www.blackhat.com/presentations/bh-usa-06/BH- US-06-Tereshkin.pdf 
http://blog.didierstevens.com/2011/01/24/circumventing- srp-and-applocker-by-design/ 
http://www.room362.com/blog/2014/01/16/application- whitelist-bypass-using-ieexec-dot-exe 
http://leastprivilege.blogspot.fr/2013/04/bypass- applocker-by-loading-dlls-from.html?m=1https://www.mandiant.com/blog/hikit-rootkit-advanced- persistent-attack-techniques-part-2/
one more thing …
two more things … 
User simulator available as Metasploitpost module 
HW FW bypass available as Metasploitpost module
Hack The Planet! 
https://github.com/MRGEffitas/Write-into-screen 
https://github.com/MRGEffitas/hwfwbypasszoltan.balazs@mrg-effitas.com 
https://hu.linkedin.com/in/zbalazs 
Twitter–@zh4ck 
www.slideshare.net/bz98 
Greetz to @CrySySLab, @hekkcamp 
JumpESPJump.blogspot.com

Más contenido relacionado

La actualidad más candente

Defcon 22-jesus-molina-learn-how-to-control-every-room
Defcon 22-jesus-molina-learn-how-to-control-every-roomDefcon 22-jesus-molina-learn-how-to-control-every-room
Defcon 22-jesus-molina-learn-how-to-control-every-roomPriyanka Aash
 
Defcon 22-adrian-crenshaw-dropping-docs-on-darknets-how-peop
Defcon 22-adrian-crenshaw-dropping-docs-on-darknets-how-peopDefcon 22-adrian-crenshaw-dropping-docs-on-darknets-how-peop
Defcon 22-adrian-crenshaw-dropping-docs-on-darknets-how-peopPriyanka Aash
 
Hacking Highly Secured Enterprise Environments by Zoltan Balazs
Hacking Highly Secured Enterprise Environments by Zoltan BalazsHacking Highly Secured Enterprise Environments by Zoltan Balazs
Hacking Highly Secured Enterprise Environments by Zoltan BalazsShakacon
 
HackInTheBox - AMS 2011 , Spying on SpyEye - What Lies Beneath ?
HackInTheBox -  AMS 2011 , Spying on SpyEye - What Lies Beneath ?HackInTheBox -  AMS 2011 , Spying on SpyEye - What Lies Beneath ?
HackInTheBox - AMS 2011 , Spying on SpyEye - What Lies Beneath ?Aditya K Sood
 
Nikita Abdullin - Reverse-engineering of embedded MIPS devices. Case Study - ...
Nikita Abdullin - Reverse-engineering of embedded MIPS devices. Case Study - ...Nikita Abdullin - Reverse-engineering of embedded MIPS devices. Case Study - ...
Nikita Abdullin - Reverse-engineering of embedded MIPS devices. Case Study - ...DefconRussia
 
Reverse Engineering the TomTom Runner pt. 1
Reverse Engineering the TomTom Runner pt. 1 Reverse Engineering the TomTom Runner pt. 1
Reverse Engineering the TomTom Runner pt. 1 Luis Grangeia
 
Step by Step on How to Setup DarkComet
Step by Step on How to Setup DarkCometStep by Step on How to Setup DarkComet
Step by Step on How to Setup DarkCometPich Pra Tna
 
Playing with fuzz bunch and danderspritz
Playing with fuzz bunch and danderspritzPlaying with fuzz bunch and danderspritz
Playing with fuzz bunch and danderspritzDeepanshu Gajbhiye
 
Introduction of ShinoBOT (Black Hat USA 2013 Arsenal)
Introduction of ShinoBOT (Black Hat USA 2013 Arsenal)Introduction of ShinoBOT (Black Hat USA 2013 Arsenal)
Introduction of ShinoBOT (Black Hat USA 2013 Arsenal)Shota Shinogi
 
Csw2017 bazhaniuk exploring_yoursystemdeeper_updated
Csw2017 bazhaniuk exploring_yoursystemdeeper_updatedCsw2017 bazhaniuk exploring_yoursystemdeeper_updated
Csw2017 bazhaniuk exploring_yoursystemdeeper_updatedCanSecWest
 
Password Stealing & Enhancing User Authentication Using Opass Protocol
Password Stealing & Enhancing User Authentication Using Opass ProtocolPassword Stealing & Enhancing User Authentication Using Opass Protocol
Password Stealing & Enhancing User Authentication Using Opass ProtocolPrasad Pawar
 
BlueHat v18 || The matrix has you - protecting linux using deception
BlueHat v18 || The matrix has you - protecting linux using deceptionBlueHat v18 || The matrix has you - protecting linux using deception
BlueHat v18 || The matrix has you - protecting linux using deceptionBlueHat Security Conference
 
Kasza smashing the_jars
Kasza smashing the_jarsKasza smashing the_jars
Kasza smashing the_jarsPacSecJP
 
Defcon 22-paul-mcmillan-attacking-the-iot-using-timing-attac
Defcon 22-paul-mcmillan-attacking-the-iot-using-timing-attacDefcon 22-paul-mcmillan-attacking-the-iot-using-timing-attac
Defcon 22-paul-mcmillan-attacking-the-iot-using-timing-attacPriyanka Aash
 
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 camPriyanka Aash
 
How to hack a telecom and stay alive
How to hack a telecom and stay aliveHow to hack a telecom and stay alive
How to hack a telecom and stay aliveqqlan
 

La actualidad más candente (20)

Defcon 22-jesus-molina-learn-how-to-control-every-room
Defcon 22-jesus-molina-learn-how-to-control-every-roomDefcon 22-jesus-molina-learn-how-to-control-every-room
Defcon 22-jesus-molina-learn-how-to-control-every-room
 
Defcon 22-adrian-crenshaw-dropping-docs-on-darknets-how-peop
Defcon 22-adrian-crenshaw-dropping-docs-on-darknets-how-peopDefcon 22-adrian-crenshaw-dropping-docs-on-darknets-how-peop
Defcon 22-adrian-crenshaw-dropping-docs-on-darknets-how-peop
 
MIPS-X
MIPS-XMIPS-X
MIPS-X
 
Hacking Highly Secured Enterprise Environments by Zoltan Balazs
Hacking Highly Secured Enterprise Environments by Zoltan BalazsHacking Highly Secured Enterprise Environments by Zoltan Balazs
Hacking Highly Secured Enterprise Environments by Zoltan Balazs
 
HackInTheBox - AMS 2011 , Spying on SpyEye - What Lies Beneath ?
HackInTheBox -  AMS 2011 , Spying on SpyEye - What Lies Beneath ?HackInTheBox -  AMS 2011 , Spying on SpyEye - What Lies Beneath ?
HackInTheBox - AMS 2011 , Spying on SpyEye - What Lies Beneath ?
 
Kali net hunter
Kali net hunterKali net hunter
Kali net hunter
 
Nikita Abdullin - Reverse-engineering of embedded MIPS devices. Case Study - ...
Nikita Abdullin - Reverse-engineering of embedded MIPS devices. Case Study - ...Nikita Abdullin - Reverse-engineering of embedded MIPS devices. Case Study - ...
Nikita Abdullin - Reverse-engineering of embedded MIPS devices. Case Study - ...
 
Reverse Engineering the TomTom Runner pt. 1
Reverse Engineering the TomTom Runner pt. 1 Reverse Engineering the TomTom Runner pt. 1
Reverse Engineering the TomTom Runner pt. 1
 
Step by Step on How to Setup DarkComet
Step by Step on How to Setup DarkCometStep by Step on How to Setup DarkComet
Step by Step on How to Setup DarkComet
 
Playing with fuzz bunch and danderspritz
Playing with fuzz bunch and danderspritzPlaying with fuzz bunch and danderspritz
Playing with fuzz bunch and danderspritz
 
Introduction of ShinoBOT (Black Hat USA 2013 Arsenal)
Introduction of ShinoBOT (Black Hat USA 2013 Arsenal)Introduction of ShinoBOT (Black Hat USA 2013 Arsenal)
Introduction of ShinoBOT (Black Hat USA 2013 Arsenal)
 
Csw2017 bazhaniuk exploring_yoursystemdeeper_updated
Csw2017 bazhaniuk exploring_yoursystemdeeper_updatedCsw2017 bazhaniuk exploring_yoursystemdeeper_updated
Csw2017 bazhaniuk exploring_yoursystemdeeper_updated
 
ShinoBOT Suite
ShinoBOT SuiteShinoBOT Suite
ShinoBOT Suite
 
Fuzzing
FuzzingFuzzing
Fuzzing
 
Password Stealing & Enhancing User Authentication Using Opass Protocol
Password Stealing & Enhancing User Authentication Using Opass ProtocolPassword Stealing & Enhancing User Authentication Using Opass Protocol
Password Stealing & Enhancing User Authentication Using Opass Protocol
 
BlueHat v18 || The matrix has you - protecting linux using deception
BlueHat v18 || The matrix has you - protecting linux using deceptionBlueHat v18 || The matrix has you - protecting linux using deception
BlueHat v18 || The matrix has you - protecting linux using deception
 
Kasza smashing the_jars
Kasza smashing the_jarsKasza smashing the_jars
Kasza smashing the_jars
 
Defcon 22-paul-mcmillan-attacking-the-iot-using-timing-attac
Defcon 22-paul-mcmillan-attacking-the-iot-using-timing-attacDefcon 22-paul-mcmillan-attacking-the-iot-using-timing-attac
Defcon 22-paul-mcmillan-attacking-the-iot-using-timing-attac
 
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
 
How to hack a telecom and stay alive
How to hack a telecom and stay aliveHow to hack a telecom and stay alive
How to hack a telecom and stay alive
 

Similar a DEFCON 22: Bypass firewalls, application white lists, secure remote desktops in 20 seconds

Defcon 22-zoltan-balazs-bypass-firewalls-application-whiteli
Defcon 22-zoltan-balazs-bypass-firewalls-application-whiteliDefcon 22-zoltan-balazs-bypass-firewalls-application-whiteli
Defcon 22-zoltan-balazs-bypass-firewalls-application-whiteliPriyanka Aash
 
Hacker Halted 2014 - Post-Exploitation After Having Remote Access
Hacker Halted 2014 - Post-Exploitation After Having Remote AccessHacker Halted 2014 - Post-Exploitation After Having Remote Access
Hacker Halted 2014 - Post-Exploitation After Having Remote AccessEC-Council
 
Placing backdoors-through-firewalls
Placing backdoors-through-firewallsPlacing backdoors-through-firewalls
Placing backdoors-through-firewallsAkapo Damilola
 
DEF CON 27 - DANIEL ROMERO and MARIO RIVAS - why you should fear your mundane...
DEF CON 27 - DANIEL ROMERO and MARIO RIVAS - why you should fear your mundane...DEF CON 27 - DANIEL ROMERO and MARIO RIVAS - why you should fear your mundane...
DEF CON 27 - DANIEL ROMERO and MARIO RIVAS - why you should fear your mundane...Felipe Prado
 
Home Automation Using RPI
Home Automation Using  RPIHome Automation Using  RPI
Home Automation Using RPIAnkara JUG
 
Security & ethical hacking p2
Security & ethical hacking p2Security & ethical hacking p2
Security & ethical hacking p2ratnalajaggu
 
Security & ethical hacking
Security & ethical hackingSecurity & ethical hacking
Security & ethical hackingAmanpreet Singh
 
Inside the Matrix,How to Build Transparent Sandbox for Malware Analysis
Inside the Matrix,How to Build Transparent Sandbox for Malware AnalysisInside the Matrix,How to Build Transparent Sandbox for Malware Analysis
Inside the Matrix,How to Build Transparent Sandbox for Malware AnalysisChong-Kuan Chen
 
Unmasking Careto through Memory Forensics (video in description)
Unmasking Careto through Memory Forensics (video in description)Unmasking Careto through Memory Forensics (video in description)
Unmasking Careto through Memory Forensics (video in description)Andrew Case
 
Cracking Into Embedded Devices - HACK.LU 2K8
Cracking Into Embedded Devices - HACK.LU 2K8Cracking Into Embedded Devices - HACK.LU 2K8
Cracking Into Embedded Devices - HACK.LU 2K8guest441c58b71
 
Kunal - Introduction to BackTrack - ClubHack2008
Kunal - Introduction to BackTrack - ClubHack2008Kunal - Introduction to BackTrack - ClubHack2008
Kunal - Introduction to BackTrack - ClubHack2008ClubHack
 
Kunal - Introduction to backtrack - ClubHack2008
Kunal - Introduction to backtrack - ClubHack2008Kunal - Introduction to backtrack - ClubHack2008
Kunal - Introduction to backtrack - ClubHack2008ClubHack
 
Workshop on BackTrack live CD
Workshop on BackTrack live CDWorkshop on BackTrack live CD
Workshop on BackTrack live CDamiable_indian
 
[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...Hackito Ergo Sum
 
Penetration Testing Project Game of Thrones CTF: 1
Penetration Testing Project Game of Thrones CTF: 1Penetration Testing Project Game of Thrones CTF: 1
Penetration Testing Project Game of Thrones CTF: 1Florin D. Tanasache
 
Time Series Database and Tick Stack
Time Series Database and Tick StackTime Series Database and Tick Stack
Time Series Database and Tick StackGianluca Arbezzano
 
BSides London 2015 - Proprietary network protocols - risky business on the wire.
BSides London 2015 - Proprietary network protocols - risky business on the wire.BSides London 2015 - Proprietary network protocols - risky business on the wire.
BSides London 2015 - Proprietary network protocols - risky business on the wire.Jakub Kałużny
 

Similar a DEFCON 22: Bypass firewalls, application white lists, secure remote desktops in 20 seconds (20)

Defcon 22-zoltan-balazs-bypass-firewalls-application-whiteli
Defcon 22-zoltan-balazs-bypass-firewalls-application-whiteliDefcon 22-zoltan-balazs-bypass-firewalls-application-whiteli
Defcon 22-zoltan-balazs-bypass-firewalls-application-whiteli
 
Hacker Halted 2014 - Post-Exploitation After Having Remote Access
Hacker Halted 2014 - Post-Exploitation After Having Remote AccessHacker Halted 2014 - Post-Exploitation After Having Remote Access
Hacker Halted 2014 - Post-Exploitation After Having Remote Access
 
Placing backdoors-through-firewalls
Placing backdoors-through-firewallsPlacing backdoors-through-firewalls
Placing backdoors-through-firewalls
 
DEF CON 27 - DANIEL ROMERO and MARIO RIVAS - why you should fear your mundane...
DEF CON 27 - DANIEL ROMERO and MARIO RIVAS - why you should fear your mundane...DEF CON 27 - DANIEL ROMERO and MARIO RIVAS - why you should fear your mundane...
DEF CON 27 - DANIEL ROMERO and MARIO RIVAS - why you should fear your mundane...
 
Home Automation Using RPI
Home Automation Using  RPIHome Automation Using  RPI
Home Automation Using RPI
 
Security & ethical hacking p2
Security & ethical hacking p2Security & ethical hacking p2
Security & ethical hacking p2
 
Security & ethical hacking
Security & ethical hackingSecurity & ethical hacking
Security & ethical hacking
 
Inside the Matrix,How to Build Transparent Sandbox for Malware Analysis
Inside the Matrix,How to Build Transparent Sandbox for Malware AnalysisInside the Matrix,How to Build Transparent Sandbox for Malware Analysis
Inside the Matrix,How to Build Transparent Sandbox for Malware Analysis
 
Unmasking Careto through Memory Forensics (video in description)
Unmasking Careto through Memory Forensics (video in description)Unmasking Careto through Memory Forensics (video in description)
Unmasking Careto through Memory Forensics (video in description)
 
Cracking Into Embedded Devices - HACK.LU 2K8
Cracking Into Embedded Devices - HACK.LU 2K8Cracking Into Embedded Devices - HACK.LU 2K8
Cracking Into Embedded Devices - HACK.LU 2K8
 
RAT - Repurposing Adversarial Tradecraft
RAT - Repurposing Adversarial TradecraftRAT - Repurposing Adversarial Tradecraft
RAT - Repurposing Adversarial Tradecraft
 
Nikto
NiktoNikto
Nikto
 
Kunal - Introduction to BackTrack - ClubHack2008
Kunal - Introduction to BackTrack - ClubHack2008Kunal - Introduction to BackTrack - ClubHack2008
Kunal - Introduction to BackTrack - ClubHack2008
 
Kunal - Introduction to backtrack - ClubHack2008
Kunal - Introduction to backtrack - ClubHack2008Kunal - Introduction to backtrack - ClubHack2008
Kunal - Introduction to backtrack - ClubHack2008
 
Workshop on BackTrack live CD
Workshop on BackTrack live CDWorkshop on BackTrack live CD
Workshop on BackTrack live CD
 
[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...
 
Penetration Testing Project Game of Thrones CTF: 1
Penetration Testing Project Game of Thrones CTF: 1Penetration Testing Project Game of Thrones CTF: 1
Penetration Testing Project Game of Thrones CTF: 1
 
Time Series Database and Tick Stack
Time Series Database and Tick StackTime Series Database and Tick Stack
Time Series Database and Tick Stack
 
BSides London 2015 - Proprietary network protocols - risky business on the wire.
BSides London 2015 - Proprietary network protocols - risky business on the wire.BSides London 2015 - Proprietary network protocols - risky business on the wire.
BSides London 2015 - Proprietary network protocols - risky business on the wire.
 
Us 17-krug-hacking-severless-runtimes
Us 17-krug-hacking-severless-runtimesUs 17-krug-hacking-severless-runtimes
Us 17-krug-hacking-severless-runtimes
 

Más de Zoltan Balazs

[ Hackersuli ] Privacy on the blockchain
[ Hackersuli ] Privacy on the blockchain[ Hackersuli ] Privacy on the blockchain
[ Hackersuli ] Privacy on the blockchainZoltan Balazs
 
Web3 + scams = It's a match
Web3 + scams = It's a matchWeb3 + scams = It's a match
Web3 + scams = It's a matchZoltan Balazs
 
Explain Ethereum smart contract hacking like i am a five
Explain Ethereum smart contract hacking like i am a fiveExplain Ethereum smart contract hacking like i am a five
Explain Ethereum smart contract hacking like i am a fiveZoltan Balazs
 
Test & Tea : ITSEC testing, manual vs automated
Test & Tea : ITSEC testing, manual vs automatedTest & Tea : ITSEC testing, manual vs automated
Test & Tea : ITSEC testing, manual vs automatedZoltan Balazs
 
Hacktivity 2016: The real risks of the IoT security-nightmare: Hacking IP cam...
Hacktivity 2016: The real risks of the IoT security-nightmare: Hacking IP cam...Hacktivity 2016: The real risks of the IoT security-nightmare: Hacking IP cam...
Hacktivity 2016: The real risks of the IoT security-nightmare: Hacking IP cam...Zoltan Balazs
 
IoT security is a nightmare. But what is the real risk?
IoT security is a nightmare. But what is the real risk?IoT security is a nightmare. But what is the real risk?
IoT security is a nightmare. But what is the real risk?Zoltan Balazs
 
[ENG] Hacktivity 2013 - Alice in eXploitland
[ENG] Hacktivity 2013 - Alice in eXploitland[ENG] Hacktivity 2013 - Alice in eXploitland
[ENG] Hacktivity 2013 - Alice in eXploitlandZoltan Balazs
 
[HUN] Védtelen böngészők - Ethical Hacking
[HUN] Védtelen böngészők - Ethical Hacking [HUN] Védtelen böngészők - Ethical Hacking
[HUN] Védtelen böngészők - Ethical Hacking Zoltan Balazs
 
[ENG] Hacker halted 2012 - Zombie browsers, spiced with rootkit extensions
[ENG] Hacker halted 2012 - Zombie browsers, spiced with rootkit extensions[ENG] Hacker halted 2012 - Zombie browsers, spiced with rootkit extensions
[ENG] Hacker halted 2012 - Zombie browsers, spiced with rootkit extensionsZoltan Balazs
 
[ENG] Zombie browsers spiced with rootkit extensions - Hacktivity 2012
[ENG] Zombie browsers spiced with rootkit extensions - Hacktivity 2012[ENG] Zombie browsers spiced with rootkit extensions - Hacktivity 2012
[ENG] Zombie browsers spiced with rootkit extensions - Hacktivity 2012Zoltan Balazs
 
[HUN] Zombi tűzróka, avagy mire képes egy rosszindulatú böngősző kiegészitő
[HUN] Zombi tűzróka, avagy mire képes egy rosszindulatú böngősző kiegészitő[HUN] Zombi tűzróka, avagy mire képes egy rosszindulatú böngősző kiegészitő
[HUN] Zombi tűzróka, avagy mire képes egy rosszindulatú böngősző kiegészitőZoltan Balazs
 
[HUN] Hacktivity2009 - M&M’s: Mafia & Malware’s
[HUN] Hacktivity2009 - M&M’s: Mafia & Malware’s[HUN] Hacktivity2009 - M&M’s: Mafia & Malware’s
[HUN] Hacktivity2009 - M&M’s: Mafia & Malware’sZoltan Balazs
 

Más de Zoltan Balazs (14)

[ Hackersuli ] Privacy on the blockchain
[ Hackersuli ] Privacy on the blockchain[ Hackersuli ] Privacy on the blockchain
[ Hackersuli ] Privacy on the blockchain
 
MLSEC 2020
MLSEC 2020MLSEC 2020
MLSEC 2020
 
Web3 + scams = It's a match
Web3 + scams = It's a matchWeb3 + scams = It's a match
Web3 + scams = It's a match
 
Explain Ethereum smart contract hacking like i am a five
Explain Ethereum smart contract hacking like i am a fiveExplain Ethereum smart contract hacking like i am a five
Explain Ethereum smart contract hacking like i am a five
 
Test & Tea : ITSEC testing, manual vs automated
Test & Tea : ITSEC testing, manual vs automatedTest & Tea : ITSEC testing, manual vs automated
Test & Tea : ITSEC testing, manual vs automated
 
Hacktivity 2016: The real risks of the IoT security-nightmare: Hacking IP cam...
Hacktivity 2016: The real risks of the IoT security-nightmare: Hacking IP cam...Hacktivity 2016: The real risks of the IoT security-nightmare: Hacking IP cam...
Hacktivity 2016: The real risks of the IoT security-nightmare: Hacking IP cam...
 
IoT security is a nightmare. But what is the real risk?
IoT security is a nightmare. But what is the real risk?IoT security is a nightmare. But what is the real risk?
IoT security is a nightmare. But what is the real risk?
 
Sandboxes
SandboxesSandboxes
Sandboxes
 
[ENG] Hacktivity 2013 - Alice in eXploitland
[ENG] Hacktivity 2013 - Alice in eXploitland[ENG] Hacktivity 2013 - Alice in eXploitland
[ENG] Hacktivity 2013 - Alice in eXploitland
 
[HUN] Védtelen böngészők - Ethical Hacking
[HUN] Védtelen böngészők - Ethical Hacking [HUN] Védtelen böngészők - Ethical Hacking
[HUN] Védtelen böngészők - Ethical Hacking
 
[ENG] Hacker halted 2012 - Zombie browsers, spiced with rootkit extensions
[ENG] Hacker halted 2012 - Zombie browsers, spiced with rootkit extensions[ENG] Hacker halted 2012 - Zombie browsers, spiced with rootkit extensions
[ENG] Hacker halted 2012 - Zombie browsers, spiced with rootkit extensions
 
[ENG] Zombie browsers spiced with rootkit extensions - Hacktivity 2012
[ENG] Zombie browsers spiced with rootkit extensions - Hacktivity 2012[ENG] Zombie browsers spiced with rootkit extensions - Hacktivity 2012
[ENG] Zombie browsers spiced with rootkit extensions - Hacktivity 2012
 
[HUN] Zombi tűzróka, avagy mire képes egy rosszindulatú böngősző kiegészitő
[HUN] Zombi tűzróka, avagy mire képes egy rosszindulatú böngősző kiegészitő[HUN] Zombi tűzróka, avagy mire képes egy rosszindulatú böngősző kiegészitő
[HUN] Zombi tűzróka, avagy mire képes egy rosszindulatú böngősző kiegészitő
 
[HUN] Hacktivity2009 - M&M’s: Mafia & Malware’s
[HUN] Hacktivity2009 - M&M’s: Mafia & Malware’s[HUN] Hacktivity2009 - M&M’s: Mafia & Malware’s
[HUN] Hacktivity2009 - M&M’s: Mafia & Malware’s
 

Último

React Native vs Ionic - The Best Mobile App Framework
React Native vs Ionic - The Best Mobile App FrameworkReact Native vs Ionic - The Best Mobile App Framework
React Native vs Ionic - The Best Mobile App FrameworkPixlogix Infotech
 
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Mark Goldstein
 
Transcript: New from BookNet Canada for 2024: BNC SalesData and LibraryData -...
Transcript: New from BookNet Canada for 2024: BNC SalesData and LibraryData -...Transcript: New from BookNet Canada for 2024: BNC SalesData and LibraryData -...
Transcript: New from BookNet Canada for 2024: BNC SalesData and LibraryData -...BookNet Canada
 
Zeshan Sattar- Assessing the skill requirements and industry expectations for...
Zeshan Sattar- Assessing the skill requirements and industry expectations for...Zeshan Sattar- Assessing the skill requirements and industry expectations for...
Zeshan Sattar- Assessing the skill requirements and industry expectations for...itnewsafrica
 
Infrared simulation and processing on Nvidia platforms
Infrared simulation and processing on Nvidia platformsInfrared simulation and processing on Nvidia platforms
Infrared simulation and processing on Nvidia platformsYoss Cohen
 
Kuma Meshes Part I - The basics - A tutorial
Kuma Meshes Part I - The basics - A tutorialKuma Meshes Part I - The basics - A tutorial
Kuma Meshes Part I - The basics - A tutorialJoão Esperancinha
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch TuesdayIvanti
 
Microsoft 365 Copilot: How to boost your productivity with AI – Part two: Dat...
Microsoft 365 Copilot: How to boost your productivity with AI – Part two: Dat...Microsoft 365 Copilot: How to boost your productivity with AI – Part two: Dat...
Microsoft 365 Copilot: How to boost your productivity with AI – Part two: Dat...Nikki Chapple
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersNicole Novielli
 
React JS; all concepts. Contains React Features, JSX, functional & Class comp...
React JS; all concepts. Contains React Features, JSX, functional & Class comp...React JS; all concepts. Contains React Features, JSX, functional & Class comp...
React JS; all concepts. Contains React Features, JSX, functional & Class comp...Karmanjay Verma
 
Testing tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesTesting tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesKari Kakkonen
 
Irene Moetsana-Moeng: Stakeholders in Cybersecurity: Collaborative Defence fo...
Irene Moetsana-Moeng: Stakeholders in Cybersecurity: Collaborative Defence fo...Irene Moetsana-Moeng: Stakeholders in Cybersecurity: Collaborative Defence fo...
Irene Moetsana-Moeng: Stakeholders in Cybersecurity: Collaborative Defence fo...itnewsafrica
 
A Glance At The Java Performance Toolbox
A Glance At The Java Performance ToolboxA Glance At The Java Performance Toolbox
A Glance At The Java Performance ToolboxAna-Maria Mihalceanu
 
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...panagenda
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Hiroshi SHIBATA
 
A Framework for Development in the AI Age
A Framework for Development in the AI AgeA Framework for Development in the AI Age
A Framework for Development in the AI AgeCprime
 
Digital Tools & AI in Career Development
Digital Tools & AI in Career DevelopmentDigital Tools & AI in Career Development
Digital Tools & AI in Career DevelopmentMahmoud Rabie
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesThousandEyes
 
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesAssure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesThousandEyes
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPathCommunity
 

Último (20)

React Native vs Ionic - The Best Mobile App Framework
React Native vs Ionic - The Best Mobile App FrameworkReact Native vs Ionic - The Best Mobile App Framework
React Native vs Ionic - The Best Mobile App Framework
 
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
 
Transcript: New from BookNet Canada for 2024: BNC SalesData and LibraryData -...
Transcript: New from BookNet Canada for 2024: BNC SalesData and LibraryData -...Transcript: New from BookNet Canada for 2024: BNC SalesData and LibraryData -...
Transcript: New from BookNet Canada for 2024: BNC SalesData and LibraryData -...
 
Zeshan Sattar- Assessing the skill requirements and industry expectations for...
Zeshan Sattar- Assessing the skill requirements and industry expectations for...Zeshan Sattar- Assessing the skill requirements and industry expectations for...
Zeshan Sattar- Assessing the skill requirements and industry expectations for...
 
Infrared simulation and processing on Nvidia platforms
Infrared simulation and processing on Nvidia platformsInfrared simulation and processing on Nvidia platforms
Infrared simulation and processing on Nvidia platforms
 
Kuma Meshes Part I - The basics - A tutorial
Kuma Meshes Part I - The basics - A tutorialKuma Meshes Part I - The basics - A tutorial
Kuma Meshes Part I - The basics - A tutorial
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch Tuesday
 
Microsoft 365 Copilot: How to boost your productivity with AI – Part two: Dat...
Microsoft 365 Copilot: How to boost your productivity with AI – Part two: Dat...Microsoft 365 Copilot: How to boost your productivity with AI – Part two: Dat...
Microsoft 365 Copilot: How to boost your productivity with AI – Part two: Dat...
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software Developers
 
React JS; all concepts. Contains React Features, JSX, functional & Class comp...
React JS; all concepts. Contains React Features, JSX, functional & Class comp...React JS; all concepts. Contains React Features, JSX, functional & Class comp...
React JS; all concepts. Contains React Features, JSX, functional & Class comp...
 
Testing tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesTesting tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examples
 
Irene Moetsana-Moeng: Stakeholders in Cybersecurity: Collaborative Defence fo...
Irene Moetsana-Moeng: Stakeholders in Cybersecurity: Collaborative Defence fo...Irene Moetsana-Moeng: Stakeholders in Cybersecurity: Collaborative Defence fo...
Irene Moetsana-Moeng: Stakeholders in Cybersecurity: Collaborative Defence fo...
 
A Glance At The Java Performance Toolbox
A Glance At The Java Performance ToolboxA Glance At The Java Performance Toolbox
A Glance At The Java Performance Toolbox
 
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024
 
A Framework for Development in the AI Age
A Framework for Development in the AI AgeA Framework for Development in the AI Age
A Framework for Development in the AI Age
 
Digital Tools & AI in Career Development
Digital Tools & AI in Career DevelopmentDigital Tools & AI in Career Development
Digital Tools & AI in Career Development
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
 
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesAssure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to Hero
 

DEFCON 22: Bypass firewalls, application white lists, secure remote desktops in 20 seconds

  • 1.
  • 2. Bypass firewalls, application white lists, secure remote desktops in 20 seconds Zoltan Balazs DEF CON 22, 2014
  • 5. root@kali:~# whoami AV testing AVbypass
  • 6. root@kali:~# whoami OSCP: Occasional Satire Captain Punk CISSP: Certified Interspecie-ialSheep Shearing Professional CPTS: Certified Pajama Toaster Specialist MCP: Microsoft Certified Psychopath OSWP: Official Sexiest Weasel Popstar CHFI: Chronic Hopeless Flux Incompetent I’mNOT a CEH CyberLympics@2012 CTF 2nd runnersup–gula.sh Creatorof theZombieBrowser Toolkit https://github.com/Z6543/ZombieBrowserPack
  • 9. How do you hack high security systems?
  • 10. How do you hack high security systems when you are not Tom Cruise?
  • 11. The mission I’m a spy(with low budget) I want access to a hardened secure RDP (remote desktop) server E.g. server contains confidential documents I need persistent C&C access to the RDP server To upload/download files Interactive remote code execution
  • 12. The solution (in an ideal world) Infected workstation Secure remote desktop server 1. Infect client’s desktop 2. Steal RDP password 3. Connect to RDP 4. Drop malware 5. Command and Control 6. Profit
  • 13. The challenges RDP server is not reachable from the Internet Directly … Two factor authentication is used to access the RDP server No access to the token seeds ;) Drive mapping disabled – no direct file copy Restrictive hardware firewall Allows workstation -> server TCP port 3389 IPv4 only Application white list is used on the RDP server M$ Applocker in my case with default policy Firewall, port 3389 allowed only
  • 14. Is this realistic? Similar environment at a client •Had no time to hack it
  • 15.
  • 16. Infected workstationSecure remote desktop serverTarget CompanyThe InternetAttackerFirewall, port 3389 allowed only
  • 17. “In hacking, there is no such thing as impossible. Only things that are more challenging.”
  • 18. Alreadyachieved I have remote code execution with C&C on a user’s workstation I have access to a test RDP server I know how the files on the server look like, what services are installed This is Spartaaaapost-exploitation
  • 19. Why should you care about this? Red team/pentester •New tools Blue team •New things to look for during log analysis/incident response Policy maker/business •Funny pictures
  • 20. Divideet impera! Dividetheproblemintosmallerpiecesand rulethemall, onebyone 1.dropmalwareintotheRDP server 2.executeanycodeonRDP server 3.elevatetoadminprivileges 4.bypasshardwarefirewall
  • 21. Divideet impera! Dividetheproblemintosmallerpiecesand rulethemall, onebyone 1.dropmalwareintotheRDP server –> newshinytool 2.executeanycodeonRDP server –> nothingnewhere 3.elevatetoadminprivileges–> nothingnew, no 0day foryou 4.bypasshardwarefirewall-> newshinytool
  • 22. 1. Drop malware into RDP server
  • 23. 1. DropmalwareintoRDP server Malware waits for the user to connect to RDP server Createsscreenshot(or new animation), show in foreground Optionallyblocksuser keyboard, mouse ~20 seconds Usesthekeyboardand theclipboard–simulates user 1.StartsM$ Wordon RDP server 2.Dropsencoded ASCII payload 3.CreatesMacrocode 4.Macrowritesbinary 5.Macro starts binaries
  • 24. Alternative usage of “user simulator” 1.Add directory to be excluded from AV scans use the AV GUI! only if the user has the privileges and no UAC 2.Install new trusted root certification authority and accept warning –and MiTMSSL connections CA pinning does not stop this attack The AV is alive. Nope, Chuck Testa™
  • 25. 2. What is Applocker?
  • 26. 2. Executeanycode, bypassApplocker „AppLockercan only control VBScript, JScript, .bat files, .cmdfiles and Windows PowerShell scripts. It does not control all interpreted code that runs within a host process, for example Perl scripts and macros. Applications could contain flagsthat are passed to functions that signal AppLockertocircumvent the rulesand allow another .exe or .dll file to be loaded. The administratoron the local computer can modify the AppLockerpolicies defined in the local GPO.”
  • 27. Executeanycode, bypassApplocker Load DLL withWord Macro! Even shellcodeexecution is possible! http://blog.didierstevens.com/2008/06/05/bpmtk- how-about-srp-whitelists/ Private Declare PtrSafeFunction LoadLibraryLib "kernel32" Alias "LoadLibraryA" (ByVallpLibFileNameAs String) As Long hLibrary= LoadLibrary(outputdir+ "hack_service.dll")
  • 29. 3. Elevatetoadmin Why do I need admin? •It is needed for the last phase, hardware firewall bypass Possibilities •Local privesc zero day for Win 2012 •Exploit unpatched vulnerability •Exploit vulnerable 3rdparty program service •Etc. Processes started with admin (or higher) privileges are not restricted by AppLocker!
  • 30. Elevatetoadmin-Service exploit C:> accesschk.exe–l mvulnservice.exe [0] ACCESS_ALLOWED_ACE_TYPE: NT AUTHORITYTERMINAL SERVER USER FILE_APPEND_DATA FILE_EXECUTE FILE_READ_ATTRIBUTES FILE_READ_DATA FILE_READ_EA FILE_WRITE_ATTRIBUTES FILE_WRITE_DATA FILE_WRITE_EA SYNCHRONIZE READ_CONTROLs C:> scsdshowmyvulnservice D:(A;;CCLCSWRPWPDTLOCRRC;;;SY) (A;;CCDCLCSWRPWPDTLOCRSDRCWDWO;;;BA)(A;;CCLCSWLOCRRCRPWP;;;IU)(A;;CCLCSWLOCRRC;;;SU)
  • 31. Elevatetoadmin-Service exploit C:> accesschk.exe–l mvulnservice.exe [0] ACCESS_ALLOWED_ACE_TYPE: NT AUTHORITYTERMINAL SERVER USER FILE_APPEND_DATA FILE_EXECUTE FILE_READ_ATTRIBUTES FILE_READ_DATA FILE_READ_EA FILE_WRITE_ATTRIBUTES FILE_WRITE_DATA FILE_WRITE_EA SYNCHRONIZE READ_CONTROLs C:> scsdshowmyvulnservice D:(A;;CCLCSWRPWPDTLOCRRC;;;SY) (A;;CCDCLCSWRPWPDTLOCRSDRCWDWO;;;BA)(A;;CCLCSWLOCRRCRPWP;;;IU)(A;;CCLCSWLOCRRC;;;SU) Allow Service start Service stop Interactivelyloggedonuser
  • 32. Quiz
  • 33. Quiz What’s the name of the company which published the first paper about packet filter firewalls in 1988?
  • 34. Quiz What’s the name of the company which published the first paper about packet filter firewalls in 1988? The company developed VAX
  • 35. Quiz What’s the name of the company which published the first paper about packet filter firewalls in 1988? Digital Equipment Corporation
  • 36. 4. Bypass hardware firewall Restrictive firewall •No Bind shell •No Reverse shell •No covert channel •DNS, ICMP, IPv6, UDP, proxy •No shell!!! In a different scenario •TCP socket reuse shell possible (not persistent) •Webshell(lame) possible •But not in this case (no exploit, no webserver)
  • 37. 4. Bypass hardware firewall First (bad) idea After malware dropped, mark every packet to be special •start with magic bytes and let akernel network filter driver select the packets Problem •Every (hacker) application has to be rewritten, or rerouted through a custom wrapper proxy (both server and client side)
  • 38. Bypass HW firewall –second idea Use TCP source port! •E.g. port 1337 is always special Limitations •NAT from the attacker side •But who cares? 
  • 39. Bypassing hardware firewallsLinux UsecodeatKernel level(withroot) if ((tcp_source_port === 1337) && (tcp_dest_port === 22)) then: redirect to bind shellon port 31337 iptables-t nat-A PREROUTING -p tcp--dport22-- sport 1337-j REDIRECT --to-ports 31337
  • 40. Attacker or infected workstationFirewall, port 3389 allowed onlySecure remote desktop serverSrc port 1337Dst port 3389Dst port 3389Dst port 31337
  • 41.
  • 42.
  • 43.
  • 44.
  • 45. Bypassing hardware firewalls on Windows x64 Installing a kernel driver in Windows x64 is not trivial •Trusted signed driver is needed Thanks to basil for WinDivertproject (and Nemea Software Development) •Trusted signed kernel driver already included! •You can interface with the kernel driver Alternatively, patchguardbypass could be used http://www.codeproject.com/Articles/28318/Bypassing- PatchGuard Uroburosrootkit –Bring Your Own Vuln Install root CA first with user simulator ;)
  • 46. How to set TCP source port for meterpreterbind shell (or any program)? Netcat(Nmapbuild) to da rescue! ncat-kl 4444 -c "ncat-p 1337 RDP.SER.VER.IP 3389"
  • 47. Demo
  • 48. Alternative usage of “hwfwbypass” You have admin on webserver but persistent outbound C&C is blocked Instead of local port forward, use netcatto port forward to other machines in the DMZ Backdoor traffic to hide your communication inside the legit network traffic
  • 49. The solution–as a whole Malware waits for the user to login to RDP with 2FA Create screenshot from user desktop Put screenshot on the screen Disable keyboard/mouse Drop malware by simulating user keyboard events + clipboard for large (ASCII) data transfer Start WORD, create new macro code Bypass application whitelist using DLL loading from Word macro code
  • 50. The solution Escalate privileges to admin (vulnerable service) Install hwfwbypass.exe with kernel driver Dropmeterpreter Profit!
  • 51.
  • 52. Demo
  • 53. Demo 2 –as seen by the user
  • 54. Lessons learned for red team You have twonew tools for your post exploitation •tool to drop malware into the remote desktop •If you have admin on a Windows server, you can bypass/fool hardware firewalls using my driver
  • 55. Lessons learned for the blue team Every additional layer of security can still be bypassed Restricted remote desktop is a real interface for malware infection Use application/protocol aware (NG) firewall instead of port based ones Can be bypassed ;) Don’t trust your firewall logs blindly
  • 57. References http://reqrypt.org/windivert.html http://inputsimulator.codeplex.com/-modified http://www.blackhat.com/presentations/bh-usa-06/BH- US-06-Tereshkin.pdf http://blog.didierstevens.com/2011/01/24/circumventing- srp-and-applocker-by-design/ http://www.room362.com/blog/2014/01/16/application- whitelist-bypass-using-ieexec-dot-exe http://leastprivilege.blogspot.fr/2013/04/bypass- applocker-by-loading-dlls-from.html?m=1https://www.mandiant.com/blog/hikit-rootkit-advanced- persistent-attack-techniques-part-2/
  • 59. two more things … User simulator available as Metasploitpost module HW FW bypass available as Metasploitpost module
  • 60. Hack The Planet! https://github.com/MRGEffitas/Write-into-screen https://github.com/MRGEffitas/hwfwbypasszoltan.balazs@mrg-effitas.com https://hu.linkedin.com/in/zbalazs Twitter–@zh4ck www.slideshare.net/bz98 Greetz to @CrySySLab, @hekkcamp JumpESPJump.blogspot.com