SlideShare ist ein Scribd-Unternehmen logo
1 von 44
Downloaden Sie, um offline zu lesen
All you ever wanted to
   know about BeEF
 Antisnatchor – ZeroNights 2012 -
           Москва
About antisnatchor
•    Lead core developer of BeEF
•    Application security researcher
•    Loves Ruby, Javascript and OpenBSD
•    Kubrick fan
•    Водка fan
BeEF
•  The most robust framework to
   control the browser of a victim
   entirely with Javascript.

•  Each browser is likely to be within
   a different security context, and
   each context may provide a set of
   unique attack vectors.
High Level Architecture
Lets start to play with it
•  BeEF Live CD
   -­‐>	
  thanks	
  Ben	
  Waugh	
  

  –  Based on Ubuntu L
  –  Latest (GIT): BeEF, Metasploit, sqlmap
  –  No GUI
  –  Exclusive release at ZeroNights 2012
•  Latest Ruby + gem dependencies
   pre-installed:
  –  If you have issues installing BeEF, use
     the live CD (i.e. don’t bother us :-)
BeEF XHR internals
BeEF XHR internals
BeEF XHR internals
BeEF XHR internals
BeEF XHR internals
BeEF XHR internals
BeEF XHR internals
Other communication
          channels
•  WebSockets
  –  Almost real-time communication, high
     responsiveness
  –  Both WebSocket and WebSocketSecure
     are supported
  –  Just start BeEF with the following
     configuration (main config.yaml):
Attack the user
•  Trick the user to click/accept using
   visual social engineering
   techniques, like:
   –  Fake flash update
   –  Clippy
   
•  Automate WebCloning and Mass Mailing
   with the Social Engineering extension
Fake flash update
Fake flash update
                          by	
  Mike	
  Haworth,	
  an8snatchor	
  

•  Prompts the user to install an
   update to Adobe Flash Player
•  The file to be delivered could be a
   Chrome or Firefox extension

•  Chrome <= 20 is required for the
   chrome extension delivery 
•  (Chrome >= 21 enables extensions
   coming only from Google WebStore)
Clippy
Clippy
Clippy
                            by	
  vt,	
  denden	
  

•  Original code:
   http://clippy.ajbnet.com/ by sprky0
•  Display the old Microsoft Clippy
   helper icon, prompting the user to
   do stuff. Click YES:
  –  Download and run executable
  –  Click on links
  –  enter data
Social Engineering
         for the masses
•  The idea was to have new BeEF
   features, exposed with the RESTful
   API, to:
  –  send phishing emails using HTML
     templates;
  –  clone webpages, harvest credentials;
  –  client-side pwnage.
Social Engineering
 for the masses: WebCloner
•  Clone a webpage and serve it on
   BeEF, then automatically:
  –  modify the page to intercept POST
     requests.
  –  add the BeEF hook to the page
  –  if the page can be framed, after POST
     interception load the original page on
     an overlay iFrame, otherwise redirect
     to original page
Social Engineering
           for the masses: WebCloner
•  curl	
  -­‐H	
  "Content-­‐Type:	
  applica8on/json;	
  charset=UTF-­‐8"	
  -­‐d	
  
   '{"url":"hKps://	
  login.yahoo.com/config/login_verify2",	
  
   "mount":"/"}'	
  -­‐X	
  POST	
  hKp://<BeEF>/api/	
  seng/clone_page?	
  
   token=53921d2736116dbd86f8f7f7f10e46f1	
  

	
  	
  
•  If you register loginyahoo.com, you
   can specify a mount point of /config/
   login_verify2, so the phishing url
   will be (almost) the same
Social Engineering
 for the masses: MassMAiler
•  Do your phishing email campaigns 

  –  Get a sample email from your target
     (possibly with company footer/HTML)
  –  Copy the HTML content in a new BeEF
     email template
  –  Download images so they will be added
     inline.
  –  Add you malicious links/attachments
  –  Send the email to X targets -> Fun!
Social Engineering
for the masses: MassMAiler
Social Engineering
   for the masses: MassMAiler
•  curl	
  -­‐H	
  "Content-­‐Type:	
  applica8on/json;	
  charset=UTF-­‐8"	
  -­‐d	
  'body'	
  -­‐X	
  
   POST	
  hKp://<BeEF>/api/	
  seng/send_mails?
   token=0fda00ea62a1102f	
  	
  


•  Where body is:
{	
  "template":	
  "default",	
  "subject":	
  "Hi	
  from	
  BeEF",	
  	
  
	
  	
  	
  "fromname":	
  "BeEF",	
  
	
  	
  	
  "link":	
  "hKp://www.microsob.com/",	
  "linktext":	
  "hKp://	
  	
  	
  
beefproject.com",	
  "recipients":	
  [{	
  	
  
	
  	
  "user1@gmail.com":	
  "Michele",	
  "user2@an8snatchor.com":	
  	
  	
  
"An8snatchor"	
  	
  
}]}	
  	
  
Social Engineering
 for the masses: MassMAiler
•  More info about the Social
   Engineering extension:
  –  http://blog.beefproject.com/2012/09/
     beef-web-cloning-beef-mass-
     mailing.html 
  –  Read the code: <beef>/extensions/
     social_engineering/rest/
     socialengineering.rb
Attack the network
•  Identify and fingerprint alive hosts
   in the hooked browser internal
   network
  –  Port scanning
  –  Network fingerprinter -> jboss exploit
•  IPEC techniques + BeEF Bind
Attack the network: network
       fingerprinter




•  Identify common services available
   on HTTP (apache, Jboss, printers,
   etc..) given a range of IPs
Attack the network: network
       fingerprinter


•  Given an array of default image
   path, width, height, we can
   determine cross-domain if a service
   is serving that image.
Attack the network:
        Port scanner




•  Scan for default nmap ports, or
   selected ports you define, on a
   specified IP
Attack the network:
         Port scanner
•  Combines 3 methods:
  –  Image loading (similar to network
     fingerprinter)
  –  WebSockets
•  Most effective: scanning for
   selected ports (20/30 ports)
IPEC Techniques
               and BeEF Bind
•  Research released at RuxCon 2012
•  Write up here:
  –  hKp://blog.beefproject.com/2012/11/revitalizing-­‐inter-­‐
     protocol.html	
  	
  
•  Slides and screencast demo:
  –  hKp://www.slideshare.net/micheleorru2/roo8ng-­‐your-­‐
     internals-­‐exploi8ng-­‐internal-­‐network-­‐vulns-­‐via-­‐the-­‐
     browser-­‐using-­‐beef-­‐bind	
  	
  
  –  hKp://vimeo.com/52801406	
  
Hook Persistence
•  Reduce the likelihood that we will
   loose the hooked browser if the
   victim browse away:
  –  Iframe_keylogger
  –  Man in the browser
  –  Confirm close
Iframe Keylogger
                                by	
  an8snatchor	
  

•  Loads a same-domain resource in an
   overlay 100% width/eight Iframe
•  Attach a keypress listener to the
   iframe -> log keystrokes with
   Javascript
  –  Ideally you want to load the login page
     of the hooked domain
    •  And get credentials. Who cares about
       stealing cookies in 2012?
Iframe Keylogger
•  Persistence is also Achieved
  –  If the victim is browsing the in the
     same tab hooked (foreground Iframe),
     the background communication will
     still be running
•  If the target domain uses X-Frame-
   Options properly, we can’t use this
   module
Man in the Browser
                      by	
  Mathias	
  Karlsson,	
  Graziano,	
  an8snatchor	
  

•  Hijack user navigation entirely in
   Javascript
  –  Same-domain link: load the resource in
     the current page
  –  Cross-domain link: opens in new tab
  –  Form submissions are sniffed
  –  AJAX calls are hijacked too
•  Works always in Chrome/Safari/
   Firefox. Need to be ported to IE/Opera.
Confirm Close
                         by	
  an8snatchor	
  

•  Shows a confirm dialog to the user
   when he tries to close a tab. 
•  If he click yes, re-display the
   confirm dialog.
Evasion and Obfuscation
•  Default techniques
•  Whitespace encoding
•  Writing new techniques
Why?
•  There are people implementing
   dumb regexes to detect BeEF
   (hook.js, Server headers) 
•  We want to be stealthy, especially
   during pentests
The Extension
•  4 obfuscation techniques:
  –  Scramble: randomize variables/cookies
     names. regex searching for ‘beef’ fail
  –  Minify: remove whitespaces, comments
  –  Base_64: adds a bootstrapper and
     encode in base64
  –  Whitespace Encoding
The Extension
•  Write your Own!
  –  Add the ruby class into obfuscation/
     directory
  –  Implement the following methods:
    •  need_bootstrap
    •  Get_bootstrap
    •  execute
Whitespace Technique
•  ‘Kolisar’ technique ported to BeEF
   by Jean Louis Huynen (galypette)
•  Binary encoded ASCII values:
  –  0 -> tab (‘t’)
  –  1 -> space (‘ ’)
Get in touch!
•  Public mailing list: 
   –  beef-subscribe@bindshell.net
•  Twitter: @beefproject, @antisnatchor
•  GitHub: 
  –  https://github.com/beefproject/beef
•  Youtube: 
  –  http://www.youtube.com/user/
     TheBeefproject
•  Vimeo (antisnatchor): 
  –  http://vimeo.com/user1924142
Thanks
•  давайте выпьем водки

Weitere ähnliche Inhalte

Was ist angesagt?

WordPress Development Tools and Best Practices
WordPress Development Tools and Best PracticesWordPress Development Tools and Best Practices
WordPress Development Tools and Best Practices
Danilo Ercoli
 
Roy foubister (hosting high traffic sites on a tight budget)
Roy foubister (hosting high traffic sites on a tight budget)Roy foubister (hosting high traffic sites on a tight budget)
Roy foubister (hosting high traffic sites on a tight budget)
WordCamp Cape Town
 

Was ist angesagt? (20)

WordPress security for everyone
WordPress security for everyoneWordPress security for everyone
WordPress security for everyone
 
WordPress Development Tools and Best Practices
WordPress Development Tools and Best PracticesWordPress Development Tools and Best Practices
WordPress Development Tools and Best Practices
 
B wapp – bee bug – installation
B wapp – bee bug – installationB wapp – bee bug – installation
B wapp – bee bug – installation
 
Html5: Something wicked this way comes (Hack in Paris)
Html5: Something wicked this way comes (Hack in Paris)Html5: Something wicked this way comes (Hack in Paris)
Html5: Something wicked this way comes (Hack in Paris)
 
Advanced Chrome extension exploitation
Advanced Chrome extension exploitationAdvanced Chrome extension exploitation
Advanced Chrome extension exploitation
 
Anthony Somerset - Site Speed = Success!
Anthony Somerset - Site Speed = Success!Anthony Somerset - Site Speed = Success!
Anthony Somerset - Site Speed = Success!
 
WordPress performance tuning
WordPress performance tuningWordPress performance tuning
WordPress performance tuning
 
WordPress Server Security
WordPress Server SecurityWordPress Server Security
WordPress Server Security
 
SANS 2014 - Superbees Wanted
SANS 2014 - Superbees WantedSANS 2014 - Superbees Wanted
SANS 2014 - Superbees Wanted
 
SANS 2015 - Superbees Wanted
SANS 2015 - Superbees WantedSANS 2015 - Superbees Wanted
SANS 2015 - Superbees Wanted
 
IBM Connections Adminblast - Soccnx 12 Edition
IBM Connections Adminblast - Soccnx 12 EditionIBM Connections Adminblast - Soccnx 12 Edition
IBM Connections Adminblast - Soccnx 12 Edition
 
Managing Multisite: Lessons from a Large Network
Managing Multisite: Lessons from a Large NetworkManaging Multisite: Lessons from a Large Network
Managing Multisite: Lessons from a Large Network
 
Automate IBM Connections Installations and more
Automate IBM Connections Installations and moreAutomate IBM Connections Installations and more
Automate IBM Connections Installations and more
 
Hacking Virtual Appliances
Hacking Virtual AppliancesHacking Virtual Appliances
Hacking Virtual Appliances
 
Buried by time, dust and BeEF
Buried by time, dust and BeEFBuried by time, dust and BeEF
Buried by time, dust and BeEF
 
Social Connections 12 - IBM Connections Adminblast
Social Connections 12 - IBM Connections AdminblastSocial Connections 12 - IBM Connections Adminblast
Social Connections 12 - IBM Connections Adminblast
 
IBM Think 2018 - IBM Connections Troubleshooting
IBM Think 2018 -  IBM Connections TroubleshootingIBM Think 2018 -  IBM Connections Troubleshooting
IBM Think 2018 - IBM Connections Troubleshooting
 
Hey My Web App is Slow Where is the Problem
Hey My Web App is Slow Where is the ProblemHey My Web App is Slow Where is the Problem
Hey My Web App is Slow Where is the Problem
 
Webinar: IBM Connections Adminblast
Webinar: IBM Connections AdminblastWebinar: IBM Connections Adminblast
Webinar: IBM Connections Adminblast
 
Roy foubister (hosting high traffic sites on a tight budget)
Roy foubister (hosting high traffic sites on a tight budget)Roy foubister (hosting high traffic sites on a tight budget)
Roy foubister (hosting high traffic sites on a tight budget)
 

Andere mochten auch

Solar designer new developments in password hashing
Solar designer   new developments in password hashingSolar designer   new developments in password hashing
Solar designer new developments in password hashing
DefconRussia
 

Andere mochten auch (7)

Solar designer new developments in password hashing
Solar designer   new developments in password hashingSolar designer   new developments in password hashing
Solar designer new developments in password hashing
 
Hp pultik 1000x1000_out_en
Hp pultik 1000x1000_out_enHp pultik 1000x1000_out_en
Hp pultik 1000x1000_out_en
 
BigDataEurope Overview - Communities, Requirements & Pilots
BigDataEurope Overview - Communities, Requirements & PilotsBigDataEurope Overview - Communities, Requirements & Pilots
BigDataEurope Overview - Communities, Requirements & Pilots
 
WebID and eCommerce
WebID and eCommerceWebID and eCommerce
WebID and eCommerce
 
Philosophy and the Social Web
Philosophy and the Social WebPhilosophy and the Social Web
Philosophy and the Social Web
 
2016 Global Communications Report
2016 Global Communications Report2016 Global Communications Report
2016 Global Communications Report
 
Ir deck 3 q16 v3
Ir deck 3 q16 v3Ir deck 3 q16 v3
Ir deck 3 q16 v3
 

Ähnlich wie Antisnatchor all you ever wanted to know about beef

Krzysztof kotowicz. something wicked this way comes
Krzysztof kotowicz. something wicked this way comesKrzysztof kotowicz. something wicked this way comes
Krzysztof kotowicz. something wicked this way comes
Yury Chemerkin
 
GeneralMobile Hybrid Development with WordPress
GeneralMobile Hybrid Development with WordPressGeneralMobile Hybrid Development with WordPress
GeneralMobile Hybrid Development with WordPress
GGDBologna
 
Hacktivity2011 be ef-preso_micheleorru
Hacktivity2011 be ef-preso_micheleorruHacktivity2011 be ef-preso_micheleorru
Hacktivity2011 be ef-preso_micheleorru
Michele Orru
 

Ähnlich wie Antisnatchor all you ever wanted to know about beef (20)

Krzysztof kotowicz. something wicked this way comes
Krzysztof kotowicz. something wicked this way comesKrzysztof kotowicz. something wicked this way comes
Krzysztof kotowicz. something wicked this way comes
 
Something wicked this way comes - CONFidence
Something wicked this way comes - CONFidenceSomething wicked this way comes - CONFidence
Something wicked this way comes - CONFidence
 
GeneralMobile Hybrid Development with WordPress
GeneralMobile Hybrid Development with WordPressGeneralMobile Hybrid Development with WordPress
GeneralMobile Hybrid Development with WordPress
 
Learn Electron for Web Developers
Learn Electron for Web DevelopersLearn Electron for Web Developers
Learn Electron for Web Developers
 
Html5 Application Security
Html5 Application SecurityHtml5 Application Security
Html5 Application Security
 
VoxxedDays Luxembourg - Abuse web browsers for fun & profits - Dominique Righ...
VoxxedDays Luxembourg - Abuse web browsers for fun & profits - Dominique Righ...VoxxedDays Luxembourg - Abuse web browsers for fun & profits - Dominique Righ...
VoxxedDays Luxembourg - Abuse web browsers for fun & profits - Dominique Righ...
 
Be ef presentation-securitybyte2011-michele_orru
Be ef presentation-securitybyte2011-michele_orruBe ef presentation-securitybyte2011-michele_orru
Be ef presentation-securitybyte2011-michele_orru
 
WordPress Security and Best Practices
WordPress Security and Best PracticesWordPress Security and Best Practices
WordPress Security and Best Practices
 
Burpsuite yara
Burpsuite yaraBurpsuite yara
Burpsuite yara
 
DEF CON 27 - ORANGE TSAI and MEH CHANG - infiltrating corporate intranet like...
DEF CON 27 - ORANGE TSAI and MEH CHANG - infiltrating corporate intranet like...DEF CON 27 - ORANGE TSAI and MEH CHANG - infiltrating corporate intranet like...
DEF CON 27 - ORANGE TSAI and MEH CHANG - infiltrating corporate intranet like...
 
Rails security: above and beyond the defaults
Rails security: above and beyond the defaultsRails security: above and beyond the defaults
Rails security: above and beyond the defaults
 
AD113 Speed Up Your Applications w/ Nginx and PageSpeed
AD113  Speed Up Your Applications w/ Nginx and PageSpeedAD113  Speed Up Your Applications w/ Nginx and PageSpeed
AD113 Speed Up Your Applications w/ Nginx and PageSpeed
 
Chrome extensions threat analysis and countermeasures
Chrome extensions threat analysis and countermeasuresChrome extensions threat analysis and countermeasures
Chrome extensions threat analysis and countermeasures
 
Security 101
Security 101Security 101
Security 101
 
Postcards from the post xss world- content exfiltration null
Postcards from the post xss world- content exfiltration nullPostcards from the post xss world- content exfiltration null
Postcards from the post xss world- content exfiltration null
 
Hacktivity2011 be ef-preso_micheleorru
Hacktivity2011 be ef-preso_micheleorruHacktivity2011 be ef-preso_micheleorru
Hacktivity2011 be ef-preso_micheleorru
 
JS digest. Decemebr 2017
JS digest. Decemebr 2017JS digest. Decemebr 2017
JS digest. Decemebr 2017
 
Oscon 2011-mueller-weinre
Oscon 2011-mueller-weinreOscon 2011-mueller-weinre
Oscon 2011-mueller-weinre
 
From WordPress With Love
From WordPress With LoveFrom WordPress With Love
From WordPress With Love
 
ServerSentEventsV2.pdf
ServerSentEventsV2.pdfServerSentEventsV2.pdf
ServerSentEventsV2.pdf
 

Mehr von DefconRussia

[DCG 25] Александр Большев - Never Trust Your Inputs or How To Fool an ADC
[DCG 25] Александр Большев - Never Trust Your Inputs or How To Fool an ADC [DCG 25] Александр Большев - Never Trust Your Inputs or How To Fool an ADC
[DCG 25] Александр Большев - Never Trust Your Inputs or How To Fool an ADC
DefconRussia
 
Advanced cfg bypass on adobe flash player 18 defcon russia 23
Advanced cfg bypass on adobe flash player 18 defcon russia 23Advanced cfg bypass on adobe flash player 18 defcon russia 23
Advanced cfg bypass on adobe flash player 18 defcon russia 23
DefconRussia
 

Mehr von DefconRussia (20)

[Defcon Russia #29] Борис Савков - Bare-metal programming на примере Raspber...
[Defcon Russia #29] Борис Савков -  Bare-metal programming на примере Raspber...[Defcon Russia #29] Борис Савков -  Bare-metal programming на примере Raspber...
[Defcon Russia #29] Борис Савков - Bare-metal programming на примере Raspber...
 
[Defcon Russia #29] Александр Ермолов - Safeguarding rootkits: Intel Boot Gua...
[Defcon Russia #29] Александр Ермолов - Safeguarding rootkits: Intel Boot Gua...[Defcon Russia #29] Александр Ермолов - Safeguarding rootkits: Intel Boot Gua...
[Defcon Russia #29] Александр Ермолов - Safeguarding rootkits: Intel Boot Gua...
 
[Defcon Russia #29] Алексей Тюрин - Spring autobinding
[Defcon Russia #29] Алексей Тюрин - Spring autobinding[Defcon Russia #29] Алексей Тюрин - Spring autobinding
[Defcon Russia #29] Алексей Тюрин - Spring autobinding
 
[Defcon Russia #29] Михаил Клементьев - Обнаружение руткитов в GNU/Linux
[Defcon Russia #29] Михаил Клементьев - Обнаружение руткитов в GNU/Linux[Defcon Russia #29] Михаил Клементьев - Обнаружение руткитов в GNU/Linux
[Defcon Russia #29] Михаил Клементьев - Обнаружение руткитов в GNU/Linux
 
Георгий Зайцев - Reversing golang
Георгий Зайцев - Reversing golangГеоргий Зайцев - Reversing golang
Георгий Зайцев - Reversing golang
 
[DCG 25] Александр Большев - Never Trust Your Inputs or How To Fool an ADC
[DCG 25] Александр Большев - Never Trust Your Inputs or How To Fool an ADC [DCG 25] Александр Большев - Never Trust Your Inputs or How To Fool an ADC
[DCG 25] Александр Большев - Never Trust Your Inputs or How To Fool an ADC
 
Cisco IOS shellcode: All-in-one
Cisco IOS shellcode: All-in-oneCisco IOS shellcode: All-in-one
Cisco IOS shellcode: All-in-one
 
Олег Купреев - Обзор и демонстрация нюансов и трюков из области беспроводных ...
Олег Купреев - Обзор и демонстрация нюансов и трюков из области беспроводных ...Олег Купреев - Обзор и демонстрация нюансов и трюков из области беспроводных ...
Олег Купреев - Обзор и демонстрация нюансов и трюков из области беспроводных ...
 
HTTP HOST header attacks
HTTP HOST header attacksHTTP HOST header attacks
HTTP HOST header attacks
 
Attacks on tacacs - Алексей Тюрин
Attacks on tacacs - Алексей ТюринAttacks on tacacs - Алексей Тюрин
Attacks on tacacs - Алексей Тюрин
 
Weakpass - defcon russia 23
Weakpass - defcon russia 23Weakpass - defcon russia 23
Weakpass - defcon russia 23
 
nosymbols - defcon russia 20
nosymbols - defcon russia 20nosymbols - defcon russia 20
nosymbols - defcon russia 20
 
static - defcon russia 20
static  - defcon russia 20static  - defcon russia 20
static - defcon russia 20
 
Zn task - defcon russia 20
Zn task  - defcon russia 20Zn task  - defcon russia 20
Zn task - defcon russia 20
 
Vm ware fuzzing - defcon russia 20
Vm ware fuzzing  - defcon russia 20Vm ware fuzzing  - defcon russia 20
Vm ware fuzzing - defcon russia 20
 
Nedospasov defcon russia 23
Nedospasov defcon russia 23Nedospasov defcon russia 23
Nedospasov defcon russia 23
 
Advanced cfg bypass on adobe flash player 18 defcon russia 23
Advanced cfg bypass on adobe flash player 18 defcon russia 23Advanced cfg bypass on adobe flash player 18 defcon russia 23
Advanced cfg bypass on adobe flash player 18 defcon russia 23
 
Miasm defcon russia 23
Miasm defcon russia 23Miasm defcon russia 23
Miasm defcon russia 23
 
Andrey Belenko, Alexey Troshichev - Внутреннее устройство и безопасность iClo...
Andrey Belenko, Alexey Troshichev - Внутреннее устройство и безопасность iClo...Andrey Belenko, Alexey Troshichev - Внутреннее устройство и безопасность iClo...
Andrey Belenko, Alexey Troshichev - Внутреннее устройство и безопасность iClo...
 
Sergey Belov - Покажите нам Impact! Доказываем угрозу в сложных условиях
Sergey Belov - Покажите нам Impact! Доказываем угрозу в сложных условияхSergey Belov - Покажите нам Impact! Доказываем угрозу в сложных условиях
Sergey Belov - Покажите нам Impact! Доказываем угрозу в сложных условиях
 

Antisnatchor all you ever wanted to know about beef

  • 1. All you ever wanted to know about BeEF Antisnatchor – ZeroNights 2012 - Москва
  • 2. About antisnatchor •  Lead core developer of BeEF •  Application security researcher •  Loves Ruby, Javascript and OpenBSD •  Kubrick fan •  Водка fan
  • 3. BeEF •  The most robust framework to control the browser of a victim entirely with Javascript. •  Each browser is likely to be within a different security context, and each context may provide a set of unique attack vectors.
  • 5. Lets start to play with it •  BeEF Live CD -­‐>  thanks  Ben  Waugh   –  Based on Ubuntu L –  Latest (GIT): BeEF, Metasploit, sqlmap –  No GUI –  Exclusive release at ZeroNights 2012 •  Latest Ruby + gem dependencies pre-installed: –  If you have issues installing BeEF, use the live CD (i.e. don’t bother us :-)
  • 13. Other communication channels •  WebSockets –  Almost real-time communication, high responsiveness –  Both WebSocket and WebSocketSecure are supported –  Just start BeEF with the following configuration (main config.yaml):
  • 14. Attack the user •  Trick the user to click/accept using visual social engineering techniques, like: –  Fake flash update –  Clippy •  Automate WebCloning and Mass Mailing with the Social Engineering extension
  • 16. Fake flash update by  Mike  Haworth,  an8snatchor   •  Prompts the user to install an update to Adobe Flash Player •  The file to be delivered could be a Chrome or Firefox extension •  Chrome <= 20 is required for the chrome extension delivery •  (Chrome >= 21 enables extensions coming only from Google WebStore)
  • 19. Clippy by  vt,  denden   •  Original code: http://clippy.ajbnet.com/ by sprky0 •  Display the old Microsoft Clippy helper icon, prompting the user to do stuff. Click YES: –  Download and run executable –  Click on links –  enter data
  • 20. Social Engineering for the masses •  The idea was to have new BeEF features, exposed with the RESTful API, to: –  send phishing emails using HTML templates; –  clone webpages, harvest credentials; –  client-side pwnage.
  • 21. Social Engineering for the masses: WebCloner •  Clone a webpage and serve it on BeEF, then automatically: –  modify the page to intercept POST requests. –  add the BeEF hook to the page –  if the page can be framed, after POST interception load the original page on an overlay iFrame, otherwise redirect to original page
  • 22. Social Engineering for the masses: WebCloner •  curl  -­‐H  "Content-­‐Type:  applica8on/json;  charset=UTF-­‐8"  -­‐d   '{"url":"hKps://  login.yahoo.com/config/login_verify2",   "mount":"/"}'  -­‐X  POST  hKp://<BeEF>/api/  seng/clone_page?   token=53921d2736116dbd86f8f7f7f10e46f1       •  If you register loginyahoo.com, you can specify a mount point of /config/ login_verify2, so the phishing url will be (almost) the same
  • 23. Social Engineering for the masses: MassMAiler •  Do your phishing email campaigns –  Get a sample email from your target (possibly with company footer/HTML) –  Copy the HTML content in a new BeEF email template –  Download images so they will be added inline. –  Add you malicious links/attachments –  Send the email to X targets -> Fun!
  • 24. Social Engineering for the masses: MassMAiler
  • 25. Social Engineering for the masses: MassMAiler •  curl  -­‐H  "Content-­‐Type:  applica8on/json;  charset=UTF-­‐8"  -­‐d  'body'  -­‐X   POST  hKp://<BeEF>/api/  seng/send_mails? token=0fda00ea62a1102f     •  Where body is: {  "template":  "default",  "subject":  "Hi  from  BeEF",          "fromname":  "BeEF",        "link":  "hKp://www.microsob.com/",  "linktext":  "hKp://       beefproject.com",  "recipients":  [{        "user1@gmail.com":  "Michele",  "user2@an8snatchor.com":       "An8snatchor"     }]}    
  • 26. Social Engineering for the masses: MassMAiler •  More info about the Social Engineering extension: –  http://blog.beefproject.com/2012/09/ beef-web-cloning-beef-mass- mailing.html –  Read the code: <beef>/extensions/ social_engineering/rest/ socialengineering.rb
  • 27. Attack the network •  Identify and fingerprint alive hosts in the hooked browser internal network –  Port scanning –  Network fingerprinter -> jboss exploit •  IPEC techniques + BeEF Bind
  • 28. Attack the network: network fingerprinter •  Identify common services available on HTTP (apache, Jboss, printers, etc..) given a range of IPs
  • 29. Attack the network: network fingerprinter •  Given an array of default image path, width, height, we can determine cross-domain if a service is serving that image.
  • 30. Attack the network: Port scanner •  Scan for default nmap ports, or selected ports you define, on a specified IP
  • 31. Attack the network: Port scanner •  Combines 3 methods: –  Image loading (similar to network fingerprinter) –  WebSockets •  Most effective: scanning for selected ports (20/30 ports)
  • 32. IPEC Techniques and BeEF Bind •  Research released at RuxCon 2012 •  Write up here: –  hKp://blog.beefproject.com/2012/11/revitalizing-­‐inter-­‐ protocol.html     •  Slides and screencast demo: –  hKp://www.slideshare.net/micheleorru2/roo8ng-­‐your-­‐ internals-­‐exploi8ng-­‐internal-­‐network-­‐vulns-­‐via-­‐the-­‐ browser-­‐using-­‐beef-­‐bind     –  hKp://vimeo.com/52801406  
  • 33. Hook Persistence •  Reduce the likelihood that we will loose the hooked browser if the victim browse away: –  Iframe_keylogger –  Man in the browser –  Confirm close
  • 34. Iframe Keylogger by  an8snatchor   •  Loads a same-domain resource in an overlay 100% width/eight Iframe •  Attach a keypress listener to the iframe -> log keystrokes with Javascript –  Ideally you want to load the login page of the hooked domain •  And get credentials. Who cares about stealing cookies in 2012?
  • 35. Iframe Keylogger •  Persistence is also Achieved –  If the victim is browsing the in the same tab hooked (foreground Iframe), the background communication will still be running •  If the target domain uses X-Frame- Options properly, we can’t use this module
  • 36. Man in the Browser by  Mathias  Karlsson,  Graziano,  an8snatchor   •  Hijack user navigation entirely in Javascript –  Same-domain link: load the resource in the current page –  Cross-domain link: opens in new tab –  Form submissions are sniffed –  AJAX calls are hijacked too •  Works always in Chrome/Safari/ Firefox. Need to be ported to IE/Opera.
  • 37. Confirm Close by  an8snatchor   •  Shows a confirm dialog to the user when he tries to close a tab. •  If he click yes, re-display the confirm dialog.
  • 38. Evasion and Obfuscation •  Default techniques •  Whitespace encoding •  Writing new techniques
  • 39. Why? •  There are people implementing dumb regexes to detect BeEF (hook.js, Server headers) •  We want to be stealthy, especially during pentests
  • 40. The Extension •  4 obfuscation techniques: –  Scramble: randomize variables/cookies names. regex searching for ‘beef’ fail –  Minify: remove whitespaces, comments –  Base_64: adds a bootstrapper and encode in base64 –  Whitespace Encoding
  • 41. The Extension •  Write your Own! –  Add the ruby class into obfuscation/ directory –  Implement the following methods: •  need_bootstrap •  Get_bootstrap •  execute
  • 42. Whitespace Technique •  ‘Kolisar’ technique ported to BeEF by Jean Louis Huynen (galypette) •  Binary encoded ASCII values: –  0 -> tab (‘t’) –  1 -> space (‘ ’)
  • 43. Get in touch! •  Public mailing list: –  beef-subscribe@bindshell.net •  Twitter: @beefproject, @antisnatchor •  GitHub: –  https://github.com/beefproject/beef •  Youtube: –  http://www.youtube.com/user/ TheBeefproject •  Vimeo (antisnatchor): –  http://vimeo.com/user1924142