pathetiq / BurpSmartBuster

A Burp Suite content discovery plugin that add the smart into the Buster!
MIT License
383 stars 68 forks source link

ImportError: No module named exceptions #24

Closed riramar closed 7 years ago

riramar commented 7 years ago

After last update I'm getting this error when loading:

Traceback (most recent call last):
  File "C:\Users\xpto\AppData\Roaming\BurpSuite\bapps\7044ef35fa5a49b39285e101a79bf4ae\BurpSmartBuster.py", line 61, in <module>
    from tld import get_tld
  File "C:\Users\xpto\AppData\Roaming\BurpSuite\bapps\7044ef35fa5a49b39285e101a79bf4ae\BappModules\tld\__init__.py", line 9, in <module>
    from tld.utils import get_tld, get_tld_names, update_tld_names, Result
  File "C:\Users\xpto\AppData\Roaming\BurpSuite\bapps\7044ef35fa5a49b39285e101a79bf4ae\BappModules\tld\utils.py", line 18, in <module>
    from tld.exceptions import TldIOError, TldDomainNotFound, TldBadUrl
ImportError: No module named exceptions
pathetiq commented 7 years ago

Please see: #23 thank you

riramar commented 7 years ago

I'm using jython-standalone-2.7.0.jar since is the current stable version. I'm also running Burp Pro under Windows where I have Python 2.7 installed. So for extra python modules I'm installing via pip and point Burp Pro python modules folder to "C:\Python27\Lib\site-packages". It works nicely for other extensions. For your extension seems it's not loading the Python modules folder from Burp.

pathetiq commented 7 years ago

Yeah, I haven't look why but on Windows the tld extension works with jython 2.7.1 hence the explication of issue 23.

riramar commented 7 years ago

I also tried with jython-standalone-2.7.1.jar and didn't work because your extension is not loading the Burp environment python modules directory.

pathetiq commented 7 years ago

Standalone won't work. Please see issue #23 detailed steps are explained.

riramar commented 7 years ago

It works and I found the problem. When loading your extension Jython will try to load python modules first from extension "BappModules" folder ("C:\Users\xpto\AppData\Roaming\BurpSuite\bapps\7044ef35fa5a49b39285e101a79bf4ae\BappModules\"). After installing your extension I've checked the folder "C:\Users\xpto\AppData\Roaming\BurpSuite\bapps\7044ef35fa5a49b39285e101a79bf4ae\BappModules\tld" and I couldn't find the file "exceptions.py" but from my local storage in "C:\Python27\Lib\site-packages\tld" I can see the file "exceptions.py". For debugging propose I've included the line "print sys.path" on "BurpSmartBuster.py" and I was able to see the item "'C:\Python27\Lib\site-packages'" from sys.path list in the Output window which means Jython is properly loading the Python Modules settings as described here https://portswigger.net/burp/help/extender.html#options_pythonenv. I've renamed the old modules from "BappModules" folder and installed using pip all the required modules. After that even using the standalone version I was able to load your extension. I suggest you to update the extension python modules under "BappModules" so the update will be transparent for the users.