Saturday 31 August 2019

how to access sub? urls keeping the main url connection alive

trying to access some sub? php urls/endpoints to get overall h/w health status. Problem here is I could able to access only from browser those urls/endpoints with long cookies. when i try with python and linux cmd line getting 401 error

url_login_page=https://10.10.10.10/designs/imm/index.php

below are the available php's I wanted to access with python & curl, and able view the content of these php's from browser without issues

{"home.php":"1"},{"event-log.php":"4"},{"event-notification.php":"5"},
{"event-notification.php":"5"},{"service-problems.php":"6"},{"servicesettings.php":"7"},{"download-service-data.php":"8"},{"serverfirmware.php":"9"},{"remote-control.php":"10"},
{"server-properties.php":"11"},{"server-actions.php":"12"},{"fanlist.php":"13"},
{"power-modules.php":"14"},{"disk-list.php":"15"},{"memorylist.php":"16"},
{"cpu-list.php":"17"},{"server-timeouts.php":"18"},{"immproperties.php":"19"},
{"user-list.php":"20"},{"network-properties.php":"21"},{"immsecurity.php":"22"},
{"backup-restore.php":"23"},{"pxe-network-boot.php":"28"},{"osfailurescreen.php":"29"},{"feature-on-demand.php":"80"}]

Not able to get the cookie value with requests

$ r=requests.get(url,auth=(usr,pswd),verify=False)
$r 
<Response [200]>
$ r.cookies
 <RequestsCookieJar[]>

And I tried with headers too but no luck

h = httplib2.Http(".cache",disable_ssl_certificate_validation=True,timeout=3)
            h.add_credentials(user_login,Password)
            headers={'Cookie': 'sessionKey=%s' % session_id }
            resp,content = h.request(
            url,
            'GET',headers=headers   
            )

Please help me how could i access the sub urls? is it possible to access with existing XHR headerss ?



from how to access sub? urls keeping the main url connection alive

No comments:

Post a Comment