SlideShare a Scribd company logo
1 of 79
Download to read offline
CMD:	
  Look	
  who’s	
  talking	
  too	
  

         DNS:	
  a	
  botnet	
  dialect	
  
Francisco	
  J.	
  Gómez	
  Rodríguez	
  (fran@Gd.es):	
  
•  Computer	
  Engineering	
  (EUI-­‐UPM)	
  
•  Security	
  Research	
  (Telefonica	
  R&D)	
  
•  dig	
  fran.rootedcon.themafia.info	
  TXT	
  

Carlos	
  Díaz	
  Hidalgo	
  (charlie@Gd.es):	
  
•  TelecommunicaGons	
  Engineer	
  (ETSITM-­‐UPM),	
  GPEN,	
  GCIH,	
  
   OPST,	
  ITILF	
  and	
  CCNA.	
  
•  Technology	
  Specialist	
  in	
  Ethical	
  Hacking	
  (Telefonica	
  R&D)	
  
•  dig	
  charlie.rootedcon.themafia.info	
  TXT	
  
look	
  who’s	
  talking	
  too	
  

Nasal	
  Spray	
  
This	
  presenta9on	
  contains:	
  
one	
  year	
  ago	
  …………………………………………....	
  	
  	
  	
  3	
  mg	
  
cloud	
  malware	
  distribuGon	
  …………………..….	
  	
  	
  10	
  mg	
  
dns	
  is	
  in	
  the	
  air	
  …………………………………………	
  	
  	
  10	
  mg	
  
suspicion	
  ………………………………………………….	
  	
  	
  	
  	
  8	
  mg	
  
data	
  leak	
  ………………………………………………….	
  	
  	
  10	
  mg	
  
laboratory	
  ……………………………………………….	
  	
  	
  	
  10	
  mg	
  




                                                                                          4.4	
  FL	
  OZ	
  (130mL)	
  
                Tamper-­‐Evident:	
  Do	
  not	
  accept	
  if	
  sealed	
  blister	
  
                      unit	
  has	
  been	
  broken	
  or	
  opened	
  


              THIS	
  PACKAGE	
  FOR	
  HOUSEHOLDS	
  
                WITHOUT	
  YOUNG	
  CHILDREN	
  
INTRODUCTION	
  
One	
  year	
  ago	
  …	
  
•  We	
  talked	
  about	
  DNS	
  and	
  Malware.	
  
•  We	
  released	
  Cloud	
  Malware	
  DistribuGon	
  
   (CMD):	
  
   –  An	
  alternaGve	
  method	
  for	
  malware	
  distribuGon	
  
      using	
  Cache	
  DNS	
  services.	
  
   –  Using	
  client	
  default	
  DNS	
  se_ngs.	
  
   –  Malware	
  source	
  virtually	
  untraceable.	
  
A	
  DNS	
  shot	
  
Cloud	
  Malware	
  DistribuGon	
  in	
  a	
  nutshell	
  

CMD	
  
Cloud	
  Malware	
  DistribuGon	
  
1.  Encoding:	
  Split	
  malware	
  payload	
  into	
  DNS	
  Records.	
  
    	
  
2.  Publishing:	
  Publish	
  domain	
  and	
  each	
  record	
  in	
  a	
  public	
  Name	
  Server.	
  
    	
  
3.  Loading:	
  Force	
  an	
  Open	
  Emi`er	
  DNS	
  Cache	
  Server	
  to	
  store	
  all	
  records.	
  
    	
  
4.  Downloading:	
  Download	
  records	
  from	
  an	
  infected	
  host	
  (bot).	
  
    	
  
5.  Decoding:	
  Rebuild	
  malware	
  payload	
  from	
  records.	
  
                                                                                                   8rjqerkjqet.cmdns.domain.com	
  	
  
                                                                                                   ueirytbdosu.cmdns.domain.com	
  	
  
                                                                                                   ktqtr53xase.cmdns.domain.com	
  	
  
                                                                                                   kzmfzzmfzze.cmdns.domain.com	
  	
  

                           8rjqerkjqet.cmdns.domain.com	
  	
  

                 1,2	
  
                           ueirytbdosu.cmdns.domain.com	
  	
  
                                                                  3	
                      4	
                        5
                           ktqtr53xase.cmdns.domain.com	
  	
  
                           kzmfzzmfzze.cmdns.domain.com	
  	
  

                                                                          Open	
  Emi`er	
  
                                                                             DNS	
  
Encoding	
  &	
  Publish	
     Cloud	
  Malware	
  DistribuGon	
  (I)	
  
                                                                                              8rjqerkjqet.cmdns.domain.com	
  	
  
                                 8rjqerkjqet	
                                                ueirytbdosu.cmdns.domain.com	
  	
  
                                 ueirytbdosu	
  
                                 ktqtr53xase	
                                                ktqtr53xase.cmdns.domain.com	
  	
  
                                 kzmfzzmfzze	
  	
                                            kzmfzzmfzze.cmdns.domain.com	
  	
  


                                                                                                    •  From	
  malware	
  file	
  we	
  create	
  
                                                                                                       a	
  base32	
  coded	
  string.	
  
                                                                                                    •  So	
  we	
  split	
  the	
  string	
  into	
  
                                                                                                       DNS	
  compliance	
  records.	
  




              DNS	
  AUTH	
                             8rjqerkjqetueirytbdosuktqtr53xasekzmfzzmfzze	
  	
  
          Freedns.afraid.org	
  
                                                       8rjqerkjqet.cmdns.domain.com	
  	
           kzmfzzmfzze.cmdns.domain.com	
  	
  

                                                                    ueirytbdosu.cmdns.domain.com	
  	
  

                                                                                          ktqtr53xase.cmdns.domain.com	
  	
  
Cloud	
  Malware	
  DistribuGon(II)	
  
                                                                        8rjqerkjqet.cmdns.domain.com	
  	
  
•  We	
  upload	
  each	
  DNS	
  record	
  from	
  
   a	
  malicious	
  DNS	
  to	
  Open	
  Emi`er.	
                     ueirytbdosu.cmdns.domain.com	
  	
  
•  This	
  is	
  made	
  by	
  requesGng	
  each	
                      ktqtr53xase.cmdns.domain.com	
  	
  
   record	
  to	
  Open	
  Emi`er	
  DNS.	
  
•  Then	
  Server	
  caches	
  each	
  record.	
                        kzmfzzmfzze.cmdns.domain.com	
  	
  



                                                         Split[1..n].cmdns.domain.com	
  
                                                                       A?	
  




                                                                             8rjqerkjqet.cmdns.domain.com	
  	
  
                                                          Open	
             ueirytbdosu.cmdns.domain.com	
  	
  
                                                         Emi`er	
            ktqtr53xase.cmdns.domain.com	
  	
  
                                  cmdns.domain.com	
  
    DNS	
  AUTH	
                        NS?	
  
                                                          DNS	
              kzmfzzmfzze.cmdns.domain.com	
  	
  

Freedns.afraid.org	
  
                                                                                            Loading	
  
Cloud	
  Malware	
  DistribuGon	
  (III)	
  
 •  Since	
  the	
  Open	
  Emi`er	
  Server	
  has	
  cached	
  all	
  records	
  we	
  
    convert	
  it	
  into	
  a	
  domain	
  authoritaGve	
  domain	
  server.	
  
 •  From	
  now	
  on,	
  Open	
  Emi`er	
  will	
  resolve	
  all	
  domain	
  queries.	
  
 •  Thus,	
  all	
  Internet	
  DNS	
  servers	
  can	
  resolve	
  malware	
  records	
  and	
  
    bots	
  can	
  get	
  them.	
  



    DNS	
  AUTH	
  
          	
  
          	
  
          	
  
Freedns.afraid.org	
  


8rjqerkjqet.cmdns.domain.com	
  	
               Open	
  
ueirytbdosu.cmdns.domain.com	
  	
  
ktqtr53xase.cmdns.domain.com	
  	
              Emi`er	
  
kzmfzzmfzze.cmdns.domain.com	
  	
  
                                                 DNS	
  
                                                                                                    Downloading	
  
Cloud	
  Malware	
  DistribuGon	
  (IV)	
  
                                                    kzmfzzmfzze.cmdns.domain.com	
  	
  
                                                    ktqtr53xase.cmdns.domain.com	
  	
  
                                                    ueirytbdosu.cmdns.domain.com	
  	
  
                                                    8rjqerkjqet.cmdns.domain.com	
  	
  




                                  8rjqerkjqetueirytbdosuktqtr53xasekzmfzzmfzze	
  	
  


 •  With	
  all	
  the	
  retrieved	
  records	
  bots	
  
    can	
  rebuild	
  the	
  original	
  file.	
  	
  
 •  Bot	
  has	
  now	
  updated	
  the	
  malware	
  
    file.	
  


Decoding	
  
 
Own	
  survey	
  :	
  yesterday	
  and	
  today	
  

                                Febrero	
  de	
  2011	
        Marzo	
  de	
  2012	
  
                               España	
         EEUU	
       España	
         EEUU	
  
     Queried	
  hosts	
         10.406	
        10.406	
       8217	
          8217	
  

     Replying	
  hosts	
        87,22%	
        87,39%	
      87,58%	
        87,69%	
  

    Open	
  resolvers	
         76,46%	
        77,28%	
      95,45%	
        82,08%	
  

     Open	
  emi`ers	
          57,76%	
        57,33%	
      53,78%	
        53,51%	
  
Accept	
  +norecurse	
  
             queries	
  
                                55,91%	
        55,49%	
      87,67%	
        74,44%	
  

      TTL	
  ≥	
  604800	
      43,05%	
        42,94%	
      51,24%	
        49,32%	
  
A	
  quick	
  test…	
  

                              DNSCrypt	
  

In	
   the	
   same	
   way	
   the	
   SSL	
   turns	
   HTTP	
   web	
   traffic	
  
into	
   HTTPS	
   encrypted	
   Web	
   traffic,	
   DNSCrypt	
  
turns	
   regular	
   DNS	
   traffic	
   into	
   encrypted	
   DNS	
  
traffic	
   that	
   is	
   secure	
   from	
   eavesdropping	
   and	
  
man-­‐in-­‐the-­‐middle	
  a`acks.	
  	
  
…	
  a	
  quick	
  demo.	
  




Summary:	
  We	
  can	
  use	
  DNSCrypt	
  and	
  CMD	
  Method	
  works.	
  	
  
DNS:	
  yesterday,	
  today,	
  and	
  tomorrow	
  

DNS	
  IS	
  IN	
  THE	
  AIR	
  
Are	
  you	
  talking	
  to	
  me?	
  
•  Let’s	
  see	
  some	
  about…	
  
    –  DNS	
  as	
  covert	
  channel.	
  
    –  DNS	
  uses	
  in	
  malware	
  communicaGons.	
  
l	
  
           DNS	
  as	
  Covert	
  Channe	
  	
  

•  OzymanDNS	
  (Kaminsky)	
  
•  Dnscapy	
  
•  (NSTX)	
  Iodine:	
  Use	
  several	
  RR	
  types,	
  
   NULL,TXT,CNAME)	
  
•  Dns2tcp	
  &	
  TCP-­‐over-­‐DNS:	
  relay	
  TCP	
  connecGons.	
  
•  LoopcVPN	
  One	
  of	
  China-­‐Telecom	
  Hotspot	
  
   nightmare.	
  
Are	
  you	
  talking	
  to	
  me?	
  
•  Let’s	
  see	
  some	
  about…	
  
    –  DNS	
  as	
  covert	
  channel.	
  
    –  DNS	
  uses	
  in	
  malware	
  communicaGons.	
  
Stateless	
  malware	
  (I)	
  
•  TSPY_ZBOT.SMQH
  –  Another Modified ZeuS Variant Seen in the Wild.
  –  Reported in September 2011 by Trendmicro.
  –  Data exchange is also now happening in UDP.
  –  http://blog.trendmicro.com/another-modified-zeus-variant-seen-in-the-wild/
Stateless	
  malware(II)	
  
•  Older	
  version	
  using	
  TCP	
  to	
  exchange	
  configura7on	
  files.	
  However,	
  
   The	
  new	
  version	
  exchanges	
  all	
  data	
  in	
  UDP
     –  http://www.symantec.com/connect/blogs/zeusbotspyeye-p2p-updated-fortifying-botnet
Stateless	
  malware(II)	
  
•  Older	
  version	
  using	
  TCP	
  to	
  exchange	
  configura7on	
  files.	
  However,	
  
   The	
  new	
  version	
  exchanges	
  all	
  data	
  in	
  UDP
     –  http://www.symantec.com/connect/blogs/zeusbotspyeye-p2p-updated-fortifying-botnet




                                                                 TCP	
  
Where	
  there's	
  smoke,	
  there's	
  fire.	
  
Feedorbot	
  
•  Using DNS protocol.
   –  Feedorbot share encrypted commands from C&C.
   –  Encapsuling data in TXT records and Base64 encoded.
   –  http://www.cj2s.de/On-Botnets-that-use-DNS-for-Command-and-Control.pdf
HiloG	
  
•  Thanks	
  DNS	
  querys	
  HiloG	
  monitors	
  infected	
  host	
  status.	
  
          –  h`p://blog.forGnet.com/hiloG-­‐the-­‐botmaster-­‐of-­‐disguise	
  
          	
  
                     142625.bc7a3d45.01.0AC1FD9D62074E6D9D2889088284DAB5.n.empty.1148.empty.
                             5_1._t_i.ffffffff.explorer_exe.173.rc2.a4h9uploading.com	
  

•  Although	
  It	
  uses	
  DNS	
  as	
  control	
  protocol,	
  bots	
  download	
  
     update	
  files	
  from	
  “file	
  hosGng”	
  servers	
  by	
  HTTP.	
  
	
  
   	
  
Morto	
  

•  From IRC to DNS.
   –  Morto, like Feedorbot, uses TXT records to comnunicate.
   –  http://www.symantec.com/connect/blogs/morto-worm-sets-dns-record
GATHERING	
  &	
  EVALUATING	
  
INFORMATION	
  
Gathering	
  &	
  EvaluaGng	
  InformaGon	
  (I)	
  
•  h`p://www.wombat-­‐project.eu/	
  	
  




•  h`p://exposure.iseclab.org/index.html	
  	
  
Gathering	
  &	
  EvaluaGng	
  InformaGon	
  (II)	
  
•  h`ps://dnsdb.isc.org/#Home	
  	
  




•  h`p://www.webboar.com	
  	
  
Gathering	
  &	
  EvaluaGng	
  InformaGon	
  (III)	
  
•  Don´t	
  forget	
  the	
  classics:	
  
                                      –  h`p://www.robtex.com/	
  
Learned	
  in	
  #Rooted2012	
  
•    h`p://labs.alienvault.com/labs/index.php/projects/open-­‐source-­‐ip-­‐reputaGon-­‐portal/	
  	
  
SomeGmes	
  …	
  I	
  see	
  dead	
  people	
  


                      •  September,	
  2011	
  
                      	
  	
  	
  	
  (Top	
  10	
  Malicious	
  Domains)	
  
Scratch	
  &	
  Win	
  
Ten	
  Li`le	
  Niggers	
  
•  h`p://www.webboar.com/ip/67.15.149.70/	
  
  –  25	
  Domain(s)	
  on	
  IP	
  Address	
  67.15.149.70	
  
     •    azxdf.com	
             •    civiGcle0.com	
       •    morewallfalls7.com	
  
     •    mjuyh.com	
             •    ckubf.com	
           •    okjyu.com	
  
     •    hjuyv.com	
             •    djhbw.com	
           •    orn2hcb.com	
  
     •    plokm.com	
             •    himovingto8.com	
     •    qlovg.com	
  
     •    nbgtr.com	
             •    hiuxd.com	
           •    quiluGon2.com	
  
     •    vcxde.com	
             •    liunj.com	
           •    uncdt.com	
  
     •    asljd.com	
             •    loijm.com	
           •    xvfar.com	
  
     •    bruGllor5.com	
         •    mjrth.com	
           •    zscdw.com	
  
                                                             •    zukamosion3.com	
  
SomeGmes	
  …	
  I	
  see	
  dead	
  people	
  
CMD	
  could	
  be	
  alive!	
  
DATA	
  LEAK	
  OVER	
  DNS	
  
DATA	
  LEAK	
  OVER	
  DNS	
  
TradiGonal	
  data	
  leak	
  using	
  DNS	
  
                                                                        [OUTPUT_DOMAIN]	
  
                             DataLeakRecord1.[OUTPUT_DOMAIN]            DataLeakRecord1	
  

                             DataLeakRecord2.[OUTPUT_DOMAIN]            DataLeakRecord2	
  
                                                                                …	
  

        1	
                              2	
  
                   Cache	
  DNS	
  
                (public or private)                               DNS	
  Auth.	
  
                                                               OUTPUT_DOMAIN	
  

  Bot
Using	
  a	
  DNS	
  reflector	
  
                                                                                                             DNS	
  Auth.	
  
                                                   DataLeakRecord1.[OUTPUT_DOMAIN]                      (OUTPUT_DOMAIN)	
  

                                                                    2	
  
      1	
  
                                                                                                (PUBLICATION_DOMAIN)	
  
                        Cache	
  DNS	
                                                           	
  Data1	
  -­‐>	
  DataLeakRecord1
                     (public or private)                                            3	
  
                                                                                            Force	
  Data	
  Leak	
  Upload	
  
                                                                                                          CMD	
  
                                                            5	
  
Bot                                                       Data1
                                                                                                        [PUBLICATION_DOMAIN]	
  
                                                                                                                Data1	
  
                   4	
                                                                                          Data2	
  
                                                                                                                   …	
  
  Data1.[PUBLICATION_DOMAIN]
                                     Cache	
  DNS	
                                DNS	
  Auth.	
  
                                                                            (Open	
  emi`er	
  +	
  cache)	
  
                                                                            PUBLICATION_DOMAIN	
  


                           	
  Data1	
  -­‐>	
  DataLeakRecord1
DNS	
  reflector	
  (demo)	
  
Using	
  Fast-­‐Flux	
  DNS	
  reflectors	
  
                                                                                                    DNS	
  Auth.	
  
                                          DataLeakRecord1.[OUTPUT_DOMAIN]
                                                                                               (OUTPUT_DOMAIN)	
  

                                                  2	
  
                    1	
  

                          Cache	
  DNS	
                                              (PUBLICATION_DOMAIN)	
  
                                                                                       	
  Data1	
  -­‐>	
  DataLeakRecord1
                       (public or private)
                                                                            3	
  
DataLeakRecord1.[OUTPUT_DOMAIN]                                                       Force	
  Data	
  Leak	
  Upload	
  
                                                                                                    CMD	
  
                                                                   5	
  
             Bot                                                  Data1
                                                                                                         [PUBLICATION_DOMAIN]	
  
                                                                                                                 Data1	
  
                                  4	
                                                                            Data2	
  
                                                                                                                    …	
  
                 Data1.[PUBLICATION_DOMAIN]
                                               Cache	
  DNS	
                       DNS	
  Auth.	
  
                                                                             (Open	
  emi`er	
  +	
  cache)	
  
Data	
  Leak	
  using	
  NXDOMAIN	
  responses	
  
•  NXDOMAIN	
  responses	
  are	
  cached:	
  
    –  NegaGve	
  caching	
  is	
  useful.	
  
    –  TTL	
  value:	
  The	
  SOA	
  'minimum'	
  parameter	
  is	
  used	
  
       as	
  the	
  negaGve	
  (NXDOMAIN)	
  caching	
  Gme	
  
       (defined	
  in	
  RFC	
  2308).	
  
•  Other	
  queries	
  may	
  reuse	
  some	
  parts	
  of	
  the	
  
   lookup	
  (quick	
  response).	
  
Caching	
  NXDOMAIN	
  responses	
  (I)	
  	
  
Caching	
  NXDOMAIN	
  responses	
  (II)	
  	
  
Caching	
  NXDOMAIN	
  responses	
  (III)	
  	
  
Data	
  leak	
  with	
  “dig”	
  

                              RCODE	
  




    TTL	
  



          QUERY	
  TIME	
  
Leak	
  recovery	
  with	
  “dig”	
  (I)	
  




                 TTL	
  <	
  86400	
  



                 QUERY	
  TIME	
  <	
  300	
  msec	
  
Leak	
  recovery	
  with	
  “dig”	
  (II)	
  




                    TTL	
  =	
  86400	
  



                    QUERY	
  TIME	
  approx.	
  300	
  msec	
  



           It	
  is	
  not	
  a	
  good	
  method	
  for	
  recovery!	
  
Leak	
  recovery	
  with	
  “dig”	
  (III)	
  




                  TTL	
  <	
  86400	
  



                  QUERY	
  TIME	
  <	
  300	
  msec	
  
Leak	
  recovery	
  with	
  “dig”	
  (IV)	
  

                                           RCODE	
  ≠	
  NXDOMAIN	
  




                         QUERY	
  TIME	
  <	
  300	
  msec	
  


      It	
  is	
  the	
  preferred	
  method	
  for	
  recovery!	
  
Data	
  Leak	
  using	
  NXDOMAIN	
  responses	
  
                                                                DNS	
                               2	
  
                                  1	
  
                                                    (Open	
  emi`er	
  +	
  cache)	
                                DNS	
  Auth.	
  
                                   UT_DOM
                                          AIN]                                           1.[OUTPUT_DOMAIN]       (OUTPUT_DOMAIN)	
  
                            1.[OUTP
                                                                                         d1.[OUTPUT_DOMAIN]
                                        OMAIN]
                                  TPUT_D
                           d1.[OU                                                               …
                                           AIN]
   dataleakrecord1




                                     UT_DOM
                           rd1.[OUTP                                            ataLeakRecord1.[OUTPUT_DOMAIN]
                                    …                                          DataLeakRecord1.[OUTPUT_DOMAIN]
                                                   IN]
                                             T_DOMA
                                    d1.[OUTPU
                              krecor
                        atalea                   MAIN]
                                           PUT_DO
                                   rd1.[OUT
                             akreco
                       datale




                     Bot
Data	
  Leak	
  using	
  NXDOMAIN	
  responses	
  
                                                                                         DNS	
                                                                                      2	
  
                                  1	
  
                                                    (Open	
  emi`er	
  +	
  cache)	
                                                                                                                 DNS	
  Auth.	
  
                                   UT_DOM
                                          AIN]                                                                                                                           1.[OUTPUT_DOMAIN]       (OUTPUT_DOMAIN)	
  
                            1.[OUTP
                                                                                                                                                                         d1.[OUTPUT_DOMAIN]
                                        OMAIN]
                                  TPUT_D
                           d1.[OU                                                                                                                                               …
                                           AIN]
   dataleakrecord1




                                     UT_DOM
                           rd1.[OUTP                                                                                                                            ataLeakRecord1.[OUTPUT_DOMAIN]
                                    …                                                                                                                   DataLeakRecord1.[OUTPUT_DOMAIN]
                                                   IN]
                                             T_DOMA
                                    d1.[OUTPU
                              krecor
                        atalea                   MAIN]
                                           PUT_DO
                                   rd1.[OUT
                             akreco




                                                           a1.[OUTPUT_DOMAIN]
                       datale




                                                                                1.[OUTPUT_DOMAIN]
                                                                                                    z.[OUTPUT_DOMAIN]


                                                                                                                        b.[OUTPUT_DOMAIN]
                                                                                                                                            a.[OUTPUT_DOMAIN]
                                                         …

                                                                                                              …
                     Bot


                                                                                                                                                                          QUERY:	
  +norecurse	
  
                                                                                                                                                                                                  	
  
                                                                                                                                                                 3	
      RESPONSE:	
  RCODE?	
  
                           dataleakrecord1                                                                                                                                           TTL	
  value?	
  
                                                                                                                                                                                Query	
  Gme?	
  
NXDOMAIN	
  (demo)	
  
Data	
  Leak	
  using	
  “nice”	
  domains	
  

•  There	
  are	
  authoritaGve	
  DNS	
  server	
  that:	
  
    –  Simply	
  point	
  all	
  unknown	
  DNS	
  queries	
  to	
  a	
  single	
  
       IP	
  address.	
  
    –  Minimum	
  TTL	
  value	
  on	
  the	
  order	
  of	
  1-­‐7	
  days.	
  
•  Where	
  can	
  I	
  find	
  them?	
      inbox.com	
  
                                            imgur.com	
  
    –  Alexa	
  “Tops	
  Sites”:	
          motherless.com	
  
       h`p://www.alexa.com/topsites	
  	
   wikia.com	
  
                                            wikispaces.com	
  
                                            pbworks.com	
  
                                            	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  …	
  
Caching	
  ‘nice’	
  responses	
  (II)	
  	
  
Caching	
  ‘nice’	
  responses	
  (II)	
  	
  
Data	
  Leak	
  using	
  ‘nice’	
  domains	
  
                                                             DNS	
                               2	
       ‘nice’	
  DNS	
  Auth.	
  
                               1	
  
                                                 (Open	
  emi`er	
  +	
  cache)	
                          (OUTPUT_DOMAIN)	
  
                                       AIN]                                           1.[OUTPUT_DOMAIN]
                                UT_DOM
                         1.[OUTP
                                                                                      d1.[OUTPUT_DOMAIN]
                                     OMAIN]
                               TPUT_D
                        d1.[OU                                                            …
                                        AIN]
dataleakrecord1




                                  UT_DOM
                        rd1.[OUTP                                            ataLeakRecord1.[OUTPUT_DOMAIN]
                                 …                                          DataLeakRecord1.[OUTPUT_DOMAIN]
                                                IN]
                                          T_DOMA
                                 d1.[OUTPU
                           krecor
                     atalea                   MAIN]
                                        PUT_DO
                                rd1.[OUT
                          akreco
                    datale




                  Bot
Data	
  Leak	
  using	
  ‘nice’	
  domains	
  
                                                                                     DNS	
                                                                                       2	
       ‘nice’	
  DNS	
  Auth.	
  
                               1	
  
                                                 (Open	
  emi`er	
  +	
  cache)	
                                                                                                          (OUTPUT_DOMAIN)	
  
                                       AIN]                                                                                                                           1.[OUTPUT_DOMAIN]
                                UT_DOM
                         1.[OUTP
                                                                                                                                                                      d1.[OUTPUT_DOMAIN]
                                     OMAIN]
                               TPUT_D
                        d1.[OU                                                                                                                                            …
                                        AIN]
dataleakrecord1




                                  UT_DOM
                        rd1.[OUTP                                                                                                                            ataLeakRecord1.[OUTPUT_DOMAIN]
                                 …                                                                                                                   DataLeakRecord1.[OUTPUT_DOMAIN]
                                                IN]
                                          T_DOMA
                                 d1.[OUTPU
                           krecor
                     atalea                   MAIN]
                                        PUT_DO
                                rd1.[OUT
                          akreco




                                                        a1.[OUTPUT_DOMAIN]
                    datale




                                                                             1.[OUTPUT_DOMAIN]
                                                                                                 z.[OUTPUT_DOMAIN]


                                                                                                                     b.[OUTPUT_DOMAIN]
                                                                                                                                         a.[OUTPUT_DOMAIN]
                                                      …

                                                                                                           …
                  Bot


                                                                                                                                                                       QUERY:	
  +norecurse	
  
                                                                                                                                                                                               	
  
                                                                                                                                                              3	
      ANSWER	
  SECTION?	
  
                        dataleakrecord1                                                                                                                                           TTL	
  value?	
  
Conclusions	
  data-­‐leak	
  

                            Use	
  client	
        Upload	
               Expose	
          Download	
           Score	
  
                           default	
  DNS	
        queries	
            cybercrime	
         queries	
           (0-­‐10)	
  
                             seings	
              needed	
           infrastructure	
       needed	
  
 TradiGonal	
  
                                 YES	
          2	
  queries/kB	
           YES	
                  -­‐	
             5	
  
DNS	
  tunneling	
  
Using	
  Fast-­‐Flux	
  
                                 YES	
          2	
  queries/kB	
           YES	
          2	
  queries/kB	
         4	
  
DNS	
  reflectors	
  
     Using	
  
  NXDOMAIN	
                     NO	
           2	
  queries/B	
            NO	
           20	
  queries/B	
         2	
  
   response	
  
  Using	
  “nice”	
  
                                 NO	
           2	
  queries/B	
            NO	
           20	
  queries/B	
         6	
  
   domains	
  
ToDo:	
  Improvement++	
  
•  Data	
  Leak	
  using	
  ‘nice’	
  domains.	
  But	
  
   remembering	
  that:	
  
    –  Must	
  use	
  client	
  default	
  DNS	
  se_ngs.	
  
•  Maybe	
  can	
  use	
  three	
  party	
  resources	
  …	
  (once	
  
   again)	
  
    –  	
  …	
  Use	
  misconfigured	
  DNS	
  (proxy	
  DNS,	
  cache	
  DNS,	
  
       authoritaGve	
  server,	
  …).	
  
    –  e.g.	
  must	
  ignore	
  “+norecurse”	
  flag,	
  “minimal-­‐
       response”	
  configured,	
  etc.	
  
•  Result:	
  Untraceable	
  data	
  leaks	
  
Harder	
  than	
  finding	
  a	
  needle	
  in	
  a	
  
              haystack!	
  
Are	
  we	
  infected?	
  

LABORATORY	
  
Making	
  the	
  lab.	
  

•  We	
  need	
  a	
  “real”	
  threat…	
  
•  But	
  we	
  are	
  “ethical”…	
  
•  And	
  we	
  are	
  not	
  developers…	
  




                        Searching…	
  
And	
  the	
  winner	
  is…	
  

•    Wri`en	
  in	
  C#	
  and	
  PHP	
  
•    GNU/GPL	
  
•    Geared	
  to	
  build	
  botnets	
  
•    HTTP	
  communicaGon	
  
How	
  Flu	
  works	
  

•  Flu	
  server	
  share	
  XML	
  commands	
  file.	
  
•  Infected	
  hosts	
  get	
  XML	
  file	
  through	
  
   HTTP	
  request.	
  




                                          HTTP	
              Flu	
  
                Flu	
  
                                                           Infected	
  
              SERVER	
  
                                                             Host	
  
Flu	
  and	
  CMD	
  
•  We	
  use	
  CMD	
  to	
  distribute	
  XML	
  commands	
  file.	
  
•  Our	
  dream:	
  Flu	
  become	
  stateless	
  Trojan.	
  
•  Then	
  we’ll	
  have	
  stateless-­‐Trojan-­‐GPL	
  botnet.	
  

       1	
  GET	
                                            1	
  query	
  
       11	
  pkts.	
     HTTP/TCP	
   Vs	
     DNS/UDP	
     2	
  pkts.	
  
       1	
  conn.	
                            	
            0	
  conn.	
  




                                DNS	
                Open	
           DNS	
        Flu	
  
                   Flu	
  
                                                    Emi`er	
                    Infected	
  
                   DNS	
  
                                                     DNS	
                        Host	
  
Flu	
  and	
  CMD:	
  Server	
  

•  PHP	
  5.3.0	
  or	
  higher	
  required.	
  
•  Three	
  steps:	
  
     1.  	
  domain.db	
  file	
  create.	
  (external	
  lib:	
  Tar.php)	
  
     2.  Load	
  XML	
  file	
  into	
  DNS	
  server.	
  (NaGve	
  lib)	
  
     3.  Download	
  data	
  from	
  infected	
  host.	
  (NaGve	
  lib)	
  
Flu	
  and	
  CMD:	
  3th	
  Party	
  
•    ISC	
  Bind	
  
•    FreeDNS.afraid.org	
  
•    HE	
  free	
  DNS	
  service	
  
•    Misconfigured	
  DNS	
  server.	
  


           Open	
  
          Emi`er	
  
Flu	
  and	
  CMD:	
  3th	
  Party	
  
•    ISC	
  Bind	
  
•    FreeDNS.afraid.org	
  
•    HE	
  free	
  DNS	
  service	
  
•    Misconfigured	
  DNS	
  server.	
  


           Open	
  
          Emi`er	
  
Flu	
  and	
  CMD:	
  Client	
  




           •  We	
  use	
  ARSoD.Tools.Net	
  library.	
  
           •  Without	
  GUI	
  changes:	
  
               –  We	
  use	
  domainload	
  to	
  data	
  leak.	
  
               –  We	
  use	
  domaindownload	
  to	
  get	
  XML	
  file.	
  
Flu	
  and	
  CMD:	
  How	
  it	
  works	
  (I)	
  


XML2DNS	
                     LOADXML	
                  DOWNLOADXML	
  




                    DNS	
          Open	
      DNS	
            Flu	
  
          Flu	
  
                                  Emi`er	
                   Infected	
  
          DNS	
  
                                   DNS	
                       Host	
  
Flu	
  and	
  CMD:	
  How	
  it	
  works	
  (II)	
  
  •  How	
  flu	
  call	
  back?	
  
         –  NXDOMAIN	
  can:	
  Track	
  new	
  bots.	
  
         –  NXDOMAIN	
  can’t:	
  Send	
  huge	
  files.	
  	
  




                              DNS	
              Open	
           DNS	
             Flu	
  
               Flu	
  
                                                Emi`er	
                         Infected	
  
              C&C	
      Nxdomainquery	
                     Nxdomainquery	
  
                         Noerror	
  
                                                 DNS	
       Noerror	
  
                                                                                   Host	
  
DNS	
  Server	
  
Flu	
  and	
  CMD:	
  How	
  it	
  works	
  (II)	
  
          1.  How	
  flu	
  call	
  back?	
  
                 –  NXDOMAIN	
  can:	
  Track	
  new	
  bots.	
  
                 –  NXDOMAIN	
  can’t:	
  Send	
  huge	
  files.	
  	
  
          2.  Then…	
  we	
  need	
  to	
  expose	
  DNS	
  server.	
  


                                      DNS	
              Open	
            DNS	
            Flu	
  
                       Flu	
  
                                                        Emi`er	
                         Infected	
  
                      C&C	
      Nxdomainquery	
                     Nxdomainquery	
  
1	
                              Noerror	
  
                                                         DNS	
       Noerror	
  
                                                                                           Host	
  
        DNS	
  Server	
  



                                     DNS	
                                DNS	
             Flu	
  
                     Flu	
                              Cache	
  
2	
                                                                                      Infected	
  
                     DNS	
                               DNS	
  
                                                                                           Host	
  
Flu	
  and	
  CMD:	
  Demo	
  
Conclusions	
  
•  DNS	
  is	
  a	
  botnet	
  dialect…	
  
    –  One	
  year	
  ago	
  DNS	
  was	
  a	
  possibility,	
  today	
  could	
  be	
  a	
  real	
  
       threat.	
  
•  Data	
  leak	
  using	
  DNS	
  need	
  an	
  improvement…	
  
    –  ...but	
  we	
  are	
  working	
  progress.	
  
•  Malware	
  need	
  to	
  communicate	
  undetected,	
  and	
  IDS	
  
   want	
  to	
  detect	
  malware.	
  
    –  Both	
  must	
  be	
  looking	
  for	
  the	
  same…	
  DNS.	
  
•  Don’t	
  forget	
  DNS	
  Protocol	
  
QuesGons?	
  




                 Who	
  invented	
  the	
  rootedcon?	
  
Perez	
  the	
  mouse	
                          Rootedcon	
  is	
  your	
  parents	
  
Santa	
                                          Three	
  Magic	
  Kings	
  
References	
  
§    h`p://code.kryo.se/iodine/	
  	
  
§    h`p://dns.measurement-­‐factory.com/	
  	
  
§    h`p://darkwing.uoregon.edu/~joe/secprof10-­‐dns/secprof10-­‐dns.pdf	
  	
  	
  
§    h`p://www.blackhat.com/presentaGons/bh-­‐europe-­‐05/BH_EU_05-­‐Kaminsky.pdf	
  	
  
§    h`p://www.blackhat.com/presentaGons/bh-­‐usa-­‐04/bh-­‐us-­‐04-­‐kaminsky/bh-­‐us-­‐04-­‐kaminsky.ppt	
  	
  
§    h`p://www.pcworld.com/arGcle/220024/feds_accidentally_seize_84000_innocent_domains_link_them_with_child_porn.html	
  	
  	
  
§    h`p://www.symantec.com/content/en/us/enterprise/media/security_response/whitepapers/zeus_king_of_bots.pdf	
  	
  	
  
§    h`p://www.secdev.org/projects/scapy/	
  	
  
§    h`ps://www.isc.org/soƒware/bind/documentaGon/arm95#man.dig	
  	
  
§    h`p://dns.measurement-­‐factory.com/cgi-­‐bin/openresolvercheck.pl	
  	
  	
  
§    h`p://hakin9.org/magazine/1652-­‐mobile-­‐malware-­‐the-­‐new-­‐cyber-­‐threat	
  	
  
§    h`p://www.ie„.org/rfc/rfc{1033,1034,1035,1183,2181}.txt	
  	
  
§    h`p://tools.ie„.org/id/draƒ-­‐cmd-­‐prevent-­‐malware-­‐dns-­‐distribute-­‐00.txt	
  	
  	
  
§    h`p://www.wombat-­‐project.eu/	
  	
  
§    h`p://exposure.iseclab.org/index.html	
  	
  
§    h`ps://dnsdb.isc.org/#Home	
  	
  	
  
§    h`p://www.webboar.com	
  	
  
§    h`ps://dns.he.net/	
  	
  
§    h`p://www.flu-­‐project.com/	
  	
  
§    h`p://arsoƒtoolsnet.codeplex.com/	
  	
  
Thanks	
  for	
  your	
  Gme!	
  
      @{Hlexpired,ffranz}	
  
      {charlie,fran}@7d.es	
  

More Related Content

What's hot

SSL/TLS for Mortals (Devoxx FR 2018)
SSL/TLS for Mortals (Devoxx FR 2018)SSL/TLS for Mortals (Devoxx FR 2018)
SSL/TLS for Mortals (Devoxx FR 2018)Maarten Mulders
 
DNSSEC signing Tutorial
DNSSEC signing Tutorial DNSSEC signing Tutorial
DNSSEC signing Tutorial Men and Mice
 
Quasar, Sobaken, and Vermin: A deeper look into an ongoing espionage campaign
Quasar, Sobaken, and Vermin: A deeper look into an ongoing espionage campaignQuasar, Sobaken, and Vermin: A deeper look into an ongoing espionage campaign
Quasar, Sobaken, and Vermin: A deeper look into an ongoing espionage campaignESET Middle East
 
SSL/TLS for Mortals (JAX DE 2018)
SSL/TLS for Mortals (JAX DE 2018)SSL/TLS for Mortals (JAX DE 2018)
SSL/TLS for Mortals (JAX DE 2018)Maarten Mulders
 
4Developers: Dns vs webapp
4Developers: Dns vs webapp4Developers: Dns vs webapp
4Developers: Dns vs webappPROIDEA
 
Encryption Boot Camp on the JVM
Encryption Boot Camp on the JVMEncryption Boot Camp on the JVM
Encryption Boot Camp on the JVMMatthew McCullough
 
State Of Zope 3 - Stephan Richter
State Of Zope 3 - Stephan RichterState Of Zope 3 - Stephan Richter
State Of Zope 3 - Stephan RichterJeffrey Clark
 
Nagios Conference 2013 - Mike Weber - SNMP Extensions
Nagios Conference 2013 - Mike Weber - SNMP ExtensionsNagios Conference 2013 - Mike Weber - SNMP Extensions
Nagios Conference 2013 - Mike Weber - SNMP ExtensionsNagios
 
SSL/TLS for Mortals (DevNexus)
SSL/TLS for Mortals (DevNexus)SSL/TLS for Mortals (DevNexus)
SSL/TLS for Mortals (DevNexus)Maarten Mulders
 
WiFi practical hacking "Show me the passwords!"
WiFi practical hacking "Show me the passwords!"WiFi practical hacking "Show me the passwords!"
WiFi practical hacking "Show me the passwords!"DefCamp
 
DNS High-Availability Tools - Open-Source Load Balancing Solutions
DNS High-Availability Tools - Open-Source Load Balancing SolutionsDNS High-Availability Tools - Open-Source Load Balancing Solutions
DNS High-Availability Tools - Open-Source Load Balancing SolutionsMen and Mice
 
Using Algorithms to Brute Force Algorithms...A Journey Through Time and Names...
Using Algorithms to Brute Force Algorithms...A Journey Through Time and Names...Using Algorithms to Brute Force Algorithms...A Journey Through Time and Names...
Using Algorithms to Brute Force Algorithms...A Journey Through Time and Names...OpenDNS
 
Stateless Microservice Security via JWT and MicroProfile - ES
Stateless Microservice Security via JWT and MicroProfile - ES Stateless Microservice Security via JWT and MicroProfile - ES
Stateless Microservice Security via JWT and MicroProfile - ES Otavio Santana
 
Stateless Microservice Security via JWT and MicroProfile - Guatemala
Stateless Microservice Security via JWT and MicroProfile - GuatemalaStateless Microservice Security via JWT and MicroProfile - Guatemala
Stateless Microservice Security via JWT and MicroProfile - GuatemalaOtávio Santana
 
Stateless Microservice Security via JWT and MicroProfile - Mexico
Stateless Microservice Security via JWT and MicroProfile - MexicoStateless Microservice Security via JWT and MicroProfile - Mexico
Stateless Microservice Security via JWT and MicroProfile - MexicoOtávio Santana
 

What's hot (16)

SSL/TLS for Mortals (Devoxx FR 2018)
SSL/TLS for Mortals (Devoxx FR 2018)SSL/TLS for Mortals (Devoxx FR 2018)
SSL/TLS for Mortals (Devoxx FR 2018)
 
DNSSEC signing Tutorial
DNSSEC signing Tutorial DNSSEC signing Tutorial
DNSSEC signing Tutorial
 
Quasar, Sobaken, and Vermin: A deeper look into an ongoing espionage campaign
Quasar, Sobaken, and Vermin: A deeper look into an ongoing espionage campaignQuasar, Sobaken, and Vermin: A deeper look into an ongoing espionage campaign
Quasar, Sobaken, and Vermin: A deeper look into an ongoing espionage campaign
 
SSL/TLS for Mortals (JAX DE 2018)
SSL/TLS for Mortals (JAX DE 2018)SSL/TLS for Mortals (JAX DE 2018)
SSL/TLS for Mortals (JAX DE 2018)
 
4Developers: Dns vs webapp
4Developers: Dns vs webapp4Developers: Dns vs webapp
4Developers: Dns vs webapp
 
Cyber-security
Cyber-securityCyber-security
Cyber-security
 
Encryption Boot Camp on the JVM
Encryption Boot Camp on the JVMEncryption Boot Camp on the JVM
Encryption Boot Camp on the JVM
 
State Of Zope 3 - Stephan Richter
State Of Zope 3 - Stephan RichterState Of Zope 3 - Stephan Richter
State Of Zope 3 - Stephan Richter
 
Nagios Conference 2013 - Mike Weber - SNMP Extensions
Nagios Conference 2013 - Mike Weber - SNMP ExtensionsNagios Conference 2013 - Mike Weber - SNMP Extensions
Nagios Conference 2013 - Mike Weber - SNMP Extensions
 
SSL/TLS for Mortals (DevNexus)
SSL/TLS for Mortals (DevNexus)SSL/TLS for Mortals (DevNexus)
SSL/TLS for Mortals (DevNexus)
 
WiFi practical hacking "Show me the passwords!"
WiFi practical hacking "Show me the passwords!"WiFi practical hacking "Show me the passwords!"
WiFi practical hacking "Show me the passwords!"
 
DNS High-Availability Tools - Open-Source Load Balancing Solutions
DNS High-Availability Tools - Open-Source Load Balancing SolutionsDNS High-Availability Tools - Open-Source Load Balancing Solutions
DNS High-Availability Tools - Open-Source Load Balancing Solutions
 
Using Algorithms to Brute Force Algorithms...A Journey Through Time and Names...
Using Algorithms to Brute Force Algorithms...A Journey Through Time and Names...Using Algorithms to Brute Force Algorithms...A Journey Through Time and Names...
Using Algorithms to Brute Force Algorithms...A Journey Through Time and Names...
 
Stateless Microservice Security via JWT and MicroProfile - ES
Stateless Microservice Security via JWT and MicroProfile - ES Stateless Microservice Security via JWT and MicroProfile - ES
Stateless Microservice Security via JWT and MicroProfile - ES
 
Stateless Microservice Security via JWT and MicroProfile - Guatemala
Stateless Microservice Security via JWT and MicroProfile - GuatemalaStateless Microservice Security via JWT and MicroProfile - Guatemala
Stateless Microservice Security via JWT and MicroProfile - Guatemala
 
Stateless Microservice Security via JWT and MicroProfile - Mexico
Stateless Microservice Security via JWT and MicroProfile - MexicoStateless Microservice Security via JWT and MicroProfile - Mexico
Stateless Microservice Security via JWT and MicroProfile - Mexico
 

Similar to #RootedCON2012 - DNS: A botnet dialect - Carlos Diaz & Francisco J. Gomez

Carlos Díaz y Fco. Jesús Gómez - CMD: Look who's talking too [RootedCON 2012]
Carlos Díaz y Fco. Jesús Gómez - CMD: Look who's talking too [RootedCON 2012]Carlos Díaz y Fco. Jesús Gómez - CMD: Look who's talking too [RootedCON 2012]
Carlos Díaz y Fco. Jesús Gómez - CMD: Look who's talking too [RootedCON 2012]RootedCON
 
Breaking the cyber kill chain!
Breaking the cyber kill chain!Breaking the cyber kill chain!
Breaking the cyber kill chain!Nahidul Kibria
 
Large-Scale Malicious Domain Detection with Spark AI
Large-Scale Malicious Domain Detection with Spark AILarge-Scale Malicious Domain Detection with Spark AI
Large-Scale Malicious Domain Detection with Spark AIDatabricks
 
Owning computers without shell access 2
Owning computers without shell access 2Owning computers without shell access 2
Owning computers without shell access 2Royce Davis
 
Order vs. Mad Science: Analyzing Black Hat Swarm Intelligence
Order vs. Mad Science: Analyzing Black Hat Swarm IntelligenceOrder vs. Mad Science: Analyzing Black Hat Swarm Intelligence
Order vs. Mad Science: Analyzing Black Hat Swarm IntelligencePriyanka Aash
 
Hacker Halted 2014 - Why Botnet Takedowns Never Work, Unless It’s a SmackDown!
Hacker Halted 2014 - Why Botnet Takedowns Never Work, Unless It’s a SmackDown!Hacker Halted 2014 - Why Botnet Takedowns Never Work, Unless It’s a SmackDown!
Hacker Halted 2014 - Why Botnet Takedowns Never Work, Unless It’s a SmackDown!EC-Council
 
The Ultimate Guide to Docker & Kubernetes Forensics and Incident Response.pdf
The Ultimate Guide to Docker & Kubernetes Forensics and Incident Response.pdfThe Ultimate Guide to Docker & Kubernetes Forensics and Incident Response.pdf
The Ultimate Guide to Docker & Kubernetes Forensics and Incident Response.pdfChristopher Doman
 
Using linuxKit to build custom rancherOS systems
Using linuxKit to build custom rancherOS systems Using linuxKit to build custom rancherOS systems
Using linuxKit to build custom rancherOS systems Moby Project
 
hackcon2013-Dirty Little Secrets They Didn't Teach You In Pentesting Class v2
hackcon2013-Dirty Little Secrets They Didn't Teach You In Pentesting Class v2hackcon2013-Dirty Little Secrets They Didn't Teach You In Pentesting Class v2
hackcon2013-Dirty Little Secrets They Didn't Teach You In Pentesting Class v2Chris Gates
 
Owning computers without shell access dark
Owning computers without shell access darkOwning computers without shell access dark
Owning computers without shell access darkRoyce Davis
 
Windows Malware Techniques
Windows Malware TechniquesWindows Malware Techniques
Windows Malware TechniquesLee C
 
Case Studies TeamTNT - AWS & Container Cryptomining Worm DFIR.pdf
Case Studies TeamTNT - AWS & Container Cryptomining Worm DFIR.pdfCase Studies TeamTNT - AWS & Container Cryptomining Worm DFIR.pdf
Case Studies TeamTNT - AWS & Container Cryptomining Worm DFIR.pdfChristopher Doman
 
So you want to be a security expert
So you want to be a security expertSo you want to be a security expert
So you want to be a security expertRoyce Davis
 
CONFidence 2018: Detecting Phishing from pDNS (Irena Damsky)
CONFidence 2018: Detecting Phishing from pDNS (Irena Damsky)CONFidence 2018: Detecting Phishing from pDNS (Irena Damsky)
CONFidence 2018: Detecting Phishing from pDNS (Irena Damsky)PROIDEA
 
(SACON) Sudarshan Pisupati & Sahir Hidayatullah - active deception sacon
(SACON) Sudarshan Pisupati & Sahir Hidayatullah - active deception sacon(SACON) Sudarshan Pisupati & Sahir Hidayatullah - active deception sacon
(SACON) Sudarshan Pisupati & Sahir Hidayatullah - active deception saconPriyanka Aash
 
A New Perspective on Resource-Level Cloud Forensics
A New Perspective on Resource-Level Cloud ForensicsA New Perspective on Resource-Level Cloud Forensics
A New Perspective on Resource-Level Cloud ForensicsChristopher Doman
 
Crypto Miners in the Cloud
Crypto Miners in the CloudCrypto Miners in the Cloud
Crypto Miners in the CloudTeri Radichel
 
[1.2] Трюки при анализе защищенности веб приложений – продвинутая версия - С...
[1.2] Трюки при анализе защищенности веб приложений – продвинутая версия - С...[1.2] Трюки при анализе защищенности веб приложений – продвинутая версия - С...
[1.2] Трюки при анализе защищенности веб приложений – продвинутая версия - С...OWASP Russia
 
Building A Cloud Security Strategy for Scale
Building A Cloud Security Strategy for ScaleBuilding A Cloud Security Strategy for Scale
Building A Cloud Security Strategy for ScaleChris Farris
 
Not a Security Boundary
Not a Security BoundaryNot a Security Boundary
Not a Security BoundaryWill Schroeder
 

Similar to #RootedCON2012 - DNS: A botnet dialect - Carlos Diaz & Francisco J. Gomez (20)

Carlos Díaz y Fco. Jesús Gómez - CMD: Look who's talking too [RootedCON 2012]
Carlos Díaz y Fco. Jesús Gómez - CMD: Look who's talking too [RootedCON 2012]Carlos Díaz y Fco. Jesús Gómez - CMD: Look who's talking too [RootedCON 2012]
Carlos Díaz y Fco. Jesús Gómez - CMD: Look who's talking too [RootedCON 2012]
 
Breaking the cyber kill chain!
Breaking the cyber kill chain!Breaking the cyber kill chain!
Breaking the cyber kill chain!
 
Large-Scale Malicious Domain Detection with Spark AI
Large-Scale Malicious Domain Detection with Spark AILarge-Scale Malicious Domain Detection with Spark AI
Large-Scale Malicious Domain Detection with Spark AI
 
Owning computers without shell access 2
Owning computers without shell access 2Owning computers without shell access 2
Owning computers without shell access 2
 
Order vs. Mad Science: Analyzing Black Hat Swarm Intelligence
Order vs. Mad Science: Analyzing Black Hat Swarm IntelligenceOrder vs. Mad Science: Analyzing Black Hat Swarm Intelligence
Order vs. Mad Science: Analyzing Black Hat Swarm Intelligence
 
Hacker Halted 2014 - Why Botnet Takedowns Never Work, Unless It’s a SmackDown!
Hacker Halted 2014 - Why Botnet Takedowns Never Work, Unless It’s a SmackDown!Hacker Halted 2014 - Why Botnet Takedowns Never Work, Unless It’s a SmackDown!
Hacker Halted 2014 - Why Botnet Takedowns Never Work, Unless It’s a SmackDown!
 
The Ultimate Guide to Docker & Kubernetes Forensics and Incident Response.pdf
The Ultimate Guide to Docker & Kubernetes Forensics and Incident Response.pdfThe Ultimate Guide to Docker & Kubernetes Forensics and Incident Response.pdf
The Ultimate Guide to Docker & Kubernetes Forensics and Incident Response.pdf
 
Using linuxKit to build custom rancherOS systems
Using linuxKit to build custom rancherOS systems Using linuxKit to build custom rancherOS systems
Using linuxKit to build custom rancherOS systems
 
hackcon2013-Dirty Little Secrets They Didn't Teach You In Pentesting Class v2
hackcon2013-Dirty Little Secrets They Didn't Teach You In Pentesting Class v2hackcon2013-Dirty Little Secrets They Didn't Teach You In Pentesting Class v2
hackcon2013-Dirty Little Secrets They Didn't Teach You In Pentesting Class v2
 
Owning computers without shell access dark
Owning computers without shell access darkOwning computers without shell access dark
Owning computers without shell access dark
 
Windows Malware Techniques
Windows Malware TechniquesWindows Malware Techniques
Windows Malware Techniques
 
Case Studies TeamTNT - AWS & Container Cryptomining Worm DFIR.pdf
Case Studies TeamTNT - AWS & Container Cryptomining Worm DFIR.pdfCase Studies TeamTNT - AWS & Container Cryptomining Worm DFIR.pdf
Case Studies TeamTNT - AWS & Container Cryptomining Worm DFIR.pdf
 
So you want to be a security expert
So you want to be a security expertSo you want to be a security expert
So you want to be a security expert
 
CONFidence 2018: Detecting Phishing from pDNS (Irena Damsky)
CONFidence 2018: Detecting Phishing from pDNS (Irena Damsky)CONFidence 2018: Detecting Phishing from pDNS (Irena Damsky)
CONFidence 2018: Detecting Phishing from pDNS (Irena Damsky)
 
(SACON) Sudarshan Pisupati & Sahir Hidayatullah - active deception sacon
(SACON) Sudarshan Pisupati & Sahir Hidayatullah - active deception sacon(SACON) Sudarshan Pisupati & Sahir Hidayatullah - active deception sacon
(SACON) Sudarshan Pisupati & Sahir Hidayatullah - active deception sacon
 
A New Perspective on Resource-Level Cloud Forensics
A New Perspective on Resource-Level Cloud ForensicsA New Perspective on Resource-Level Cloud Forensics
A New Perspective on Resource-Level Cloud Forensics
 
Crypto Miners in the Cloud
Crypto Miners in the CloudCrypto Miners in the Cloud
Crypto Miners in the Cloud
 
[1.2] Трюки при анализе защищенности веб приложений – продвинутая версия - С...
[1.2] Трюки при анализе защищенности веб приложений – продвинутая версия - С...[1.2] Трюки при анализе защищенности веб приложений – продвинутая версия - С...
[1.2] Трюки при анализе защищенности веб приложений – продвинутая версия - С...
 
Building A Cloud Security Strategy for Scale
Building A Cloud Security Strategy for ScaleBuilding A Cloud Security Strategy for Scale
Building A Cloud Security Strategy for Scale
 
Not a Security Boundary
Not a Security BoundaryNot a Security Boundary
Not a Security Boundary
 

Recently uploaded

The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
QCon London: Mastering long-running processes in modern architectures
QCon London: Mastering long-running processes in modern architecturesQCon London: Mastering long-running processes in modern architectures
QCon London: Mastering long-running processes in modern architecturesBernd Ruecker
 
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
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 
Glenn Lazarus- Why Your Observability Strategy Needs Security Observability
Glenn Lazarus- Why Your Observability Strategy Needs Security ObservabilityGlenn Lazarus- Why Your Observability Strategy Needs Security Observability
Glenn Lazarus- Why Your Observability Strategy Needs Security Observabilityitnewsafrica
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxLoriGlavin3
 
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
 
Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsRavi Sanghani
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotesMuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotesManik S Magar
 
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...Wes McKinney
 
Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Farhan Tariq
 
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
 
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 Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxLoriGlavin3
 
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentEmixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentPim van der Noll
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)Kaya Weers
 
Data governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationData governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationKnoldus Inc.
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxLoriGlavin3
 

Recently uploaded (20)

The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
QCon London: Mastering long-running processes in modern architectures
QCon London: Mastering long-running processes in modern architecturesQCon London: Mastering long-running processes in modern architectures
QCon London: Mastering long-running processes in modern architectures
 
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
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 
Glenn Lazarus- Why Your Observability Strategy Needs Security Observability
Glenn Lazarus- Why Your Observability Strategy Needs Security ObservabilityGlenn Lazarus- Why Your Observability Strategy Needs Security Observability
Glenn Lazarus- Why Your Observability Strategy Needs Security Observability
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
 
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
 
Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and Insights
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotesMuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
 
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
 
Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...
 
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
 
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 Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
 
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentEmixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)
 
Data governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationData governance with Unity Catalog Presentation
Data governance with Unity Catalog Presentation
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
 

#RootedCON2012 - DNS: A botnet dialect - Carlos Diaz & Francisco J. Gomez

  • 1. CMD:  Look  who’s  talking  too   DNS:  a  botnet  dialect  
  • 2. Francisco  J.  Gómez  Rodríguez  (fran@Gd.es):   •  Computer  Engineering  (EUI-­‐UPM)   •  Security  Research  (Telefonica  R&D)   •  dig  fran.rootedcon.themafia.info  TXT   Carlos  Díaz  Hidalgo  (charlie@Gd.es):   •  TelecommunicaGons  Engineer  (ETSITM-­‐UPM),  GPEN,  GCIH,   OPST,  ITILF  and  CCNA.   •  Technology  Specialist  in  Ethical  Hacking  (Telefonica  R&D)   •  dig  charlie.rootedcon.themafia.info  TXT  
  • 3. look  who’s  talking  too   Nasal  Spray   This  presenta9on  contains:   one  year  ago  …………………………………………....        3  mg   cloud  malware  distribuGon  …………………..….      10  mg   dns  is  in  the  air  …………………………………………      10  mg   suspicion  ………………………………………………….          8  mg   data  leak  ………………………………………………….      10  mg   laboratory  ……………………………………………….        10  mg   4.4  FL  OZ  (130mL)   Tamper-­‐Evident:  Do  not  accept  if  sealed  blister   unit  has  been  broken  or  opened   THIS  PACKAGE  FOR  HOUSEHOLDS   WITHOUT  YOUNG  CHILDREN  
  • 5. One  year  ago  …   •  We  talked  about  DNS  and  Malware.   •  We  released  Cloud  Malware  DistribuGon   (CMD):   –  An  alternaGve  method  for  malware  distribuGon   using  Cache  DNS  services.   –  Using  client  default  DNS  se_ngs.   –  Malware  source  virtually  untraceable.  
  • 7. Cloud  Malware  DistribuGon  in  a  nutshell   CMD  
  • 8. Cloud  Malware  DistribuGon   1.  Encoding:  Split  malware  payload  into  DNS  Records.     2.  Publishing:  Publish  domain  and  each  record  in  a  public  Name  Server.     3.  Loading:  Force  an  Open  Emi`er  DNS  Cache  Server  to  store  all  records.     4.  Downloading:  Download  records  from  an  infected  host  (bot).     5.  Decoding:  Rebuild  malware  payload  from  records.   8rjqerkjqet.cmdns.domain.com     ueirytbdosu.cmdns.domain.com     ktqtr53xase.cmdns.domain.com     kzmfzzmfzze.cmdns.domain.com     8rjqerkjqet.cmdns.domain.com     1,2   ueirytbdosu.cmdns.domain.com     3   4   5 ktqtr53xase.cmdns.domain.com     kzmfzzmfzze.cmdns.domain.com     Open  Emi`er   DNS  
  • 9. Encoding  &  Publish   Cloud  Malware  DistribuGon  (I)   8rjqerkjqet.cmdns.domain.com     8rjqerkjqet   ueirytbdosu.cmdns.domain.com     ueirytbdosu   ktqtr53xase   ktqtr53xase.cmdns.domain.com     kzmfzzmfzze     kzmfzzmfzze.cmdns.domain.com     •  From  malware  file  we  create   a  base32  coded  string.   •  So  we  split  the  string  into   DNS  compliance  records.   DNS  AUTH   8rjqerkjqetueirytbdosuktqtr53xasekzmfzzmfzze     Freedns.afraid.org   8rjqerkjqet.cmdns.domain.com     kzmfzzmfzze.cmdns.domain.com     ueirytbdosu.cmdns.domain.com     ktqtr53xase.cmdns.domain.com    
  • 10. Cloud  Malware  DistribuGon(II)   8rjqerkjqet.cmdns.domain.com     •  We  upload  each  DNS  record  from   a  malicious  DNS  to  Open  Emi`er.   ueirytbdosu.cmdns.domain.com     •  This  is  made  by  requesGng  each   ktqtr53xase.cmdns.domain.com     record  to  Open  Emi`er  DNS.   •  Then  Server  caches  each  record.   kzmfzzmfzze.cmdns.domain.com     Split[1..n].cmdns.domain.com   A?   8rjqerkjqet.cmdns.domain.com     Open   ueirytbdosu.cmdns.domain.com     Emi`er   ktqtr53xase.cmdns.domain.com     cmdns.domain.com   DNS  AUTH   NS?   DNS   kzmfzzmfzze.cmdns.domain.com     Freedns.afraid.org   Loading  
  • 11. Cloud  Malware  DistribuGon  (III)   •  Since  the  Open  Emi`er  Server  has  cached  all  records  we   convert  it  into  a  domain  authoritaGve  domain  server.   •  From  now  on,  Open  Emi`er  will  resolve  all  domain  queries.   •  Thus,  all  Internet  DNS  servers  can  resolve  malware  records  and   bots  can  get  them.   DNS  AUTH         Freedns.afraid.org   8rjqerkjqet.cmdns.domain.com     Open   ueirytbdosu.cmdns.domain.com     ktqtr53xase.cmdns.domain.com     Emi`er   kzmfzzmfzze.cmdns.domain.com     DNS   Downloading  
  • 12. Cloud  Malware  DistribuGon  (IV)   kzmfzzmfzze.cmdns.domain.com     ktqtr53xase.cmdns.domain.com     ueirytbdosu.cmdns.domain.com     8rjqerkjqet.cmdns.domain.com     8rjqerkjqetueirytbdosuktqtr53xasekzmfzzmfzze     •  With  all  the  retrieved  records  bots   can  rebuild  the  original  file.     •  Bot  has  now  updated  the  malware   file.   Decoding  
  • 13.   Own  survey  :  yesterday  and  today   Febrero  de  2011   Marzo  de  2012   España   EEUU   España   EEUU   Queried  hosts   10.406   10.406   8217   8217   Replying  hosts   87,22%   87,39%   87,58%   87,69%   Open  resolvers   76,46%   77,28%   95,45%   82,08%   Open  emi`ers   57,76%   57,33%   53,78%   53,51%   Accept  +norecurse   queries   55,91%   55,49%   87,67%   74,44%   TTL  ≥  604800   43,05%   42,94%   51,24%   49,32%  
  • 14. A  quick  test…   DNSCrypt   In   the   same   way   the   SSL   turns   HTTP   web   traffic   into   HTTPS   encrypted   Web   traffic,   DNSCrypt   turns   regular   DNS   traffic   into   encrypted   DNS   traffic   that   is   secure   from   eavesdropping   and   man-­‐in-­‐the-­‐middle  a`acks.    
  • 15. …  a  quick  demo.   Summary:  We  can  use  DNSCrypt  and  CMD  Method  works.    
  • 16. DNS:  yesterday,  today,  and  tomorrow   DNS  IS  IN  THE  AIR  
  • 17. Are  you  talking  to  me?   •  Let’s  see  some  about…   –  DNS  as  covert  channel.   –  DNS  uses  in  malware  communicaGons.  
  • 18. l   DNS  as  Covert  Channe     •  OzymanDNS  (Kaminsky)   •  Dnscapy   •  (NSTX)  Iodine:  Use  several  RR  types,   NULL,TXT,CNAME)   •  Dns2tcp  &  TCP-­‐over-­‐DNS:  relay  TCP  connecGons.   •  LoopcVPN  One  of  China-­‐Telecom  Hotspot   nightmare.  
  • 19. Are  you  talking  to  me?   •  Let’s  see  some  about…   –  DNS  as  covert  channel.   –  DNS  uses  in  malware  communicaGons.  
  • 20. Stateless  malware  (I)   •  TSPY_ZBOT.SMQH –  Another Modified ZeuS Variant Seen in the Wild. –  Reported in September 2011 by Trendmicro. –  Data exchange is also now happening in UDP. –  http://blog.trendmicro.com/another-modified-zeus-variant-seen-in-the-wild/
  • 21. Stateless  malware(II)   •  Older  version  using  TCP  to  exchange  configura7on  files.  However,   The  new  version  exchanges  all  data  in  UDP –  http://www.symantec.com/connect/blogs/zeusbotspyeye-p2p-updated-fortifying-botnet
  • 22. Stateless  malware(II)   •  Older  version  using  TCP  to  exchange  configura7on  files.  However,   The  new  version  exchanges  all  data  in  UDP –  http://www.symantec.com/connect/blogs/zeusbotspyeye-p2p-updated-fortifying-botnet TCP  
  • 23. Where  there's  smoke,  there's  fire.  
  • 24. Feedorbot   •  Using DNS protocol. –  Feedorbot share encrypted commands from C&C. –  Encapsuling data in TXT records and Base64 encoded. –  http://www.cj2s.de/On-Botnets-that-use-DNS-for-Command-and-Control.pdf
  • 25. HiloG   •  Thanks  DNS  querys  HiloG  monitors  infected  host  status.   –  h`p://blog.forGnet.com/hiloG-­‐the-­‐botmaster-­‐of-­‐disguise     142625.bc7a3d45.01.0AC1FD9D62074E6D9D2889088284DAB5.n.empty.1148.empty. 5_1._t_i.ffffffff.explorer_exe.173.rc2.a4h9uploading.com   •  Although  It  uses  DNS  as  control  protocol,  bots  download   update  files  from  “file  hosGng”  servers  by  HTTP.      
  • 26. Morto   •  From IRC to DNS. –  Morto, like Feedorbot, uses TXT records to comnunicate. –  http://www.symantec.com/connect/blogs/morto-worm-sets-dns-record
  • 27. GATHERING  &  EVALUATING   INFORMATION  
  • 28. Gathering  &  EvaluaGng  InformaGon  (I)   •  h`p://www.wombat-­‐project.eu/     •  h`p://exposure.iseclab.org/index.html    
  • 29. Gathering  &  EvaluaGng  InformaGon  (II)   •  h`ps://dnsdb.isc.org/#Home     •  h`p://www.webboar.com    
  • 30. Gathering  &  EvaluaGng  InformaGon  (III)   •  Don´t  forget  the  classics:   –  h`p://www.robtex.com/  
  • 31. Learned  in  #Rooted2012   •  h`p://labs.alienvault.com/labs/index.php/projects/open-­‐source-­‐ip-­‐reputaGon-­‐portal/    
  • 32. SomeGmes  …  I  see  dead  people   •  September,  2011          (Top  10  Malicious  Domains)  
  • 34. Ten  Li`le  Niggers   •  h`p://www.webboar.com/ip/67.15.149.70/   –  25  Domain(s)  on  IP  Address  67.15.149.70   •  azxdf.com   •  civiGcle0.com   •  morewallfalls7.com   •  mjuyh.com   •  ckubf.com   •  okjyu.com   •  hjuyv.com   •  djhbw.com   •  orn2hcb.com   •  plokm.com   •  himovingto8.com   •  qlovg.com   •  nbgtr.com   •  hiuxd.com   •  quiluGon2.com   •  vcxde.com   •  liunj.com   •  uncdt.com   •  asljd.com   •  loijm.com   •  xvfar.com   •  bruGllor5.com   •  mjrth.com   •  zscdw.com   •  zukamosion3.com  
  • 35. SomeGmes  …  I  see  dead  people  
  • 36. CMD  could  be  alive!  
  • 37. DATA  LEAK  OVER  DNS  
  • 38. DATA  LEAK  OVER  DNS  
  • 39. TradiGonal  data  leak  using  DNS   [OUTPUT_DOMAIN]   DataLeakRecord1.[OUTPUT_DOMAIN] DataLeakRecord1   DataLeakRecord2.[OUTPUT_DOMAIN] DataLeakRecord2   …   1   2   Cache  DNS   (public or private) DNS  Auth.   OUTPUT_DOMAIN   Bot
  • 40. Using  a  DNS  reflector   DNS  Auth.   DataLeakRecord1.[OUTPUT_DOMAIN] (OUTPUT_DOMAIN)   2   1   (PUBLICATION_DOMAIN)   Cache  DNS    Data1  -­‐>  DataLeakRecord1 (public or private) 3   Force  Data  Leak  Upload   CMD   5   Bot Data1 [PUBLICATION_DOMAIN]   Data1   4   Data2   …   Data1.[PUBLICATION_DOMAIN] Cache  DNS   DNS  Auth.   (Open  emi`er  +  cache)   PUBLICATION_DOMAIN    Data1  -­‐>  DataLeakRecord1
  • 42. Using  Fast-­‐Flux  DNS  reflectors   DNS  Auth.   DataLeakRecord1.[OUTPUT_DOMAIN] (OUTPUT_DOMAIN)   2   1   Cache  DNS   (PUBLICATION_DOMAIN)    Data1  -­‐>  DataLeakRecord1 (public or private) 3   DataLeakRecord1.[OUTPUT_DOMAIN] Force  Data  Leak  Upload   CMD   5   Bot Data1 [PUBLICATION_DOMAIN]   Data1   4   Data2   …   Data1.[PUBLICATION_DOMAIN] Cache  DNS   DNS  Auth.   (Open  emi`er  +  cache)  
  • 43. Data  Leak  using  NXDOMAIN  responses   •  NXDOMAIN  responses  are  cached:   –  NegaGve  caching  is  useful.   –  TTL  value:  The  SOA  'minimum'  parameter  is  used   as  the  negaGve  (NXDOMAIN)  caching  Gme   (defined  in  RFC  2308).   •  Other  queries  may  reuse  some  parts  of  the   lookup  (quick  response).  
  • 47. Data  leak  with  “dig”   RCODE   TTL   QUERY  TIME  
  • 48. Leak  recovery  with  “dig”  (I)   TTL  <  86400   QUERY  TIME  <  300  msec  
  • 49. Leak  recovery  with  “dig”  (II)   TTL  =  86400   QUERY  TIME  approx.  300  msec   It  is  not  a  good  method  for  recovery!  
  • 50. Leak  recovery  with  “dig”  (III)   TTL  <  86400   QUERY  TIME  <  300  msec  
  • 51. Leak  recovery  with  “dig”  (IV)   RCODE  ≠  NXDOMAIN   QUERY  TIME  <  300  msec   It  is  the  preferred  method  for  recovery!  
  • 52. Data  Leak  using  NXDOMAIN  responses   DNS   2   1   (Open  emi`er  +  cache)   DNS  Auth.   UT_DOM AIN] 1.[OUTPUT_DOMAIN] (OUTPUT_DOMAIN)   1.[OUTP d1.[OUTPUT_DOMAIN] OMAIN] TPUT_D d1.[OU … AIN] dataleakrecord1 UT_DOM rd1.[OUTP ataLeakRecord1.[OUTPUT_DOMAIN] … DataLeakRecord1.[OUTPUT_DOMAIN] IN] T_DOMA d1.[OUTPU krecor atalea MAIN] PUT_DO rd1.[OUT akreco datale Bot
  • 53. Data  Leak  using  NXDOMAIN  responses   DNS   2   1   (Open  emi`er  +  cache)   DNS  Auth.   UT_DOM AIN] 1.[OUTPUT_DOMAIN] (OUTPUT_DOMAIN)   1.[OUTP d1.[OUTPUT_DOMAIN] OMAIN] TPUT_D d1.[OU … AIN] dataleakrecord1 UT_DOM rd1.[OUTP ataLeakRecord1.[OUTPUT_DOMAIN] … DataLeakRecord1.[OUTPUT_DOMAIN] IN] T_DOMA d1.[OUTPU krecor atalea MAIN] PUT_DO rd1.[OUT akreco a1.[OUTPUT_DOMAIN] datale 1.[OUTPUT_DOMAIN] z.[OUTPUT_DOMAIN] b.[OUTPUT_DOMAIN] a.[OUTPUT_DOMAIN] … … Bot QUERY:  +norecurse     3   RESPONSE:  RCODE?   dataleakrecord1 TTL  value?   Query  Gme?  
  • 55. Data  Leak  using  “nice”  domains   •  There  are  authoritaGve  DNS  server  that:   –  Simply  point  all  unknown  DNS  queries  to  a  single   IP  address.   –  Minimum  TTL  value  on  the  order  of  1-­‐7  days.   •  Where  can  I  find  them?   inbox.com   imgur.com   –  Alexa  “Tops  Sites”:   motherless.com   h`p://www.alexa.com/topsites     wikia.com   wikispaces.com   pbworks.com                          …  
  • 58. Data  Leak  using  ‘nice’  domains   DNS   2   ‘nice’  DNS  Auth.   1   (Open  emi`er  +  cache)   (OUTPUT_DOMAIN)   AIN] 1.[OUTPUT_DOMAIN] UT_DOM 1.[OUTP d1.[OUTPUT_DOMAIN] OMAIN] TPUT_D d1.[OU … AIN] dataleakrecord1 UT_DOM rd1.[OUTP ataLeakRecord1.[OUTPUT_DOMAIN] … DataLeakRecord1.[OUTPUT_DOMAIN] IN] T_DOMA d1.[OUTPU krecor atalea MAIN] PUT_DO rd1.[OUT akreco datale Bot
  • 59. Data  Leak  using  ‘nice’  domains   DNS   2   ‘nice’  DNS  Auth.   1   (Open  emi`er  +  cache)   (OUTPUT_DOMAIN)   AIN] 1.[OUTPUT_DOMAIN] UT_DOM 1.[OUTP d1.[OUTPUT_DOMAIN] OMAIN] TPUT_D d1.[OU … AIN] dataleakrecord1 UT_DOM rd1.[OUTP ataLeakRecord1.[OUTPUT_DOMAIN] … DataLeakRecord1.[OUTPUT_DOMAIN] IN] T_DOMA d1.[OUTPU krecor atalea MAIN] PUT_DO rd1.[OUT akreco a1.[OUTPUT_DOMAIN] datale 1.[OUTPUT_DOMAIN] z.[OUTPUT_DOMAIN] b.[OUTPUT_DOMAIN] a.[OUTPUT_DOMAIN] … … Bot QUERY:  +norecurse     3   ANSWER  SECTION?   dataleakrecord1 TTL  value?  
  • 60. Conclusions  data-­‐leak   Use  client   Upload   Expose   Download   Score   default  DNS   queries   cybercrime   queries   (0-­‐10)   seings   needed   infrastructure   needed   TradiGonal   YES   2  queries/kB   YES   -­‐   5   DNS  tunneling   Using  Fast-­‐Flux   YES   2  queries/kB   YES   2  queries/kB   4   DNS  reflectors   Using   NXDOMAIN   NO   2  queries/B   NO   20  queries/B   2   response   Using  “nice”   NO   2  queries/B   NO   20  queries/B   6   domains  
  • 61. ToDo:  Improvement++   •  Data  Leak  using  ‘nice’  domains.  But   remembering  that:   –  Must  use  client  default  DNS  se_ngs.   •  Maybe  can  use  three  party  resources  …  (once   again)   –   …  Use  misconfigured  DNS  (proxy  DNS,  cache  DNS,   authoritaGve  server,  …).   –  e.g.  must  ignore  “+norecurse”  flag,  “minimal-­‐ response”  configured,  etc.   •  Result:  Untraceable  data  leaks  
  • 62. Harder  than  finding  a  needle  in  a   haystack!  
  • 63. Are  we  infected?   LABORATORY  
  • 64. Making  the  lab.   •  We  need  a  “real”  threat…   •  But  we  are  “ethical”…   •  And  we  are  not  developers…   Searching…  
  • 65. And  the  winner  is…   •  Wri`en  in  C#  and  PHP   •  GNU/GPL   •  Geared  to  build  botnets   •  HTTP  communicaGon  
  • 66. How  Flu  works   •  Flu  server  share  XML  commands  file.   •  Infected  hosts  get  XML  file  through   HTTP  request.   HTTP   Flu   Flu   Infected   SERVER   Host  
  • 67. Flu  and  CMD   •  We  use  CMD  to  distribute  XML  commands  file.   •  Our  dream:  Flu  become  stateless  Trojan.   •  Then  we’ll  have  stateless-­‐Trojan-­‐GPL  botnet.   1  GET   1  query   11  pkts.   HTTP/TCP   Vs   DNS/UDP   2  pkts.   1  conn.     0  conn.   DNS   Open   DNS   Flu   Flu   Emi`er   Infected   DNS   DNS   Host  
  • 68. Flu  and  CMD:  Server   •  PHP  5.3.0  or  higher  required.   •  Three  steps:   1.   domain.db  file  create.  (external  lib:  Tar.php)   2.  Load  XML  file  into  DNS  server.  (NaGve  lib)   3.  Download  data  from  infected  host.  (NaGve  lib)  
  • 69. Flu  and  CMD:  3th  Party   •  ISC  Bind   •  FreeDNS.afraid.org   •  HE  free  DNS  service   •  Misconfigured  DNS  server.   Open   Emi`er  
  • 70. Flu  and  CMD:  3th  Party   •  ISC  Bind   •  FreeDNS.afraid.org   •  HE  free  DNS  service   •  Misconfigured  DNS  server.   Open   Emi`er  
  • 71. Flu  and  CMD:  Client   •  We  use  ARSoD.Tools.Net  library.   •  Without  GUI  changes:   –  We  use  domainload  to  data  leak.   –  We  use  domaindownload  to  get  XML  file.  
  • 72. Flu  and  CMD:  How  it  works  (I)   XML2DNS   LOADXML   DOWNLOADXML   DNS   Open   DNS   Flu   Flu   Emi`er   Infected   DNS   DNS   Host  
  • 73. Flu  and  CMD:  How  it  works  (II)   •  How  flu  call  back?   –  NXDOMAIN  can:  Track  new  bots.   –  NXDOMAIN  can’t:  Send  huge  files.     DNS   Open   DNS   Flu   Flu   Emi`er   Infected   C&C   Nxdomainquery   Nxdomainquery   Noerror   DNS   Noerror   Host   DNS  Server  
  • 74. Flu  and  CMD:  How  it  works  (II)   1.  How  flu  call  back?   –  NXDOMAIN  can:  Track  new  bots.   –  NXDOMAIN  can’t:  Send  huge  files.     2.  Then…  we  need  to  expose  DNS  server.   DNS   Open   DNS   Flu   Flu   Emi`er   Infected   C&C   Nxdomainquery   Nxdomainquery   1   Noerror   DNS   Noerror   Host   DNS  Server   DNS   DNS   Flu   Flu   Cache   2   Infected   DNS   DNS   Host  
  • 75. Flu  and  CMD:  Demo  
  • 76. Conclusions   •  DNS  is  a  botnet  dialect…   –  One  year  ago  DNS  was  a  possibility,  today  could  be  a  real   threat.   •  Data  leak  using  DNS  need  an  improvement…   –  ...but  we  are  working  progress.   •  Malware  need  to  communicate  undetected,  and  IDS   want  to  detect  malware.   –  Both  must  be  looking  for  the  same…  DNS.   •  Don’t  forget  DNS  Protocol  
  • 77. QuesGons?   Who  invented  the  rootedcon?   Perez  the  mouse   Rootedcon  is  your  parents   Santa   Three  Magic  Kings  
  • 78. References   §  h`p://code.kryo.se/iodine/     §  h`p://dns.measurement-­‐factory.com/     §  h`p://darkwing.uoregon.edu/~joe/secprof10-­‐dns/secprof10-­‐dns.pdf       §  h`p://www.blackhat.com/presentaGons/bh-­‐europe-­‐05/BH_EU_05-­‐Kaminsky.pdf     §  h`p://www.blackhat.com/presentaGons/bh-­‐usa-­‐04/bh-­‐us-­‐04-­‐kaminsky/bh-­‐us-­‐04-­‐kaminsky.ppt     §  h`p://www.pcworld.com/arGcle/220024/feds_accidentally_seize_84000_innocent_domains_link_them_with_child_porn.html       §  h`p://www.symantec.com/content/en/us/enterprise/media/security_response/whitepapers/zeus_king_of_bots.pdf       §  h`p://www.secdev.org/projects/scapy/     §  h`ps://www.isc.org/soƒware/bind/documentaGon/arm95#man.dig     §  h`p://dns.measurement-­‐factory.com/cgi-­‐bin/openresolvercheck.pl       §  h`p://hakin9.org/magazine/1652-­‐mobile-­‐malware-­‐the-­‐new-­‐cyber-­‐threat     §  h`p://www.ie„.org/rfc/rfc{1033,1034,1035,1183,2181}.txt     §  h`p://tools.ie„.org/id/draƒ-­‐cmd-­‐prevent-­‐malware-­‐dns-­‐distribute-­‐00.txt       §  h`p://www.wombat-­‐project.eu/     §  h`p://exposure.iseclab.org/index.html     §  h`ps://dnsdb.isc.org/#Home       §  h`p://www.webboar.com     §  h`ps://dns.he.net/     §  h`p://www.flu-­‐project.com/     §  h`p://arsoƒtoolsnet.codeplex.com/    
  • 79. Thanks  for  your  Gme!   @{Hlexpired,ffranz}   {charlie,fran}@7d.es