Volume
-
Posts
3 -
Joined
-
Last visited
Content Type
Profiles
Forums
Gallery
Events
Posts posted by Volume
-
-
Yes.
root@lap:~/stuff/airpwn# cat conf/pyexamplebegin 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.
-
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 -vParsing configuration file..
initializing python..
Error loading module: pyexample
Error parsing configuration file.
root@lap:~/stuff/airpwn#
Installing airpwn 1.4 in bt4
in Questions
Posted
*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:
And this is the error output:
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:
~Vol