├── .gitignore ├── CONTRIBUTING.md ├── LICENSE ├── README.md ├── evil_ssdp.py ├── requirements.txt └── templates ├── bitcoin ├── device.xml ├── present.html └── service.xml ├── microsoft-azure ├── device.xml ├── present.html └── service.xml ├── office365 ├── device.xml ├── present.html └── service.xml ├── password-vault ├── device.xml ├── present.html └── service.xml ├── scanner ├── device.xml ├── present.html └── service.xml ├── xxe-exfil ├── data.dtd ├── device.xml ├── present.html └── service.xml └── xxe-smb ├── device.xml ├── present.html └── service.xml /.gitignore: -------------------------------------------------------------------------------- 1 | logs-essdp.txt 2 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing Guidelines 2 | 3 | Thank you so much for thinking about contributing! 4 | 5 | There are a few ways you can help, if you're so inclined: 6 | 7 | - Open up an issue on here if you notice something odd. 8 | - Submit a feature request if you think the tool should be doing something additional. 9 | - Submit bug fixes or streamlime the existing code. 10 | 11 | I'd like to keep the tool pretty straightforward, so that it does one thing and does it well. 12 | 13 | Before you spend a lot of time re-writing something massive, it might be worth contacting me first just to make sure I'm not in the middle of a conflicting re-write. You can open an issue or try me at protonmail. 14 | 15 | I may redirect commits to the dev branch for some burning in before pushing to master. If there is any type of credit of special handling you'd like with your contribution, please let me know and I will do my best to oblige. 16 | 17 | Some info on contributing code: 18 | - Python 3, without maintaining backwards support for Python 2 19 | - Run through pylint for best-effort PEP8 20 | 21 | Thanks for reading! 22 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018 InitString 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 | # Overview 2 | This tool responds to SSDP multicast discover requests, posing as a generic UPNP device. Your spoofed device will magically appear in Windows Explorer on machines in your local network. Users who are tempted to open the device are shown a configurable phishing page. This page can load a hidden image over SMB, allowing you to capture or relay the NetNTLM challenge/response. 3 | 4 | Templates are also provided to capture clear-text credentials via basic authentication and logon forms, and creating your own custom templates is quick and easy. 5 | 6 | This requires no existing credentials to execute and works even on networks that have protected against Responder attacks by disabling NETBIOS and LLMNR. Any Operating System or application leveraging SSDP/UPNP can be targeted, but most of the current weaponization has been aimed at Windows 10. 7 | 8 | [Video: Phishing Overview](https://initstring.keybase.pub/host/videos/essdp-phishing.mp4) 9 | 10 | As a bonus, this tool can also detect and exploit potential zero-day vulnerabilities in the XML parsing engines of applications using SSDP/UPNP. If a vulnerable device is found, it will alert you in the UI and then mount your SMB share or exfiltrate data with NO USER INTERACTION REQUIRED via an XML External Entity (XXE) attack. 11 | 12 | [Video: 0-Day Overview](https://initstring.keybase.pub/host/videos/essdp-0days.mp4) 13 | 14 | # Usage 15 | The most basic run looks like this: 16 | 17 | ``` 18 | evil_ssdp.py eth0 19 | ``` 20 | 21 | You need to provide the network interface at a minimum. The interface is used for both the UDP SSDP interaction as well as hosting a web server for the XML files and phishing page. 22 | 23 | The tool will automatically update an IMG tag in the phishing page using the IP of the interface you provide. To work with challenge/response, you'll need to launch an SMB server at that interface (like Impacket). This address can be customized with the `-s` option. 24 | 25 | Some example scenarios: 26 | 27 | ``` 28 | # Use wlan0 for device advertisement and phishing, capturing NetNTLM and 29 | # asking for clear-text via a spoofed Office365 logon form. Redirect to 30 | # Microsoft aftering capturing credentials: 31 | evil_ssdp.py wlan0 -t office365 -u 'https://office.microsoft.com' 32 | 33 | # Same as above, but assuming your SMB server is running on another IP: 34 | evil_ssdp.py wlan0 -t office365 -u 'https://office.microsoft.com' \ 35 | -s 192.168.1.205 36 | 37 | # Prompt for creds using basic auth and redirect to Azure: 38 | evil_ssdp.py wlan0 -t microsoft-azure -u \ 39 | 'https://azure.microsoft.com/auth/signin/' -b 40 | 41 | # Hope for an XXE vul to capture NetNTLM while Impacket/Responder is running 42 | on wlan0: 43 | evil_ssdp.py wlan0 -t xxe-smb 44 | ``` 45 | 46 | Full usage details: 47 | 48 | ``` 49 | usage: evil_ssdp.py [-h] [-p PORT] [-t TEMPLATE] [-s SMB] [-b] [-r REALM] 50 | [-u URL] 51 | interface 52 | 53 | positional arguments: 54 | interface Network interface to listen on. 55 | 56 | optional arguments: 57 | -h, --help show this help message and exit 58 | -p PORT, --port PORT Port for HTTP server. Defaults to 8888. 59 | -t TEMPLATE, --template TEMPLATE 60 | Name of a folder in the templates directory. Defaults 61 | to "office365". This will determine xml and phishing 62 | pages used. 63 | -s SMB, --smb SMB IP address of your SMB server. Defalts to the primary 64 | address of the "interface" provided. 65 | -b, --basic Enable base64 authentication for templates and write 66 | credentials to log file. 67 | -r REALM, --realm REALM 68 | Realm when prompting target for authentication via 69 | Basic Auth. 70 | -u URL, --url URL Redirect to this URL. Works with templates that do a 71 | POST for logon forms and with templates that include 72 | the custom redirect JavaScript (see README for more 73 | info).[example: -r https://google.com] 74 | -a, --analyze Run in analyze mode. Will NOT respond to any SSDP 75 | queries, but will still enable and run the web server 76 | for testing. 77 | ``` 78 | 79 | # Templates 80 | The following templates come with the tool. If you have good design skills, please contribute one of your own! 81 | 82 | - `office365`: Will show up in Windows Explorer as "Office365 Backups". Phishing page looking like Office365 logon will POST credentials back to you. These will be flagged in the UI and logged in the log file. Recommend to run with '-u https://www.office.com' to redirect users to the legit site after stealing their credentials. Developer: [pentestgeek](https://github.com/pentestgeek/phishing-frenzy-templates). 83 | - `scanner`: Will show up in Windows Explorer as a scanner with the name "Corporate Scanner [3 NEW SCANS WAITING]". Double-clicking will bring to a generic looking logon page. This template would do well with customization for your particular target. Template mostly copied from [this template](http://codepen.io/miroot/pen/qwIgC). 84 | - `microsft-azure`: Will appear in Windows Explorer as "Microsoft Azure Storage". Landing page is the Windows Live login page when cookies are disabled. Recommend to use with the -u option to redirect users to real login page. Developer: [Dwight Hohnstein](https://github.com/djhohnstein). 85 | - `bitcoin`: Will show up in Windows Explorer as "Bitcoin Wallet". Phishing page is just a random set of Bitcoin private/public/address info. There are no actual funds in these accounts. 86 | - `password-vault`: Will show up in Windows Explorer as "IT Password Vault". Phishing page contains a short list of fake passwords / ssh keys / etc. 87 | - `xxe-smb`: Will not likely show up in Windows Explorer. Used for finding zero day vulnerabilities in XML parsers. Will trigger an "XXE - VULN" alert in the UI for hits and will attempt to force clients to authenticate with the SMB server, with 0 interaction. 88 | - `xxe-exfil`: Another example of searching for XXE vulnerabilities, but this time attempting to exfiltrate a test file from a Windows host. Of course you can customize this to look for whatever specific file you are after, Windows or Linux. In the vulnerable applications I've discovered, exfiltration works only on a file with no whitepace or linebreaks. This is due to how it is injected into the URL of a GET request. If you get this working on multi-line files, PLEASE let me know how you did it. 89 | 90 | Creating your own templates is easy. Simply copy the folder of an existing template and edit the following files: 91 | - `device.xml`: Here is where you will define what the device looks like inside Windows Explorer. 92 | - `present.html`: This is the phishing page displayed when a target opens the evil device. Craft anything you like here. Note that Python's string template will parse this, so you will need to use `$$` in place of `$` anywhere to escape the template engine. 93 | - `service.xml`: Not yet implemented. May be needed for more complex UPNP spoofing in the future. 94 | 95 | In your phishing page (`present.html`), use variables like the following for additional functionality: 96 | 97 | ``` 98 | # The following line will initiate a NetNTLM challenge/response using the IP 99 | # address of either the interface you provide or an optionally specified IP 100 | # address: 101 |
102 | 103 | # The following will leverage optionally specified URL redirection. This is 104 | # handy when used with basic authentication to redirect to a valid site. This 105 | # line is built in to the microsoft-azure template: 106 | 112 | 113 | 114 | # If using an HTTP form to capture clear-text credentials, use code like the 115 | # following. Also any template doing a POST request will automatically 116 | # support the '-u' parameter to redirect after the POST completes. The tool 117 | # will monitor POSTs to this URL for credentials: 118 |