Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
import urllib
import urllib2
import time
import sys
try:
login=sys.argv[1] # 0 -> logout 1-> login
except IndexError:
login = 1
submitVars={}
if(login==0): # LOGOUT
submitVars['mode'] = "191"
submitVars['isAccessDenied'] = "false"
submitVars['url'] = "www.alliancekolkata.co.in/weblink.php"
submitVars['message'] = ""
submitVars['checkClose'] = "0"
submitVars['sessionTimeout'] = "-1.0"
submitVars['guestmsgreq'] = "false"
referer = "http://10.10.0.1/24online/servlet/CyberoamHTTPClient" # URL of referring web page goes here
else: # LOGIN
time.sleep(3)
submitVars['mode'] = "191"
submitVars['isAccessDenied'] = "null"
submitVars['url'] = "www.indiabroadband.net/other-cable-internet-services/12845-alliance-broadband.html"
submitVars['message'] = ""
submitVars['checkClose'] = "0"
submitVars['sessionTimeout'] = "0.0"
submitVars['guestmsgreq'] = "false"
submitVars['username'] = "sayanc_ec"
submitVars['password'] = "1234"
referer = "http://10.10.0.1/24online/webpages/client.jsp" # URL of referring web page goes here
submitUrl = "http://10.10.0.1/24online/servlet/CyberoamHTTPClient" # URL of form action goes here
submitVarsUrlencoded = urllib.urlencode(submitVars)
req = urllib2.Request(submitUrl, submitVarsUrlencoded)
req.add_header('Referer', referer)
response = urllib2.urlopen(req)
thePage = response.read()
#print thePage
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.