imported>mutante m (New page: == proftpd "post-upload" hook == Um mit proftpd einen "post upload" hook zu realisieren, also ein Bash script auszuführen wenn ein Dateiupload stattfand, benötigt man zunächst das Modu...) |
No edit summary |
||
(2 intermediate revisions by one other user not shown) | |||
Line 1: | Line 1: | ||
== proftpd "post-upload" hook == |
== proftpd "post-upload" hook == |
||
Um mit proftpd einen "post upload" hook zu realisieren, also ein Bash script auszuführen wenn ein Dateiupload stattfand, benötigt man zunächst das Modul [http://www.castaglia.org/proftpd/modules/mod_exec.html mod_exec] welches nicht per Default compiled wird. Vor der |
Um mit proftpd einen "post upload" hook zu realisieren, also ein Bash script auszuführen wenn ein Dateiupload stattfand, benötigt man zunächst das Modul [http://www.castaglia.org/proftpd/modules/mod_exec.html mod_exec] welches nicht per Default compiled wird. Vor der Benutzung dieses Moduls sollte man sich über die Sicherheitsrisiken bewusst sein die dies mit sich bringen kann. Hierzu nocheinmal die offizielle Warnung: |
||
<i>"The mod_exec module can be used to execute external programs or scripts at various points in the process of handling FTP commands. By conscious design, ProFTPD does not and will not execute external programs. This is a security decision, as it was decided not to allow ProFTPD to serve as a means of compromising a system or disclosing information via bugs in external programs or scripts. Use of this module allows for such external programs to be executed, and also opens up the server to the mentioned possibilities of compromise or disclosure via those programs."</i> |
<i>"The mod_exec module can be used to execute external programs or scripts at various points in the process of handling FTP commands. By conscious design, ProFTPD does not and will not execute external programs. This is a security decision, as it was decided not to allow ProFTPD to serve as a means of compromising a system or disclosing information via bugs in external programs or scripts. Use of this module allows for such external programs to be executed, and also opens up the server to the mentioned possibilities of compromise or disclosure via those programs."</i> |
||
Line 16: | Line 16: | ||
* [http://www.castaglia.org/proftpd/modules/proftpd-mod-exec-0.9.4.tar.gz proftpd-mod-exec-0.9.4.tar.gz] [http://www.castaglia.org/proftpd/modules/proftpd-mod-exec-0.9.4.tar.gz.md5 MD5] |
* [http://www.castaglia.org/proftpd/modules/proftpd-mod-exec-0.9.4.tar.gz proftpd-mod-exec-0.9.4.tar.gz] [http://www.castaglia.org/proftpd/modules/proftpd-mod-exec-0.9.4.tar.gz.md5 MD5] |
||
* [http://www.castaglia.org/proftpd/modules/mod_exec.html docs] |
* [http://www.castaglia.org/proftpd/modules/mod_exec.html docs] |
||
---- |
|||
see also http://www.castaglia.org/proftpd/doc/contrib/ProFTPD-mini-HOWTO-Logging.html |
|||
[[Category:Networking]] |
Latest revision as of 08:34, 3 July 2008
proftpd "post-upload" hook[edit]
Um mit proftpd einen "post upload" hook zu realisieren, also ein Bash script auszuführen wenn ein Dateiupload stattfand, benötigt man zunächst das Modul mod_exec welches nicht per Default compiled wird. Vor der Benutzung dieses Moduls sollte man sich über die Sicherheitsrisiken bewusst sein die dies mit sich bringen kann. Hierzu nocheinmal die offizielle Warnung:
"The mod_exec module can be used to execute external programs or scripts at various points in the process of handling FTP commands. By conscious design, ProFTPD does not and will not execute external programs. This is a security decision, as it was decided not to allow ProFTPD to serve as a means of compromising a system or disclosing information via bugs in external programs or scripts. Use of this module allows for such external programs to be executed, and also opens up the server to the mentioned possibilities of compromise or disclosure via those programs."
Nachdem man nun dieses Modul erfolgreich installiert hat, kommt folgende Konfigurationszeile dem gewünschten Ziel am nächsten:
ExecOnCommand APPE,STOR /path/to/bash-script --user %u --file %f
Hier ist also nur der Pfad zum Script anzupassen. ExecOnCommand wird trotz seines Namens nicht vor sondern erst nach dem erfolgreichen Ausführen eines Befehls, in diesem Fall "STOR" für den Upload, ausgeführt.
Siehe die "mod_exec" Doku für weitere Möglichkeiten wie z.B. ExecOnConnect, ExecOnError, u.a.
see also http://www.castaglia.org/proftpd/doc/contrib/ProFTPD-mini-HOWTO-Logging.html