Hallo Leute,
ich versuche gerade (leider Gottes unter Windows) eine automatische Anmeldung für einen Hotspot Zugang zu schreiben. Leider habe ich nur HTML - Kenntnisse und so gut wie keine Javascriptkenntnisse.
hier ist einmal der Quellcode für den Zugang zum hotspot
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 | <html> <head> <title>Web Authentication</title> <meta http-equiv="Cache-control" content="no-cache"> <meta http-equiv="Pragma" content="no-cache"> <meta http-equiv="Expires" content="-1"> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <style> <!-- DIV.sidebar { RIGHT: 0px; POSITION: absolute; TOP: -1px; HEIGHT: 100%; width: 200; } DIV.graybar { RIGHT: 0px; POSITION: absolute; TOP: 0px; HEIGHT: 100%; BACKGROUND-COLOR: #f8f8f8 } /* background not be shown for NEC */ DIV.header { BACKGROUND-POSITION: right 50%; LEFT: 0px; BACKGROUND-IMAGE: url(images/background_web41.jpg); WIDTH: 100%; BACKGROUND-REPEAT: repeat; POSITION: absolute; TOP: 0px; HEIGHT: 52px; BACKGROUND-COLOR: #FFFFFF} DIV.content { LEFT: 14px; MARGIN: 15px; POSITION: absolute; TOP: 60px } H1 { FONT-WEIGHT: bold; FONT-SIZE: 19px; MARGIN: 16px 0px 0px 25px; COLOR: #ffffff; FONT-FAMILY: Tahoma, Arial, Helvetica, sans-serif } H2 { FONT-WEIGHT: bold; FONT-SIZE: 15px; MARGIN: 10px 0px 0px 10px; COLOR: #336666; FONT-FAMILY: Arial, Helvetica, sans-serif } INPUT { FONT-SIZE: 12px; FONT-FAMILY: Arial, Helvetica, sans-serif } INPUT.button { MARGIN-TOP: 10px; FONT-WEIGHT: bold; WIDTH: 80px; COLOR: #ffffff; BACKGROUND-COLOR: #669999 } P { FONT-SIZE: 12px; MARGIN: 0px 0px 10px; COLOR: #001133; FONT-FAMILY: Arial, Helvetica, sans-serif } TD { FONT-WEIGHT: bold; FONT-SIZE: 12px; COLOR: #336666; FONT-FAMILY: Arial, Helvetica, sans-serif } TD.message { FONT-WEIGHT: normal; COLOR: #000000 } --> </STYLE> <script language="javascript" src="./loginscript.js"></script> <script> var url = ""; if(url != ""){ var link = document.location.href; var searchString = "?redirect="; var equalIndex = link.indexOf(searchString); var redirectUrl = ""; if(equalIndex > 0) { equalIndex += searchString.length; redirectUrl += link.substring(equalIndex); //attach the redirect url only if the ext web auth url doesn't contain it searchString = "&redirect="; equalIndex = url.indexOf(searchString); if(equalIndex < 0){ url+= "&redirect="; url+=redirectUrl; } } window.location.href = url; } function getErrorMsgIfAny(){ if(document.forms[0].err_flag.value == 1){ document.writeln(' \ <tr align="center"> <td colspan="2" style="color:#CC0000">Login Error.</td>\ </tr><tr align="center"> <td width="350" class="message" colspan="2">The User Name and Password combination you have entered is invalid. Please try again.</td></tr>\ <tr> <td class="caption" colspan="2"> </td></tr>'); }else{ document.writeln(' '); } } </script> </head> <body bgcolor="#ffffff" text="#000000" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0"> <FORM method="post" ACTION="/login.html"> <INPUT TYPE="hidden" NAME="buttonClicked" SIZE="16" MAXLENGTH="15" VALUE="0"> <INPUT TYPE="hidden" NAME="err_flag" SIZE="16" MAXLENGTH="15" VALUE="0"> <INPUT TYPE="hidden" NAME="err_msg" SIZE="32" MAXLENGTH="31" VALUE=""> <INPUT TYPE="hidden" NAME="info_flag" SIZE="16" MAXLENGTH="15" VALUE="0"> <INPUT TYPE="hidden" NAME="info_msg" SIZE="32" MAXLENGTH="31" VALUE=""> <INPUT TYPE="hidden" NAME="redirect_url" SIZE="255" MAXLENGTH="255" VALUE=""> <div class="header"> <h1>Login</h1> </div> <div class="content"> <h2>Welcome to the guest wireless network</h2> <table border="0" cellspacing="10" cellpadding="0" width="350"> <tr> <td colspan="2" class="message"> <p>*** is pleased to provide the Wireless LAN infrastructure for your network. Please login and put your air space to work.</p> </td> </tr> <script> getErrorMsgIfAny(); </script> <tr> <td width="100">User Name</td> <td> <INPUT type="TEXT" name="username" SIZE="25" MAXLENGTH="63" VALUE=""> </td> </tr> <tr> <td>Password</td> <td> <INPUT type="Password" name="password" emweb_type=PASSWORD autocomplete="off" EMWEB_TYPE=PASSWORD onKeyPress="submitOnEnter(event);" SIZE="25" MAXLENGTH="63" VALUE=""> </td> </tr> <tr> <td> </td> <td> <script>getHtmlForButton("Submit","Submit","button","submitAction()"); </script> </td> </tr> </table> </div> <div class="sidebar"> <table width="200" cellpadding="0" cellspacing="0" border="0"> <TBODY> <tr> <td height="53" align="right" style="padding-bottom: 4px; padding-right: 20px; background="../../images/background_web41.jpg" width="200"><div align="right"><img src="../../images/cisco/cisco-webauth-logo-2007.gif" width="67" height="40"></div></td> </tr> <tr> <td align="right" style="padding-top: 25px; padding-right: 20px;" bgcolor="#99cccc" > <div ></div></td> </tr> </TBODY> </table> </div> </FORM> </body> <HEAD> <meta http-equiv="Cache-control" content="no-cache"> <meta http-equiv="Pragma" content="no-cache"> <meta http-equiv="Expires" content="-1"> </HEAD> </html> |
Anhand dessen habe ich mir einmal folgendes Script erarbeitet:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | <html> <head> <title>Login beim Gästewlan</title> </head> <body> <FORM method="post" ACTION="https://192.168.1.1/login.html"> <INPUT type="TEXT" name="username" VALUE="der_benutzername"> <INPUT type="Password" name="password" VALUE="das_Passwort"> <!--ich versuch mal was--> <INPUT type=submit value="OK"> <!--<INPUT TYPE="hidden" NAME="redirect_url" VALUE="www.google.de">--> <script>getHtmlForButton("Submit","Submit","button","submitAction()"); </script> </form> </body> </html> |
Das ist allerdings sehr frei heraus und geht natürlich auch nicht ☺ ich habe noch folgende Anleitung gefunden (Augenmerk auf den nutzer *pedant*): http://www.administrator.de/contentid/37479
Kann mir da vielleicht ein erfahrener Mensch helfen? Ich gelobe auch Javascript Besserung
Bearbeitet von rklm:
Wenn Du schon solche Mengen hier reinpackst, dann benutz doch bitte wenigstens das passende Hightlighting.