How can i extract all the strings present in script tags. I want to extract each string and find whether any shellcode is present. But javascript uses several methods in declaring a string For example a string can be
var y="Some text";
var x1 = "3+4";
eval("\144\157\143\165\155\145\156\164"); //string given in eval();
It can be in a concatenated format
var x1 = "te ActiveX Co"; var x2 = "ntrol"; var x3 = x1 + x2;
var x4 = "Execu" + x3;
How can i identify each and every string even if it is defined in eval() or document.write() by using simple javacript code.
.join(), etc. Variables could even be set with values retrieved via Ajax. You've asked for "simple" code, but I just don't think it is possible at all, let alone with simple code.