Ylianst / MeshCommander

MeshCommander is a Intel(R) Active Management Technology (Intel(R) AMT) remote management tool. It's feature rich and includes a built-in remote desktop viewer for Hardware-KVM, a Serial-over-LAN terminal, IDER-Redirection support and much more. MeshCommander is built on web technologies and runs on many plaforms. In addition to being available as a stand-alone tool, MeshCommander was built to be very space efficient to that it can be uploaded into Intel AMT flash space to have it served diretly from the Intel AMT web serve.
Apache License 2.0
334 stars 72 forks source link

Remote Desktop with the web app does not work with AMT 12.0.22.1310 #24

Closed nomis closed 4 years ago

nomis commented 4 years ago

With 11.8.70.3626 the WebSocket messages look like this:

-> 10:01:00:00:4b:56:4d:52
<- 11:00:00:00:01:00:0b:08:57:01:00:00:00

-> 13:00:00:00:01:00:00:00:00
<- 14:00:00:00:01:00:00:00:00

-> 40:00:00:00:00:00:00:00
<- 41:00:00:00:00:00:00:00:52:46:42:20:30:30:34:2e:30:30:30:0a

With 12.0.22.1310, this happens (it fails to skip authentication):

-> 10:01:00:00:4b:56:4d:52
<- 11:00:00:00:01:00:0c:00:57:01:00:00:00

-> 13:00:00:00:01:00:00:00:00
<- 14:02:00:00:01:00:00:00:00

If I connect directly with MeshCommander, it authenticates and then the RFB session works:

-> 10:01:00:00:4b:56:4d:52
<- 11:00:00:00:01:00:0c:00:57:01:00:00:00

-> 13:00:00:00:00:00:00:00:00
<- 14:00:00:00:00:01:00:00:00:04

-> 13:00:00:00:04:20:00:00:00:*
<- 14:01:00:00:04:4e:00:00:00:*

-> 13:00:00:00:04:b3:00:00:00:*
<- 14:00:00:00:04:00:00:00:00

-> 40:00:00:00:00:00:00:00
<- 41:00:00:00:00:00:00:00:52:46:42:20:30:30:33:2e:30:30:38:0a

I'm using MeshCommander v0.8.8.

nomis commented 4 years ago

Based on the SDK code the 0x02 response indicates that the session is busy, but it's not. The /ws-redirection URL just always fails like this.

nomis commented 4 years ago

Using authentication type 02 on the WebSocket connection instead of 00 works:

-> 13:00:00:00:02:00:00:00:00
<- 14:00:00:00:02:00:00:00:00
nomis commented 4 years ago

However... while that fixes the problem for HTTP it doesn't even get that far on HTTPS.

When using HTTPS, AMT 12 immediately closes the established WebSocket connection:

GET /ws-redirection HTTP/1.1
Host: 127.0.0.1:8080
Upgrade: websocket
Connection: Upgrade
Sec-WebSocket-Key: sckiHh3nixFfu1uMLOZBpw==
Sec-WebSocket-Version: 13
Sec-WebSocket-Extensions: permessage-deflate; client_max_window_bits
Authorization: Digest username="*", realm="Digest:*", nonce="*", uri="/ws-redirection", response="*", qop="auth", nc=00000002, cnonce="*"
User-Agent: Python/3.7 websockets/8.1

HTTP/1.1 101 Switching protocols
Content-Type: text/html
Server: Intel(R) Active Management Technology 12.0.22.1310
Upgrade: websocket
Connection: Upgrade
Content-Length: 0
Sec-Websocket-Accept: YEGdOE4KoaWIqxQfyAXg80y1RQo=

The same process works on AMT 11:

GET /ws-redirection HTTP/1.1
Host: 127.0.0.1:8080
Upgrade: websocket
Connection: Upgrade
Sec-WebSocket-Key: ovp/qFOn9OCbwSSkBjOu+Q==
Sec-WebSocket-Version: 13
Sec-WebSocket-Extensions: permessage-deflate; client_max_window_bits
Authorization: Digest username="*", realm="Digest:*", nonce="*", uri="/ws-redirection", response="*", qop="auth", nc=00000002, cnonce="*"
User-Agent: Python/3.7 websockets/8.1

HTTP/1.1 101 Switching protocols
Content-Type: text/html
Server: Intel(R) Active Management Technology 11.8.70.3626
Upgrade: websocket
Connection: Upgrade
Content-Length: 0
Sec-Websocket-Accept: 8+TNFG9qxMHNP0sEaCod18AogB4=

..V].WF\.W.....
........W.......U...U...U....   .........................A.......RFB 004.000
..b4._a.....

(127.0.0.1:8080 is a stunnel proxy to :16993)

Ylianst commented 4 years ago

Wow, it's crazy you found this and the fix for it. I just published a "new" version of MeshCommander v0.8.8 with your pull request included. You need to uninstall/downloads/reinstall v0.8.8 to get the update.

nomis commented 4 years ago

Do you have a solution to /ws-redirection not working at all over HTTPS on AMT 12? I've opened a support case with Intel (04749316) but MeshCommander is the only user of this URL. The feature gets a couple of mentions in the SDK documentation without providing the URL.

nomis commented 2 years ago

Intel will have fixed this in an unspecified later version of AMT but refused to fix this in AMT 12.