Patent ID: 8819819

Claim:
A method for JavaScript execution and analysis comprising: extracting an original URL from a message; labeling the extracted URL as the original URL; activating the original URL to determine if the original URL results in a redirect to a new URL; if the original URL does not result in a redirect to a new URL, accessing a webpage associated with the original URL; if the original URL results in a redirect to a new URL, applying a URL redirect analysis process, the URL redirect analysis process applying a redirect processing procedure selected based on the type of redirect associated with the original URL; identifying JavaScript on webpages linked to by the original or any new URLs redirected to by the original URL; extracting the identified JavaScript; executing the identified JavaScript in a shared JavaScript execution context that includes a DOM implementation that simulates a web browser; analyzing the state of the DOM implementation after execution of the JavaScript to identify one or more of: any URLs being redirected to; any additional executable JavaScript; and any content dynamically written to the webpage; and if the result of analyzing is additional executable JavaScript, executing and analyzing the additional JavaScript.