From: ArcyQwerty <arc...@ar...> - 2009-05-11 20:34:10
|
Thanks I just figured it out $p = proc_open($command, array(1 => array('pipe', 'w'), 2 => array('pipe', 'w')), $io, getcwd()); The proc_open command can take a parameter with the current directory which is then passed onto the executed program ----- Original Message ----- From: Tobias Unger To: ArcyQwerty ; Discuss the development of PHP Shell Sent: Monday, May 11, 2009 4:02 PM Subject: Re: Fw: Fw: PHP Shell That (dir still showing the unchanged path) may have something to do with "cd" being an internal comand of PHP Shell. As far as I know you do not really change to the directory but just tell PHP Shell where you want the next comand to be executed. That is because the connection to PHP / the web server is not persistent (every comand you submit via PHP Shell will start a new task which does not know how the one before finished his work). ArcyQwerty schrieb am 11.05.2009 21:54 Uhr: After some experimentation, changing $_SESSION['cwd'] to chdir() and getcwd() depending on what I need seems to work out It will now recognize the current directory but commands like 'dir' still give me the system32 (probably has something to do with cmd.exe being in system32) ----- Original Message ----- From: Tobias Unger To: ArcyQwerty ; Discuss the development of PHP Shell Sent: Monday, May 11, 2009 2:52 PM Subject: Re: Fw: Fw: PHP Shell I'm sorry but I do not have a clue what the problem might be caused by, so I will not be able to help you... sorry for that! Actually I am just subscribed to this list because I once used PHP Shell... but that was some years ago... I hope there's anybody else reading this who is more familiar with PHP Shell and/or Windows Servers and who is able to help you! Good look with that! ArcyQwerty schrieb am 11.05.2009 20:35 Uhr: Yes I am still subscribed ;) I have tried different methods such as cd / cd .. cd ../ cd C:\ cd C: cd C:/ ----- Original Message ----- From: Tobias Unger To: ArcyQwerty ; Discuss the development of PHP Shell Sent: Sunday, May 10, 2009 4:37 PM Subject: Re: Fw: PHP Shell OK. Well then the problem must be caused by something else. I guess you tried using "cd .." serveral times instead of cd "C:\" to make sure it's not just a "syntax" problem? If you tried so without success, I hope Martin Geisler (the author of PHP Shell) can help you with that (as I do not have a clue what the problem might be caused by). @Martin Geisler I guess you are still subscribed to this mailing list? ArcyQwerty schrieb am 10.05.2009 22:08 Uhr: I am fairly sure that it has the ability to use the rights of the logged in user as the system32 directory is strictly off limits to the 'public' account ----- Original Message ----- From: Tobias Unger To: ArcyQwerty ; Discuss the development of PHP Shell Sent: Sunday, May 10, 2009 2:55 PM Subject: Re: PHP Shell I do not know if these Windows Web Servers access anything that the user they are running as is able to access, but if you run an Apache server you usually tell the server that he's not allowed to access files which are not in a special "public" folder. So if you run Apache with Linux as root (you normaly will not do that) and tell him not to access files which are not in /var/www/ (for example) or its subfolders, it is not able to change to / (which is usually simular to C:\) (even though root is able to access any files). As far as I know, PHP Shell is not able to access all the files that the user is able to access but just those the Web Server allows it to access (unlike a normal ssh etc.). Or did I just misunderstand your question? ArcyQwerty schrieb am 10.05.2009 19:28 Uhr: If I start with homedir as C:\ Current Working Directory: C:\ $ cd ./inetpub Current Working Directory: C:\/./inetpub $ ls [list of files in C:\windows\system32 shows up] C:\ and all directories under it are accessible by the authenticated user running PHP shell (running as admin by NTLM authentication) ----- Original Message ----- From: Tobias Unger To: ArcyQwerty ; Discuss the development of PHP Shell Sent: Sunday, May 10, 2009 10:48 AM Subject: Re: PHP Shell Did you try whether "cd .." works or not? And is C:\ accessable for PHP? [inside DocumentRoot for Apache Servers] I never tried using PHP Shell on an Windows Server... but that of course does not mean it will not work... ArcyQwerty schrieb am 10.05.2009 15:51 Uhr: I have installed phpshell 2.1 according to the INSTALL file and have successfully created a user and run it It is currently running on Windows Server 2003 R2 and IIS 6 However, I cannot use the cd command to change directory: $ cd C:\ chdir() [<a href='function.chdir'>function.chdir</a>]: No error (errno 0) cd: could not change to: C:\/C:\ PHP is not in safemode and the process running PHP Shell is running as a domain admin (authenticated through NTLM) ------------------------------------------------------------ ------------------------------------------------------------------------------ The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your production scanning environment may not be a perfect world - but thanks to Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700 Series Scanner you'll get full speed at 300 dpi even with all image processing features enabled. http://p.sf.net/sfu/kodak-com------------------------------------------------------------ _______________________________________________ phpshell-devel mailing list php...@li... https://lists.sourceforge.net/lists/listinfo/phpshell-devel -- Tobias Unger ma...@to... www.tobias-unger.de 0911 - 30 83 50 63 ---------------------------------------------------------------- ------------------------------------------------------------------------------ The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your production scanning environment may not be a perfect world - but thanks to Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700 Series Scanner you'll get full speed at 300 dpi even with all image processing features enabled. http://p.sf.net/sfu/kodak-com---------------------------------------------------------------- _______________________________________________ phpshell-devel mailing list php...@li... https://lists.sourceforge.net/lists/listinfo/phpshell-devel -- Tobias Unger ma...@to... www.tobias-unger.de 0911 - 30 83 50 63 -------------------------------------------------------------------- ------------------------------------------------------------------------------ The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your production scanning environment may not be a perfect world - but thanks to Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700 Series Scanner you'll get full speed at 300 dpi even with all image processing features enabled. http://p.sf.net/sfu/kodak-com-------------------------------------------------------------------- _______________________________________________ phpshell-devel mailing list php...@li... https://lists.sourceforge.net/lists/listinfo/phpshell-devel -- Tobias Unger ma...@to... www.tobias-unger.de 0911 - 30 83 50 63 ------------------------------------------------------------------------ ------------------------------------------------------------------------------ The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your production scanning environment may not be a perfect world - but thanks to Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700 Series Scanner you'll get full speed at 300 dpi even with all image processing features enabled. http://p.sf.net/sfu/kodak-com------------------------------------------------------------------------ _______________________________________________ phpshell-devel mailing list php...@li... https://lists.sourceforge.net/lists/listinfo/phpshell-devel -- Tobias Unger ma...@to... www.tobias-unger.de 0911 - 30 83 50 63 ---------------------------------------------------------------------------- ------------------------------------------------------------------------------ The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your production scanning environment may not be a perfect world - but thanks to Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700 Series Scanner you'll get full speed at 300 dpi even with all image processing features enabled. http://p.sf.net/sfu/kodak-com---------------------------------------------------------------------------- _______________________________________________ phpshell-devel mailing list php...@li... https://lists.sourceforge.net/lists/listinfo/phpshell-devel -- Tobias Unger ma...@to... www.tobias-unger.de 0911 - 30 83 50 63 |