TimeToogo / tunshell

Remote shell into ephemeral environments 🐚 🦀
https://tunshell.com
MIT License
767 stars 56 forks source link

Fails on Windows Github CI with powershell #50

Open madhavajay opened 1 year ago

madhavajay commented 1 year ago

Hi, I have tried a task like this:

- name: tunshell
      run: |
        [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.SecurityProtocolType]::Tls12; &$([scriptblock]::Create((New-Object System.Net.WebClient).DownloadString('https://lets.tunshell.com/init.ps1'))) xxxxx au.relay.tunshell.com
      shell: powershell

And I also tried shell: pwsh but they both give the following error on my side or the web browser version.

[2022-08-03T04:11:54Z ERROR client] Error occurred: shell server returned an error

    Caused by:
        expected value at line 1 column 1

Any ideas why?

madhavajay commented 1 year ago

Also, looks like the python version is wrong for windows:

'Windows': {
        'x86_64': 'x86_64-pc-windows-msvc',
        'AMD64': 'x86_64-pc-windows-msvc', # correct python platform string
        'i686': 'i686-pc-windows-msvc',
      },

But then it also looks like these binaries are missing: https://artifacts.tunshell.com/client-x86_64-pc-windows-msvc # no file here

I guess it should be .exe? https://artifacts.tunshell.com/client-x86_64-pc-windows-msvc.exe

failing CD: https://github.com/TimeToogo/tunshell/runs/7251580122?check_suite_focus=true

Once I do that though I still get the issue above. Is it because the client libraries are out of sync?

Hrm that might be it, however when I use windows powershell on both sides it just hangs.

Screen Shot 2022-08-03 at 3 07 52 pm
TimeToogo commented 1 year ago

Hi @madhavajay,

Thanks for the detailed issue. Honestly I didn't put much time into windows support for tunshell so I don't believe that it is going to be an easy solve and may require updates to how the shell pty is handled on windows. I don't have time to look at this right now so cannot say when this will be fixed.

Also would welcome any PR's which improve platform support :)

NyaMisty commented 1 year ago

It seems that the problem is happening on the connection client side (i.e. L side)

With x86_64-pc-windows-msvc.exe as T If we use x86_64-pc-windows-msvc.exe as L, everything works If we use other client (like x86_64-unknown-linux-musl or browser wasm), it fails.

L side logs:

[2023-03-11T15:32:37Z INFO  tunshell_client::server::ring_tls_stream] Connecting to relay server over TCP
[2023-03-11T15:32:37Z DEBUG rustls::client::hs] No cached session for DNSNameRef("relay.tunshell.com")
[2023-03-11T15:32:37Z DEBUG rustls::client::hs] Not resuming any session
[2023-03-11T15:32:38Z DEBUG rustls::client::hs] Using ciphersuite TLS13_CHACHA20_POLY1305_SHA256
[2023-03-11T15:32:38Z DEBUG rustls::client::tls13] Not resuming
[2023-03-11T15:32:38Z DEBUG rustls::client::tls13] TLS1.3 encrypted extensions: [ServerNameAck]
[2023-03-11T15:32:38Z DEBUG rustls::client::hs] ALPN protocol is None
[2023-03-11T15:32:38Z DEBUG rustls::client::tls13] Server cert is [Certificate(b"..............")]
[2023-03-11T15:32:38Z DEBUG tunshell_shared::message_stream] sent message: Key(KeyPayload { key: "9X9zpVoq4D1yhz1f79CRPq" })
[2023-03-11T15:32:38Z DEBUG tunshell_shared::message_stream] message_stream: poll_next
[2023-03-11T15:32:38Z DEBUG tunshell_shared::message_stream] message_stream: poll_next
[2023-03-11T15:32:38Z DEBUG rustls::client::tls13] Ticket saved
[2023-03-11T15:32:38Z DEBUG tunshell_shared::message_stream] message_stream: poll_next
[2023-03-11T15:32:38Z DEBUG tunshell_shared::message_stream] Received message KeyAccepted
Waiting for peer to join...
[2023-03-11T15:32:38Z DEBUG tunshell_shared::message_stream] message_stream: poll_next
[2023-03-11T15:32:38Z DEBUG tunshell_shared::message_stream] Received message PeerJoined(PeerJoinedPayload { peer_key: "r9leVdRK2sPAsx4y33eYhX", peer_ip_address: "111.192.246.145", session_nonce: "nG6feJsrsi8HJ61hklldZc" })
111.192.246.145 joined the session
Negotiating connection...
[2023-03-11T15:32:38Z DEBUG tunshell_shared::message_stream] message_stream: poll_next
[2023-03-11T15:32:38Z DEBUG tunshell_shared::message_stream] Received message BindForDirectConnect
Attempting direct connection to 111.192.246.145
[2023-03-11T15:32:38Z DEBUG tunshell_client::client] binding ports for direct connection
[2023-03-11T15:32:38Z DEBUG tunshell_client::client] direct connection ports: PortBindings { udp_port: Some(49269), tcp_port: Some(52827) }
[2023-03-11T15:32:38Z DEBUG tunshell_shared::message_stream] sent message: DirectConnectBound(PortBindings { udp_port: Some(49269), tcp_port: Some(52827) })
[2023-03-11T15:32:38Z DEBUG tunshell_shared::message_stream] message_stream: poll_next
[2023-03-11T15:32:43Z DEBUG tunshell_shared::message_stream] message_stream: poll_next
[2023-03-11T15:32:43Z DEBUG tunshell_shared::message_stream] Received message AttemptDirectConnect(PortBindings { udp_port: Some(57144), tcp_port: Some(57472) })
[2023-03-11T15:32:43Z INFO  tunshell_client::p2p::tcp] Attempting to connect to 111.192.246.145 via TCP
[2023-03-11T15:32:43Z DEBUG tunshell_client::p2p::udp::state] connection state initialised to NEW
[2023-03-11T15:32:43Z DEBUG tunshell_client::p2p::udp::state] connection state set to SENT_HELLO
[2023-03-11T15:32:46Z DEBUG tunshell_shared::message_stream] sent message: DirectConnectFailed
[2023-03-11T15:32:46Z DEBUG tunshell_shared::message_stream] message_stream: poll_next
[2023-03-11T15:32:46Z DEBUG tunshell_shared::message_stream] message_stream: poll_next
[2023-03-11T15:32:46Z DEBUG tunshell_shared::message_stream] Received message StartRelayMode
Falling back to relayed connection
[2023-03-11T15:32:46Z INFO  tunshell_client::shell::client] connecting to shell server
[2023-03-11T15:32:46Z INFO  tunshell_client::shell::client] shell client attempting to authenticate
[2023-03-11T15:32:46Z DEBUG tunshell_client::stream::aes_stream] sending 25 bytes
[2023-03-11T15:32:46Z DEBUG tunshell_client::stream::crypto::ring] encrypted 25 bytes
[2023-03-11T15:32:46Z DEBUG tunshell_client::stream::aes_stream] encrypted into 41 bytes
[2023-03-11T15:32:46Z DEBUG tunshell_shared::message_stream] Sending message: EncryptedMessage { nonce: [242, 1, 10, 175, 2, 12, 56, 58, 227, 121, 54, 160], ciphertext: [0, 85, 185, 165, 170, 34, 182, 27, 7, 234, 77, 110, 233, 163, 51, 36, 175, 253, 255, 64, 150, 147, 163, 85, 217, 154, 122, 241, 60, 43, 69, 255, 164, 121, 169, 142, 222, 196, 215, 134, 30] }
[2023-03-11T15:32:46Z DEBUG tunshell_shared::message_stream] Sending message: Relay(RelayPayload { data: [0, 0, 56, 12, 242, 1, 10, 175, 2, 12, 56, 58, 227, 121, 54, 160, 0, 41, 0, 85, 185, 165, 170, 34, 182, 27, 7, 234, 77, 110, 233, 163, 51, 36, 175, 253, 255, 64, 150, 147, 163, 85, 217, 154, 122, 241, 60, 43, 69, 255, 164, 121, 169, 142, 222, 196, 215, 134, 30] })
[2023-03-11T15:32:46Z DEBUG tunshell_client::stream::aes_stream] flushing aes stream
[2023-03-11T15:32:46Z DEBUG tunshell_shared::message_stream] sent message: Key("0000000000000000000000")
[2023-03-11T15:32:46Z DEBUG tunshell_client::shell::client] sent shell key to peer
[2023-03-11T15:32:46Z DEBUG tunshell_shared::message_stream] message_stream: poll_next
[2023-03-11T15:32:46Z DEBUG tunshell_client::stream::aes_stream] reading from aes stream
[2023-03-11T15:32:46Z DEBUG tunshell_shared::message_stream] message_stream: poll_next
[2023-03-11T15:32:46Z DEBUG tunshell_client::stream::relay_stream] poll_read: poll_next underlying message stream
[2023-03-11T15:32:46Z DEBUG tunshell_shared::message_stream] message_stream: poll_next
[2023-03-11T15:32:46Z DEBUG tunshell_client::stream::relay_stream] poll_read: read result: Pending
[2023-03-11T15:32:47Z DEBUG tunshell_shared::message_stream] message_stream: poll_next
[2023-03-11T15:32:47Z DEBUG tunshell_client::stream::aes_stream] reading from aes stream
[2023-03-11T15:32:47Z DEBUG tunshell_shared::message_stream] message_stream: poll_next
[2023-03-11T15:32:47Z DEBUG tunshell_client::stream::relay_stream] poll_read: poll_next underlying message stream
[2023-03-11T15:32:47Z DEBUG tunshell_shared::message_stream] message_stream: poll_next
[2023-03-11T15:32:47Z DEBUG tunshell_shared::message_stream] Received message Relay(RelayPayload { data: [0, 0, 34, 12, 29, 29, 13, 12, 60, 128, 35, 215, 253, 151, 35, 234, 0, 19, 245, 117, 206, 164, 184, 184, 31, 59, 121, 146, 64, 234, 196, 226, 68, 33, 22, 35, 83] })
[2023-03-11T15:32:47Z DEBUG tunshell_client::stream::relay_stream] poll_read: read result: Ready(Some(Ok(Relay(RelayPayload { data: [0, 0, 34, 12, 29, 29, 13, 12, 60, 128, 35, 215, 253, 151, 35, 234, 0, 19, 245, 117, 206, 164, 184, 184, 31, 59, 121, 146, 64, 234, 196, 226, 68, 33, 22, 35, 83] }))))
[2023-03-11T15:32:47Z DEBUG tunshell_client::stream::relay_stream] poll_read: relay message returned RelayPayload { data: [0, 0, 34, 12, 29, 29, 13, 12, 60, 128, 35, 215, 253, 151, 35, 234, 0, 19, 245, 117, 206, 164, 184, 184, 31, 59, 121, 146, 64, 234, 196, 226, 68, 33, 22, 35, 83] }
[2023-03-11T15:32:47Z DEBUG tunshell_client::stream::relay_stream] poll_read: returned 37 bytes
[2023-03-11T15:32:47Z DEBUG tunshell_shared::message_stream] Received message EncryptedMessage { nonce: [29, 29, 13, 12, 60, 128, 35, 215, 253, 151, 35, 234], ciphertext: [245, 117, 206, 164, 184, 184, 31, 59, 121, 146, 64, 234, 196, 226, 68, 33, 22, 35, 83] }
[2023-03-11T15:32:47Z DEBUG tunshell_client::stream::crypto::ring] decrypted 3 bytes
[2023-03-11T15:32:47Z DEBUG tunshell_shared::message_stream] Received message KeyAccepted
[2023-03-11T15:32:47Z INFO  tunshell_client::shell::client] shell client authenticated
[2023-03-11T15:32:47Z DEBUG tunshell_client::shell::client] requesting shell from server
[2023-03-11T15:32:47Z DEBUG tunshell_client::stream::aes_stream] sending 83 bytes
[2023-03-11T15:32:47Z DEBUG tunshell_client::stream::crypto::ring] encrypted 83 bytes
[2023-03-11T15:32:47Z DEBUG tunshell_client::stream::aes_stream] encrypted into 99 bytes
[2023-03-11T15:32:47Z DEBUG tunshell_shared::message_stream] Sending message: EncryptedMessage { nonce: [206, 148, 86, 165, 238, 165, 11, 94, 104, 139, 99, 156], ciphertext: [48, 35, 96, 166, 133, 188, 95, 144, 164, 119, 212, 253, 216, 99, 6, 32, 182, 110, 4, 70, 243, 29, 29, 155, 242, 79, 229, 82, 240, 146, 37, 93, 171, 100, 53, 118, 119, 40, 68, 150, 96, 12, 24, 47, 223, 168, 209, 101, 43, 50, 189, 218, 229, 165, 13, 91, 100, 176, 28, 187, 125, 4, 208, 126, 217, 54, 186, 7, 82, 138, 214, 68, 82, 124, 10, 41, 233, 127, 231, 3, 216, 210, 104, 102, 80, 220, 97, 124, 34, 213, 159, 140, 48, 175, 153, 73, 105, 172, 14] }
[2023-03-11T15:32:47Z DEBUG tunshell_shared::message_stream] Sending message: Relay(RelayPayload { data: [0, 0, 114, 12, 206, 148, 86, 165, 238, 165, 11, 94, 104, 139, 99, 156, 0, 99, 48, 35, 96, 166, 133, 188, 95, 144, 164, 119, 212, 253, 216, 99, 6, 32, 182, 110, 4, 70, 243, 29, 29, 155, 242, 79, 229, 82, 240, 146, 37, 93, 171, 100, 53, 118, 119, 40, 68, 150, 96, 12, 24, 47, 223, 168, 209, 101, 43, 50, 189, 218, 229, 165, 13, 91, 100, 176, 28, 187, 125, 4, 208, 126, 217, 54, 186, 7, 82, 138, 214, 68, 82, 124, 10, 41, 233, 127, 231, 3, 216, 210, 104, 102, 80, 220, 97, 124, 34, 213, 159, 140, 48, 175, 153, 73, 105, 172, 14] })
[2023-03-11T15:32:47Z DEBUG tunshell_client::stream::aes_stream] flushing aes stream
[2023-03-11T15:32:47Z DEBUG tunshell_shared::message_stream] sent message: StartShell(StartShellPayload { term: "xterm-256color", color: true, size: WindowSize(120, 30), remote_pty_support: true })
[2023-03-11T15:32:47Z INFO  tunshell_client::shell::client] shell requested
[2023-03-11T15:32:47Z DEBUG tunshell_shared::message_stream] message_stream: poll_next
[2023-03-11T15:32:47Z DEBUG tunshell_client::stream::aes_stream] reading from aes stream
[2023-03-11T15:32:47Z DEBUG tunshell_shared::message_stream] message_stream: poll_next
[2023-03-11T15:32:47Z DEBUG tunshell_client::stream::relay_stream] poll_read: poll_next underlying message stream
[2023-03-11T15:32:47Z DEBUG tunshell_shared::message_stream] message_stream: poll_next
[2023-03-11T15:32:47Z DEBUG tunshell_client::stream::relay_stream] poll_read: read result: Pending
[2023-03-11T15:32:49Z DEBUG tunshell_shared::message_stream] message_stream: poll_next
[2023-03-11T15:32:49Z DEBUG tunshell_client::stream::aes_stream] reading from aes stream
[2023-03-11T15:32:49Z DEBUG tunshell_shared::message_stream] message_stream: poll_next
[2023-03-11T15:32:49Z DEBUG tunshell_client::stream::relay_stream] poll_read: poll_next underlying message stream
[2023-03-11T15:32:49Z DEBUG tunshell_shared::message_stream] message_stream: poll_next
[2023-03-11T15:32:49Z DEBUG tunshell_shared::message_stream] Received message Relay(RelayPayload { data: [0, 1, 234, 12, 102, 176, 244, 138, 56, 22, 227, 116, 78, 77, 60, 80, 1, 219, 146, 249, 212, 50, 32, 56, 128, 22, 189, 174, 246, 111, 101, 60, 173, 12, 23, 181, 227, 180, 31, 40, 40, 148, 115, 106, 47, 163, 196, 119, 62, 187, 182, 136, 71, 197, 198, 117, 171, 82, 150, 154, 156, 118, 228, 66, 41, 108, 145, 119, 62, 252, 35, 14, 57, 139, 148, 113, 181, 11, 100, 225, 15, 62, 129, 195, 169, 120, 13, 110, 122, 74, 238, 193, 219, 182, 170, 240, 213, 148, 189, 86, 5, 241, 100, 114, 26, 24, 67, 50, 58, 73, 134, 15, 174, 109, 0, 181, 66, 245, 172, 117, 222, 122, 224, 249, 214, 6, 14, 137, 250, 3, 42, 199, 251, 35, 243, 248, 33, 97, 129, 165, 132, 13, 119, 232, 164, 61, 22, 115, 248, 72, 101, 255, 176, 45, 10, 225, 204, 130, 29, 34, 101, 215, 130, 86, 191, 249, 47, 26, 90, 25, 75, 2, 180, 207, 246, 212, 7, 147, 21, 22, 151, 37, 168, 105, 106, 176, 62, 102, 70, 0, 32, 242, 184, 56, 194, 82, 223, 209, 23, 21, 89, 131, 95, 20, 168, 54, 202, 158, 160, 125, 152, 71, 11, 115, 174, 189, 86, 237, 0, 121, 40, 210, 228, 55, 21, 92, 158, 159, 232, 163, 255, 68, 38, 250, 15, 47, 38, 59, 166, 150, 155, 21, 77, 84, 33, 94, 95, 159, 226, 202, 70, 148, 170, 143, 10, 3, 58, 133, 93, 120, 117, 46, 137, 123, 186, 24, 210, 78, 202, 191, 158, 89, 43, 105, 21, 143, 143, 157, 83, 216, 116, 152, 201, 200, 104, 108, 111, 7, 143, 206, 135, 233, 248, 192, 235, 100, 148, 207, 123, 40, 222, 15, 122, 39, 222, 12, 130, 182, 123, 110, 246, 123, 133, 5, 79, 226, 97, 26, 34, 86, 218, 174, 120, 140, 94, 12, 95, 153, 39, 36, 170, 18, 38, 41, 0, 146, 124, 250, 44, 93, 22, 98, 61, 156, 57, 247, 219, 15, 4, 100, 150, 212, 21, 254, 32, 82, 105, 157, 84, 244, 142, 65, 193, 166, 254, 87, 12, 89, 128, 11, 15, 156, 84, 235, 199, 163, 237, 30, 130, 73, 6, 75, 29, 14, 170, 46, 167, 107, 198, 147, 103, 142, 32, 42, 15, 241, 139, 25, 32, 94, 61, 112, 214, 27, 250, 229, 235, 215, 32, 50, 198, 240, 37, 127, 236, 125, 228, 66, 228, 200, 70, 136, 161, 252, 119, 167, 109, 131, 164, 78, 201, 21, 95, 56, 154, 169, 128, 3, 15, 70, 238, 233, 254, 193, 4, 231, 207, 15, 100, 115, 188, 218, 193, 42, 132, 182, 37, 188, 74, 36, 112, 20, 136, 79, 225, 185, 50, 188, 111, 158, 63, 126, 158, 175, 221, 227, 183, 78, 251, 171, 210, 217, 62, 184, 234, 159, 87, 25, 174, 91, 63, 139, 91] })
[2023-03-11T15:32:49Z DEBUG tunshell_client::stream::relay_stream] poll_read: read result: Ready(Some(Ok(Relay(RelayPayload { data: [0, 1, 234, 12, 102, 176, 244, 138, 56, 22, 227, 116, 78, 77, 60, 80, 1, 219, 146, 249, 212, 50, 32, 56, 128, 22, 189, 174, 246, 111, 101, 60, 173, 12, 23, 181, 227, 180, 31, 40, 40, 148, 115, 106, 47, 163, 196, 119, 62, 187, 182, 136, 71, 197, 198, 117, 171, 82, 150, 154, 156, 118, 228, 66, 41, 108, 145, 119, 62, 252, 35, 14, 57, 139, 148, 113, 181, 11, 100, 225, 15, 62, 129, 195, 169, 120, 13, 110, 122, 74, 238, 193, 219, 182, 170, 240, 213, 148, 189, 86, 5, 241, 100, 114, 26, 24, 67, 50, 58, 73, 134, 15, 174, 109, 0, 181, 66, 245, 172, 117, 222, 122, 224, 249, 214, 6, 14, 137, 250, 3, 42, 199, 251, 35, 243, 248, 33, 97, 129, 165, 132, 13, 119, 232, 164, 61, 22, 115, 248, 72, 101, 255, 176, 45, 10, 225, 204, 130, 29, 34, 101, 215, 130, 86, 191, 249, 47, 26, 90, 25, 75, 2, 180, 207, 246, 212, 7, 147, 21, 22, 151, 37, 168, 105, 106, 176, 62, 102, 70, 0, 32, 242, 184, 56, 194, 82, 223, 209, 23, 21, 89, 131, 95, 20, 168, 54, 202, 158, 160, 125, 152, 71, 11, 115, 174, 189, 86, 237, 0, 121, 40, 210, 228, 55, 21, 92, 158, 159, 232, 163, 255, 68, 38, 250, 15, 47, 38, 59, 166, 150, 155, 21, 77, 84, 33, 94, 95, 159, 226, 202, 70, 148, 170, 143, 10, 3, 58, 133, 93, 120, 117, 46, 137, 123, 186, 24, 210, 78, 202, 191, 158, 89, 43, 105, 21, 143, 143, 157, 83, 216, 116, 152, 201, 200, 104, 108, 111, 7, 143, 206, 135, 233, 248, 192, 235, 100, 148, 207, 123, 40, 222, 15, 122, 39, 222, 12, 130, 182, 123, 110, 246, 123, 133, 5, 79, 226, 97, 26, 34, 86, 218, 174, 120, 140, 94, 12, 95, 153, 39, 36, 170, 18, 38, 41, 0, 146, 124, 250, 44, 93, 22, 98, 61, 156, 57, 247, 219, 15, 4, 100, 150, 212, 21, 254, 32, 82, 105, 157, 84, 244, 142, 65, 193, 166, 254, 87, 12, 89, 128, 11, 15, 156, 84, 235, 199, 163, 237, 30, 130, 73, 6, 75, 29, 14, 170, 46, 167, 107, 198, 147, 103, 142, 32, 42, 15, 241, 139, 25, 32, 94, 61, 112, 214, 27, 250, 229, 235, 215, 32, 50, 198, 240, 37, 127, 236, 125, 228, 66, 228, 200, 70, 136, 161, 252, 119, 167, 109, 131, 164, 78, 201, 21, 95, 56, 154, 169, 128, 3, 15, 70, 238, 233, 254, 193, 4, 231, 207, 15, 100, 115, 188, 218, 193, 42, 132, 182, 37, 188, 74, 36, 112, 20, 136, 79, 225, 185, 50, 188, 111, 158, 63, 126, 158, 175, 221, 227, 183, 78, 251, 171, 210, 217, 62, 184, 234, 159, 87, 25, 174, 91, 63, 139, 91] }))))
[2023-03-11T15:32:49Z DEBUG tunshell_client::stream::relay_stream] poll_read: relay message returned RelayPayload { data: [0, 1, 234, 12, 102, 176, 244, 138, 56, 22, 227, 116, 78, 77, 60, 80, 1, 219, 146, 249, 212, 50, 32, 56, 128, 22, 189, 174, 246, 111, 101, 60, 173, 12, 23, 181, 227, 180, 31, 40, 40, 148, 115, 106, 47, 163, 196, 119, 62, 187, 182, 136, 71, 197, 198, 117, 171, 82, 150, 154, 156, 118, 228, 66, 41, 108, 145, 119, 62, 252, 35, 14, 57, 139, 148, 113, 181, 11, 100, 225, 15, 62, 129, 195, 169, 120, 13, 110, 122, 74, 238, 193, 219, 182, 170, 240, 213, 148, 189, 86, 5, 241, 100, 114, 26, 24, 67, 50, 58, 73, 134, 15, 174, 109, 0, 181, 66, 245, 172, 117, 222, 122, 224, 249, 214, 6, 14, 137, 250, 3, 42, 199, 251, 35, 243, 248, 33, 97, 129, 165, 132, 13, 119, 232, 164, 61, 22, 115, 248, 72, 101, 255, 176, 45, 10, 225, 204, 130, 29, 34, 101, 215, 130, 86, 191, 249, 47, 26, 90, 25, 75, 2, 180, 207, 246, 212, 7, 147, 21, 22, 151, 37, 168, 105, 106, 176, 62, 102, 70, 0, 32, 242, 184, 56, 194, 82, 223, 209, 23, 21, 89, 131, 95, 20, 168, 54, 202, 158, 160, 125, 152, 71, 11, 115, 174, 189, 86, 237, 0, 121, 40, 210, 228, 55, 21, 92, 158, 159, 232, 163, 255, 68, 38, 250, 15, 47, 38, 59, 166, 150, 155, 21, 77, 84, 33, 94, 95, 159, 226, 202, 70, 148, 170, 143, 10, 3, 58, 133, 93, 120, 117, 46, 137, 123, 186, 24, 210, 78, 202, 191, 158, 89, 43, 105, 21, 143, 143, 157, 83, 216, 116, 152, 201, 200, 104, 108, 111, 7, 143, 206, 135, 233, 248, 192, 235, 100, 148, 207, 123, 40, 222, 15, 122, 39, 222, 12, 130, 182, 123, 110, 246, 123, 133, 5, 79, 226, 97, 26, 34, 86, 218, 174, 120, 140, 94, 12, 95, 153, 39, 36, 170, 18, 38, 41, 0, 146, 124, 250, 44, 93, 22, 98, 61, 156, 57, 247, 219, 15, 4, 100, 150, 212, 21, 254, 32, 82, 105, 157, 84, 244, 142, 65, 193, 166, 254, 87, 12, 89, 128, 11, 15, 156, 84, 235, 199, 163, 237, 30, 130, 73, 6, 75, 29, 14, 170, 46, 167, 107, 198, 147, 103, 142, 32, 42, 15, 241, 139, 25, 32, 94, 61, 112, 214, 27, 250, 229, 235, 215, 32, 50, 198, 240, 37, 127, 236, 125, 228, 66, 228, 200, 70, 136, 161, 252, 119, 167, 109, 131, 164, 78, 201, 21, 95, 56, 154, 169, 128, 3, 15, 70, 238, 233, 254, 193, 4, 231, 207, 15, 100, 115, 188, 218, 193, 42, 132, 182, 37, 188, 74, 36, 112, 20, 136, 79, 225, 185, 50, 188, 111, 158, 63, 126, 158, 175, 221, 227, 183, 78, 251, 171, 210, 217, 62, 184, 234, 159, 87, 25, 174, 91, 63, 139, 91] }
[2023-03-11T15:32:49Z DEBUG tunshell_client::stream::relay_stream] poll_read: returned 493 bytes
[2023-03-11T15:32:49Z DEBUG tunshell_shared::message_stream] Received message EncryptedMessage { nonce: [102, 176, 244, 138, 56, 22, 227, 116, 78, 77, 60, 80], ciphertext: [146, 249, 212, 50, 32, 56, 128, 22, 189, 174, 246, 111, 101, 60, 173, 12, 23, 181, 227, 180, 31, 40, 40, 148, 115, 106, 47, 163, 196, 119, 62, 187, 182, 136, 71, 197, 198, 117, 171, 82, 150, 154, 156, 118, 228, 66, 41, 108, 145, 119, 62, 252, 35, 14, 57, 139, 148, 113, 181, 11, 100, 225, 15, 62, 129, 195, 169, 120, 13, 110, 122, 74, 238, 193, 219, 182, 170, 240, 213, 148, 189, 86, 5, 241, 100, 114, 26, 24, 67, 50, 58, 73, 134, 15, 174, 109, 0, 181, 66, 245, 172, 117, 222, 122, 224, 249, 214, 6, 14, 137, 250, 3, 42, 199, 251, 35, 243, 248, 33, 97, 129, 165, 132, 13, 119, 232, 164, 61, 22, 115, 248, 72, 101, 255, 176, 45, 10, 225, 204, 130, 29, 34, 101, 215, 130, 86, 191, 249, 47, 26, 90, 25, 75, 2, 180, 207, 246, 212, 7, 147, 21, 22, 151, 37, 168, 105, 106, 176, 62, 102, 70, 0, 32, 242, 184, 56, 194, 82, 223, 209, 23, 21, 89, 131, 95, 20, 168, 54, 202, 158, 160, 125, 152, 71, 11, 115, 174, 189, 86, 237, 0, 121, 40, 210, 228, 55, 21, 92, 158, 159, 232, 163, 255, 68, 38, 250, 15, 47, 38, 59, 166, 150, 155, 21, 77, 84, 33, 94, 95, 159, 226, 202, 70, 148, 170, 143, 10, 3, 58, 133, 93, 120, 117, 46, 137, 123, 186, 24, 210, 78, 202, 191, 158, 89, 43, 105, 21, 143, 143, 157, 83, 216, 116, 152, 201, 200, 104, 108, 111, 7, 143, 206, 135, 233, 248, 192, 235, 100, 148, 207, 123, 40, 222, 15, 122, 39, 222, 12, 130, 182, 123, 110, 246, 123, 133, 5, 79, 226, 97, 26, 34, 86, 218, 174, 120, 140, 94, 12, 95, 153, 39, 36, 170, 18, 38, 41, 0, 146, 124, 250, 44, 93, 22, 98, 61, 156, 57, 247, 219, 15, 4, 100, 150, 212, 21, 254, 32, 82, 105, 157, 84, 244, 142, 65, 193, 166, 254, 87, 12, 89, 128, 11, 15, 156, 84, 235, 199, 163, 237, 30, 130, 73, 6, 75, 29, 14, 170, 46, 167, 107, 198, 147, 103, 142, 32, 42, 15, 241, 139, 25, 32, 94, 61, 112, 214, 27, 250, 229, 235, 215, 32, 50, 198, 240, 37, 127, 236, 125, 228, 66, 228, 200, 70, 136, 161, 252, 119, 167, 109, 131, 164, 78, 201, 21, 95, 56, 154, 169, 128, 3, 15, 70, 238, 233, 254, 193, 4, 231, 207, 15, 100, 115, 188, 218, 193, 42, 132, 182, 37, 188, 74, 36, 112, 20, 136, 79, 225, 185, 50, 188, 111, 158, 63, 126, 158, 175, 221, 227, 183, 78, 251, 171, 210, 217, 62, 184, 234, 159, 87, 25, 174, 91, 63, 139, 91] }
[2023-03-11T15:32:49Z DEBUG tunshell_client::stream::crypto::ring] decrypted 459 bytes
[2023-03-11T15:32:49Z DEBUG tunshell_shared::message_stream] Error while deserialised received message expected value at line 1 column 1
[2023-03-11T15:32:49Z DEBUG tunshell_client::shell::client::shell] disabling tty raw mode
[2023-03-11T15:32:49Z ERROR client] Error occurred: shell server returned an error

    Caused by:
        expected value at line 1 column 1

With debugger, I'm able to decrypt a sample last message:

b'\x03\x01\xd4\x1b[?25l\x1b[2J\x1b[m\x1b[HMicrosoft Windows [\xe7\x89\x88\xe6\x9c\xac 10.0.25309.1000]\r\n(c) Microsoft Corporation\xe3\x80\x82\xe4\xbf\x9d\xe7\x95\x99\xe6\x89\x80\xe6\x9c\x89\xe6\x9d\x83\xe5\x88\xa9\xe3\x80\x82\r\n\x1b]0;C:\\WINDOWS\\system32\\cmd.exe - "C:\\Program Files (x86)\\clink\\1.2.46.69fc92\\clink.bat"  inject --autorun --profile ~\\clink\x07\x1b[?25h\r\nClink v1.2.46.69fc92\r\nCopyright (c) 2012-2018 Martin Ridgers\r\nPortions Copyright (c) 2020-2021 Christopher Antos\r\nhttps://github.com/chrisant996/clink\r\n\x1b]0;\xe7\xae\xa1\xe7\x90\x86\xe5\x91\x98: C:\\WINDOWS\\system32\\cmd.exe\x07\r\n\x1b[?25lC:\\Users\\Misty>\x1b[?25h'

Easy to guess it's type_id 3, 0x1d4 length, message, which I believe it's the old Stdout message of ShellServerMessage, which is updated to RemotePtyData message in https://github.com/TimeToogo/tunshell/commit/aa7a3b705fdac7d499c593354a6ae05837d1a76f

So how on earth you only updated the Linux client but not the windows one? I strongly suggest you to release the client binary in Github Release for a better version tracking

EDIT: I know why you deployed half of them: Because you wrote GitHub Actions script in an unsafe & inconsistent way.. In the last run (https://github.com/TimeToogo/tunshell/actions/runs/2636147833), only some of Linux target succeeded, and half of other targets are failing. You should compile all of them using matrix jobs, uploading to Github Actions artifact in each matrix job, then using a final job to download artifacts & upload them to S3 altogether.

TimeToogo commented 1 year ago

Thanks for the detailed bug report @NyaMisty, feel free to submit a PR with the fixes!

REDJOB1 commented 1 year ago

project new titel : DEAD