execute usr/sbin/csf -d within a php script
Posted: 11 Jul 2013, 20:44
I'm trying to figure out a way to add ip addresses to the csf.deny list by means of a php script.
My first approach was to directly write to csf.deny from my php script. But figured that it was better to use usr/sbin/csf -d x.x.x.x because the ip is then directly blocked.
But the above is not working.
Tried with shell_exec and some other commands too.
My php file has ownership root 4711
Any suggestions?
My first approach was to directly write to csf.deny from my php script. But figured that it was better to use usr/sbin/csf -d x.x.x.x because the ip is then directly blocked.
Code: Select all
<?php
// some code to retrieve an abusing IP address.
exec("/usr/sbin/csf -d x.x.x.x");
?>
Tried with shell_exec and some other commands too.
My php file has ownership root 4711
Any suggestions?