Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > saving the output of obfuscated javascript

Reply
Thread Tools

saving the output of obfuscated javascript

 
 
kpmassey@gmail.com
Guest
Posts: n/a
 
      10-05-2006
I am trying to use wget to retrieve web pages like this:

http://www.michigan-football.com/s/2006/cascades.htm

Visit it and view source to see the obfuscated javascript.

Is there any tool to run this javascript outside my web-browser, and
save the page's text to a file? I've tried spidermonkey, but it just
exits waying window is not defined.

Any ideas?

Thanks.

 
Reply With Quote
 
 
 
 
web.dev
Guest
Posts: n/a
 
      10-05-2006

(E-Mail Removed) wrote:
> I am trying to use wget to retrieve web pages like this:
>
> http://www.michigan-football.com/s/2006/cascades.htm
>
> Visit it and view source to see the obfuscated javascript.
>
> Is there any tool to run this javascript outside my web-browser, and
> save the page's text to a file? I've tried spidermonkey, but it just
> exits waying window is not defined.


Haven't seen a tool that does so, however you can see what the output
is. Tested in IE, type the following in the URL, javascript:
alert(document.body.innerHTML);

That should give you a nice big alert showing you the modified page
results.

 
Reply With Quote
 
 
 
 
McKirahan
Guest
Posts: n/a
 
      10-05-2006
"web.dev" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) oups.com...
>
> (E-Mail Removed) wrote:
> > I am trying to use wget to retrieve web pages like this:
> >
> > http://www.michigan-football.com/s/2006/cascades.htm
> >
> > Visit it and view source to see the obfuscated javascript.
> >
> > Is there any tool to run this javascript outside my web-browser, and
> > save the page's text to a file? I've tried spidermonkey, but it just
> > exits waying window is not defined.

>
> Haven't seen a tool that does so, however you can see what the output
> is. Tested in IE, type the following in the URL, javascript:
> alert(document.body.innerHTML);
>
> That should give you a nice big alert showing you the modified page
> results.



Another technique to view the source is to type following in
your browser's address bar (as one line):

javascript:window.open('about:blank').document.wri te('<pre>'+document.docume
ntElement.outerHTML.replace(/</g, '&lt;')+'</pre>')


 
Reply With Quote
 
RobG
Guest
Posts: n/a
 
      10-06-2006

http://www.velocityreviews.com/forums/(E-Mail Removed) wrote:
> I am trying to use wget to retrieve web pages like this:
>
> http://www.michigan-football.com/s/2006/cascades.htm
>
> Visit it and view source to see the obfuscated javascript.
>
> Is there any tool to run this javascript outside my web-browser, and
> save the page's text to a file? I've tried spidermonkey, but it just
> exits waying window is not defined.


Use Firefox and View Source Chart:

<URL: https://addons.mozilla.org/firefox/655/ >

Incidentally, the page has some errors that appear to be the result of
copying erroneous HTML:

<th aligh="left" ... >


--
Rob

 
Reply With Quote
 
kpmassey@gmail.com
Guest
Posts: n/a
 
      10-12-2006
Thanks for the ideas. They work, but I was really hoping there was
some way to run a standalone program to interpret the javascript. I
believe spidermonkey

http://www.mozilla.org/js/spidermonkey/

will do it, but I can not get it to interpret web pages because things
like document and window are undefined. Is there a standard wrapper
environment code that could define those things to simulate a web
browser environment, so that document.write would work?

Thanks.

RobG wrote:
> (E-Mail Removed) wrote:
> > I am trying to use wget to retrieve web pages like this:
> >
> > http://www.michigan-football.com/s/2006/cascades.htm
> >
> > Visit it and view source to see the obfuscated javascript.
> >
> > Is there any tool to run this javascript outside my web-browser, and
> > save the page's text to a file? I've tried spidermonkey, but it just
> > exits waying window is not defined.

>
> Use Firefox and View Source Chart:
>
> <URL: https://addons.mozilla.org/firefox/655/ >
>
> Incidentally, the page has some errors that appear to be the result of
> copying erroneous HTML:
>
> <th aligh="left" ... >
>
>
> --
> Rob


 
Reply With Quote
 
Spamless
Guest
Posts: n/a
 
      10-12-2006
On 2006-10-12, (E-Mail Removed) <(E-Mail Removed)> wrote:
> Thanks for the ideas. They work, but I was really hoping there was
> some way to run a standalone program to interpret the javascript. I
> believe spidermonkey
>
> http://www.mozilla.org/js/spidermonkey/
>
> will do it, but I can not get it to interpret web pages because things
> like document and window are undefined. Is there a standard wrapper
> environment code that could define those things to simulate a web
> browser environment, so that document.write would work?


I usually do it interactively in vim.

I make changes in the code (for example, changing document.write()
to print() or perhaps
document = new Object()
document.write = print
or quicker
document = {writerint}
and other things (if I want to see the result of an eval, I change
eval(decrypt(string)) to print(decrypt(string))) and put in things,
such as, if there is a
myurl=window.location
I change to
myurl="HE IS USING THE WINDOW_LOCATION")

Then I take the sections I want and use

[range]!js

to pipe it through spidermonkey (it works as a filter so the original
code disappears, but one can make a copy and always use "u" to
undo the change).


Also, "seashell" is an interpreter which has a document object with
write method which is just print
(the same as 'document={writerint}')


Using a good text editor which allows you to pipe data to other
programmes provides a decent interactive session. I suppose emacs
would do as well as vim (here come the emac users!).
 
Reply With Quote
 
kpmassey@gmail.com
Guest
Posts: n/a
 
      10-12-2006
Thanks!! You really helped - js works perfectly now. I just added

document = {writerint}
window = {writerint}

to the top of the file before running it through.




Spamless wrote:
> On 2006-10-12, (E-Mail Removed) <(E-Mail Removed)> wrote:
> > Thanks for the ideas. They work, but I was really hoping there was
> > some way to run a standalone program to interpret the javascript. I
> > believe spidermonkey
> >
> > http://www.mozilla.org/js/spidermonkey/
> >
> > will do it, but I can not get it to interpret web pages because things
> > like document and window are undefined. Is there a standard wrapper
> > environment code that could define those things to simulate a web
> > browser environment, so that document.write would work?

>
> I usually do it interactively in vim.
>
> I make changes in the code (for example, changing document.write()
> to print() or perhaps
> document = new Object()
> document.write = print
> or quicker
> document = {writerint}
> and other things (if I want to see the result of an eval, I change
> eval(decrypt(string)) to print(decrypt(string))) and put in things,
> such as, if there is a
> myurl=window.location
> I change to
> myurl="HE IS USING THE WINDOW_LOCATION")
>
> Then I take the sections I want and use
>
> [range]!js
>
> to pipe it through spidermonkey (it works as a filter so the original
> code disappears, but one can make a copy and always use "u" to
> undo the change).
>
>
> Also, "seashell" is an interpreter which has a document object with
> write method which is just print
> (the same as 'document={writerint}')
>
>
> Using a good text editor which allows you to pipe data to other
> programmes provides a decent interactive session. I suppose emacs
> would do as well as vim (here come the emac users!).


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Can anyone recommend a free, non-obfuscated javascript menu builder? Gremenbulin Javascript 5 10-22-2007 03:30 PM
ANN: 2005 International Obfuscated Ruby Code Contest (IORCC) iorcc@yahoo.com Perl 0 03-18-2005 11:44 PM
obfuscated c/c++ Thomas Garai C++ 5 06-22-2004 08:05 PM
Help...I feel Obfuscated, but I need to decompile something.. chris kramer Java 5 04-09-2004 09:17 PM
Obfuscated xsl fix XML 4 11-28-2003 05:08 PM



Advertisments