Quería conectarme a SSH usando Tryhackme, pero luché por hacerlo, así que lo dejaré como un memorando.
Si alguien sufre el mismo problema, creo que esto podría ser útil.




Esperar ssh2_msg_kex_dh_gex_group deja de procesar
Para verificar el evento, intenté sshing con "-vvv".
┌── (HackLab㉿hackLab)-[~] └─ $ ssh user@10.10.237.121 -vvv 130 ⨯ OpenSSH_8.7p1 Debian-4, OpenSSL 1.1.1M 14 de diciembre de 2021 DEBUG1: Datos de configuración de lectura /home/hacklab/.ssh/Config Debug1: /home/hacklab 1: Aplicación de opciones para * Debug1: Lectura de datos de configuración/etc/ssh/ssh_config debug1:/etc/ssh/ssh_config line 19: include /etc/ssh/ssh_config.d/*.conf no coincide con los archivos debug1:/etc/ssh/ssh_config line 21: aplicando opciones para * debug2: shede_canonicalize: hosting: hostMeNeM 10.10.237.121 IS DIRECCIÓN DEBUG3: Usuario expandido conocidoHostSfile '~/.ssh/conocido_hosts' -> '/home/hacklab/.ssh/nownelk_hosts' Debug3: usuarios expandidos conocidos conocidos '~/.ssh/know_hosts2' -> '/home/hacklab/ssh/HOWN_HOWS2' DEBUN SSH_CONNECT_DIRECT: Entrando debug1: conectarse a 10.10.237.121 [10.10.237.121] puerto 22. Debug3: set_sock_tos: set socket 3 ip_tos 0x10 debug1: conexión establecida. debug1: archivo de identidad /home/hacklab/.ssh/id_rsa type -1 debug1: identidad file /home/hacklab/.ssh/id_rsa-cert type -1 debug1: identidad archivo /home/hacklab/.ssh/id_dsa type -1 DEBUG1: Identity File /home/hacklab/.ssh/idsa-cert type -type -1-1DoDuG1: archivo de identidad /home/hacklab/.ssh/id_ecdsa type -1 debug1: identidad file /home/hacklab/.ssh/id_ecdsa-cert type -1 debug1: identity file /home/hacklab/.ssh/id_ecdsa_sk type -1 Debug1: identity file /home/hacklab/.ssh/id Debug1: archivo de identidad /home/hacklab/.ssh/id_ed25519 Tipo -1 debug1: archivo de identidad /home/hacklab/.ssh/id_ed25519-cert type -1 debug1: archivo de identidad /home/hacklab/.ssh/id_ed25519_sk type -1 debug1: archivo de identidad /home/hacklab/.ssh/id_ed25519_sk-cert type -1 debug1: identidad file /home/hacklab/.ssh/id_xmss type -1 debug1: identity file /home/hacklab/.ssh/id_xmss-cert type -1 debug1: shing ssh-2.0-openssh_8.7.7p1 DEBUG1 protocol version 2.0, remote software version OpenSSH_5.5p1 Debian-6+squeeze5 debug1: compat_banner: match: OpenSSH_5.5p1 Debian-6+squeeze5 pat OpenSSH_5* compat 0x0c000002 debug2: fd 3 setting O_NONBLOCK debug1: Authenticating to 10.10.237.121:22 as 'user' debug1: load_hostkeys: fopen /home/hacklab/.ssh/ conocido_hosts: no dicho archivo o directorio debug1: load_hostkeys: fopen /home/hacklab/.ssh/ knowling_hosts2: no hay dicho archivo o directorio debug1: load_hostkeys: fopen /home/hacklab/ssh/ whonk_hosts2: low_hostkey debug1: load_hostkeys: fopen/etc/ssh/ssh_konk_hosts: no dicho archivo o directorio debug1: load_hostkeys: fopen/etc/ssh/ssh_konk_hosts2: no hay tal archivo o directorio debug3: orden_hostkeyalgs: no hay algoritms coincidentes; Acepte la depuración original3: Enviar paquete: Tipo 20 DEBUG1: SSH2_MSG_KEXINIT ENSEPUG3: Recibir Packet: Tipo 20 DEBUG1: SSH2_MSG_KEXINIT RECIBADO DEBUG2: CLIENTE LOCAL Propuesta de Kexinit Debug2: Algoritmos KEX: Curve25519 Sha256, Curve25519 Sha256@libssh.org, ECDH-Sha2-Nistp256, ECDH-SHA2-NISTP384, ECDH-SHA2-NISTP521, Diffie-Hellman Roup-Exchange-Sha256, Diffie-Hellman-Group16-Sha512, Diffie-Hellman-Group18-Sha512, Diffie-Hellman-Group14-Sha256, Ext-Info-C Debug2: Algoritmos de clave de host: ssh-ed25519-cert-v01@openssh.com, ECDSA-SHA2-NISTP256-CERT-V01@openssh.com, ECDSA-SHA2-NISTP384-CERT-V01@openssh.com, ECDSA-SHA2 -nistp521-cert-v01@openssh.com, sk-ssh-ed25519-cert-v01@openssh.com, sk-eCDSA-sha2-nistp256-cert-v01@openssh.com, rsa-sha2-512-c ert-v01@openssh.com, rsa-sha2-256-cert-v01@openssh.com, ssh-rsa-cert-v01@openssh.com, ssh-ed25519, ECDSA-SHA2-NISTP256, ECDSA-SHA2 -nistp384, ECDSA-SHA2-NISTP521, SK-SSH-ED25519@openssh.com, SK-ECDSA-SHA2-NISTP256@openssh.com, RSA-SHA2-512, RSA-SHA2-256, SSH-RSA DEBUG2: CIPHERS CTO: CHACHA20 POLY1305@openssh.com, AES128-CTR, AES192-CTR, AES256-CTR, AES128-GCM@Openssh.com, AES256-GCM@Openssh.com DEBUG2: CIPHERS STOC: Chacha20-Poly1305@openssh.com, AES128-CTR, AES192-CTR, AES256-CTR, AES128-GCM@Openssh.com, AES256-GCM@OpenSSH.com Debug2: CTO MacS: UMAC-64-ETM@openssh.com, umac-128-etm@openssh.com, hmac-sha2-256-etm@openssh.com, hmac-sha2-512-etm@openssh.c om, hmac-sha1-etm@openssh.com, umac-64@openssh.com, umac-128@openssh.com, HMAC-SHA2-256, HMAC-SHA2-512, HMAC-SHA1 Debug2: Macs STOC: UMAC-64-ETM@openssh.com, umac-128-etm@openssh.com, hmac-sha2-256-etm@openssh.com, hmac-sha2-512-etm@openssh.c om, hmac-sha1-etm@openssh.com, umac-64@openssh.com, umac-128@openssh.com, HMAC-SHA2-256, HMAC-SHA2-512, HMAC-SHA1 Debug2: compresión CTO: Ninguno, zlib@openssh.com, Zlib Debug2: Compression Stoc: None, Zlib@openssh.com, Zlib Debug2: Idiomas CTO: Debug2: Idiomas STOC: Debug2: First_KEX_Follows 0 Debug2: Reservado 0 Debug2: Peer Server Kexinit Proposal Debug22: KEX: KEX: KEX: KEX: KEX: KEX: Diffie-Hellman-Group-Exchange-Sha256, Diffie-Hellman-Group-Exchange-Sha1, Diffie-Hellman-Group14-Sha1, Diffie-Hellman-Group1-Sha1 Debug2: Algoritmos clave de anfitriones: SSH-RSA, SSH-DDSS DEBUG2: CIPHERS CTOS: AES128-CTR, AES192-CTR, AES256-CTR, ARCFOUR256, ARCFOUR128, AES128-CBC, 3DES-CBC, BLOWFISH-CBC, CAST128-CBC, AES192-CBC, AES256-CBC, Arcfour, Rijndael-CBC@lysator. CIPHERS STOC: AES128-CTR, AES192-CTR, AES256-CTR, ARCFOUR256, ARCFOUR128, AES128-CBC, 3DES-CBC, BLOWFISP-CBC, CAST128-CBC, AES192-CBC, AES256-CBC, Arcfour, Rijndael-CBC@lySator. CTO: HMAC-MD5, HMAC-SHA1, UMAC-64@openssh.com, HMAC-RIPEMD160, HMAC-RIPEMD160@openssh.com, HMAC-SHA1-96, HMAC-MD5-96 DEBUG2: MacS STOC: HMAC-MD5, HMAC-SHA1, UMAC-64@openssh.com, HMAC-RIPEMD160, HMAC-RIPEMD160@openssh.com, HMAC-SHA1-96, HMAC-MD5-96 DEBUG2: CTOS de compresión: Ninguno, Zlib@OpenSsh.com: Compresion STOC: Ninguno, ZLEB@Compresion CTO: DEBUG2: Idiomas STOC: Debug2: First_KEX_Follows 0 Debug2: Reservado 0 Debug1: KEX: Algorithm: Diffie-Hellman-Group-Exchange-Sha256 Debug1: KEX: Algoritmo clave de Host Host: umacs: SSH-RSA DEBUG1: KEX: Server-> Client Cipher: AES128-CTR MACTR MAC: umacs: umacsh.comsh.comsh.com compression: none debug1: kex: client->server cipher: aes128-ctr MAC: umac-64@openssh.com compression: none debug3: send packet: type 34 debug1: SSH2_MSG_KEX_DH_GEX_REQUEST(2048<3072<8192) sent debug1: expecting SSH2_MSG_KEX_DH_GEX_GROUP Connection cerrado por 10.10.237.121 Puerto 22
Cuando revisé, descubrí que se detuvo con "Esperando SSH2_MSG_KEX_DH_GEX_GROUP". . .
Después de investigar un poco, me encontré con algunos artículos que decían que los valores de MTU eran pobres.
Primero, cuando verifiqué el valor de MTU, descubrí que ETH0 es 1500.
┌── (Hacklab㉿hackLab)-[~] └─ $ Ifconfig 127 ⨯ eth0: flags = 4163<UP,BROADCAST,RUNNING,MULTICAST> MTU 1500 ...
Por ahora, estableceré ETH0 a 1454.
┌── (Hacklab㉿hacklab)-[~] └─ $ sudo ifconfig et0 mtu 1454
¡Intenté SSH nuevamente en este estado y funcionó! !
┌── (Hacklab㉿hackLab)-[~] └─ $ ssh user@10.10.237.121 user@10.10.237.121's contraseña: Linux Debian 2.6.32-5-amd64 #1 SMP 13 de mayo 16:34:35 UTC 2014 X86_64 Los programas incluidos con el System Gnu/Linux de Debian son libres/Sytware Linux están liberados. Los términos de distribución exactos para cada programa se describen en los archivos individuales en/usr/share/doc/*/copyright. Debian GNU/Linux no tiene absolutamente ninguna garantía, en la medida permitida por la ley aplicable. Último inicio de sesión: miércoles 5 de abril 11:11:52 2023 de IP-10-18-110-90.eu-west-1.compute.internal User@Debian: ~ $
resumen
El servidor se estaba ejecutando, pero me asusté cuando me cerré "la conexión", pero pude conectarme de alguna manera, así que me alegro.
Referencias y sitios
@IT: https://atmarkit.itmedia.co.jp/flinux/rensai/Linuxtips/418chkmtu.html