Python Forum
Paramiko Server -- Exception (server): Error reading SSH protocol banner
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Paramiko Server -- Exception (server): Error reading SSH protocol banner
#1
For the code snippet below , I am unable to trap error (as enumerated as tracebac)
hostF = "keys/id_rsa"
HOST_KEY = paramiko.RSAKey(filename=hostF)
transport = paramiko.Transport(client)
transport.add_server_key(HOST_KEY)
transport.local_version = "SSH-2.0-OpenSSH_7.6p1 Ubuntu-4ubuntu0.3"  # this is the banner that goes out
server = libServer.mySSH()
try: 
   [b] transport.start_server(server=server)  # Trouble here for DOS attack. Error below arent captured[/b][color=#E74C3C][/color]
    channel = transport.accept(20)
    channel.send("Got Channel .. will try SSH connection \r\n")
except Exception as e:
    print (e)
transport.start_server(server=server) --> this triggers a traceback as enumertaed below when a plain socket connection attempt is made on paramiko SSH server listening port. This can be a raw potential DOS attack.
Error:
Exception (server): Error reading SSH protocol banner Traceback (most recent call last): File "/home/uzi/.local/lib/python3.8/site-packages/paramiko/transport.py", line 2292, in _check_banner buf = self.packetizer.readline(timeout) File "/home/uzi/.local/lib/python3.8/site-packages/paramiko/packet.py", line 374, in readline buf += self._read_timeout(timeout) File "/home/uzi/.local/lib/python3.8/site-packages/paramiko/packet.py", line 603, in _read_timeout raise EOFError() EOFError During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/home/uzi/.local/lib/python3.8/site-packages/paramiko/transport.py", line 2113, in run self._check_banner() File "/home/uzi/.local/lib/python3.8/site-packages/paramiko/transport.py", line 2296, in _check_banner raise SSHException( paramiko.ssh_exception.SSHException: Error reading SSH protocol banner
Gribouillis write Jul-23-2023, 07:25 PM:
Please post all code, output and errors (it it's entirety) between their respective tags. Refer to BBCode help topic on how to post. Use the "Preview Post" button to make sure the code is presented as you expect before hitting the "Post Reply/Thread" button.
Reply


Messages In This Thread
Paramiko Server -- Exception (server): Error reading SSH protocol banner - by ujlain - Jul-23-2023, 04:42 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Authentication server (console) biscoito 0 791 Oct-20-2023, 11:44 PM
Last Post: biscoito
  Socks 5 Proxy Server For UDP ASSOCIATE ankit 1 3,056 Jun-13-2023, 10:48 AM
Last Post: margaretmossman
  Handshake ( Server Hello ) JohnnyCoffee 2 1,612 May-27-2023, 03:23 PM
Last Post: JohnnyCoffee
  TCP server syntax error wabbit 2 1,593 May-18-2023, 06:40 AM
Last Post: buran
  Server Http and Https JohnnyCoffee 2 2,044 Feb-10-2023, 12:56 AM
Last Post: Skaperen
  multi-threaded tcp server-newbie gary 15 3,927 Nov-19-2022, 03:45 PM
Last Post: dreamer
  Asyncio | Websockets - general problem starting the server dreamer 5 3,369 Oct-26-2022, 11:55 AM
Last Post: dreamer
  Client/Server proper finalizing transfer wolfman5874 1 1,521 Jul-04-2022, 07:35 PM
Last Post: wolfman5874
  Socket server problem H84Gabor 0 1,299 Jun-21-2022, 12:14 AM
Last Post: H84Gabor
Bug Problem connecting TLS client written in C++ and Twisted server gpropf 0 1,436 Jun-12-2022, 05:57 PM
Last Post: gpropf

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020