Bluehost.com Web Hosting $6.95

Can't get shell_exec() to work!

This is a discussion on Can't get shell_exec() to work! within the alt.comp.lang.php forums, part of the PHP Programming Forums category; I have a registration page in php for webhosting. It has all the users stored in a mysql database with ...


Go Back   Usenet Forums > PHP Programming Forums > alt.comp.lang.php

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 09-23-2003
NeoPhreak
 
Posts: n/a
Default Can't get shell_exec() to work!

I have a registration page in php for webhosting. It has all the users
stored in a mysql database with their information... when a new user signs
up.. it first checks with the mysql database and then if the username
doesn't already exist.. it creates an account on my machine along with an
ftp directory and a virtual directory where their website will reside....
only one problem... I can't get php to execute the vbscript to create the
account on my machine.

code looks like this:

$command ="mkaccount /username:".$user." /password:".$pass."";
shell_exec($command);

I have already checked my php.ini and safemode is set to off and the only
error it comes up with is
Unable to execute command: "mkaccount /username:testuser
/password:testpass"

testuser and testpass being the username and password i entered

if someone could help me out i would greatly appreciate it!

Thanks in advance.
NeoPhreak >.<



Reply With Quote
  #2 (permalink)  
Old 09-23-2003
Tom Thackrey
 
Posts: n/a
Default Re: Can't get shell_exec() to work!


On 22-Sep-2003, "NeoPhreak" <admin@neophreak.com> wrote:

> I have a registration page in php for webhosting. It has all the users
> stored in a mysql database with their information... when a new user signs
> up.. it first checks with the mysql database and then if the username
> doesn't already exist.. it creates an account on my machine along with an
> ftp directory and a virtual directory where their website will reside....
> only one problem... I can't get php to execute the vbscript to create the
> account on my machine.
>
> code looks like this:
>
> $command ="mkaccount /username:".$user." /password:".$pass."";
> shell_exec($command);
>
> I have already checked my php.ini and safemode is set to off and the only
> error it comes up with is
> Unable to execute command: "mkaccount /username:testuser
> /password:testpass"
>
> testuser and testpass being the username and password i entered
>
> if someone could help me out i would greatly appreciate it!


Two thoughts come to mind-- 1: permissions (can mkaccount run from the web
server's user and group?) and 2: path (have you tried the fully qualified
path to 'mkaccount'?)

--
Tom Thackrey
www.creative-light.com
Reply With Quote
  #3 (permalink)  
Old 09-25-2003
Mairhtin O'Feannag
 
Posts: n/a
Default Re: Can't get shell_exec() to work!

Is it possible to su - root from the shell_exec($command); ????? or
another user?

Mairhtin


"Tom Thackrey" <tomnr@creative-light.com> wrote in
news:8uNbb.4$A41.2653325@newssvr13.news.prodigy.co m:

>
> On 22-Sep-2003, "NeoPhreak" <admin@neophreak.com> wrote:
>
>> I have a registration page in php for webhosting. It has all the
>> users stored in a mysql database with their information... when a new
>> user signs up.. it first checks with the mysql database and then if
>> the username doesn't already exist.. it creates an account on my
>> machine along with an ftp directory and a virtual directory where
>> their website will reside.... only one problem... I can't get php to
>> execute the vbscript to create the account on my machine.
>>
>> code looks like this:
>>
>> $command ="mkaccount /username:".$user." /password:".$pass."";
>> shell_exec($command);
>>
>> I have already checked my php.ini and safemode is set to off and the
>> only error it comes up with is
>> Unable to execute command: "mkaccount /username:testuser
>> /password:testpass"
>>
>> testuser and testpass being the username and password i entered
>>
>> if someone could help me out i would greatly appreciate it!

>
> Two thoughts come to mind-- 1: permissions (can mkaccount run from the
> web server's user and group?) and 2: path (have you tried the fully
> qualified path to 'mkaccount'?)
>


Reply With Quote
  #4 (permalink)  
Old 09-25-2003
NeoPhreak
 
Posts: n/a
Default Re: Can't get shell_exec() to work!

That becomes a security issue....

"Mairhtin O'Feannag" <irishboyca@rocketmail.com> wrote in message
news:Xns9400B585AF891mairhtinofeannag@64.164.98.6. ..
> Is it possible to su - root from the shell_exec($command); ????? or
> another user?
>
> Mairhtin
>
>
> "Tom Thackrey" <tomnr@creative-light.com> wrote in
> news:8uNbb.4$A41.2653325@newssvr13.news.prodigy.co m:
>
> >
> > On 22-Sep-2003, "NeoPhreak" <admin@neophreak.com> wrote:
> >
> >> I have a registration page in php for webhosting. It has all the
> >> users stored in a mysql database with their information... when a new
> >> user signs up.. it first checks with the mysql database and then if
> >> the username doesn't already exist.. it creates an account on my
> >> machine along with an ftp directory and a virtual directory where
> >> their website will reside.... only one problem... I can't get php to
> >> execute the vbscript to create the account on my machine.
> >>
> >> code looks like this:
> >>
> >> $command ="mkaccount /username:".$user." /password:".$pass."";
> >> shell_exec($command);
> >>
> >> I have already checked my php.ini and safemode is set to off and the
> >> only error it comes up with is
> >> Unable to execute command: "mkaccount /username:testuser
> >> /password:testpass"
> >>
> >> testuser and testpass being the username and password i entered
> >>
> >> if someone could help me out i would greatly appreciate it!

> >
> > Two thoughts come to mind-- 1: permissions (can mkaccount run from the
> > web server's user and group?) and 2: path (have you tried the fully
> > qualified path to 'mkaccount'?)
> >

>



Reply With Quote
  #5 (permalink)  
Old 09-25-2003
Mairhtin O'Feannag
 
Posts: n/a
Default Re: Can't get shell_exec() to work!

I realize it is a security issue. Is it possible?

Mairhtin


"NeoPhreak" <admin@neophreak.com> wrote in news:awAcb.7370$yD1.1230128
@news20.bellglobal.com:

> That becomes a security issue....
>
> "Mairhtin O'Feannag" <irishboyca@rocketmail.com> wrote in message
> news:Xns9400B585AF891mairhtinofeannag@64.164.98.6. ..
>> Is it possible to su - root from the shell_exec($command); ????? or
>> another user?
>>
>> Mairhtin
>>

Reply With Quote
  #6 (permalink)  
Old 09-25-2003
Andy Hassall
 
Posts: n/a
Default Re: Can't get shell_exec() to work!

On Thu, 25 Sep 2003 17:34:36 GMT, "Mairhtin O'Feannag"
<irishboyca@rocketmail.com> wrote:

>>> Is it possible to su - root from the shell_exec($command); ????? or
>>> another user?

>>
>> That becomes a security issue....
>>

>
>I realize it is a security issue. Is it possible?


What happens when you tried it?

(The answer is yes, if you're mad enough to put your root password in a
script)

--
Andy Hassall (andy@andyh.co.uk) icq(5747695) (http://www.andyh.co.uk)
Space: disk usage analysis tool (http://www.andyhsoftware.co.uk/space)
Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT +1. The time now is 12:20 PM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0