rufus777 Posted June 17, 2011 Posted June 17, 2011 What up? hehe I think of a python script that does everything for me ... I'm at an enterprise that makes a "Web Authentication" ("https://10.10.17.10/login.html") I have "User Name" & "Password", but I have to enter it!!! uff... I think that it is HTML Python, but what is it?? <input type="TEXT" value="" maxlength="80" size="25" name="username"> <input type="Password" value="" maxlength="127" size="25" onkeypress="submitOnEnter(event);" autocomplete="off" emweb_type="PASSWORD" name="password" and <input class="button" type="button" onclick="submitAction()" value="Submit" name="Submit"> I know that the internet has everything, but I go into the forums before I go online .... Quote
rufus777 Posted June 17, 2011 Author Posted June 17, 2011 it's screenshot if it is bad english ... Quote
Sitwon Posted June 17, 2011 Posted June 17, 2011 Are you talking about the call in @onclick or @onkeypress? That's not Python it's JavaScript. Quote
rufus777 Posted June 17, 2011 Author Posted June 17, 2011 Are you talking about the call in @onclick or @onkeypress? That's not Python it's JavaScript. JavaScript can't I do, but python that I can do.... ssl server ----> username ---> password ---> accept !!! import httplib conn = httplib.HTTPSConnection("https://10.10.17.10/login.html") conn.request("GET", "/login.html") r1 = conn.getresponse() that is what I have ... GET might be wrong .. Perhaps POST? maybe it's the two of them? httplib is it right? What with urllib? hehe, that can be wrong ,but I will try... Quote
rufus777 Posted June 17, 2011 Author Posted June 17, 2011 (edited) maybe you have javascript code, Sitwon? Edited June 17, 2011 by rufus777 Quote
Sparda Posted June 17, 2011 Posted June 17, 2011 It's just a form. The university I went to used this and it was simple enough to auto login with a script I can't remember what language it was written in. As I recall it doesn't even do any thing as elaborate as set a session when the form displays, you can just instantly POST having no prior communication with it and it will work. Quote
Sitwon Posted June 17, 2011 Posted June 17, 2011 JavaScript can't I do, but python that I can do.... ssl server ----> username ---> password ---> accept !!! import httplib conn = httplib.HTTPSConnection("https://10.10.17.10/login.html") conn.request("GET", "/login.html") r1 = conn.getresponse() that is what I have ... GET might be wrong .. Perhaps POST? maybe it's the two of them? httplib is it right? What with urllib? hehe, that can be wrong ,but I will try... So you're trying to log in with a Python script? you need to check the <form> to see if it's doing a POST or GET. It's probably POST. Also you need to send your username and password in the POST request. Quote
digip Posted June 17, 2011 Posted June 17, 2011 (edited) emweb_type is specifically for an embedded web server in the device itself that treats the code as HTML part of the form, and the Cisco router accepts the form using this server side type code extension, possibly compiling it on the fly. Its not normal HTML or Python, but a hybrid of HTML and server side code for the embedded webserver. The onclick events look like normal JavaScript. See: http://www.prnewswire.com/news-releases/virata-announces-software-license-agreement-with-cisco-systems-75355147.html http://en.wikipedia.org/wiki/Virata_Corporation Edited June 17, 2011 by digip Quote
rufus777 Posted June 18, 2011 Author Posted June 18, 2011 but in python .... I have created a web browser + Javascript, but it works not ... hehe, I want anything to work with one touch .. import webbrowser import sys url = "Web_Hysnes.html" webbrowser.open(url + 'javascript:document.forms["HACK"].submit();') or import webbrowser import sys url = "Web_Hysnes.html" webbrowser.open(url + '@javascript:document.forms["HACK"].submit();') I am a beginner but I want to learn! Quote
rufus777 Posted June 18, 2011 Author Posted June 18, 2011 hmm, if I have a html file with a new windows + I have javascript in the SAME windows? i have done this, but it is not working.. url = "Web_Hysnes.html" webbrowser.open(url) webbrowser.open('javascript:document.forms["HACK"].submit();', new=0) 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.