473,748 Members | 2,170 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Windows registry access in PHP webpage possible?

Has anyone ever managed to read a Windows registry key in a PHP webpage? I
installed the PHP extension win32std and saved their sample script from
http://wildphp.free.fr/wiki/doku.php...egistry_access as a
webpage. However when I open the webpage (PHP 5.1.2, Windows Server 2003,
IIS 6) I get the error message "Warning: Can't open registry key: The
operation completed successfully." Is registry access only possible in
Windows executables?

Boris
Jan 27 '06 #1
6 9014
*** Boris escribió/wrote (Fri, 27 Jan 2006 18:32:36 +0100):
Has anyone ever managed to read a Windows registry key in a PHP webpage? I
installed the PHP extension win32std and saved their sample script from
http://wildphp.free.fr/wiki/doku.php...egistry_access as a
webpage. However when I open the webpage (PHP 5.1.2, Windows Server 2003,
IIS 6) I get the error message "Warning: Can't open registry key: The
operation completed successfully." Is registry access only possible in
Windows executables?


Just speculating... Apache normally runs under the local system account, if
I recall correctly. The chosen registry key may have more restrictive
permissions.

I suggest you first try to run your script from the command line, so it has
the same privileges as your personal user. If that's the issue, it can be
fixed later.
--
-+ Álvaro G. Vicario - Burgos, Spain
++ http://bits.demogracia.com es mi sitio para programadores web
+- http://www.demogracia.com es mi web de humor libre de cloro
--
Jan 27 '06 #2
*** Alvaro G. Vicario escribió/wrote (Fri, 27 Jan 2006 23:24:46 +0100):
Apache normally runs under the local system account


Where I said Apache please read IIS and where I said system account please
read IUSR_FOOBAR. See the "Services" snap-in console for further info.
--
-+ Álvaro G. Vicario - Burgos, Spain
++ http://bits.demogracia.com es mi sitio para programadores web
+- http://www.demogracia.com es mi web de humor libre de cloro
--
Jan 27 '06 #3
Boris wrote:
Has anyone ever managed to read a Windows registry key in a PHP webpage? I
installed the PHP extension win32std and saved their sample script from
http://wildphp.free.fr/wiki/doku.php...egistry_access as a
webpage. However when I open the webpage (PHP 5.1.2, Windows Server 2003,
IIS 6) I get the error message "Warning: Can't open registry key: The
operation completed successfully." Is registry access only possible in
Windows executables?

Boris

If anything other than the local running user is able to read the
registry, I would consider that a breach of security - BAD - VERY BAD
IDEA.

Another reason to ditch winbloze and go Linux for a desktop.

Michael Austin.
Jan 28 '06 #4

"Alvaro G. Vicario" <we*******@NOSP AMdemogracia.co m>,
news:10******** *************** ******@40tude.n et...
*** Boris escribió/wrote (Fri, 27 Jan 2006 18:32:36 +0100):
Has anyone ever managed to read a Windows registry key in a PHP webpage?
I
installed the PHP extension win32std and saved their sample script from
http://wildphp.free.fr/wiki/doku.php...egistry_access as
a
webpage. However when I open the webpage (PHP 5.1.2, Windows Server 2003,
IIS 6) I get the error message "Warning: Can't open registry key: The
operation completed successfully." Is registry access only possible in
Windows executables?
Just speculating... Apache normally runs under the local system account,
if
I recall correctly. The chosen registry key may have more restrictive
permissions.


The script tries to read "HKEY_CURRENT_U SER\Control Panel". As far as I know
this key exists for all user accounts. And each user should be able to read
his HKEY_CURRENT_US ER branch, too.
I suggest you first try to run your script from the command line, so it
has
the same privileges as your personal user. If that's the issue, it can be
fixed later.


Thanks, I tried that. It works! Actually I would agree that it is a
permission issue but see above. According to
http://support.microsoft.com/kb/163846/en-us the registry keys of the SYSTEM
account are stored at \HKEY_USERS\S-1-5-18. When I check
"\HKEY_USER S\S-1-5-18\Control Panel" the SYSTEM account does have
read-access. I would expect the PHP webpage to be able to find and read this
key under \HKEY_CURRENT_U SER?

Boris
Jan 28 '06 #5
*** Boris escribió/wrote (Sat, 28 Jan 2006 14:28:04 +0100):
Thanks, I tried that. It works! Actually I would agree that it is a
permission issue but see above. According to
http://support.microsoft.com/kb/163846/en-us the registry keys of the SYSTEM
account are stored at \HKEY_USERS\S-1-5-18. When I check
"\HKEY_USER S\S-1-5-18\Control Panel" the SYSTEM account does have
read-access. I would expect the PHP webpage to be able to find and read this
key under \HKEY_CURRENT_U SER?


Please read my second message. IIS runs under its own user, typically
called IUSR_MACHINENAM E.

--
-+ Álvaro G. Vicario - Burgos, Spain
++ http://bits.demogracia.com es mi sitio para programadores web
+- http://www.demogracia.com es mi web de humor libre de cloro
--
Jan 29 '06 #6

"Alvaro G. Vicario" <we*******@NOSP AMdemogracia.co m>,
news:zx******** *************** ******@40tude.n et...
*** Boris escribió/wrote (Sat, 28 Jan 2006 14:28:04 +0100):
Thanks, I tried that. It works! Actually I would agree that it is a
permission issue but see above. According to
http://support.microsoft.com/kb/163846/en-us the registry keys of the
SYSTEM
account are stored at \HKEY_USERS\S-1-5-18. When I check
"\HKEY_USER S\S-1-5-18\Control Panel" the SYSTEM account does have
read-access. I would expect the PHP webpage to be able to find and read
this
key under \HKEY_CURRENT_U SER?


Please read my second message. IIS runs under its own user, typically
called IUSR_MACHINENAM E.


I created now a new application pool for the virtual directory which
contains the PHP script and explicitly set the user account to NETWORK
SERVICE. This is the same user account used by ASP.NET scripts. While the
ASP.NET script can access the registry the PHP script still returns the same
error. Meanwhile I also contacted one of the developers of the PHP extension
and asked him if he ever ran his sample script succesfully from a webpage.
If I get an answer I'll forward it.

Boris
Jan 29 '06 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

16
2320
by: Paul Rubin | last post by:
As what must be penance for something or other, I'm needing to release a Python app for use under Windows XP. Please be gentle with me since I'm a Un*x weenie and the only thing I've had much practice with under Windows is rebooting it. My app contains three different programs (say alice.py, bob.py, and carol.py) that need to be independently launchable, and a dozen or so other .py files that get imported into those first three. What...
5
12939
by: Dhilip Kumar | last post by:
Hi All, I'm writing a Windows Service app using C#. I need to read some configuration settings before the service starts up. These settings will be used by the service in its operation. Question is, which is the best way to store & retrieve the settings? I'm thinking of storing it in the registry in HKLM\Software\ServiceName and access it using the Registry class in the "public ServiceName()" method. I'm instructing the service...
4
3534
by: James | last post by:
I have a VB windows forms application that accesses a Microsoft Access database that has been secured using user-level security. The application is being deployed using No-Touch deployment. The objective in utilizing this new deployment method is to reduce the maintenance overhead as well as making it easier for my users to setup and run the application initially. I have VS 2002, Windows XP, Access XP(2000 format). He is my problem....
1
4336
by: PrettySneaky | last post by:
I currently working on a webservice which calls a DCOM object! The webproject works just fine when i run it in Visual studio 2005. However due to some compability issues with .NET 2.0 and the server which my webservice uses I have to use Visual Studio 2003 and a older .NET framework (.NET 1.1 or something, not important). Now it's impossible to run the webservices and I believe it has to do with something with the security settings of...
4
6352
by: korund | last post by:
Is there any difference to read & write to windows Registry with VBScript or JavaScript? Both scripting languages have similar syntax. What is preferable use for this? thanks.
16
1844
by: eSolTec, Inc. 501(c)(3) | last post by:
Thank you in advance for any and all assistance. I'm looking for a way to programmatically retrieve the following if possible: Windows Installation Key or COA from the registry Windows installed applications, like: MS Office 97-2003 MS FrontPage MS Word MS Works
2
10253
by: Ntl News Group | last post by:
Is it possible to run Access 97 on Windows Vista? I have installed Access 97 and Access 2000, when I run Access 2000, then try to open Access 97 it says it cant find the windows registry entries? Re-Installing Access 97 seems to fix it until I open Access 2000 again. I have run both Access 97 and Access 2000 on all previous versions of windows without any problems. Any suggestions would be appreciated.
5
3680
by: =?Utf-8?B?Qkw=?= | last post by:
Hello friends In c# 2005 I have written a function to access "font file name" by "Font name" and it is working fine in all the windows version other than vista, in vista it is throughing an error so please help me how can i access font file name by font name in windows vista or what change i have to do in following function to get the solution my function source code is givin below -
1
2710
by: kbnumesh | last post by:
Dear All, I have query regarding the registry. Is it possible to write it to windows registry using the XML? if yes then what is the API or tag used to write it. I am just a beginner in XML. thanks in advance.
0
8991
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8831
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9376
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9249
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6796
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6076
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4607
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3315
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2215
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.