Professional Web Applications Themes

Can't get shell_exec() to work! - PHP Development

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 ...

  1. #1

    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 >.<



    NeoPhreak Guest

  2. #2

    Default Re: Can't get shell_exec() to work!


    On 22-Sep-2003, "NeoPhreak" <adminneophreak.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
    [url]www.creative-light.com[/url]
    Tom Thackrey Guest

  3. #3

    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" <tomnrcreative-light.com> wrote in
    news:8uNbb.4$A41.2653325newssvr13.news.prodigy.co m:
    >
    > On 22-Sep-2003, "NeoPhreak" <adminneophreak.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'?)
    >
    Mairhtin O'Feannag Guest

  4. #4

    Default Re: Can't get shell_exec() to work!

    That becomes a security issue....

    "Mairhtin O'Feannag" <irishboycarocketmail.com> wrote in message
    news:Xns9400B585AF891mairhtinofeannag64.164.98.6. ..
    > Is it possible to su - root from the shell_exec($command); ????? or
    > another user?
    >
    > Mairhtin
    >
    >
    > "Tom Thackrey" <tomnrcreative-light.com> wrote in
    > news:8uNbb.4$A41.2653325newssvr13.news.prodigy.co m:
    >
    > >
    > > On 22-Sep-2003, "NeoPhreak" <adminneophreak.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'?)
    > >
    >

    NeoPhreak Guest

  5. #5

    Default Re: Can't get shell_exec() to work!

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

    Mairhtin


    "NeoPhreak" <adminneophreak.com> wrote in news:awAcb.7370$yD1.1230128
    news20.bellglobal.com:
    > That becomes a security issue....
    >
    > "Mairhtin O'Feannag" <irishboycarocketmail.com> wrote in message
    > news:Xns9400B585AF891mairhtinofeannag64.164.98.6. ..
    >> Is it possible to su - root from the shell_exec($command); ????? or
    >> another user?
    >>
    >> Mairhtin
    >>
    Mairhtin O'Feannag Guest

  6. #6

    Default Re: Can't get shell_exec() to work!

    On Thu, 25 Sep 2003 17:34:36 GMT, "Mairhtin O'Feannag"
    <irishboycarocketmail.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 (andyandyh.co.uk) icq(5747695) ([url]http://www.andyh.co.uk[/url])
    Space: disk usage ysis tool ([url]http://www.andyhsoftware.co.uk/space[/url])
    Andy Hassall Guest

Similar Threads

  1. shell_exec sudo problem
    By Paul in forum FreeBSD
    Replies: 2
    Last Post: February 19th, 09:03 PM
  2. calling a java program with shell_exec()
    By Martin Hampl in forum PHP Development
    Replies: 2
    Last Post: September 17th, 09:43 PM
  3. [PHP] shell_exec
    By Curt Zirzow in forum PHP Development
    Replies: 0
    Last Post: August 17th, 10:49 PM
  4. shell script not working with shell_exec
    By Chris Overman in forum PHP Development
    Replies: 2
    Last Post: August 14th, 02:58 PM
  5. [PHP] shell_exec
    By Christophe Chisogne in forum PHP Development
    Replies: 1
    Last Post: August 6th, 02:56 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139