Jump to content

Volume

Members
  • Posts

    3
  • Joined

  • Last visited

Posts posted by Volume

  1. *bump*

    Okay, it's definitely a problem with python module paths. The file "pyexample" is the configuration file and "pyexample.py" is the module. Both files are in the same folder. I've added a few calls to the PyErr_Print() function in conf.c like so:

    PyObject *str = PyString_FromString(argument);

    if (str == NULL) {

    printf("PyString_FromString returned NULL:\n");

    PyErr_Print();

    return NULL;

    }

    PyObject *module = PyImport_Import(str);

    if(module == NULL){

    printf("Error loading module: %s\n", argument);

    PyErr_Print();

    return NULL;

    }

    And this is the error output:

    root@lap:~/stuff/airpwn# airpwn -c pyexample -d rtl8187 -i wlan0

    Initializing python..

    Error loading module: pyexample

    ImportError: No module named pyexample

    Error parsing configuration file.

    Clearly python fails to find the specified module, but I've always thought that the interpreter also searches the application working path for the given modules. Unfortunately I'm not a python expert so this might be a rough one for me to fix on my own.

    EDIT: Eh, stupid environmental variables. It turns out that PYTHONPATH did not exist on my system. Running "export PYTHONPATH=." without the quotes in a shell fixed the problem. Although you'll have to modify the configuration files and add relative paths to the modules from the directory you're running airpwn, else it won't work i.e. the pyexample conf file should look like:

    begin pyexample

    match ^(GET|POST)

    ignore ^GET [^ ?]+\.(jpg|jpeg|gif|png|tif|tiff)

    pymodule pyscripts/pyexample

    ~Vol

  2. Yes.

    root@lap:~/stuff/airpwn# cat conf/pyexample

    begin pyexample

    match ^(GET|POST)

    ignore ^GET [^ ?]+\.(jpg|jpeg|gif|png|tif|tiff)

    pymodule pyexample

    root@lap:~/stuff/airpwn# airpwn -c conf/pyexample -d madwifi -i mon0 -v -v -v

    Parsing configuration file..

    initializing python..

    Error loading module: pyexample

    Error parsing configuration file.

    root@lap:~/stuff/airpwn# mv conf/pyexample conf/pyexample2

    root@lap:~/stuff/airpwn# airpwn -c conf/pyexample -d madwifi -i mon0 -v -v -v

    Parsing configuration file..

    fopen: No such file or directory

    Error parsing configuration file.

    root@lap:~/stuff/airpwn# cat pyscripts/pyexample.py | head

    #!/usr/bin/env python

    #

    # Demo python module to illustrate airpwn python integration.

    # the TCP data payload is sent as input to airpwn_response, and the data

    # returned from the function is injected as a response. If you don't

    # want to send a response return None

    #

    root@lap:~/stuff/airpwn#

    It would seem that airpwn can find the conf file, but for some reason fails to locate the pyexample.py module. I have copied both files into one directory, but I get the same result. Perhaps there should be some variable that tells the interpreter where to look for the given py script.

  3. Hey, has anyone gotten the python scripting to work in airpwn 1.4? I upgraded the python implementation from 2.4 to my system python version 2.5 and reinstalled airpwn. While trying the python example included in airpwn 1.4 I get this:

    root@lap:~/stuff/airpwn# airpwn -c conf/pyexample -d madwifi -i mon0 -v -v -v

    Parsing configuration file..

    initializing python..

    Error loading module: pyexample

    Error parsing configuration file.

    root@lap:~/stuff/airpwn#

×
×
  • Create New...