Can't load python modules from their directory

A place to ask the community for help with using Autopsy.

Moderator: carrier

Can't load python modules from their directory

Postby Cube » Fri Nov 18, 2016 5:42 pm

Hi all,

I built a sluehtkit PostgreSQL release (64bit) and compiled Autopsy (64bit) against it.
I forked the release-4.1.1 branch from github repositories and I'm able to run it by clicking "suite.run". Everything works.

Just a little problem: I need to create and run a python plugin but, when I right-click the evidence to "run ingest module", i can't see my plugin and IntelliJ prints this warning:

WARNING [org.netbeans.core.startup.InstalledFileLocatorImpl]: no such module C:\Users\adevito\Documents\tools\autopsy\build\cluster\update_tracking\org-sleuthkit-autopsy-python.xml at org.sleuthkit.autopsy.python.JythonModuleLoader.getInterfaceImplementations(JythonModuleLoader.java:77)

Any clues? My python modules directory is: C:\Users\adevito\Documents\tools\autopsy\build\testuserdir\python_modules

Thank you
Cube
 
Posts: 7
Joined: Tue Apr 05, 2016 5:21 pm

Re: Can't load python modules from their directory

Postby Cube » Fri Dec 02, 2016 2:32 pm

Hi all,

I moved my scripts in build\cluster\InternalPythonModules\myDir and now I can run them on Autopsy.

I think it is not a "clean" solution of my problem but, for now, it works fine :)

Alessandro
Cube
 
Posts: 7
Joined: Tue Apr 05, 2016 5:21 pm

Re: Can't load python modules from their directory

Postby Hoyt » Wed Dec 07, 2016 3:10 am

Sorry no one's replied before now. You didn't say why you changed the Python plugins directory from the default. Assuming you don't have a specific reason to change it, here's what you can do:

With Autopsy open, select "Tools" > "Python Plugins" from the main menu bar. This will open up Autopsy's default directory for Python modules. It should be something like:

C:\Users\[user_name]\AppData\Roaming\autopsy\python_modules

Create a folder for each individual module, but you're free to name them however you like. The module contained in each folder will have it's own name - whatever you decided to name it - so the folder name doesn't matter. Once the folder is created, dump your module inside. Location is one caveat. The other is that your module must implement a class interface defined by Autopsy. See the online tutorials here, here, and here if you're not sure what I mean. I assume you've got class interface taken care of if you already have a module your testing. I also assume you've got your dev environment configured, but I include that link here for others who may be reading this and need that. This last link has or is linked to everything you need to build and run a Python/Jython module... plus you might win a little cash with it if you pursue that. All the info is in the last link.

If both of these are correct (location and class interface), Autopsy should find each module so configured. Also, there's no need to restart Autopsy. It will poll for modules each time it needs them.

Try this and see if it solves your problem. If I've misunderstood, steer me in the right direction and I'll do what I can to help.

Hoyt
Hoyt
 
Posts: 48
Joined: Thu Dec 11, 2014 4:02 am
Location: Little Rock, AR

Re: Can't load python modules from their directory

Postby Cube » Fri Dec 09, 2016 9:50 am

Hi all,

First of all, thank you for your reply :) very kind

You didn't say why you changed the Python plugins directory from the default. Assuming you don't have a specific reason to change it


What do you mean? I didn't change it and I don't know how to do it :)

With Autopsy open, select "Tools" > "Python Plugins" from the main menu bar. This will open up Autopsy's default directory for Python modules. It should be something like:

C:\Users\[user_name]\AppData\Roaming\autopsy\python_modules


Yes, but "Tools -> Python Plugins" open up the following directory:
C:\Users\adevito\Documents\tools\autopsy\build\testuserdir\python_modules
I don't know why :(

If both of these are correct (location and class interface), Autopsy should find each module so configured. Also, there's no need to restart Autopsy. It will poll for modules each time it needs them.


My ingest module works fine, but I have to move it inside this directory:
C:\Users\adevito\Documents\tools\autopsy\build\cluster\InternalPythonModules\
to make it loadable

I've another Autopsy release installation on the same PC and it loads the plugins from the correct default directory... :?

Cube
Cube
 
Posts: 7
Joined: Tue Apr 05, 2016 5:21 pm


Return to Autopsy Troubleshooting

Who is online

Users browsing this forum: No registered users and 1 guest