Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

connection problem when setting the simple mode of proxy #1825

Open
luoluoluoxue opened this issue Mar 2, 2023 · 1 comment
Open

connection problem when setting the simple mode of proxy #1825

luoluoluoxue opened this issue Mar 2, 2023 · 1 comment

Comments

@luoluoluoxue
Copy link

luoluoluoxue commented Mar 2, 2023

In this whole process, I try to run the Cowrie with the simple mode of proxy.

The bug is about connection problem.When I run Cowrie and there is a new connection from the attacker is generated. The following bug will occur.

For Telnet connection:

2023-03-02T09:07:55.551347Z [cowrie.telnet.factory.HoneyPotTelnetFactory] New connection: 118.79.97.184:44725 (128.110.219.52:23) [session: 3a0e409e70e9]
2023-03-02T09:07:55.551846Z [cowrie.telnet_proxy.client_transport.BackendTelnetFactory#info] Starting factory <cowrie.telnet_proxy.client_transport.BackendTelnetFactory object at 0x7f093b3ede50>
2023-03-02T09:07:55.552450Z [Uninitialized] Connection to honeypot backend refused: Connection was refused by other side: 111: Connection refused.. Disconnecting frontend...
2023-03-02T09:07:55.552646Z [cowrie.telnet_proxy.client_transport.BackendTelnetFactory#info] Stopping factory <cowrie.telnet_proxy.client_transport.BackendTelnetFactory object at 0x7f093b3ede50>
2023-03-02T09:07:55.552983Z [FrontendTelnetTransport,310,118.79.97.184] Closing TTY Log: var/lib/cowrie/tty/e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 after 0 seconds

For SSH connection:

2023-03-02T11:58:30.082252Z [cowrie.ssh.factory.CowrieSSHFactory] New connection: 67.205.140.79:38642 (128.110.219.52:22) [session: 9b655eedf9ef]
2023-03-02T11:58:30.083029Z [cowrie.ssh_proxy.client_transport.BackendSSHFactory#info] Starting factory <cowrie.ssh_proxy.client_transport.BackendSSHFactory object at 0x7f945fa7f670>
2023-03-02T11:58:30.083891Z [Uninitialized] Connection to honeypot backend refused: Connection was refused by other side: 111: Connection refused.. Disconnecting frontend...
2023-03-02T11:58:30.084117Z [cowrie.ssh_proxy.client_transport.BackendSSHFactory#info] Stopping factory <cowrie.ssh_proxy.client_transport.BackendSSHFactory object at 0x7f945fa7f670>
2023-03-02T11:58:30.084344Z [cowrie.ssh_proxy.server_transport.FrontendSSHTransport#info] connection lost
2023-03-02T11:58:30.084494Z [FrontendSSHTransport,25,67.205.140.79] Unhandled Error
        Traceback (most recent call last):
          File "/home/cowrie/cowrie/cowrie-env/lib/python3.8/site-packages/twisted/application/app.py", line 304, in runReactorWithLogging
            reactor.run()
          File "/home/cowrie/cowrie/cowrie-env/lib/python3.8/site-packages/twisted/internet/base.py", line 1318, in run
            self.mainLoop()
          File "/home/cowrie/cowrie/cowrie-env/lib/python3.8/site-packages/twisted/internet/base.py", line 1331, in mainLoop
            reactorBaseSelf.doIteration(t)
          File "/home/cowrie/cowrie/cowrie-env/lib/python3.8/site-packages/twisted/internet/epollreactor.py", line 244, in doPoll
            log.callWithLogger(selectable, _drdw, selectable, fd, event)
      --- <exception caught here> ---
          File "/home/cowrie/cowrie/cowrie-env/lib/python3.8/site-packages/twisted/python/log.py", line 96, in callWithLogger
            return callWithContext({"system": lp}, func, *args, **kw)
          File "/home/cowrie/cowrie/cowrie-env/lib/python3.8/site-packages/twisted/python/log.py", line 80, in callWithContext
            return context.call({ILogContext: newCtx}, func, *args, **kw)
          File "/home/cowrie/cowrie/cowrie-env/lib/python3.8/site-packages/twisted/python/context.py", line 117, in callWithContext
            return self.currentContext().callWithContext(ctx, func, *args, **kw)
          File "/home/cowrie/cowrie/cowrie-env/lib/python3.8/site-packages/twisted/python/context.py", line 82, in callWithContext
            return func(*args, **kw)
          File "/home/cowrie/cowrie/cowrie-env/lib/python3.8/site-packages/twisted/internet/posixbase.py", line 500, in _doReadOrWrite
            self._disconnectSelectable(selectable, why, inRead)
          File "/home/cowrie/cowrie/cowrie-env/lib/python3.8/site-packages/twisted/internet/posixbase.py", line 104, in _disconnectSelectable
            selectable.connectionLost(f)
          File "/home/cowrie/cowrie/cowrie-env/lib/python3.8/site-packages/twisted/internet/tcp.py", line 326, in connectionLost
            protocol.connectionLost(reason)
          File "/home/cowrie/cowrie/src/cowrie/ssh_proxy/server_transport.py", line 368, in connectionLost
            if self.sshParse.client and self.sshParse.client.transport:
        builtins.AttributeError: 'SSH' object has no attribute 'client'

Could you help me to solve it? Thanks!!!

@jiangyin97
Copy link

jiangyin97 commented Dec 7, 2023

I have encountered the same situation. Have you solved it? @luoluoluoxue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants