thinkst / opencanary

Modular and decentralised honeypot
http://opencanary.org
BSD 3-Clause "New" or "Revised" License
2.21k stars 353 forks source link

[BUG] v0.91 Seems to have problem with Telnet (Tested on Ubuntu 20.04 and 22.04) #320

Closed backlash-code closed 8 months ago

backlash-code commented 8 months ago

Opencanary looks to install and run, but no telnet service appears int the log, telnet port listens according to netstat but is not working when trying to connect. No response.

Error points to the twisted/conch/telnet.py module.

Expected maybe the newer python version to be the problem, but apparently not the issue.

Ubuntu 22.04 same result with 0.91 Ubuntu 20.04 same result with 0.91.

After a few attempts, installed a v0.90 on 20.04 - everything looks to be working normally, I assume 22.04 will work too with v0.90 - but haven't tested.

Nenodema commented 8 months ago

I encounter the same issue on Debian, I have some logs from the Docker container.

      File "/usr/local/lib/python3.10/site-packages/twisted/conch/telnet.py", line 902, in connectionMade
    builtins.TypeError: AuthenticatingTelnetProtocol.__init__() missing 1 required positional argument: 'portal'
2023-10-30T08:25:48+0000 [CanaryTelnetTransport,0,10.32.22.10] Unhandled Error
      File "/opencanary/opencanary/modules/telnet.py", line 16, in dataReceived
        TelnetTransport.dataReceived(self, data)
      File "/usr/local/lib/python3.10/site-packages/twisted/conch/telnet.py", line 556, in dataReceived
      File "/usr/local/lib/python3.10/site-packages/twisted/conch/telnet.py", line 627, in commandReceived
      File "/usr/local/lib/python3.10/site-packages/twisted/conch/telnet.py", line 644, in telnet_WILL
      File "/usr/local/lib/python3.10/site-packages/twisted/conch/telnet.py", line 648, in will_no_false
      File "/usr/local/lib/python3.10/site-packages/twisted/conch/telnet.py", line 926, in enableRemote
thinkst-francois commented 8 months ago

Hi @backlash-code I quickly checked I can confirm it is broken with version 0.91. The issue is twisted expecting a parameter portal in the init for AuthenticatingTelnetProtocol

Nenodema commented 8 months ago

Thanks @thinkst-francois I just tested your fix successfully.