what you don't know can hurt you
Home Files News &[SERVICES_TAB]About Contact Add New

nt.php.htm

nt.php.htm
Posted Jan 8, 2002
Authored by securiteam | Site securiteam.com

NT PHP.exe remote exploit. Allows any file on the webserver to be read.

tags | exploit, remote, php
SHA-256 | c70fec2805964960bbe0e6b210553f178550aa358ea04a158de1e717aa0fec37

nt.php.htm

Change Mirror Download
        <TD colspan="2" align="left" bgColor="navy">&nbsp;<FONT color=white><B style="FONT-SIZE: 12pt">Summary</B></FONT></TD>
</TR>
<TR>
<TD colspan="2" style="FONT-SIZE: 11pt">As advised in the installation text that comes with all versions of PHP, when installing PHP.EXE for use on a windows machine installed with Apache, the user should insert a few lines of code into the Apache "httpd.conf". These exact lines are shown here:<br>

&nbsp;&nbsp;&nbsp;ScriptAlias /php/ "c:/php/"<br>
&nbsp;&nbsp;&nbsp;AddType application/x-httpd-php .php<br>
&nbsp;&nbsp;&nbsp;Action application/x-httpd-php "/php/php.exe"<br>

A security vulnerability arises when placing the ScriptAlias line above. This line effectively maps the alias /php/ to your web document root such that typing "http://www.example.com/php/" will actually try to access in this case "c:\php\". Please note that the last "/" on the end of the URL has to exist for this to work ("http://www.example.com/php" will not work). At this point your server will respond with "Access Denied", however if you now specify the URL "http://www.example.com/php/php.exe" , you will see the error "No input file specified". This error is actually returned by php.exe, which you have just executed on the server.<br>

There are many exploits that can happen with this setup (some very serious, which could be used to gain root access).<br>
<br></TD>
</TR>
<TR>
<TD colspan="2" align="left" bgColor="navy">&nbsp;<FONT color="white"><B style="FONT-SIZE: 12pt">Details</B></FONT></TD>
</TR>
<TR>
<TD colspan="2" style="FONT-SIZE: 11pt"><B>Exploit 1:</B> <br>
It is possible to read <b>any</b> file remotely on the server, even across drives with the following URL construct:<br>
<br>
&nbsp;"http://www.example.com/php/php.exe?c:\winnt\repair\sam"<br>
<br>
PHP.EXE will parse the sam file "c:\winnt\repair\sam" and return it to the browser for download (this is the Windows NT password file).<br>
<br>
&nbsp;"http://www.example.com/php/php.exe?d:\winnt\repair\sam"<br>
<br>
PHP.EXE will return the same file on the D: drive.<br>
<br>
The above SAM file can then be used to decrypt all the Account Passwords for the Server.<br>
<br>
<B>Exploit 2:</B> <br>
If you specify a file that exists in the php directory (different files exist depending on the version of PHP), the web server will try to execute this file and will throw back an error reporting the install directory of php. So in PHP4, for example, you would specify the following line:<br>
<br>
&nbsp;"http://www.example.com/php/php4ts.dll"<br>
<br>
The error returned by the web server would be: " couldn't create child process: 22693: C:/php/php4ts.dll " showing the install path of PHP.<br>
<br></TD>
</TR>
<TR>
<TD colspan="2" align=left bgColor=navy>&nbsp;<FONT color=white><B style="FONT-SIZE: 12pt">Additional information</B></FONT></TD>
</TR>
<TR>
<TD colspan="2" style="FONT-SIZE: 11pt">The information has been provided by <A HREF="mailto:brereton_paul at btopenworld.com">Paul Brereton</A>.
<br></TD>
</TR>
</TABLE>
</td>
</TR>
<TR>
<TD COLSPAN="3">&nbsp;</TD>
</TR>
<TR>
<TD COLSPAN="3" width="1" height="1" bgcolor="orange"><img src="http://www.securiteam.com/space.gif" height=1 border="0" width=1 alt=&"nbsp;"></TD>
</TR>
<tr>
<td COLSPAN="3">
<div align="center">
<font color="gray" style="FONT-SIZE: 8pt">
Copyright © 1998-2001 <a href="http://www.beyondsecurity.com/info.html" style="COLOR: gray; FONT-SIZE: 7pt">Beyond Security
Ltd.</a> All rights reserved.<br>
<a href="http://www.beyondsecurity.com/legal.html" style="COLOR: gray; FONT-SIZE: 7pt">Terms of Use</a> <a href="http://www.beyondsecurity.com/privacy.html" style="COLOR: gray; FONT-SIZE: 7pt">Site Privacy Statement</a>.<br><br>
</font>
</div>
</td>
</tr>
</TABLE>
</DIV>
Login or Register to add favorites

File Archive:

July 2024

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    Jul 1st
    27 Files
  • 2
    Jul 2nd
    10 Files
  • 3
    Jul 3rd
    35 Files
  • 4
    Jul 4th
    27 Files
  • 5
    Jul 5th
    18 Files
  • 6
    Jul 6th
    0 Files
  • 7
    Jul 7th
    0 Files
  • 8
    Jul 8th
    28 Files
  • 9
    Jul 9th
    44 Files
  • 10
    Jul 10th
    24 Files
  • 11
    Jul 11th
    25 Files
  • 12
    Jul 12th
    11 Files
  • 13
    Jul 13th
    0 Files
  • 14
    Jul 14th
    0 Files
  • 15
    Jul 15th
    28 Files
  • 16
    Jul 16th
    6 Files
  • 17
    Jul 17th
    0 Files
  • 18
    Jul 18th
    0 Files
  • 19
    Jul 19th
    0 Files
  • 20
    Jul 20th
    0 Files
  • 21
    Jul 21st
    0 Files
  • 22
    Jul 22nd
    0 Files
  • 23
    Jul 23rd
    0 Files
  • 24
    Jul 24th
    0 Files
  • 25
    Jul 25th
    0 Files
  • 26
    Jul 26th
    0 Files
  • 27
    Jul 27th
    0 Files
  • 28
    Jul 28th
    0 Files
  • 29
    Jul 29th
    0 Files
  • 30
    Jul 30th
    0 Files
  • 31
    Jul 31st
    0 Files

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2022 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close