├── LICENSE ├── README.md ├── email.html ├── framework.php ├── index.php └── mydata.txt /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 Jan Soucek 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # iOS 8.3 Mail.app inject kit 2 | 3 | Back in January 2015 I stumbled upon a bug in iOS's mail client, resulting in `` HTML tag in e-mail messages not being ignored. This bug allows remote HTML content to be loaded, replacing the content of the original e-mail message. JavaScript is disabled in this UIWebView, but it is still possible to build a functional password "collector" using simple HTML and CSS. 4 | 5 | It was filed under Radar #19479280 back in January, but the fix was not delivered in any of the iOS updates following 8.1.2. 6 | Therefore I decided to publish the proof of concept code here. 7 | 8 | Demo: https://www.youtube.com/watch?v=9wiMG-oqKf0 9 | 10 | 11 | ##### Update 2015-06-30: 12 | The exploit got a nice `CVE-2015-3710` sticker and was fixed by Apple in [iOS 8.4](https://support.apple.com/en-us/HT204941) and [OS X 10.10.4](https://support.apple.com/en-us/HT204942). 13 | Kudos to Apple for prompt response once it was published publicly. 14 | 15 | ## Usage 16 | 17 | 1. Edit the e-mail address you would like to use for password collection in `framework.php` 18 | 2. Upload `index.php`, `framework.php` and `mydata.txt` to your server 19 | 3. Send an e-mail containing HTML code from `email.html` to the research subject 20 | - Don't forget to change the `modal-username` GET parameter value to the e-mail address of the recipient 21 | - You can use https://putsmail.com for testing purposes 22 | 23 | 24 | ## Credits 25 | 26 | - Framework7: Vladimir Kharlampidi (http://www.idangero.us/framework7/) - Framework7's CSS code was used for the login dialog styling 27 | 28 | 29 | ## License 30 | 31 | MIT 32 | 33 | ## Notes 34 | 35 | - The code detects that the research subject has already visited the page in the past (using cookies) and it stops displaying the password prompt to reduce suspicion. 36 | - The e-mail address and password are submitted via GET to `framework.php`, which then saves them to the `mydata.txt` file, sends them out via e-mail to the specified "collector" e-mail address and then returns the research subject back to Mail.app using redirect to `message://dummy`. 37 | - The password field has autofocus enabled. We then use focus detection to hide the login dialog once the password field loses its focus (e.g. after the subject clicks on OK and submits the password). 38 | - [Why even bother with this redirect nonsense when you can put `