Using Swing to write a burp extension - python

I try to use Jython to develop a burp extension with Pycharm, essentially to follow this tutorial. I run into problem with configuring Pycharm to resolve java and javax after setting Jython to be the interpreter and I just can't find a way to resolve this. Is there a way to get Pycharm to resolve it or I have to work with the errors and hope it will work correctly on burp?

Related

Is it possible to embed Jedi in an application on a system where Python is not installed?

I'm working on an (Windows and Mac) application that uses Python as an embedded scripting language.
The application includes an internal text editor, implemented using Scintilla, and I'm using Jedi for autocompletion, which generally works great.
However, when attempting autocompletion on a computer that does not have a separate installation of Python, Jedi raises an error:
jedi.api.environment.InvalidPythonEnvironment:
Could not get version information for 'python':
FileNotFoundError(2, 'The system cannot find the file specified', None, 2, None)
Digging into the code, I can see that the underlying code that is throwing the FileNotFoundError is when Jedi attempts to run python using subprocess.Popen. Python is not installed on the computer, so this fails.
I can also reproduce the same issue on a computer that does have Python installed by editing my Path environment variable not to include the location of python.exe.
Ideally, we don't want users of our application to have to install Python just to get autocompletion working.
My questions:
Is it possible to get Jedi not to spawn subprocesses, and instead run its code inside the same instance of Python within which it itself is running? I couldn't find anything about this in the documentation or the source code that deals with Environments, and extrapolating from the discussion here I suspect the answer might be no.
Is it possible somehow to get Jedi to use the same python37.dll that our application is using for its functionality, instead of looking for a .exe file that does not exist?
Is there any way we could make some kind of minimal Python installation within our existing app installation that uses the same DLLs/Python Lib etc? How could I go about doing this?
Is there any other way to get Jedi autocompletion working in our app without requiring the user to install Python, or including a full Python installer as part of our build process?
Is it possible to get Jedi not to spawn subprocesses, and instead run its code inside the same instance of Python within which it itself is running? I couldn't find anything about this in the documentation or the source code that deals with Environments, and extrapolating from the discussion here I suspect the answer might be no.
This is definitely possible. All the tools are there. There are discussions ongoing here: https://github.com/davidhalter/jedi-vim/issues/870.
IMO a patch to Jedi is needed that uses an jedi.api.environment.InterpreterEnvironment in some cases like yours. It's definitely possible, it's just buggy at the moment.

How to debug already installed Python application?

I am trying to debug an application that is written in Python 2. Problem is, before application can be run, it must be installed (according to the documentation) like this:
python setup.py develop
Application (Cuckoo Sandbox) then can be run like this:
cuckoo -d
With the new Python package developing and testing code now works slightly different than it used to be. As one
will first have to Install Cuckoo before being able to use it in the first place, a simple modify-and-test development
sequence doesn’t work out-of-the-box as it used to do.
Is it possible to somehow debug such application?
Later in the (unfinished) docs there is a mention of debugging web interface which I am not sure would get me to the code I need to debug and it also requires PyCharm Professional. I am using PyCharm Community but I am willing to use any other free IDE or debugger.
It will be difficult to debug if you are working only with compiled .pyo and .pyc files, which is all that you might have from an installed application. It is possible that the install includes some source files. You will have to figure out where it is installed, which is platform specific. Since many projects (including cuckoo) are open source, I would recommend cloning the Github repository and debugging from that.

Intellij IDEA OSX Python Development Headaches

I recently started working at a Java shop where staff primarily use IntelliJ IDEA on Macs for development. I am in charge of writing automated tests for a data centric project, and my go-to language for this is Python. In the past, I have used PyCharm on Linux and Windows with great success, but configuring IntelliJ IDEA for Python on OSX has been confusing to me. So far, I have had no issues setting up a project and getting it to run Python scripts, but each time I try using the debugger, I get the following error:
/usr/bin/python: can't open file '/Users/{USER}/Library/Application Support/helpers/pydev/pydevd.py': [Errno 2] No such file or directory
So far, Googling around has turned up hardly anything useful - and most of JetBrains's help manuals are PyCharm focused, which is rather unhelpful in the IntelliJ context. Has anyone else come across something like this? I'm looking for insight into what exactly is going wrong here.
Try uninstalling and re-installing the plugin? There's definitely something wrong with the path above, it should have an IntelliJ<version number> between the Application Support/python and the helpers (at least by what's on my system). I am running IntelliJ 13 with the python plugin and have been able to debug without any problems with it.

Pretty print in Eclipse CDT: unable to look at any variable

I'm developing a QT based application on ARM, iMX6 device.
Using toolchain from Freescale and Eclipse CDT Kepler, I would like to use pretty printer with GDB.
I followed the tutorial on http://anadoxin.org/blog/node/98 and the setup seems fine (no error while starting GDB).
However when looking at debug view panel, I'm not able to look at any datatype (not only QT but also int, double etc, the whole panel is blank. Furthermore also writing print variable to gdb Eclipse console doesn't generate a valid output).
I think my setup is fine:
GNU gdb (GDB) 7.6 for ARM device
Python: Python 2.7.3
Eclipse: Kepler
KUbuntu 12.04
Is there anyone that can help me understand what is wrong?
Can I send any command to gdb console in order to understand why pretty printer aren't working fine, and even worse, they corrupt the whole gdb debug view variables?
Any help will be really appreciated
I finally fixed it.
The problem was that my toolchain for ARM was built without the support for Python in GDB. If you search the web, you will find that there is a flag in the configuration named (--with-python).
Using it and rebuilding gdb, you will be able to use the python scripts available at
Pretty printers
Hope this will be helpful for the stackoverflow community.
best regards

Get error when coding Python in Eclipse

I was looking for an appropriate Python IDE for a long time. When googling and looking for a desired one in this forum and on the other websites I finally realised Eclipse is being suggested by the majority of the professional programmers. So as you would understand I downloaded Eclipse and the Pydev plugin for that purpose and started trying to configure and prepare Eclipse for usage and programming. As a beginner and a new one to Python, frankly I faced so many serious obstacles for installing and configuring the Eclipse and specifically for installing the Pydev plugin. After so much struggle, I finally succeeded in getting through with the configuration and installation but when I run the Eclipse and try to build a new project, when I introduce a new module and code, when I debug and run my code I get such error "
"Exception occurred executing command line.
Cannot run program "C:\Program Files\Python3\python.exe" (in directory "C:\EclipseWorkspace\csse120\Hello world"): CreateProcess error=3, The system cannot find the path specified"
I looked for Identical or similar issues in the forum and topics but the only suggestions were that this might be due to python 3.0(means I should be choosing Python 2.6 or 2.7 while choosing a new project), but this didn't solve my problem.
Would anybody please assist me: what should I be doing to solve this issue and problem. I be appreciating and thankful toward ant guidance and assistance.
I Thank you all in advance for your kind help
I haven't used eclipse in a while, but normally that error simply means that eclipse can't find the specified file in the specified path.
it might sounds stupid, I know, but are you sure you have C:\Program Files\Python3\python.exe in your system?

Categories

Resources