I'm working on controlled environment for analysing malicious JS code. I
use PhantomJS (based on Webkit) to execute it.
Now I'm trying to intercept get acces to window.location to return fake
location to analysed script, but I can't do it. My test JS code:
Object.defineProperty(window.location, "href",
{
get: function ()
{
document.write("HOOK");
}
});
console.log(window.location);
When I try to execute it I got "Attempting to change access mechanism for
an unconfigurable property.". I patched Location.idl: added "Deletable" to
"attribute DOMString href", rebuilt the project and test it again. This
won't work too. I tried to patch DOMWindow.idl (Deletable on attribute
location) and other files and now I gave up with it.
Could you please help me with this task? How can I make attributes
"hookable" in Webkit?
_______________________________________________
webkit-help mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-help