When someone buys a domain name the usual purchase length is one year, with certain DNS providers allowing multi-year purchases. Large entities can quickly lose track of all their domains and keeping track of when those domains expire can be an even bigger hassle. When you add Flash integration into the mix it starts becoming a security issue.
Adobe Flash has been known to have many vulnerabilities in the past, and my favorite is actually a feature. Flash has the feature of respecting a cross-domain policy for inter-site communication; the crossdomain.xml file lists valid external domains that can make requests to the Victim Site (VS). An example crossdomain.xml looks like this:
Any of those sites have full cross-domain access to the VS. Manyblogshave covered the topic of overly-permissive cross domain policies with rules like <allow-access-from domain=”*”/> that allow access from any site. This blog will cover the topic of expired domains that are allowed in cross-domain files, allowing an attacker to purchase that domain and gain full cross-domain access.
As stated before, cross-domain exploitation has been well documented so I will link tutorials on defeating CSRF on the expired domains below, here is how we can go about discovering those domains using my crossdomainscanner python script located here.
I’ll start with identifying the VS I would like to scan, for this demo I’ll be using https://jakereynolds.co. A VS can be found any number of ways and we can verify it has a cross-domain policy by accessing https://jakereynolds.co/crossdomain.xml. We’ll then feed this into the cross-domain scanner with the command:
python scanner.py https://jakereynolds.co -v
Once the script is finished it will tell us if there are any expired domains in the policy.
Possible expired domains:
The best way to exploit this is to take advantage of the CSRF bypass. Purchase the expired domain, make someone visit your site, and if they are logged in on the VS you can make requests under the context of their account. This will be done by creating a Flash application for manipulating requests, more on that here. If the VS does not have any valuable APIs the cross-domain access does not warrant a valid finding, since nothing can be exploited from it.
Out of the Top 5000 Alexa domains:
222 allow cross-origin requests from any domain (*)
20 allow cross-origin requests from expired domain names
20 allow cross-origin requests from domains with invalid TLDs (.local, .des, etc…)
As a site owner/maintainer it is best to run this script against your own domain and remove or repurchase any expired domains allowed in your crossdomain.xml file. For long-term monitoring it would be good to incorporate this tool into your development pipeline so that it gets checked at least once every production deployment. A permanent fix would be to remove Flash integration with the website, since Flash is already being deprecated in certainbrowsers.
PTaaS is NetSPI’s delivery model for penetration testing. It enables customers to simplify the scoping of new engagements, view their testing results in real time, orchestrate faster remediation, perform always-on continuous testing, and more - all through the Resolve™ vulnerability management and orchestration platform.
We help organizations defend against adversaries by being the best at simulating real-world, sophisticated adversaries with the products, services, and training we provide. We know how attackers think and operate, allowing us to help our customers better defend against the threats they face daily.
At NetSPI, we believe that there is simply no replacement for human-led manual deep dive testing. Our Resolve platform delivers automation to ensure our people spend time looking for the critical vulnerabilities that tools miss. We provide automated and manual testing of all aspects of an organization’s entire attack surface, including external and internal network, application, cloud, and physical security.
Our proven methodology ensures that the client experience and our findings aren’t only as good as the latest tester assigned to your project. That consistency gives our customers assurance that if vulnerabilities exist, we will find them.
Is your organization prepared for a ransomware attack? Explore our Ransomware Attack Simulation service.