I've tried on and off for over a year now, but without any success.What I'm trying to do is simply make a script that will disconnect the router, wait about 12 seconds then reconnect.
$sPOST = 'STOP0=%C4%E4%BB%DF&sWebSessionnum=0&sWebSessionid=-0000000000'
$oHTTP = ObjCreate("winhttp.winhttprequest.5.1")
$oHTTP.Open("POST", "http://192.168.11.1/cgi-bin/cgi?req=frm&frm=info.html", False, "admin","password")
$oHTTP.SetRequestHeader("Content-Type", "application/x-www-form-urlencoded")
$oHTTP.Send($sPOST)
- Tried reading up on how to make AutoIt click a webpage button... but the guides were rather obtuse from my point of view, couldn't even get a basic script together.
- Tried using packets with TCPStartup>TCPConnect>TCPSend ... also didn't work, packet data was pulled from 2 sources, Wireshark and JDownloader. No difference, it didn't throw any errors, but didn't cut the connection either, so I'm without any ideas to where to go from here.
$packet1 = 'GET / HTTP/1.1'&@CRLF& _
'source: 192.168.11.2'&@CRLF& _
'Host: 192.168.11.1'&@CRLF& _
'user-agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:24.0) Gecko/20100101 Firefox/24.0'&@CRLF& _
'accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8'&@CRLF& _
'accept-language: en-US,en;q=0.5'&@CRLF& _
'accept-encoding: gzip, deflate'&@CRLF& _
'authorization: Basic YWRtaW46cGFzc3dvcmQ='&@CRLF& _
'credentials: admin:password'&@CRLF& _
'connection: keep-alive'&@CRLF& _
'if-modified-since: Tue, 30 Jul 2013 04:17:10 GMT'&@CRLF& _
'cache-control: max-age=0'&@CRLF&@CRLF
$packet2 = 'POST /cgi-bin/cgi?req=frm&frm=info.html HTTP/1.1'&@CRLF& _
'source: 192.168.11.2'&@CRLF& _
'Host: 192.168.11.1'&@CRLF& _
'user-agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:24.0) Gecko/20100101 Firefox/24.0'&@CRLF& _
'accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8'&@CRLF& _
'accept-language: en-US,en;q=0.5'&@CRLF& _
'accept-encoding: gzip, deflate'&@CRLF& _
'authorization: Basic YWRtaW46cGFzc3dvcmQ='&@CRLF& _
'credentials: admin:password'&@CRLF& _
'connection: keep-alive'&@CRLF& _
'content-type: application/x-www-form-urlencoded'&@CRLF& _
'content-length: 5'&@CRLF& _
'STOP0'&@CRLF&@CRLF
TCPStartup()
$socket = TCPConnect('192.168.11.1', 80)
$bytes = TCPSend($socket, $packet1)
$bytes = TCPSend($socket, $packet2)
TCPCloseSocket($socket)
TCPShutdown()