Error with imports when loading own python extension in burp

145 Views Asked by At

I'm currently trying to create my own Burp extension to automatize testing. For this, I want to run script I made before via Burp. I need to import differents libraries for this, such as requests.

To give my you context on the extension architecture: all the tests are runned by my script and I just want to use the output to print issues in burpSuite along side with the built-in scanner issues.

Here is my problem. When I'm loading my extension into burp, this error happens:

File "path/to/my/extension.py", line 4, in <module>
    import requests
  File "path/to/package\requests\__init__.py", line 43, in <module>
    import urllib3
SyntaxError: ("no viable alternative at input 'f'", (path\\to\\package\\urllib3\\__init__.py', 36, 12, '            f"the \'ssl\' module is compiled with {ssl.OPENSSL_VERSION!r}. "\n'))

I cannot find anything online which seems similar to my problem and the few things I found didn't help. I tried to dodge the error by loading my script from external files, copy paste my whole scripts in the burp extension file,etc... It's still happening.

Thanks in advance for your responses ! :)

PS : I'm using the last jython version (2.7.3)

1

There are 1 best solutions below

2
RadoTheProgrammer On

This error is not with your extension, but with the urllib3 library. Try to reinstall this library with

pip install --upgrade urllib3