Just send HTTP POST to:
http://192.168.1.2/cgi-bin/ConfigManApp.com (192.168.1.2 - phone address)
with header for basic auth:
'Authorization: Basic KJDSGHj54KLDSJ3='
and content:
PAGEID=7&CONFIG_DATA=RESETFACTORY - for reset
PAGEID=7&CONFIG_DATA=REBOOT - for reboot
Python example
#> python
import urllib2
post = urllib2.Request('http://192.168.1.2/cgi-bin/ConfigManApp.com?Id=7')
post.add_header('Authorization','Basic KJDSGHj54KLDSJ3=')
response = urllib2.urlopen(post, 'PAGEID=7&CONFIG_DATA=RESETFACTORY')
response.msg.lower() == 'ok'
response.code == 200
response.read()
>>> '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">\n<html><body><script type="text/javascript">if(parent && parent.onloadIFrame)\n parent.onloadIFrame("Talking");\nelse\n window.location.replace(\'/cgi-bin/ConfigManApp.com?Id=13\');\n</script></body></html>'
>>> '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">\n<html><body><script type="text/javascript">if(parent && parent.onloadIFrame)\n parent.onloadIFrame("RESETFACTORY");\nelse\n window.location.replace(\'/cgi-bin/ConfigManApp.com?Id=13\');\n</script></body></html>'
No comments:
Post a Comment