×
Create a new article
Write your page title here:
We currently have 3,189 articles on s23. Type your article name above or create one of the articles listed here!



    s23
    3,189Articles

    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

    Cookies help us deliver our services. By using our services, you agree to our use of cookies.
    Cookies help us deliver our services. By using our services, you agree to our use of cookies.