Name is required.
Email address is required.
Invalid email address
Answer is required.
Exceeding max length of 5KB

Trouble integrating requests python library and jython

Manuel Anderson Oct 02, 2019 01:29PM UTC

Im currently building a burp extension using Jython. At one point I basically get URLs from the proxy Tab and make an additional request with that url+someEndpoint with the Python Requests library.

The extension works fine if I use the URL that "comes" from proxy tab, something like this.

requests.get(str(requestInfo.getUrl()))

But when I, for example, want to get the "source" URL and then send the request with the library.
Something like this.

splitURL = str(str(requestInfo.getUrl())).split("/")
newURLToSend = ((splitURL[0] + "/" + splitURL[1] + "/" + splitURL[2] + "/"))

That does not work and I get weir errors like "Invalid distance too far back" and such.

Both of the URLs are strings so I cant wrap my head around on why that is not working. Any idea on what could be going on?

Thanks for the help!


Liam Tai-Hogan Oct 03, 2019 12:55PM UTC Support Center agent

Have you tried debugging each point in the Python code you have written?


Post Your public answer

Your name
Your email address
Answer