Core Shell taking AGES to upload or download a 4byte file

Hello,

When I try to upload or download a file (even a simple 4 byte text file), it literally takes minutes to do so. It gets stuck on the "Preparing files to upload/download" step for most of the time, but eventually, it is able to do the UL/DL.

This definitely seems like a bug, but I am putting it in support in case there is something I am doing wrong on my end. This is connected to a local server on my LAN. When I use SCP to do the same operation, it happens instantly, which is why I believe it is a bug of some sort.

I have quick downloads/uploads enabled, but I have tried both with this enabled and disabled and the result is the same.

Screen Recording showing the issue.

Thank you so much for recording video. Could you please send me a copy of desensitized log? To get the log, please follow steps:

  1. Enable logging.
  2. Do UL/DL again, and wait task to be finished.
  3. Then select "Reveal Logs" from item's context menu.

Kindly Regards,

Yang

Sure! Here is the log:

2023/05/07 09:11:27:301  ––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––
2023/05/07 09:11:27:301  Equivalent Command: sftp -v -o ServerAliveCountMax=3 -o ServerAliveInterval=15 -o ExitOnForwardFailure=yes -o ControlMaster=no -P 22 kali@192.168.40.7:
2023/05/07 09:11:27:303  Using Core Helper 6.6 (r3386)
2023/05/07 09:11:27:341  OpenSSH_8.8p1, OpenSSL 1.1.1l  24 Aug 2021
2023/05/07 09:11:27:342  debug1: Reading configuration data /Users/piercecohen/.ssh/config
2023/05/07 09:11:27:342  debug1: /Users/piercecohen/.ssh/config line 1: Applying options for *
2023/05/07 09:11:27:342  debug1: Connecting to 192.168.40.7 [192.168.40.7] port 22.
2023/05/07 09:11:27:353  debug1: Connection established.
2023/05/07 09:11:27:353  debug1: identity file /Users/piercecohen/.ssh/id_rsa type -1
2023/05/07 09:11:27:353  debug1: identity file /Users/piercecohen/.ssh/id_rsa-cert type -1
2023/05/07 09:11:27:353  debug1: identity file /Users/piercecohen/.ssh/id_dsa type -1
2023/05/07 09:11:27:353  debug1: identity file /Users/piercecohen/.ssh/id_dsa-cert type -1
2023/05/07 09:11:27:353  debug1: identity file /Users/piercecohen/.ssh/id_ecdsa type -1
2023/05/07 09:11:27:353  debug1: identity file /Users/piercecohen/.ssh/id_ecdsa-cert type -1
2023/05/07 09:11:27:353  debug1: identity file /Users/piercecohen/.ssh/id_ecdsa_sk type -1
2023/05/07 09:11:27:353  debug1: identity file /Users/piercecohen/.ssh/id_ecdsa_sk-cert type -1
2023/05/07 09:11:27:353  debug1: identity file /Users/piercecohen/.ssh/id_ed25519 type 3
2023/05/07 09:11:27:353  debug1: identity file /Users/piercecohen/.ssh/id_ed25519-cert type -1
2023/05/07 09:11:27:353  debug1: identity file /Users/piercecohen/.ssh/id_ed25519_sk type -1
2023/05/07 09:11:27:353  debug1: identity file /Users/piercecohen/.ssh/id_ed25519_sk-cert type -1
2023/05/07 09:11:27:353  debug1: identity file /Users/piercecohen/.ssh/id_xmss type -1
2023/05/07 09:11:27:353  debug1: identity file /Users/piercecohen/.ssh/id_xmss-cert type -1
2023/05/07 09:11:27:353  debug1: Local version string SSH-2.0-OpenSSH_8.8
2023/05/07 09:11:27:398  debug1: Remote protocol version 2.0, remote software version OpenSSH_9.2p1 Debian-2
2023/05/07 09:11:27:399  debug1: compat_banner: match: OpenSSH_9.2p1 Debian-2 pat OpenSSH* compat 0x04000000
2023/05/07 09:11:27:399  debug1: Authenticating to 192.168.40.7:22 as 'kali'
2023/05/07 09:11:27:399  debug1: load_hostkeys: fopen /Users/piercecohen/.ssh/known_hosts2: No such file or directory
2023/05/07 09:11:27:399  debug1: load_hostkeys: fopen /etc/ssh/ssh_known_hosts: No such file or directory
2023/05/07 09:11:27:399  debug1: load_hostkeys: fopen /etc/ssh/ssh_known_hosts2: No such file or directory
2023/05/07 09:11:27:399  debug1: SSH2_MSG_KEXINIT sent
2023/05/07 09:11:27:404  debug1: SSH2_MSG_KEXINIT received
2023/05/07 09:11:27:404  debug1: kex: algorithm: curve25519-sha256
2023/05/07 09:11:27:404  debug1: kex: host key algorithm: ssh-ed25519
2023/05/07 09:11:27:404  debug1: kex: server->client cipher: chacha20-poly1305@openssh.com MAC: <implicit> compression: none
2023/05/07 09:11:27:404  debug1: kex: client->server cipher: chacha20-poly1305@openssh.com MAC: <implicit> compression: none
2023/05/07 09:11:27:405  debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
2023/05/07 09:11:27:427  debug1: SSH2_MSG_KEX_ECDH_REPLY received
2023/05/07 09:11:27:427  debug1: Server host key: ssh-ed25519 SHA256:BmCuLEL+Z4o/iHVX00oBtgQa8uNFAkhLNg09JcGjmGI
2023/05/07 09:11:27:427  debug1: load_hostkeys: fopen /Users/piercecohen/.ssh/known_hosts2: No such file or directory
2023/05/07 09:11:27:427  debug1: load_hostkeys: fopen /etc/ssh/ssh_known_hosts: No such file or directory
2023/05/07 09:11:27:427  debug1: load_hostkeys: fopen /etc/ssh/ssh_known_hosts2: No such file or directory
2023/05/07 09:11:27:427  debug1: Host '192.168.40.7' is known and matches the ED25519 host key.
2023/05/07 09:11:27:427  debug1: Found key in /Users/piercecohen/.ssh/known_hosts:36
2023/05/07 09:11:27:432  debug1: rekey out after 134217728 blocks
2023/05/07 09:11:27:432  debug1: SSH2_MSG_NEWKEYS sent
2023/05/07 09:11:27:432  debug1: expecting SSH2_MSG_NEWKEYS
2023/05/07 09:11:27:432  debug1: SSH2_MSG_NEWKEYS received
2023/05/07 09:11:27:432  debug1: rekey in after 134217728 blocks
2023/05/07 09:11:27:452  debug1: Will attempt key: /Users/piercecohen/.ssh/id_ed25519 ED25519 SHA256:xRUruM4xxLp1YHzguqu+X2VMwKh8d4O1pvl9+GTa1bA agent
2023/05/07 09:11:27:452  debug1: Will attempt key: Linode ED25519 SHA256:cD+jXmMHesRO/FONczi5TInoFOdDrHT6AiASdw3jLz8 agent
2023/05/07 09:11:27:452  debug1: Will attempt key: RPI SSH Keys (AdGuard+Kali Server) ED25519 SHA256:OWnG6N0ync9gbLMbbUl3lru/XT6s+x4OLQ8C/5IWALU agent
2023/05/07 09:11:27:452  debug1: Will attempt key: /Users/piercecohen/.ssh/id_rsa 
2023/05/07 09:11:27:452  debug1: Will attempt key: /Users/piercecohen/.ssh/id_dsa 
2023/05/07 09:11:27:452  debug1: Will attempt key: /Users/piercecohen/.ssh/id_ecdsa 
2023/05/07 09:11:27:452  debug1: Will attempt key: /Users/piercecohen/.ssh/id_ecdsa_sk 
2023/05/07 09:11:27:452  debug1: Will attempt key: /Users/piercecohen/.ssh/id_ed25519_sk 
2023/05/07 09:11:27:452  debug1: Will attempt key: /Users/piercecohen/.ssh/id_xmss 
2023/05/07 09:11:27:452  debug1: SSH2_MSG_EXT_INFO received
2023/05/07 09:11:27:453  debug1: kex_input_ext_info: server-sig-algs=<ssh-ed25519,sk-ssh-ed25519@openssh.com,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,sk-ecdsa-sha2-nistp256@openssh.com,webauthn-sk-ecdsa-sha2-nistp256@openssh.com,ssh-dss,ssh-rsa,rsa-sha2-256,rsa-sha2-512>
2023/05/07 09:11:27:453  debug1: kex_input_ext_info: publickey-hostbound@openssh.com (unrecognised)
2023/05/07 09:11:27:459  debug1: SSH2_MSG_SERVICE_ACCEPT received
2023/05/07 09:11:27:469  debug1: Authentications that can continue: publickey,password
2023/05/07 09:11:27:469  debug1: Next authentication method: publickey
2023/05/07 09:11:27:469  debug1: Offering public key: /Users/piercecohen/.ssh/id_ed25519 ED25519 SHA256:xRUruM4xxLp1YHzguqu+X2VMwKh8d4O1pvl9+GTa1bA agent
2023/05/07 09:11:27:478  debug1: Authentications that can continue: publickey,password
2023/05/07 09:11:27:478  debug1: Offering public key: Linode ED25519 SHA256:cD+jXmMHesRO/FONczi5TInoFOdDrHT6AiASdw3jLz8 agent
2023/05/07 09:11:27:488  debug1: Authentications that can continue: publickey,password
2023/05/07 09:11:27:488  debug1: Offering public key: RPI SSH Keys (AdGuard+Kali Server) ED25519 SHA256:OWnG6N0ync9gbLMbbUl3lru/XT6s+x4OLQ8C/5IWALU agent
2023/05/07 09:11:27:492  debug1: Server accepts key: RPI SSH Keys (AdGuard+Kali Server) ED25519 SHA256:OWnG6N0ync9gbLMbbUl3lru/XT6s+x4OLQ8C/5IWALU agent
2023/05/07 09:12:27:444  sign_and_send_pubkey: signing failed for ED25519 "RPI SSH Keys (AdGuard+Kali Server)" from agent: communication with agent failed
2023/05/07 09:12:27:444  debug1: Trying private key: /Users/piercecohen/.ssh/id_rsa
2023/05/07 09:12:27:444  debug1: Trying private key: /Users/piercecohen/.ssh/id_dsa
2023/05/07 09:12:27:444  debug1: Trying private key: /Users/piercecohen/.ssh/id_ecdsa
2023/05/07 09:12:27:444  debug1: Trying private key: /Users/piercecohen/.ssh/id_ecdsa_sk
2023/05/07 09:12:27:444  debug1: Trying private key: /Users/piercecohen/.ssh/id_ed25519_sk
2023/05/07 09:12:27:445  debug1: Trying private key: /Users/piercecohen/.ssh/id_xmss
2023/05/07 09:12:27:445  debug1: Next authentication method: password
2023/05/07 09:12:27:445  debug1: read_passphrase: requested to askpass
2023/05/07 09:12:27:770  Authenticated to 192.168.40.7 ([192.168.40.7]:22) using "password".
2023/05/07 09:12:27:770  debug1: channel 0: new [client-session]
2023/05/07 09:12:27:771  debug1: Requesting no-more-sessions@openssh.com
2023/05/07 09:12:27:771  debug1: Entering interactive session.
2023/05/07 09:12:27:771  debug1: pledge: filesystem full
2023/05/07 09:12:27:832  debug1: client_input_global_request: rtype hostkeys-00@openssh.com want_reply 0
2023/05/07 09:12:27:833  debug1: client_input_hostkeys: searching /Users/piercecohen/.ssh/known_hosts for 192.168.40.7 / (none)
2023/05/07 09:12:27:836  debug1: client_input_hostkeys: searching /Users/piercecohen/.ssh/known_hosts2 for 192.168.40.7 / (none)
2023/05/07 09:12:27:836  debug1: client_input_hostkeys: hostkeys file /Users/piercecohen/.ssh/known_hosts2 does not exist
2023/05/07 09:12:27:836  debug1: client_input_hostkeys: host key found matching a different name/address, skipping UserKnownHostsFile update
2023/05/07 09:12:27:836  debug1: Remote: /home/kali/.ssh/authorized_keys:1: key options: agent-forwarding port-forwarding pty user-rc x11-forwarding
2023/05/07 09:12:27:836  debug1: Sending subsystem: sftp
2023/05/07 09:12:27:861  debug1: Using server download size 261120
2023/05/07 09:12:27:861  debug1: Using server upload size 261120
2023/05/07 09:12:27:861  Connected to 192.168.40.7.
2023/05/07 09:12:27:861  debug1: Server handle limit 1019; using 64
2023/05/07 09:12:27:877  Changing to: /home/kali/.
2023/05/07 09:12:27:877  sftp> put -R "/Users/piercecohen/OSCP/kali_server_shared/test.txt" "/home/kali"
2023/05/07 09:12:27:881  Uploading /Users/piercecohen/OSCP/kali_server_shared/test.txt to /home/kali/test.txt
2023/05/07 09:12:27:892  sftp> bye

Here is the problem, your private key in agent was rejected by remote for some reasons, but it succeeded afterward via password authentication.

Disable PubkeyAuthentication directive or set PreferredAuthentications to password,keyboard-interactive should fix the issue.

Feel free to let me know if you still could not get it work.

Kindly Regards,

Yang

That worked, thank you!

For others with this issue - I use 1Password SSH Agent for managing my SSH keys, which uses IdentityAgent or SSH_AUTH_SOCK to authenticate:

So, even though I had no keys in CoreShell, it seems like it will only trigger the agent for initial login authentication and not for file transfers.

Is there any way to work around this to make it use an agent for file transfers? Ideally, I would like it to trigger the prompt as in the screenshot above whenever I upload/download a file.

Could you please try run command in local shell:

sftp -vvv -o ServerAliveCountMax=3 -o ServerAliveInterval=15 -o ExitOnForwardFailure=yes -o ControlMaster=no -P 22 kali@192.168.40.7:

then send me a copy of desensitized terminal output? It would help me identified the problem.

Yang

Hi Yang,

Here is that log: sftp_coreshell.log

Thank you for your help with this.

Thank you again for the log. I found a similar issue reporting on a open source project:

This issue is caused by 1Password not responding to the agent request because it can't find a GUI app associated with the client, which is the OrbStack service/forwarder in this case. Our service is a background daemon, so I'm not sure if we can do much about this.

ssh-agent forwarding not working (with 1Password) · Issue #185 · orbstack/orbstack · GitHub

Core Shell's SFTP component also a background service, so I suspect that it may be rejected by 1Password. Could you please create a ticket for 1Password team?

I'll keep this ticket open until we find out the real cause.

Kindly Regards,

Yang