netroact
04-11-2009, 09:11 PM
Malicious Javascript code has been inserted into the html pages on one of my huge websites. It is an encrypted string that calls stuff that comes from a .js file on another server.
I want to use perl regex to remove the javascript code. I usually do regex per line, but in this case it is spread over several lines alongside other code. Since the code begins with an opening javascript tag:
<script language=javascript>
And ends with the closing javascript tag:
</script>
I'm thinking that there's probably a way to remove just the javascript code from multiple lines. There is no other javascript in the html pages.
I would prefer that the script goes through all directories and subdirectories in one pass, but I'm not prepared to think that hard today. If I could just learn the regex, I will just do one dir or subdir at a time, and check it.
Thanks anyone!
I want to use perl regex to remove the javascript code. I usually do regex per line, but in this case it is spread over several lines alongside other code. Since the code begins with an opening javascript tag:
<script language=javascript>
And ends with the closing javascript tag:
</script>
I'm thinking that there's probably a way to remove just the javascript code from multiple lines. There is no other javascript in the html pages.
I would prefer that the script goes through all directories and subdirectories in one pass, but I'm not prepared to think that hard today. If I could just learn the regex, I will just do one dir or subdir at a time, and check it.
Thanks anyone!