Accessing An External Programm
Moderator: General Moderators
There are other ways to disable the exec functions.
Try
Try
Code: Select all
$fns = array('shell_exec', 'exec');
foreach($fns as $f) {
echo $f, function_exists($f) ? ' exists':' does not exist', "<br />\n";
}
echo 'disabled functions: ', ini_get('disable_functions'), "<br />\n";
echo 'disabled classes: ', ini_get('disable_classes'), "<br />\n";- neel_basu
- Forum Contributor
- Posts: 454
- Joined: Wed Dec 06, 2006 9:33 am
- Location: Picnic Garden, Kolkata, India
No no
I Dont Want To Disable It
I Wanna Know If I Am Hosted In A Shared Hosted Linux Server Where Safe Mode Is Turned Off and I am Alowed To Use program Execution Functions In php Then -->
OK Wrote In Linux I Have To Define The Full Path To The out File
In Shared Hosting What Would Be The Full Path ?? Is It like http://www.mysitename.com/somedir/paaa_arg.out ??
or Some Thing Else And In Shared Hosting How Can I Know The Actual Full Path Where I am Hosted Are There Any Function To Get It ??
If Its then How To Use That Function
If Its Not Possible Are there Another program execution Functions in php By which
I can Execute pass_arg.out file Without Specifing The Full Path Of That File
Are There Any Other functions In php That Doesn't requir The Full Path To The Binary out File Are There Any function That Can work With The short Path
I Dont Want To Disable It
I Wanna Know If I Am Hosted In A Shared Hosted Linux Server Where Safe Mode Is Turned Off and I am Alowed To Use program Execution Functions In php Then -->
OK Wrote In Linux I Have To Define The Full Path To The out File
OK On 4th Page wrote: I tested it and it can run but the PHP code should like that:
Code: Select all
$output = shell_exec('/full/path/to/executable/pass_arg.out arg1 arg2'); echo $output;
In Shared Hosting What Would Be The Full Path ?? Is It like http://www.mysitename.com/somedir/paaa_arg.out ??
or Some Thing Else And In Shared Hosting How Can I Know The Actual Full Path Where I am Hosted Are There Any Function To Get It ??
If Its then How To Use That Function
If Its Not Possible Are there Another program execution Functions in php By which
I can Execute pass_arg.out file Without Specifing The Full Path Of That File
Are There Any Other functions In php That Doesn't requir The Full Path To The Binary out File Are There Any function That Can work With The short Path
neel_basu wrote:No no
I Dont Want To Disable It
Ok, let's try again:
MaYbE. mAyBe NoT. nOt RuNnInG iN sAfE mOdE dOeS nOt GuArAnTeE eXeC() oR sHeLl_ExEc() ArE aVaIlAbLeIf The Host Doesn't Run php In Safe Mode Can I Then Use shell_exec or exec()
TrY tHe ScRiPt. It WiLl TeLl YoU wEtHeR tHe FuNcTiOnS aRe AvAiLaBlE oR nOt
You haven't tried what ok suggested, have you?neel_basu wrote:In Shared Hosting What Would Be The Full Path ?? Is It like http://www.mysitename.com/somedir/paaa_arg.out ??
or Some Thing Else And In Shared Hosting How Can I Know The Actual Full Path Where I am Hosted Are There Any Function To Get It ??
You can use a relative path, see http://en.wikipedia.org/wiki/Path_%28computing%29neel_basu wrote:If Its Not Possible Are there Another program execution Functions in php By which
I can Execute pass_arg.out file Without Specifing The Full Path Of That File
- neel_basu
- Forum Contributor
- Posts: 454
- Joined: Wed Dec 06, 2006 9:33 am
- Location: Picnic Garden, Kolkata, India
Then Can I Mak Sure About It That
would do The Same Job As
If Both of Them Are in The same Directory
Code: Select all
$output = shell_exec('/full/path/to/executable/pass_arg.out arg1 arg2');Code: Select all
$output = shell_exec('pass_arg.out arg1 arg2');- dibyendrah
- Forum Contributor
- Posts: 491
- Joined: Wed Oct 19, 2005 5:14 am
- Location: Nepal
- Contact:
Even though shared host are not running in safe mode, they might sometime don't allow to use certain functions which might be harmful for the shared server.
Suppose if php.ini contains the following options :
You'll not be able to use these functions.
Suppose if php.ini contains the following options :
Code: Select all
disable_functions = exec, shell_execThere's still no need for an "external" program for that. Chances are you'd rather increase the threat level. And as mentioned: It's unlikely your method beats those of standard encryption modules e.g. provided by mcrypt. You might come up with a fabulous new way of encrypting data one day but as a beginner ....
Really, there's no point to it and you'll learn as much or even more from using a given crypto lib as from trying to build some encoderish thingeling
Really, there's no point to it and you'll learn as much or even more from using a given crypto lib as from trying to build some encoderish thingeling