コマンドの実行方法を確認する

コマンドの実行方法を確認する

私はNGINXとPHP-FPMを使用していくつかのPHP Webページを実行しています。最近、私はWordPressセキュリティの問題を経験している友人のためにウェブサイトをホストし、すべてのアップグレード、WP、およびプラグインを完了しました。

しかし、今日のWebサイトがPHP-FPMで実行されているユーザーがシステムコマンドを実行していることを知りました。たとえば、/usr/bin/host
上書きするファイルが見つかりませんでしphp.iniphp-fpm

  1. コマンドの実行方法を把握する方法はありますか?コマンドはPHPプロセスによって直接実行されますか、それとも実行されているサーバーにいくつかのスクリプトがありますか?

  2. コマンドにアクセスできるユーザーを制限できますか?

  3. Linuxサーバーのセキュリティに関する良い本/記事、詳細はどこで検索できますか?

サーバーは最新のUbuntu LTS 14.04とUbuntuバージョンのNGINXとPHPを実行します。

ベストアンサー1

コマンドにアクセスできるユーザーを制限できますか?

はい、php.iniファイルでパラメータを拡張するだけです。disable_functions(位置は設定によって異なります。例えば/etc/php5/cgi/php/ini

disable_functions = system,exec,shell_exec,escapeshellcmd,show_source,leak,ini_restore,pfsockopen,popen,eproc_c,posix_kill,posix_setuid,posix_setpgid,posix_setsid,proc_open,proc_terminate,proc_get_status,proc_nice,proc_close,passthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority

おすすめ記事