Jump to content

Java loop


Thor

Recommended Posts

Hello.I am working on a script where my plan is to make a loop witch execute a number until it reach the goal. the thing is that I am playing on a "hack me" site.the script is:

<html><body><script type="text/javascript">for (i = 0; i <= 50; i++){document.write ("www.awebsite.com" + i)document.write("<br>")}</script></body></html>

How do I make it so ("www.awebsite.com" + i) will be clickable or auto "opened" (tested).When I get the correct number it tells me (with an alert) that I cot the correct number.

Link to comment
Share on other sites

I must admit, I don't understand your goal... but to make that text "clickable" just change

document.write ("www.awebsite.com" + i)

to

var address = "www.awebsite.com" + idocument.write ("<a href='"+address+"'>"+address+"</a>")

As far as "auto opening" instead of writing the address as a link (using the <a> tag), you could open the pages into a new window, or into a frame, or something, but then you might end up with 50 popups!!

Link to comment
Share on other sites

thanks. it worked :)edit: instead of spamming the forum with a new topic.what does this mean? where is the document with the pw? (I am still working on the "hack me" site)

function go() {var input = document.login.pw.valuelocation.href = "?page=level20&pw=" + input;

Link to comment
Share on other sites

kore source needed? ... ok

<script language="JavaScript" src="levels/20/src.php">alert('Not here');</script><script language="JavaScript"><!--function go() {var input = document.login.pw.valuelocation.href = "?page=level20&pw=" + input;}//--></script><form name="login"><table width="144" border="0" align="center" cellpadding="0" cellspacing="0">  <tr>    <td align="center"><b>LEVEL 20 </b></td>  </tr>  <tr>    <td> </td>  </tr>  <tr>    <td align="left">Enter password:</td>  </tr>  <tr>    <td> </td>  </tr>  <tr>    <td align="left"><input name="pw" type="password" id="pw"></td>  </tr>  <tr>    <td align="left"><input type="button" value="ok" onClick="go()"></td>

Link to comment
Share on other sites

As Chocolate said, you've got a form element there with an id of "pw" which is inside the "login" form.

<input name="pw" type="password" id="pw">

The javascript is reading in the value of this field and appending it to the url, so the contents of this password field will be appearing on the querystring in plain text:

?page=level20&pw=PASSWORD

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...