code edit

Learn the basics of how to exploit JavaScript.

code edit

Post by Mortecai4 on Sun Feb 22, 2009 6:06 pm
([msg=18434]see code edit[/msg])

how would i change the script from js 1 so that the password is retrieved from a text file?
Mortecai4
New User
New User
 
Posts: 44
Joined: Wed Apr 23, 2008 2:14 pm
Blog: View Blog (0)


Re: code edit

Post by TheMindRapist on Tue Feb 24, 2009 6:54 pm
([msg=18585]see Re: code edit[/msg])

Javascript is client-side, so it wouldn't be from a text file on the server.
Image
User avatar
TheMindRapist
Contributor
Contributor
 
Posts: 585
Joined: Mon Apr 14, 2008 4:57 pm
Blog: View Blog (0)


Re: code edit

Post by cen on Tue Feb 24, 2009 10:34 pm
([msg=18618]see Re: code edit[/msg])

Actually, I'm gonna have to disagree with you on that one MindRapist...

A search on google will show you everthing I think you're looking for Mortecai4.

http://www.lmgtfy.com?q=clsid:333C7BC4- ... 80C7055A83
User avatar
cen
Experienced User
Experienced User
 
Posts: 77
Joined: Mon Jun 30, 2008 1:06 pm
Blog: View Blog (0)


Re: code edit

Post by TheMindRapist on Wed Feb 25, 2009 3:02 pm
([msg=18661]see Re: code edit[/msg])

That isn't so much changing the script from Javascript 1 as it is using Javascript to do something more easily done with PHP.
But yes, it is possible if you create objects.
Image
User avatar
TheMindRapist
Contributor
Contributor
 
Posts: 585
Joined: Mon Apr 14, 2008 4:57 pm
Blog: View Blog (0)


Re: code edit

Post by cen on Wed Feb 25, 2009 5:36 pm
([msg=18674]see Re: code edit[/msg])

That isn't so much changing the script from Javascript 1 as it is using Javascript to do something more easily done with PHP. But yes, it is possible if you create objects.


Although I would obviously agree that this is certainly easier/more securely done with PHP, I don't think that was what he asked - My understanding of his question was that he merely wanted a way to 'pull' the password (or any data) from a text file using Javascript. Your response suggested that it wasn't possible because Javascript is client-side. Yet, clearly there are alternatives - With this ActiveX control it is possible to still get what he was asking for (albeit not necessarily using Javascript, but I think he just wanted a way to 'make it happen').

I've used this control a few times for sites where security isn't really an issue and the tables used were not that complicated or required much modification (and NO modification from the users). Sometimes it's just more of a pain to setup a database anyways, especially when you're only READING from it. For someone without a server or much knowledge of servers and how they work - This is an easy fix for most people and a great way to get their feet wet with databases.

You CANNOT permanently modify the data using this control, just read from it.

The best way to utilize this object is with DHTML and Javascript - Although Javascript is not required for this control, merely using DHTML will work in most situations. And it will work perfectly for Mortecai4 for what he was asking (and in his situation, it would likely require the use of Javscript). I doubt there are many options for securing the data within the file though - I WOULD NOT use this for passwords, yet, for other 'public' data, it's perfectly fine.

If you ACTUALLY want to utilize this with passwords, then I would recommend joining a site with free web hosting (like x10hosting.com for example) which provides PHP/MySQL for free and utilizing these languages instead to serve your purpose. Clearly, this can take MUCH longer for someone inexperienced to setup though.

Anyways, I'm just rambling now - Hope this helps you out Mortecai4.
User avatar
cen
Experienced User
Experienced User
 
Posts: 77
Joined: Mon Jun 30, 2008 1:06 pm
Blog: View Blog (0)


Re: code edit

Post by Mortecai4 on Thu Mar 04, 2010 9:08 pm
([msg=36128]see Re: code edit[/msg])

Code: Select all
<script language="javascript">
c="";
d="";
c=ut(c);
d=tt(d);
a=c;
b=d;

//document.write(a+'\n'+b);
//function validatey(y)
//{
//if(y == b)
//{
//alert("Authentication Successful.   Redirecting...");
//window.location = "/morelater.html";
//}
//else
//{
//alert("Authenication failure...");
//}
//}
function validatex(x,y)
{

     if(x == unescape(a))
     {
              alert("User name isValid.  Now checking password...");
             if(y == unescape(b))
              {
             alert("Authentication Successful.   Redirecting...");
             window.location = "/morelater.html";
              }
              else
              {
              alert("Authentication failure...");
               }
      }
     else
     {
     alert("Authentication Failure...");
     }
}
</script>
<table border="1">
<tr>
<td>
<h4>BurthedWurm Security XML Authentication</h4><br>
User:<input type="text" id="usr" value=""><br>
Pwrd:<input type="password" id="pwd" value="">
<br><br>
<button onsubmit="validatex(document.getElementById('usr').value,document.getElementById('pwd').value);">Submit</button>
</td>
</tr>
</table>

I'm back, and i'm trying this, its a JS script similar to the JS challenges on this site, and matches the string from ut() and tt()
to the input from the user and pass boxes. For some reason, the page won't respond when i press the 'submit' button.
I don't get it...
Mortecai4
New User
New User
 
Posts: 44
Joined: Wed Apr 23, 2008 2:14 pm
Blog: View Blog (0)


Re: code edit

Post by rustyrob on Thu Mar 11, 2010 10:23 am
([msg=36530]see Re: code edit[/msg])

y place the password on a text file and let javascript pull it up? y not have more fun and hide the password in plain sight or add it on there as function x but encrypt in 2 or more ways that javascript will still be able to read, thats what i have been doing, exect i use 6 different encryptors and the password still works and only one of my freinds figured it out but thats cause i told him the first encryptoin
rustyrob
New User
New User
 
Posts: 10
Joined: Tue Mar 02, 2010 4:22 pm
Blog: View Blog (0)



Return to Javascript

Who is online

Users browsing this forum: No registered users and 0 guests