{"id":16960,"date":"2017-06-02T12:38:50","date_gmt":"2017-06-02T16:38:50","guid":{"rendered":"https:\/\/www.kaspersky.com\/blog\/?p=16960"},"modified":"2019-11-15T06:47:27","modified_gmt":"2019-11-15T11:47:27","slug":"cloak-and-dagger-attack","status":"publish","type":"post","link":"https:\/\/www.kaspersky.com\/blog\/cloak-and-dagger-attack\/16960\/","title":{"rendered":"Cloak and Dagger: A hole in Android"},"content":{"rendered":"<p>Everyone, this is not a drill. It applies to all versions of Android, and at the time of this post\u2019s publication, Google has not yet patched the vulnerability. By using this vulnerability, malicious actors can steal data including passwords; install applications with <a href=\"https:\/\/www.kaspersky.com\/blog\/android-permissions-guide\/\" target=\"_blank\" rel=\"noopener noreferrer nofollow\">a full set of permissions<\/a>; and monitor what the user is interacting with or typing on a keyboard on any Android smartphone or tablet. We repeat: This is not a drill\u2026<\/p>\n<p>The attack, dubbed Cloak and Dagger, was demonstrated by employees of the Georgia Institute of Technology and the University of California, Santa Barbara. They drew Google\u2019s attention to the problem three times, but each time, Google replied that everything was working as intended. The researchers were left with no option but to publish their discoveries: They even created a website, cloak-and-dagger.org, for that purpose.<\/p>\n<h2>The essence of the Cloak and Dagger attack<\/h2>\n<p>In a nutshell, the attack uses an app from Google Play. Although the app asks for no specific permissions from the user, attackers obtain the rights to show the interface of the app on top of other apps, visually blocking them, and to click buttons on behalf of the user in such a way that they do not notice anything suspicious.<\/p>\n<p>The attack is possible because users are not explicitly prompted to allow apps to access SYSTEM_ALERT_WINDOW functions when installing apps from Google Play, and permission to access ACCESSIBILITY_SERVICE (A11Y) is quite easy to obtain.<\/p>\n<p>What kind of permissions are those? The first permission allows an app to overlay its interface on top of any other app, and the second one gives it access to a set of functions \u2014 Accessibility Service \u2014 for people with visual or hearing impairment. The latter can do a lot of different, even dangerous things, on a device by allowing an application both to monitor what happens in other apps and to interact with them on behalf of the user.<\/p>\n<p>What could possibly go wrong?<\/p>\n<h3>An invisible layer<\/h3>\n<p>Essentially, the attacks that use the first permission, SYSTEM_ALERT_WINDOW, overlay other apps with their own interface without prompting the user. Moreover, the windows it can show can have any shape \u2014 including shapes with holes. They can also either register tapping or let it go through so that the app window below registers it.<\/p>\n<p>For example, malicious developers can create a transparent layer that overlays the virtual keyboard of an Android device and captures all attempts to tap on the screen. Correlating the coordinates of the place where the user tapped the screen and the character positions on the keyboard, the attacker can find out what exactly the user is typing on that keyboard. Malicious programs of that kind are called <a href=\"https:\/\/www.kaspersky.com\/blog\/keylogger\/1573\/\" target=\"_blank\" rel=\"noopener noreferrer nofollow\">keyloggers<\/a>. This is one of the examples the researchers presented to demonstrate the attack.<\/p>\n<p><span class=\"embed-youtube\" style=\"text-align:center; display: block;\"><iframe class=\"youtube-player\" type=\"text\/html\" width=\"640\" height=\"390\" src=\"https:\/\/www.youtube.com\/embed\/NceNhsu87iA?version=3&amp;rel=1&amp;fs=1&amp;showsearch=0&amp;showinfo=1&amp;iv_load_policy=1&amp;wmode=transparent\" frameborder=\"0\" allowfullscreen=\"true\"><\/iframe><\/span><\/p>\n<p>Generally speaking, SYSTEM_ALERT_WINDOW is quite a dangerous permission; and Google itself assumes that it should be limited to a small number of apps. However, with popular applications such as Facebook Messenger (those Chat Heads that overlay everything else), Skype, and Twitter requiring this permission, the team at Google apparently decided that it would be easier if Google Play just granted the permission without explicitly prompting the user. Simplicity and security, unfortunately, don\u2019t always go hand in hand.<\/p>\n<h3>The dangers of Accessibility features<\/h3>\n<p>The second permission, Accessibility, was designed with good intentions: to make it easier for people with visual or hearing impairments to interact with Android devices. However, this feature gives such a large number of permissions to apps that it is more often used for different purposes \u2014 by apps that need to execute actions not usually allowed on Android.<\/p>\n<blockquote class=\"twitter-tweet\" data-width=\"500\" data-dnt=\"true\">\n<p lang=\"en\" dir=\"ltr\">So what are all of these <a href=\"https:\/\/twitter.com\/hashtag\/Android?src=hash&amp;ref_src=twsrc%5Etfw\" target=\"_blank\" rel=\"noopener nofollow\">#Android<\/a> permissions anyway? A guide to what it all means. <a href=\"https:\/\/twitter.com\/hashtag\/Mobile?src=hash&amp;ref_src=twsrc%5Etfw\" target=\"_blank\" rel=\"noopener nofollow\">#Mobile<\/a> <a href=\"https:\/\/twitter.com\/hashtag\/security?src=hash&amp;ref_src=twsrc%5Etfw\" target=\"_blank\" rel=\"noopener nofollow\">#security<\/a> <a href=\"https:\/\/twitter.com\/hashtag\/privacy?src=hash&amp;ref_src=twsrc%5Etfw\" target=\"_blank\" rel=\"noopener nofollow\">#privacy<\/a> <a href=\"https:\/\/t.co\/RetY9JVYZX\" target=\"_blank\" rel=\"noopener nofollow\">https:\/\/t.co\/RetY9JVYZX<\/a> <a href=\"https:\/\/t.co\/ZoCUslOFQc\" target=\"_blank\" rel=\"noopener nofollow\">pic.twitter.com\/ZoCUslOFQc<\/a><\/p>\n<p>\u2014 Kaspersky (@kaspersky) <a href=\"https:\/\/twitter.com\/kaspersky\/status\/829729180401205248?ref_src=twsrc%5Etfw\" target=\"_blank\" rel=\"noopener nofollow\">February 9, 2017<\/a><\/p><\/blockquote>\n<p><script async src=\"https:\/\/platform.twitter.com\/widgets.js\" charset=\"utf-8\"><\/script><\/p>\n<p>For example, to read out loud what is happening on the screen for people with a visual impairment, an app with Accessibility access may obtain information such as: what app has been opened, what the user taps on, and when a notification pops up. This means that the app knows the entire context of what is happening. And that\u2019s not all. In addition to monitoring activities, the app can also perform various actions on behalf of the user.<\/p>\n<p>All in all, Google is aware that the Accessibility permission gives applications the ability to do practically anything that one can think of on the device; therefore, it requires users to enable Accessibility for each individual application in a special menu in the settings section of a smartphone.<\/p>\n<p>The problem is that by using the first permission, SYSTEM_ALERT_WINDOW, and by skillfully showing windows that overlap most of the screen (aside from the \u201cOK\u201d button), attackers can trick users into enabling Accessibility options, thinking that they are agreeing to something innocuous.<\/p>\n<p>Then, because Accessibility can perceive context and act on behalf of users, which includes making purchases in the Google Play store, it becomes child\u2019s play for attackers to use Google Play to download a special spy app and give it any permissions they want. Moreover, they can do so even when the screen is off or, for example, while a video clip plays, blocking everything that is happening below it.<\/p>\n<p><span class=\"embed-youtube\" style=\"text-align:center; display: block;\"><iframe class=\"youtube-player\" type=\"text\/html\" width=\"640\" height=\"390\" src=\"https:\/\/www.youtube.com\/embed\/RYQ1i03OVpI?version=3&amp;rel=1&amp;fs=1&amp;showsearch=0&amp;showinfo=1&amp;iv_load_policy=1&amp;wmode=transparent\" frameborder=\"0\" allowfullscreen=\"true\"><\/iframe><\/span><\/p>\n<h3>Ultimate phishing<\/h3>\n<p>Accessing SYSTEM_ALERT_WINDOW and ACCESSIBILITY_SERVICE also allows fraudsters to perform phishing attacks without raising user suspicion.<\/p>\n<p>For example, when a user opens the Facebook app and attempts to enter their login and password, another app with the Accessibility permissions may understand what\u2019s happening and interfere. Then, by making use of SYSTEM_ALERT_WINDOW and the ability to overlay other apps, the application may show the user a phishing window that looks just like Facebook\u2019s password prompt, into which the unsuspecting user will enter the login and password of his or her account.<\/p>\n<p><span class=\"embed-youtube\" style=\"text-align:center; display: block;\"><iframe class=\"youtube-player\" type=\"text\/html\" width=\"640\" height=\"390\" src=\"https:\/\/www.youtube.com\/embed\/oGKYHavKZ24?version=3&amp;rel=1&amp;fs=1&amp;showsearch=0&amp;showinfo=1&amp;iv_load_policy=1&amp;wmode=transparent\" frameborder=\"0\" allowfullscreen=\"true\"><\/iframe><\/span><\/p>\n<p>In this case, the knowledge of context allows the developers to show the phishing screen at the right spot only when the user is going to enter the password. And from the user\u2019s point of view, the Facebook login worked as expected, so they won\u2019t have any reason to suspect that something has gone wrong.<\/p>\n<p>Attacks such as those we describe above are not new to security researchers. They even have a name \u2014 <em>tapjacking<\/em>. Google gave Android app developers a way to fight back: an option to check if an app is overlaid, in which case users will not be allowed to perform some actions. That\u2019s why most banking apps are protected against attacks with overlays such as Cloak and Dagger. However, the only way to be 100% sure an app is not vulnerable to such attacks is to contact the developer.<\/p>\n<h3>How to protect your device against Cloak and Dagger<\/h3>\n<p>The authors of the Cloak and Dagger research have tested the attack on three most popular Android versions: Android 5, Android 6, and Android 7, which together account for 70% of all Android devices. It turns out that those versions are all vulnerable to the attack \u2014 and it\u2019s likely all previous versions are as well. In other words, if you have an Android device, it probably concerns you as well.<\/p>\n<p>So, here is what you can do to protect yourself:<\/p>\n<p>1. Try not to install unknown apps from Google Play and other stores, especially free apps. Legitimate apps will not attack you using Cloak and Dagger. Nevertheless, the question of how to tell a suspicious app from a harmless one remains open.<\/p>\n<p>2. Regularly check which permissions the apps on your device have and revoke unnecessary ones. You can <a href=\"https:\/\/www.kaspersky.com\/blog\/android-permissions-guide\/\" target=\"_blank\" rel=\"noopener noreferrer nofollow\">read this post<\/a> to learn more on how to do that.<\/p>\n<input type=\"hidden\" class=\"category_for_banner\" value=\"kisa-generic\">\n<p>Last but not least, do not forget about installing security solutions on Android devices. There is a free version of <a href=\"https:\/\/app.appsflyer.com\/com.kms.free?pid=smm&amp;c=ww_kdaily\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">Kaspersky Internet Security for Android<\/a>, and if you do not yet have a security solution on your smartphone or tablet, installing it is good start.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>How a couple of simple permissions let an application steal passwords, log user actions, and do many other nasty things.<\/p>\n","protected":false},"author":675,"featured_media":16961,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[5,2683],"tags":[1616,105,109,2527,183,180,36,2528,422],"class_list":{"0":"post-16960","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"has-post-thumbnail","7":"category-news","8":"category-threats","9":"tag-access","10":"tag-android","11":"tag-apps","12":"tag-cloak-and-dagger","13":"tag-google-play","14":"tag-kaspersky-internet-security","15":"tag-malware-2","16":"tag-permissions","17":"tag-threats"},"hreflang":[{"hreflang":"x-default","url":"https:\/\/www.kaspersky.com\/blog\/cloak-and-dagger-attack\/16960\/"},{"hreflang":"en-ae","url":"https:\/\/me-en.kaspersky.com\/blog\/cloak-and-dagger-attack\/7850\/"},{"hreflang":"ar","url":"https:\/\/me.kaspersky.com\/blog\/cloak-and-dagger-attack\/4270\/"},{"hreflang":"en-us","url":"https:\/\/usa.kaspersky.com\/blog\/cloak-and-dagger-attack\/11493\/"},{"hreflang":"en-gb","url":"https:\/\/www.kaspersky.co.uk\/blog\/cloak-and-dagger-attack\/10587\/"},{"hreflang":"es-mx","url":"https:\/\/latam.kaspersky.com\/blog\/cloak-and-dagger-attack\/10506\/"},{"hreflang":"es","url":"https:\/\/www.kaspersky.es\/blog\/cloak-and-dagger-attack\/13077\/"},{"hreflang":"it","url":"https:\/\/www.kaspersky.it\/blog\/cloak-and-dagger-attack\/13155\/"},{"hreflang":"ru","url":"https:\/\/www.kaspersky.ru\/blog\/cloak-and-dagger-attack\/17723\/"},{"hreflang":"tr","url":"https:\/\/www.kaspersky.com.tr\/blog\/cloak-and-dagger-attack\/3248\/"},{"hreflang":"fr","url":"https:\/\/www.kaspersky.fr\/blog\/cloak-and-dagger-attack\/8840\/"},{"hreflang":"pt-br","url":"https:\/\/www.kaspersky.com.br\/blog\/cloak-and-dagger-attack\/9220\/"},{"hreflang":"pl","url":"https:\/\/plblog.kaspersky.com\/cloak-and-dagger-attack\/6831\/"},{"hreflang":"de","url":"https:\/\/www.kaspersky.de\/blog\/cloak-and-dagger-attack\/13221\/"},{"hreflang":"ja","url":"https:\/\/blog.kaspersky.co.jp\/cloak-and-dagger-attack\/15956\/"},{"hreflang":"en-au","url":"https:\/\/www.kaspersky.com.au\/blog\/cloak-and-dagger-attack\/16960\/"},{"hreflang":"en-za","url":"https:\/\/www.kaspersky.co.za\/blog\/cloak-and-dagger-attack\/16960\/"}],"acf":[],"banners":"","maintag":{"url":"https:\/\/www.kaspersky.com\/blog\/tag\/android\/","name":"Android"},"_links":{"self":[{"href":"https:\/\/www.kaspersky.com\/blog\/wp-json\/wp\/v2\/posts\/16960","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.kaspersky.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.kaspersky.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.kaspersky.com\/blog\/wp-json\/wp\/v2\/users\/675"}],"replies":[{"embeddable":true,"href":"https:\/\/www.kaspersky.com\/blog\/wp-json\/wp\/v2\/comments?post=16960"}],"version-history":[{"count":8,"href":"https:\/\/www.kaspersky.com\/blog\/wp-json\/wp\/v2\/posts\/16960\/revisions"}],"predecessor-version":[{"id":29968,"href":"https:\/\/www.kaspersky.com\/blog\/wp-json\/wp\/v2\/posts\/16960\/revisions\/29968"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.kaspersky.com\/blog\/wp-json\/wp\/v2\/media\/16961"}],"wp:attachment":[{"href":"https:\/\/www.kaspersky.com\/blog\/wp-json\/wp\/v2\/media?parent=16960"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.kaspersky.com\/blog\/wp-json\/wp\/v2\/categories?post=16960"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.kaspersky.com\/blog\/wp-json\/wp\/v2\/tags?post=16960"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}