LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Router Web Page Authentication

See attachment, I've added all the header elements and removed the space as you directed.  The POST body returned is still:

 

<HEAD><TITLE>501 Not Implemented</TITLE></HEAD>
<BODY><H1>501 Not Implemented</H1>
The requested method is not recognized by this server.
</BODY>

 

I'll go back and look at the tamperdata again.  Thanks for the input.

0 Kudos
Message 11 of 15
(1,086 Views)

I see I was missing part of the POST, the full entry should be:

 

POST http://192.168.0.1/ajax_request?Endpassword=admin Load Flags[LOAD_BYPASS_CACHE  LOAD_BACKGROUND  ] Content Size[-1] Mime Type[text/html]

 

0 Kudos
Message 12 of 15
(1,082 Views)

In order to figure out what LabVIEW is submitting differently I used Wireshark to monitor a login attempt with my LabVIEW VI and again with Firefox, I removed the CR and NL to make it easier to compare.

 

Firefox login:

 

POST /ajax_request?Endpassword=admin HTTP/1.1
Host: 192.168.0.1
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.13) Gecko/20101203 Firefox/3.6.13
Accept: */*
Accept-Language: en-us,en;q=0.5
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 115
Connection: keep-alive
X-Requested-With: XMLHttpRequest
Referer: http://192.168.0.1/
Cookie: lct_remember_me=; mac_remember=; lct_psw=; checked=
Pragma: no-cache
Cache-Control: no-cache
Content-Length: 0

HTTP/1.0 200 OK
Content-type: text/html
Date: Tue, 17 Mar 2009 15:32:24 GMT
Connection: close

 

LabVIEW VI login:

 

POST / HTTP/1.1
Host: 192.168.0.1
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.13) Gecko/20101203 Firefox/3.6.13
Accept: */*
Accept-Language: en-us,en;q=0.5
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 115
Connection: keep-alive
X-Requested-With: XMLHttpRequest
Referer: http://192.168.0.1/
Cookie: ddddd=; dddddddd=; lct_remember_me=; mac_remember=; lct_psw=; checked=
Pragma: no-cache
Cache-Control: no-cache
Content-Length: 0
Content-Type: application/x-www-form-urlencoded

POST /ajax_request?Endpassword=admin

 

 

 I see a couple things wrong:

1. The LabVIEW POST VI is submitting the POST command AFTER the header in the LabVIEW POST, but Firefox submits it before.

2. The LabVIEW POST VI is adding "Content-Type: application/x-www-form-urlencoded" to the header, I didn't put that in there.

0 Kudos
Message 13 of 15
(1,072 Views)

 

LabVIEW VI login:

 

POST / HTTP/1.1
Host: 192.168.0.1
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.13) Gecko/20101203 Firefox/3.6.13
Accept: */*
Accept-Language: en-us,en;q=0.5
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 115
Connection: keep-alive
X-Requested-With: XMLHttpRequest
Referer: http://192.168.0.1/
Cookie: ddddd=; dddddddd=; lct_remember_me=; mac_remember=; lct_psw=; checked=
Pragma: no-cache
Cache-Control: no-cache
Content-Length: 0
Content-Type: application/x-www-form-urlencoded

POST /ajax_request?Endpassword=admin

 

 

 I see a couple things wrong:

1. The LabVIEW POST VI is submitting the POST command AFTER the header in the LabVIEW POST, but Firefox submits it before.

2. The LabVIEW POST VI is adding "Content-Type: application/x-www-form-urlencoded" to the header, I didn't put that in there.


 

I'm not sure if the "Content-Type" header entry is affecting things or not, but I'm a bit suspicious of the beginning of the header. It's putting in

 

POST / HTTP/1.1

 I think that's where the POST should be, but it's putting it at the end. What happens if you put the POST function before the headers in the VI?

 

Caleb Harris

National Instruments | http://www.ni.com/support
0 Kudos
Message 14 of 15
(1,060 Views)

Then I get the LabVIEW default header information.

 

 

POST / HTTP/1.1
User-Agent: National Instruments LabVIEW
Host: 192.168.0.1
Accept: */*
Content-Length: 36
Content-Type: application/x-www-form-urlencoded

POST /ajax_request?Endpassword=adminHTTP/1.0 501 Not Implemented
Content-type: text/html
Date: Tue, 17 Mar 2009 17:18:19 GMT
Connection: close

 

The POST VI's block diagram is locked so I can't open it to see how these things are being appended, or to change the way they're being appended.

 

POST / HTTP/1.1

User-Agent: National Instruments LabVIEW

Host: 192.168.0.1

Accept: */*

Content-Length: 36

Content-Type: application/x-www-form-urlencoded



POST /ajax_request?Endpassword=adminHTTP/1.0 501 Not Implemented
Content-type: text/html

Date: Tue, 17 Mar 2009 17:18:19 GMT

Connection: close
0 Kudos
Message 15 of 15
(1,055 Views)