recon-ng icon indicating copy to clipboard operation
recon-ng copied to clipboard

Python 3.12: Migrate from deprecated imp to importlib

Open l4rzy opened this issue 1 year ago • 4 comments

This PR migrates from imp to importlib. The helper function followed https://docs.python.org/3/whatsnew/3.12.html#imp

This should make recon-ng work with Python 3.12

l4rzy avatar May 20 '24 10:05 l4rzy

I tried with your settings but now I get the same error but on line 15 import yaml

Traceback (most recent call last): File "/usr/share/recon-ng/recon-ng", line 8, in from recon.core import base File "/usr/share/recon-ng/recon/core/base.py", line 15, in import yaml ModuleNotFoundError: No module named 'yaml'

hacklexander avatar May 22 '24 04:05 hacklexander

I tried with your settings but now I get the same error but on line 15 import yaml

Traceback (most recent call last): File "/usr/share/recon-ng/recon-ng", line 8, in from recon.core import base File "/usr/share/recon-ng/recon/core/base.py", line 15, in import yaml ModuleNotFoundError: No module named 'yaml'

That has nothing to do with my PR. This is to fix the problem with Python 3.12, which doesn't have imp

l4rzy avatar May 22 '24 07:05 l4rzy

Its working

~/venv/bin/python3 --version
Python 3.12.3
~/venv/bin/python3 recon-ng

    _/_/_/    _/_/_/_/    _/_/_/    _/_/_/    _/      _/            _/      _/    _/_/_/
   _/    _/  _/        _/        _/      _/  _/_/    _/            _/_/    _/  _/       
  _/_/_/    _/_/_/    _/        _/      _/  _/  _/  _/  _/_/_/_/  _/  _/  _/  _/  _/_/_/
 _/    _/  _/        _/        _/      _/  _/    _/_/            _/    _/_/  _/      _/ 
_/    _/  _/_/_/_/    _/_/_/    _/_/_/    _/      _/            _/      _/    _/_/_/    


                                          /\
                                         / \\ /\
    Sponsored by...               /\  /\/  \\V  \/\
                                 / \\/ // \\\\\ \\ \/\
                                // // BLACK HILLS \/ \\
                               www.blackhillsinfosec.com

                  ____   ____   ____   ____ _____ _  ____   ____  ____
                 |____] | ___/ |____| |       |   | |____  |____ |
                 |      |   \_ |    | |____   |   |  ____| |____ |____
                                   www.practisec.com

                      [recon-ng v5.1.2, Tim Tomes (@lanmaster53)]                       

[*] No modules enabled/installed.

[recon-ng][default] > 

pingpongterminator300 avatar Jun 04 '24 21:06 pingpongterminator300

modules load worked

[recon-ng][default] > marketplace install recon/domains-hosts/hackertarget
[*] Module installed: recon/domains-hosts/hackertarget
[*] Reloading modules...
[recon-ng][default] > modules load recon/domains-hosts/hackertarget
[recon-ng][default][hackertarget] > options set SOURCE github.com
SOURCE => github.com
[recon-ng][default][hackertarget] > run

----------
GITHUB.COM
----------
[*] Country: None
...

l4rzy avatar Jun 08 '24 06:06 l4rzy

Resolved by #218.

lanmaster53 avatar Nov 01 '24 20:11 lanmaster53