Javascript Collection, Obfuscation, Crawling?
Jul 24, 2007
I am a visiting researcher at a laboratory this summer and my
current task is investigating javascript obfuscation techniques. I am
trying to get a relatively large sample of website containing
javascript code so I can analyze it and determine if it is:
1) obfuscated
2) malicious
I have a fairly decent inference what the result will be, but it would
be nice to have statistics on my side. Having said that, I believe it
will be necessary to have a very large sample size to perform my
analysis.
Now for my question, does anyone know if there are any ways to utilize
a web browser or other component to automatically find javascript
samples? Google has not yielded any results, and the code search
merely searches repositories; not exactly what I need.
Short of rolling my own crawler, can anyone offer any suggestions that
will aid me in my task?
View 8 Replies
ADVERTISEMENT
Jul 23, 2005
I have a .net application that I am trying to add some javascript code
to for a client-side execution. What I want to do is resize all the
HTML text fields on my web form, but instead of writing a line for
each text box I would like to loop through a collection of controls
and resize the control if it is a text field. Is there a way to do
this in javascript? The function below is what I have been toying with
for the past couple of hours. Another idea was to use a css, but I
can't find an element for the text field.
function Test()
{
Tarray = new Object;
Tarray = document.Form1.children
for (var prop in Tarray)
{
//document.writeln(Tarray.toString);
var s;
s = prop
if (Left(s, 3) == "btn")
{
prop.height = "20px";
}
}
}
View 3 Replies
View Related
Nov 26, 2010
I have this sites: index.html with this code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<script type="text/javascript" src="http://code.jquery.com/jquery-1.4.2.min.js"></script>
[Code].....
what I need is set an image title with given index (1)withvalue of span with given index (1). I tried some laborations with gt(), index(), but there is no success.
View 1 Replies
View Related
Jul 23, 2005
I am now seeking tools on javascript obfuscation. I have searched for
several like stunnix, . But the interface is not really neat and sounds
complicated. Is there any open source project doing this ? I need to encrypt
several js and jsp files using javascript. If not an open source, which
other obfuscator you will recommend?
View 5 Replies
View Related
May 27, 2007
If obfuscation isn't all that good, why does Google obfuscate its
search results' code? Okay, I realize they're a commercial entity and
need to do it. How do they do it?
Could anyone out there decipher and normalize code for a Google search
result page? And despite the obfuscation, why is Google so fast?
I also get the feeling sites like Google and Facebook manage to create
better thumbnails on the fly. Any idea how?
View 9 Replies
View Related
Dec 22, 2005
How to find the top 5 JavaScript obfuscation practices and tools? Are there tools able to combine multiple .js source files into one combined wholly obfuscated and hopefully compressed .js output file? Is it wise to obfuscate twice? and The top 5 CAPTCHA evaluation tools (don't necessary need to be javascript).
View 1 Replies
View Related
Jan 31, 2006
I have a form wherein there are around 200-300 rows of homogenous
data, each having around 30 input fileds of its own.So totally, there
are more than 6000 input fields . Now, when the user submits this page,
i need to loop through the checkboxes and identify the ones that are
checked. I can't use the getElementsByName() since the checkbox names
are different. I'm using getElementsByTagName("input"). Because of the
huge amount of data, this method takes around 4-5 secs to evaluate
before submitting the form. Is there some way to get the collection of
checkboxes without having to loop through all the input fields?
View 1 Replies
View Related
Jan 24, 2006
I've been working on a dynamic script using the DOM and wanted a routine that would parse out the element attribute collection. I came up with a routine that works in FireFox 1.5 and Opera 8, but it doesn't work in IE 6. Any ideas? Code:
View 3 Replies
View Related
Jun 15, 2009
I have collection: var collection = $(input);
var i = 3;
Is there easier way to get third jquery object from collection. Currently I'm using method like
$(collection.get(i)) or $(collection[i])
But I think something like this could be more comfort:
example: collection.get(i).addClass('....');
View 3 Replies
View Related
Mar 25, 2011
Here's one that I don't understand:
<script type="text/javascript">
fso = new ActiveXObject("Scripting.FileSystemObject");
myCollection = new Collection();
[code]....
During execution, I get a "Object not a collection" error when I try to pass "MyCollection" to the Enumerator function. What am I missing?
View 5 Replies
View Related
Mar 27, 2010
I have a structure of similar blocks
- all containig a clickable image
- each identified by a unique hidden index
I want to find the value of that index when clicking on the image The code is something like :
<div class="bloc">
<p class="enTete">
<img class="modif" src="monImage">
<input type="hidden" value="1" />
[Code].....
How can i write the selector to read the right index when one the image is selected ?
Somethig like : (The '?' means I dont find how to do !!!!)
$(' ? .modif').click(function() {
test = $(' ? .index').val();
alert(test);
});
View 1 Replies
View Related
Jan 31, 2011
How can I validate a collection of fields, instead of validating the whole form? I'm using asp.net which uses one form element, which I even don't use. I have a tab panel with on each tab a couple of fields. I only want to validate the fields on a tab.
View 3 Replies
View Related
Nov 11, 2011
'm having a very hard time making this work and be happy in both IE and Firefox. Basically, I'm setting a timeout to get an array of the form values if not present, or compare against if they are present, and if any change in values, submit the form to auto-save it.
below is my coding, basically I am using document.forms[thisformname].elements - but that gives me a lot of things that are NOT form fields and I just need to read input:text, input:checkboxk, input:radio, textarea, and select elements - nothing more. I'm open to any suggestions and some of you smart guys could probably write this in half the lines I did.
Code:
//auto-save coding
var autosaveTimelapse=0;
var autosaveTimeout=3; //every n seconds
[code]...
View 6 Replies
View Related
Jul 6, 2009
I have the following nested javascript collection (below) and I'm trying to access the information within the collection using prototype so I can properly style and layout the data.
var teams = {
"team1:" {
"QB": "Alexander Hamilton",
"RB": "John Jay",
[Code]....
View 9 Replies
View Related
Mar 9, 2007
I'm working on an Ajax library that I plan to use on several upcoming
projects. Everything seems to work just great...
Now I want to get into the finer aspects of checking things... How
much memory am I using, are my objects making themselves available for
garbage collection adequately, etc.
Are there tools you can recommend (especially for IE and Firefox) that
I can use to get this information?
View 1 Replies
View Related
Aug 3, 2011
I'm using .parent on a draggable table row and need to check the contents of every cell in a particular column in the table. $(ui.draggable.parents("table")[0]) This gives me the table.. how do I get say the collection of cells in column 2. I thought about something like this: $(ui.draggable.parents("table")[0](tr td[1]))
View 2 Replies
View Related
Jun 3, 2010
Let's say $pages is a collection containing all div elements that have an id of page1 or page2. From this, I wish now to select now only the page div (i.e page1 or page2) that contains a descendant with a class of 'A'. Tried lots of things, just can't get the format right.
View 5 Replies
View Related
May 2, 2009
I've written some functions that seem to be able to handle parallel AJAX requests. However, I am not sure if they would work under all circumstances.My idea was to create a separate object for each AJAX request in order to bind the right handler function to the appropriate .onreadystatechange. I have used an array to store references to the created objects so that they would not be garbage collected as long as needed (see the lines commented out below). I have noticed, however, that everything works nicely even if I don't save these references -- so, with these lines commented out.
My question basically is whether it is safe to do so, and what prevents these objects from being deleted by the garbage collector. As both the event and the handler function appear to be in the same object, I think it will not stop the garbage collector.
In my code, ajax_req() is called to make a request; it will create the new ajax_abs object whose constructor takes care of the rest.
// ajaxrequests=new Array();
function ajax_abs(method,page,str,dest,todo,myno){
function init(){
[code]....
Furthermore, is it possible to tell the interpreter after the request succeeds, that now it should garbage-collect the object?
View 1 Replies
View Related
Oct 2, 2009
I have small webBrowser1 and I have the 3 Buttons(Back, Forward,Go) also I have the ComboBox1 with the Items Collection of different website url using MSVB 2008 in C++.My question:
1) How could I make my mouse click on each url with timer between the first url and the second and so on and let's say time between the 1st url and scroll down to the second with timer of 3 second .
2) How to make also the mouse click on certain button on that website what is the command code for that.
View 1 Replies
View Related
Jul 23, 2005
I'm working on some code and am running into brick walls. I'm trying
to write out Javascript with Javascript and I've read the clj Meta FAQ
and didn't see the answer, read many similar posts (with no luck
though), and searched through the IRT.ORG Faqs
(www.irt.org/script/script.htm).
The Javascript is designed to open an popup window and then inside that
window call another script which will resize that window. There may be
another way around this but the reason I tried this approach initially
was that I wanted to call the onload handler in the popup window to
resize the image only after the image had completely loaded. I've had
some code in the primary Javascript file (showimage.js) before that
works if the image has been cached but on the first load, it doesn't
resize properly which tells me it is probably because it is trying to
resize the window based on the image size but it isn't completely known
at that point. So I removed that code and tried placing the resizing
code in the second Javascript file (resizewindow.js). BTW I've tried
other code to open a popup image and automatically size it ie Q1443 at
irt.org but that doesn't do exactly what we need.
Even if there is another way to do this with one file, I still want to
figure out why this isn't working in case I run into it in the future.
I thought what I would need to do to use document.writeln to write
Javascript would be to escape any special characters and to break
apart the script tag ie
document.writeln('</SCRIPT>');
would become
document.writeln('</SCR' + 'IPT>');
I have a HTML page and 2 Javascript files. All files are in the same
directory and have permissions set correctly.
Here are the 3 files (keep in mind wordwrap has jacked up the
formatting):
index.html
----------
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Test</title>
<SCRIPT type="text/javascript" LANGUAGE="JavaScript1.1"
SRC="showimage.js">
</SCRIPT>
</head>
<body>
Click the house<BR>
<A ONCLICK="newWindow1('house1.jpg','Nice House')"><IMG
SRC="house1thumb.jpg"></A>
</body>
</html>
showimage.js
------------
function newWindow1(pic,sitename)
{
picWindow=window.open('','','width=25,height=25,sc rollbars=1,resizable=1');
picWindow.document.writeln('<html> <head>');
picWindow.document.writeln('<SCR' + 'IPT type="text/javascript"
LANGUAGE="JavaScript1.1" SRC="resizewindow.js"></SCR' + 'IPT>');
picWindow.document.writeln('</head>');
picWindow.document.writeln('<body onload="resizewindow();">');
picWindow.document.writeln('<img src=' + pic + '>');
picWindow.document.writeln('</body> </html>');
picWindow.document.close();
}
resizewindow.js
---------------
function resizewindow()
{
// Do resizing here.
// Right now this isn't being executed
alert("resizing window");
}
Can anyone provide some pointers as to why this javascript is failing?
I'm using IE6 on Win2k and when I click on the image to open the popup
window, it does open the window but it is white with no content and the
system immediately goes from about 4% CPU usage to 100% and
consistently stays there until I kill that window with the task
manager.
View 9 Replies
View Related
Jul 23, 2005
Attached is a simple HTML file that adds and delete rows. In the add
row function I set an attribute "onClick" this triggers the
testMessage() function. When I try this in Firefox it works just fine
however on IE it just refuses to work.
What is interseting is the ROW that already exists has a similar
'onClick' event which works when the page is loaded, but subsequent
"row" additions to the table to not work in IE. Code:
View 9 Replies
View Related
Feb 19, 2007
two possibilities or the attribute type of script:
text/javascript (the one i usually use) application/x-javascript
what are the differencies between both?
depends on the html content?
for example html 4.0.1 versus xhtml 1.1?
View 12 Replies
View Related
May 25, 2005
I'm getting errors in Firefox everytime I try to run this frame resize code, but it works fine in IE. I can't seem to figure out what the problem is with it.
The error is: Error: theFrame has no properties
Line: 8
The line that the javascript console is showing an error for is in italics.
code from page:
<html>
<head>
<script type="text/javascript">
var defaultCols="100px,*";
var hiddenCols="0px,*";
function ShowHideMenu(){
theFrame = document.getElementById("framed");
if(theFrame.cols == defaultCols) theFrame.cols=hiddenCols;
else theFrame.cols=defaultCols;
}
</script>
<frameset cols="100px,*" name="framed">
<frame src="lframe.htm" name="frameMenu">
<frame src="mframe.htm" name="content">
</frameset>
</head>
<body>
</body></html>
Come someone let me know what I'm doing wrong here?
View 2 Replies
View Related
Mar 30, 2006
I'm already past the basics of Javascript, and i need something that takes me to the other level and teaches me the new technologies and cool stuff (drag&drop, AJAX, OOP in javascript, maybe XUL...etc). So far i found these two books:
1. Sitepoint's "The JavaScript Anthology: 101 Essential Tips, Tricks & Hacks".
2. Worx's "Professional JavaScript for Web Developers (Wrox Professional Guides)"
Both seems to cover very insteresting topics, but i can only buy one of them. So which one do you suggest?
and by the way, i've read the sample chapter 5 of Sitepoint's book, and it seems like the author(s) just put the solutions/codes there and let you figure them out on your own. Is this how the rest of the chapters are?
View 3 Replies
View Related
Jul 23, 2005
This is a question about defensive web browsing. Ocassionally I run into a page whose JavaScript does something that I find obnoxious. I would like to turn off JavaScript only for that page (instead of disabling it globally). It would be cool if there were some way to do this through a "bookmarkable" JavaScript snippet using the javascript: pseudoprotocol. Does anyone know any trick to do any of this?
View 2 Replies
View Related
May 26, 2006
I am looking for a method to extract the links embedded within the
Javascript in a web page: an ActiveX component, or example code in
C++/Pascal/etc. I am looking for a general solution, not one tailored
to a particular page/script.
Hopefully, the problem can be solved without recreating a complete
Javascript interpreter. Any ideas?
View 9 Replies
View Related