pathetiq / BurpSmartBuster

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

Burp Import Error #13

Closed xpathmaster closed 7 years ago

xpathmaster commented 7 years ago

While trying to import the module I have this error:

Error:
Traceback (innermost last):
  (no code object) at line 0
SyntaxError: ('invalid syntax', ('/root/Tools/BurpSmartBuster/BurpSmartBuster.py', 70, 14, 'class Logger():'))
    at org.python.core.parser.fixParseError(Unknown Source)
    at org.python.core.parser.parse(Unknown Source)
    at org.python.core.Py.compile_flags(Unknown Source)
    at org.python.core.__builtin__.execfile_flags(Unknown Source)
    at org.python.util.PythonInterpreter.execfile(Unknown Source)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at burp.nk.<init>(Unknown Source)
    at burp.atc.a(Unknown Source)
    at burp.n0f.run(Unknown Source)
    at java.lang.Thread.run(Thread.java:745)

What can be wrong?

pathetiq commented 7 years ago

Hi,

I'm not so sure here the error does not give a lot of information. Did you import the burpsmarbuster.py file inside burp extender and set jython 2.7 jar in the option?

xpathmaster commented 7 years ago

Yes, I've followed the installation wiki-page. And while importing burpsmarbuster.py file inside burp extender have this error inside Burp

pathetiq commented 7 years ago

Ok thanks. I'll test a few things in a few hours and I'll get back to you.

xpathmaster commented 7 years ago

Seems to me that it was my fault - wrong version of jython was used. But now I have another error while importing:

Traceback (most recent call last):
  File "/root/Tools/BurpSmartBuster/BurpSmartBuster.py", line 48, in <module>
    from bs4 import BeautifulSoup
  File "/usr/lib/python2.7/dist-packages/bs4/__init__.py", line 35, in <module>
    from .builder import builder_registry, ParserRejectedMarkup
  File "/usr/lib/python2.7/dist-packages/bs4/builder/__init__.py", line 318, in <module>
    from . import _html5lib
  File "/usr/lib/python2.7/dist-packages/bs4/builder/__init__.py", line 318, in <module>
    from . import _html5lib
  File "/usr/lib/python2.7/dist-packages/bs4/builder/_html5lib.py", line 19, in <module>
    import html5lib
  File "/usr/lib/python2.7/dist-packages/html5lib/__init__.py", line 16, in <module>
    from .html5parser import HTMLParser, parse, parseFragment
  File "/usr/lib/python2.7/dist-packages/html5lib/html5parser.py", line 6, in <module>
    from . import inputstream
UnicodeDecodeError: 'unicodeescape' codec can't decode bytes in position 47-53: illegal Unicode character
pathetiq commented 7 years ago

Make sure you installed bs4 using pip from the jython bin directory, usually that's the problem where it doesn't use the right bs4 package.

gavz commented 7 years ago

please make a video how to install this plugin

pathetiq commented 7 years ago

Will do and add an install script. Thanks for the idea

gavz commented 7 years ago

yes of course. Not worked anything

gavz commented 7 years ago

my installation steps OS kali linux :

java -jar jython_installer-2.7.0.jar

cd /root/jython2.7.0/bin ./pip install beautifulsoup4 requests tld textblob

changes -> BurpSmartBuster.py :

sys.path.append("/root/jython2.7.0/Lib/site-packages/") sys.path.append("/root/jython2.7.0/Lib/site-packages/textblob") sys.path.append("/root/jython2.7.0/Lib/site-packages/nltk")

BurpSuite :

Tab Extender - Tab Options - Python Environment : path /root/jython2.7.0/jpython.jar

pathetiq commented 7 years ago

@xpathmaster Let me know if @gavz installation steps works for you. Thank you

pathetiq commented 7 years ago

I update the installation notes and added a fix in the code for the plugin to load correctly

https://github.com/pathetiq/BurpSmartBuster/commit/23f95bc18c038620e6604d6a7a519fbe4c939b29 https://github.com/pathetiq/BurpSmartBuster/wiki

xpathmaster commented 7 years ago

Maybe I am the only unlucky one, but still have issues: /root/jython2.7.0/bin/pip install requests fails with error: .... File "/root/jython2.7.0/Lib/py_compile.py", line 96, in compile _py_compile.compile(file, cfile, dfile) File "/root/jython2.7.0/Lib/py_compile.py", line 96, in compile _py_compile.compile(file, cfile, dfile) RuntimeException: java.lang.RuntimeException: Method code too large! .... any thoughts on that? have found similar question: http://stackoverflow.com/questions/14919557/how-to-get-urllib3-and-requests-working-with-jython-2-7-beta-1 - but it seems to be old one.

pathetiq commented 7 years ago

Morning,

I can't reproduce this bug with requests, but I think (I hope) you can fix it with the vm size increase like discussed here:

http://www.ibm.com/support/knowledgecenter/SSAW57_8.0.0/com.ibm.websphere.nd.doc/info/ae/ae/txml_heapsize.html and here http://bugs.jython.org/issue527524

Let me know if that succeed or not.

xpathmaster commented 7 years ago

No, I even just have installed fresh Kali (Linux kali 4.6.0-kali1-686-pae #1 SMP Debian 4.6.4-1kali1 (2016-07-21) i686 GNU/Linux), jython2.7.0 and still have errors with downloading requests: er1

pathetiq commented 7 years ago

That's weird. I have requests 2.10.0 thought it was updated. Try to find an older version, seems like they create a function that is too large for the jvm in newest version.. Will have to retest my setup with your version... :/

pathetiq commented 7 years ago

Just tested the upgraded version and have the same error. Will investigate, but you can fix by installing an older version (haven't looked how yet).

xpathmaster commented 7 years ago

Yes, older one (2.10) installed with no problems. You can download it here:https://pypi.python.org/pypi/requests/2.10.0#downloads and then install with: /path/to/jython/bin/jython setup.py install

pathetiq commented 7 years ago

Thanks a lot, will adjust the installation steps temporary with this. Let me know if you got any other problem or have any suggestion to help the tool. Cheers