shlomikalfa Posted December 15, 2007 Share Posted December 15, 2007 This is my page: <html> <head> <META name="description" content="WGR624"> <META http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <META http-equiv="Pragma" content="no-cache"> <META HTTP-equiv="Cache-Control" content="no-cache"> <meta HTTP-EQUIV="Expires" CONTENT="Mon, 06 Jan 1990 00:00:01 GMT"> <link rel="stylesheet" href="form.css"> <title>PPPoE Status</title> <script language="javascript" type="text/javascript"> <!-- function refreshPage() { if(document.forms[0].Connect.value == 'Renew') return true; window.setTimeout('window.location.href = "RST_st_poe.htm";',5000); } function disableConButton() { document.forms[0].Connect.disabled = true; document.forms[0].Disconnect.disabled = true; document.forms[0].ConMethod.value = " Connect "; document.forms[0].submit(); return true; } function disableDisConButton() { document.forms[0].Connect.disabled = true; document.forms[0].Disconnect.disabled = true; document.forms[0].ConMethod.value = "Disconnect"; document.forms[0].submit(); return true; } //--> </script> </head> <body bgcolor="#ffffff" onLoad="refreshPage()"> <form name="poe_st" method="post" action="st_poe.cgi"> <TABLE border=0 width="100%"> <TR> <TD colspan="2" align="left" nowrap><h1>Connection Status </h1></TD> </TR> </TABLE> <table border="0" cellpadding="0" cellspacing="3" width="100%"> <tr> <!-- RULE --> <td background="liteblue.gif" height="12"> </td> </tr> </table> <table width="100%" border=1 cellspacing=1 cellpadding=4> <tr> <TD NOWRAP width="50%"><B>Connection Time</B></td> <TD NOWRAP width="50%">14:16:02</td> </tr> <tr> <TD NOWRAP><B>Connecting to Server</B></td> <TD NOWRAP>On</td> </tr> <tr> <TD NOWRAP><B>Negotiation</B></td> <TD NOWRAP>On</td> </tr> <tr> <TD NOWRAP><B>Authentication</B></td> <TD NOWRAP>On</td> </tr> <tr> <TD NOWRAP><B>Getting IP Addresses</B></td> <TD NOWRAP>79.179.9.128</td> </tr> <tr> <TD NOWRAP><B>Getting Network Mask</B></td> <TD NOWRAP>255.255.255.255</td> </tr> </table> <table border="0" cellpadding="0" cellspacing="3" width="100%"> <TR> <TD align="center" nowrap> <BR> <input type="submit" name="Connect" value=" Connect " onClick="return disableConButton()"> <input type="submit" name="Disconnect" value="Disconnect" onClick="return disableDisConButton()"></TD> </TR> <tr> <!-- RULE --> <td background="liteblue.gif" height="12"> </td> </tr> <TR> <TD align="center"><input type=button name="close" value="Close Window" onclick="self.close();"></TD> </TR> </TABLE> <input type="hidden" name="ConMethod" value="Disconnect"> </form> </body> </html> Well... i've recieved it after posting this: post data = "login:command/username=admin&login:command/password=password" post url = "http://192.168.1.11/st_poe.cgi" Post Headers = "Content-Type: application/x-www-form-urlencoded" so then after realizing with you'se guys help that this page actually posts to the 'st_poe.cgi' page i've tried to send another posting msg. post data = "Disconnect=Disconnect" post url = "http://192.168.1.11/st_poe.cgi" Post Authorization = "admin:password" Post Headers = "Content-Type: application/x-www-form-urlencoded" but then i've recieved that page: <html><head><meta http-equiv='Pragma' content='no-cache'><meta http-equiv='Cache-Control' content='no-cache'><title> Authorization warning</title><script language="javascript" type="text/javascript">function cancelevent(){document.formname.submit();}</script></head><body onload=cancelevent()><form name="formname" action="ptimeout.cgi" method="POST"><b>401 Unauthorized</b><input type="hidden" name="inputname" value=""></form></body></html> please tell me what am i doing wrong and how do i make it right ? i want to restart my router ... please help me Quote Link to comment Share on other sites More sharing options...
shlomikalfa Posted December 16, 2007 Author Share Posted December 16, 2007 After alot of tries, i've managed to 'POST' to the router using an external application however i've managed to get authorised only when i've used the 'connect' value, when used the 'disconnect' value i'm always getting the 401 error, unauthorized... My 'connect' send that does work: [Obj:MSXML2.ServerXMLHTTP][iP:http://192.168.1.11/st_poe.cgi][Method:POST][Data:ConMethod= Connect ][Authentication:admin:password] [Headers: User-Agent | Mozilla/4.0 (compatible; MSIE 5.00; Windows 98) Cache-Control | no-cache Content-Type | text/html; charset=iso-8859-1 Authorization | Basic YWRtaW46cGFzc3dvcmQ= /Headers] I've got that page returned: <html> <head> <meta name="description" content="WGR614_2022"> <link rel="stylesheet" href="form.css"> <title>Error Message</title> <script type="text/javascript"> function delayedLoad() { var nextF = document.forms[0].next_file.value; if (nextF == "historyBack") setTimeout("history.back()", 6000); else setTimeout("location.replace('" + nextF + "')", 6000); } </script> </head> <body bgcolor="#ffffff" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" onLoad="delayedLoad()"> <form name="msg" action="message.cgi" method="post" onSubmit="return false"> <table WIDTH="100%" BORDER="0" CELLSPACING="0" CELLPADDING="4"> <tr> <td align="left"><h1></h1></td> </tr> </table> <table WIDTH="100%" BORDER="0" CELLSPACING="3" CELLPADDING="0"> <tr> <!-- RULE --> <td colspan="2" background="liteblue.gif" height="12"> </td> </tr> </table> <table WIDTH="100%" BORDER="0" CELLSPACING="0" CELLPADDING="4"> <tr> <td align=center><b>Session is connected. </b></TD> </TR> </table> <table WIDTH="100%" BORDER="0" CELLSPACING="3" CELLPADDING="0"> <tr> <!-- RULE --> <td colspan="2" background="liteblue.gif" height="12"> </td> </tr> </table> <table WIDTH="100%" BORDER="0" CELLSPACING="0" CELLPADDING="4"> <tr> <td align=center>This page will automatically return to the previous page in a few seconds...</TD> </TR> </TABLE> <input type="hidden" name="next_file" value="RST_st_poe.htm"> </form> </BODY> </HTML> But when trying to 'POST' the following: [Obj:MSXML2.ServerXMLHTTP][iP:http://192.168.1.11/st_poe.cgi][Method:POST][Data:ConMethod=Disconnect][Authentication:admin:password] [Headers: User-Agent | Mozilla/4.0 (compatible; MSIE 5.00; Windows 98) Cache-Control | no-cache Content-Type | text/html; charset=iso-8859-1 Authorization | Basic YWRtaW46cGFzc3dvcmQ= /Headers] I Get that error: <html><head><meta http-equiv='Pragma' content='no-cache'><meta http-equiv='Cache-Control' content='no-cache'><title> Authorization warning</title><script language="javascript" type="text/javascript">function cancelevent(){document.formname.submit();}</script></head><body onload=cancelevent()><form name="formname" action="ptimeout.cgi" method="POST"><b>401 Unauthorized</b><input type="hidden" name="inputname" value=""></form></body></html> can anyone please tell me what am i doing wrong ?! Quote Link to comment Share on other sites More sharing options...
shlomikalfa Posted December 16, 2007 Author Share Posted December 16, 2007 Oky, now i've also tried to "Renew" the page and apperantly it work all ok! [Obj:MSXML2.ServerXMLHTTP][iP:http://192.168.1.11/st_poe.cgi][Method:POST][Data:ConMethod=Renew] [Headers: User-Agent | Mozilla/4.0 (compatible; MSIE 5.00; Windows 98) Cache-Control | no-cache Content-Type | text/html; charset=iso-8859-1 Authorization | Basic YWRtaW46cGFzc3dvcmQ= /Headers] <html> <head> <META name="description" content="WGR624"> <META http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <META http-equiv="Pragma" content="no-cache"> <META HTTP-equiv="Cache-Control" content="no-cache"> <meta HTTP-EQUIV="Expires" CONTENT="Mon, 06 Jan 1990 00:00:01 GMT"> <link rel="stylesheet" href="form.css"> <title>PPPoE Status</title> <script language="javascript" type="text/javascript"> <!-- function refreshPage() { if(document.forms[0].Connect.value == 'Renew') return true; window.setTimeout('window.location.href = "RST_st_poe.htm";',5000); } function disableConButton() { document.forms[0].Connect.disabled = true; document.forms[0].Disconnect.disabled = true; document.forms[0].ConMethod.value = " Connect "; document.forms[0].submit(); return true; } function disableDisConButton() { document.forms[0].Connect.disabled = true; document.forms[0].Disconnect.disabled = true; document.forms[0].ConMethod.value = "Disconnect"; document.forms[0].submit(); return true; } //--> </script> </head> <body bgcolor="#ffffff" onLoad="refreshPage()"> <form name="poe_st" method="post" action="st_poe.cgi"> <TABLE border=0 width="100%"> <TR> <TD colspan="2" align="left" nowrap><h1>Connection Status </h1></TD> </TR> </TABLE> <table border="0" cellpadding="0" cellspacing="3" width="100%"> <tr> <!-- RULE --> <td background="liteblue.gif" height="12"> </td> </tr> </table> <table width="100%" border=1 cellspacing=1 cellpadding=4> <tr> <TD NOWRAP width="50%"><B>Connection Time</B></td> <TD NOWRAP width="50%">11:43:14</td> </tr> <tr> <TD NOWRAP><B>Connecting to Server</B></td> <TD NOWRAP>On</td> </tr> <tr> <TD NOWRAP><B>Negotiation</B></td> <TD NOWRAP>On</td> </tr> <tr> <TD NOWRAP><B>Authentication</B></td> <TD NOWRAP>On</td> </tr> <tr> <TD NOWRAP><B>Getting IP Addresses</B></td> <TD NOWRAP>79.180.79.95</td> </tr> <tr> <TD NOWRAP><B>Getting Network Mask</B></td> <TD NOWRAP>255.255.255.255</td> </tr> </table> <table border="0" cellpadding="0" cellspacing="3" width="100%"> <TR> <TD align="center" nowrap> <BR> <input type="submit" name="Connect" value=" Connect " onClick="return disableConButton()"> <input type="submit" name="Disconnect" value="Disconnect" onClick="return disableDisConButton()"></TD> </TR> <tr> <!-- RULE --> <td background="liteblue.gif" height="12"> </td> </tr> <TR> <TD align="center"><input type=button name="close" value="Close Window" onclick="self.close();"></TD> </TR> </TABLE> <input type="hidden" name="ConMethod" value="Disconnect"> </form> </body> </html> How come only when sending "Disconnect" it doesn't work ?! ---> EDIT: just to make sure that the "Disconnect"'s return is the Erroneous one i've tried with 'aaaaa' instead, and yeps... that's the error... just to make sure which is the falseous return i've made an extra check with a parameter from my head as post data: [code] [Obj:MSXML2.ServerXMLHTTP][iP:http://192.168.1.11/st_poe.cgi][Method:POST][Data:ConMethod=aaaa] [Headers: User-Agent | Mozilla/4.0 (compatible; MSIE 5.00; Windows 98) Cache-Control | no-cache Content-Type | text/html; charset=iso-8859-1 Authorization | Basic YWRtaW46cGFzc3dvcmQ= /Headers] <html><head><meta http-equiv='Pragma' content='no-cache'><meta http-equiv='Cache-Control' content='no-cache'><title> Authorization warning</title><script language="javascript" type="text/javascript">function cancelevent(){document.formname.submit();}</script></head><body onload=cancelevent()><form name="formname" action="ptimeout.cgi" method="POST"><b>401 Unauthorized</b><input type="hidden" name="inputname" value=""></form></body></html> as you can see, there is a problem with posting "Disconnect"... but what else can we infer from the page ?![/code] Quote Link to comment Share on other sites More sharing options...
shlomikalfa Posted December 16, 2007 Author Share Posted December 16, 2007 Well... I've just checked another thingy, if i'm connecting manualy to the router and then sending the exact same thing [disconnect message] it works and it disconnects me... is there any 'POST' data that is a standard for authentication ?! [not the header, but a data to send as post...] Quote Link to comment Share on other sites More sharing options...
shlomikalfa Posted December 16, 2007 Author Share Posted December 16, 2007 Who ever reads this for studying purposes... --> Just send a first empty or not, just send a first Authentication MSG, with no posting data... then the second one will pass through and everything will work! Sorry for all the spamm, someone might find it usefull someday! Quote Link to comment Share on other sites More sharing options...
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.