Jump to content

Execute Perl Radius Kick using PHP


ciber

Recommended Posts

Hi,

 

I have a perl script, which kicks my clients session when they have reached their usage limit on DSL. Currently I use a Perl script, to do this

shell_exec("perl /usr/local/etc/raddb/scripts/rad-disc.pl -u ".$_GET['username']." -i ".$_GET['ip']." -n ".$_GET['nas']." -s 'secretgoe\$here'");
// -i  --> IP 
// -u --> Username
// -n --> NAS Server
// -s --> Servers Secret (ie: Password)

 

When I execute this script:

perl /usr/local/etc/raddb/scripts/rad-disc.pl -u [email protected] -i xxx.xxx.xxx.xxx -n xxx.xxx.xxx.xxx -s 'secretgoe$here'

in SSH, I get ACK response saying that the server has Acknowledged my request and disconnected the client, but when I execute it using PHP's shell_exec() (or exec()) (as show in the first line of code), the server responded with a NAK, Negative Acknowledgment.

 

The files are set on root, and are set to execute 6777. I don't see why it would be doing this, unless shell_exec is doing something different that would be done in SSH.

 

------------------->>>

 

In addition to this, I tried writing the script with the information from the database to a file, and then tried to execute that file using PHP. Again NAK.

However when I try to execute that exact generated script using SSH - it executes perfect.

 

Please if anyone can assist, I will be very grateful!!

Link to comment
https://forums.phpfreaks.com/topic/203632-execute-perl-radius-kick-using-php/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.