A simple tftp server implementation capable of serving CGI scripts from a specified cgi directory (defaults to cgi/).
This would be useful for serving different boot configurations for PXE based on IP or MAC address.
Configuration is currently done at the top of tftpd-cgi.py
.
Simply run python tftpd-cgi
or ./tftpd-cgi.py
to start the server. Remember you usually need elevated privileges to bind to ports under 1024, and TFTP uses port 69 by default.
This ships with a basic cgi script: "cgi/test". It currently outputs a simple message and the client HOST:PORT when retrieved.
With a simple tftp client, I test the cgi functionality like this:
echo 'get cgi/test' | tftp 127.0.0.1; cat test && rm test