help No module named 'urllib2'
hi i have a problem i get this issue when i lunch the payload C:\Users\IEUser\Desktop>python kT7.py --debug kT7.py:6: DeprecationWarning: the imp module is deprecated in favour of importlib; see the module's documentation for alternative uses import imp
DEBUG:main:FINDER=================
DEBUG:main:Searching: urllib2
DEBUG:main:Path: None
INFO:main:Checking if in declared remote module names...
INFO:main:Checking if built-in....
INFO:main:Checking if it is name repetition...
INFO:main:[+] Module/Package 'urllib2' can be loaded!
DEBUG:main:LOADER=================
DEBUG:main:Loading urllib2...
DEBUG:main:Trying to import 'urllib2' as package from: 'http://192.168.43.26:8082/urllib2/init.py'
DEBUG:main:FINDER=================
DEBUG:main:Searching: StringIO
DEBUG:main:Path: None
INFO:main:Checking if in declared remote module names...
INFO:main:Checking if built-in....
INFO:main:Checking if it is name repetition...
INFO:main:[+] Module/Package 'StringIO' can be loaded!
DEBUG:main:LOADER=================
DEBUG:main:Loading StringIO...
DEBUG:main:Trying to import 'StringIO' as package from: 'http://192.168.43.26:8082/StringIO/init.py'
DEBUG:main:FINDER=================
DEBUG:main:Searching: colorama
DEBUG:main:Path: None
INFO:main:Checking if in declared remote module names...
INFO:main:Checking if built-in....
INFO:main:Checking if it is name repetition...
INFO:main:[+] Module/Package 'colorama' can be loaded!
DEBUG:main:LOADER=================
DEBUG:main:Loading colorama...
DEBUG:main:Trying to import 'colorama' as package from: 'http://192.168.43.26:8082/colorama/init.py'
DEBUG:main:FINDER=================
DEBUG:main:Searching: requests
DEBUG:main:Path: None
INFO:main:Checking if in declared remote module names...
INFO:main:Checking if built-in....
INFO:main:Checking if it is name repetition...
INFO:main:[+] Module/Package 'requests' can be loaded!
DEBUG:main:LOADER=================
DEBUG:main:Loading requests...
DEBUG:main:Trying to import 'requests' as package from: 'http://192.168.43.26:8082/requests/init.py'
DEBUG:main:public_ip returned error: module 'urllib' has no attribute 'urlopen'
Traceback (most recent call last):
File "kT7.py", line 2241, in
C:\Users\IEUser\Desktop>python kT7.py --debug
kT7.py:6: DeprecationWarning: the imp module is deprecated in favour of importlib; see the module's documentation for alternative uses
import imp
Traceback (most recent call last):
File "kT7.py", line 9, in
How can i fix this
Thank you
thank you
have you tried to pip install urllib2?
This means you are running Python 3 can you confirm?
This means you are running Python 3 can you confirm?
indeed because urllib & urllib2 are merged together now in python3 all you need to do is to remove urlib2 "import urlib2" and keep "import urllib"
to be clear this is an issue because the library is being loaded using python3 on the remote system (payload)
The remote system (bot) you're attempting to run on must include python2 and be called explicitly, or this will break;
There are two alternatives -- either we include a switch for python2 / python3 availability to automatically solve for this or, since this is an educational tool, I don't see an issue with just limiting platform availability to those that support a particular version.
Edit: sorry, was thinking inversely during first response
I've written a PR that should hopefully resolve a part of this.
This issue has been resolved in PR #127