qeeqbox / honeypots

30 different honeypots in one package! (dhcp, dns, elastic, ftp, http proxy, https proxy, http, https, imap, ipp, irc, ldap, memcache, mssql, mysql, ntp, oracle, pjl, pop3, postgres, rdp, redis, sip, smb, smtp, snmp, socks5, ssh, telnet, vnc)
GNU Affero General Public License v3.0
663 stars 108 forks source link

code is broken on python 3.12, tries to use ssl.wrap_socket which was deprecated and removed in that version #68

Closed sysfu closed 2 weeks ago

sysfu commented 3 months ago

Environment is gentoo with Python 3.12.3

Stepping through the code there are several ssl wrap_socket errors.

https://bpa.st/CACA

blshkv commented 3 months ago

https://github.com/ansible-collections/community.vmware/pull/1967/files this patch looks similar

giga-a commented 3 months ago

@sysfu & @blshkv sorry for the delay and thanks for the info! I'm looking..

giga-a commented 3 months ago

I will be pushing a new update by the end of this week

blshkv commented 3 weeks ago

that's a really long week you are having ;-)

giga-a commented 3 weeks ago

@sysfu, would you be able to re-share the logs? is that problem in the elastic_server.py or rdp_server.py?

blshkv commented 3 weeks ago

@sysfu, would you be able to re-share the logs? is that problem in the elastic_server.py or rdp_server.py?

I think you will hit it immediately, if try to run with python 3.12

giga-a commented 3 weeks ago

@sysfu, would you be able to re-share the logs? is that problem in the elastic_server.py or rdp_server.py?

I think you will hit it immediately, if try to run with python 3.12

Found it, thanks, it did hit it immediately

ImportError while loading conftest '/home/runner/work/honeypots/honeypots/tests/conftest.py'.
tests/conftest.py:12: in <module>
    from .utils import IP, PASSWORD, USERNAME
tests/utils.py:9: in <module>
    from honeypots.helper import wait_for_service
honeypots/__init__.py:3: in <module>
    from .elastic_server import QElasticServer
honeypots/elastic_server.py:5: in <module>
    from ssl import wrap_socket
E   ImportError: cannot import name 'wrap_socket' from 'ssl' (/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/ssl.py)
Error: Process completed with exit code 4.
giga-a commented 2 weeks ago

@blshkv @sysfu - I do apologize for the long delay, I fixed that problem and I also made a SMTP server that works with python 3.12

blshkv commented 2 weeks ago

great, thank you. Please make a new release for this important change as well

sysfu commented 1 week ago

great, thank you. Please make a new release for this important change as well

Any progress on that release making it into gentoo/pentoo?

I tried installing honeypots on up to date pentoo core system just now and this was the result

$ sudo emerge -av net-analyzer/honeypots

These are the packages that would be merged, in reverse order:

Calculating dependencies... done!
Dependency resolution took 2.86 s (backtrack: 0/20).

emerge: there are no ebuilds built with USE flags to satisfy "dev-python/twisted[python_targets_python3_10(-)?,python_targets_python3_11(-)?]".
!!! One of the following packages is required to complete your request:
- dev-python/twisted-24.7.0::gentoo (Change USE: +python_targets_python3_11)
- net-analyzer/honeypots-0.65-r1::pentoo (Change USE: -python_targets_python3_11, this change violates use flag constraints defined by net-analyzer/honeypots-0.65-r1: 'any-of ( python_targets_python3_10 python_targets_python3_11 ) any-of ( python_targets_python3_10 python_targets_python3_11 )')
(dependency required by "net-analyzer/honeypots-0.65-r1::pentoo" [ebuild])
(dependency required by "net-analyzer/honeypots" [argument])
blshkv commented 1 week ago

@sysfu please don't spam other project's bug trackers. Pentoo issues should go to Pentoo's tracker. I see honeypots 0.66 was released today, I'll push it when I have a free time, or feel free to create a pull request with a working ebuild.

sysfu commented 6 days ago

@sysfu please don't spam other project's bug trackers. Pentoo issues should go to Pentoo's tracker. I see honeypots 0.66 was released today, I'll push it when I have a free time, or feel free to create a pull request with a working ebuild.

Apologies, will be mindful of that going forward.

Good news, I just emerged net-analyzer/honeypots-0.66 on a pentoo core system and ran honeypots --setup all and it's working!

Thank you @giga-a and @blshkv for your efforts getting this working again.

hplaunch.log