Posted: June 15th, 2012 | Author: xanda | Filed under: IT Related | Tags: 5.4.3, Code Read Vulnerability, php | 2 Comments »
As posted on http://1337day.com/exploits/18605, cheki claimed that PHP 5.4.3 is vulnerable to code read vulnerability, where the PHP interpreter will fail to execute the file once ‘~’ symbol added to the end of the file name. Snipped from the PoC:
=============================================================
#Demo: [root@cheki]# curl 109.234.119.2/index.php~
result: <!--?php phpinfo(); ?-->
#Target: http://localhost/index.php~
result: <!--?php phpinfo(); ?-->
============================================================
[root@cheki]# curl 109.234.119.2/index.php
result: NULL
#Target: http://localhost/index.php
result: NULL
=========================================================== |
=============================================================
#Demo: [root@cheki]# curl 109.234.119.2/index.php~
result: <!--?php phpinfo(); ?-->
#Target: http://localhost/index.php~
result: <!--?php phpinfo(); ?-->
============================================================
[root@cheki]# curl 109.234.119.2/index.php
result: NULL
#Target: http://localhost/index.php
result: NULL
===========================================================
Ok.. Since I had a test machine (Ubuntu) SSHed earlier, so I stright away add a new PPA repo (https://launchpad.net/~ondrej/+archive/php5) and install PHP 5.4.3. So here is my version to verify the PoC:
xanda@vostro:~$ php -v
PHP 5.4.3-4~precise+1 (cli) (built: May 17 2012 13:00:25)
Copyright (c) 1997-2012 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2012 Zend Technologies
xanda@vostro:~$ curl 127.0.0.1/index.php
<form action="" method="post">
<input type="text" name="lala">
<input type="submit">
</form>
xanda@vostro:~$ curl 127.0.0.1/index.php~
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>404 Not Found</title>
</head><body>
<h1>Not Found</h1>
<p>The requested URL /index.php~ was not found on this server.</p>
<hr>
<address>Apache/2.2.22 (Ubuntu) Server at 127.0.0.1 Port 80</address>
</body></html> |
xanda@vostro:~$ php -v
PHP 5.4.3-4~precise+1 (cli) (built: May 17 2012 13:00:25)
Copyright (c) 1997-2012 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2012 Zend Technologies
xanda@vostro:~$ curl 127.0.0.1/index.php
<form action="" method="post">
<input type="text" name="lala">
<input type="submit">
</form>
xanda@vostro:~$ curl 127.0.0.1/index.php~
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>404 Not Found</title>
</head><body>
<h1>Not Found</h1>
<p>The requested URL /index.php~ was not found on this server.</p>
<hr>
<address>Apache/2.2.22 (Ubuntu) Server at 127.0.0.1 Port 80</address>
</body></html>
Hurmmmm okkkk…. I haven’t tested on Fedora release 17 (Beefy Miracle) as claimed by the author, but I think this is… You name it..
Please take note that most of GUI based text editor (eg: Gedit) will (auto)save your edited file into a backup file with the same file name but ended with ‘~’… Just like in the PoC huh?
If anyone managed to test it on Fedora release 17 (Beefy Miracle), kindly drop me the result on the comment section. Thanks in advance
Cheers 🙂
Mirror for the advisory: http://pastebin.com/H1tjRDpD
Update
1) @Netasq has given 2 workarounds for this issue.
- http://twitter.com/Netasq/status/213647398025703425
In case you can't update PHP to 5.4.4, a quick Apache fix #security (1/2) Order allow,deny Deny from all |
In case you can't update PHP to 5.4.4, a quick Apache fix #security (1/2) Order allow,deny Deny from all
2) Its not listed here (or I’ve missed it?) :- http://www.php.net/ChangeLog-5.php
Posted: June 14th, 2012 | Author: xanda | Filed under: IT Related | Tags: port, SCADA | No Comments »
Just re-mirror for http://pastebin.com/EwCibKgc
# Default Scada Ports
- xflix
+-------+---------------------------------------+
| Port | Description |
+-------+---------------------------------------+
| 502 | Modbus |
| 1089 | Foundation Fieldbus HSE |
| 1090 | Foundation Fieldbus HSE |
| 1091 | Foundation Fieldbus HSE |
| 1541 | Foxboro/Invensys Foxboro DCS Informix |
| 1883 | MQ Telemetry Transport |
| 2222 | EtherNet/IP |
| 3480 | OPC UA Discovery Server |
| 4000 | Emerson/Fisher ROC Plus |
| 4592 | Project/SCADA Node Primary Port |
| 5050 | Telvent OASyS DNA |
| 5052 | Telvent OASyS DNA |
| 5065 | Telvent OASyS DNA |
| 5450 | OSIsoft PI Server |
| 10307 | ABB Ranger 2003 |
| 10311 | ABB Ranger 2003 |
| 10364 | ABB Ranger 2003 |
| 10407 | ABB Ranger 2003 |
| 10409 | ABB Ranger 2003 |
| 10412 | ABB Ranger 2003 |
| 10414 | ABB Ranger 2003 |
| 10428 | ABB Ranger 2003 |
| 10431 | ABB Ranger 2003 |
| 10447 | ABB Ranger 2003 |
| 10449 | ABB Ranger 2003 |
| 12316 | ABB Ranger 2003 |
| 12645 | ABB Ranger 2003 |
| 12647 | ABB Ranger 2003 |
| 13722 | ABB Ranger 2003 |
| 11001 | Johnson Controls Metasys N1 |
| 12135 | Telvent OASyS DNA |
| 13724 | ABB Ranger 2003 |
| 13782 | ABB Ranger 2003 |
| 14592 | SCADA Node Secondary Port |
| 18000 | Iconic Genesis32 GenBroker (TCP) |
| 19999 | DNP |
| 20000 | DNP3 |
| 34962 | PROFINET |
| 34963 | PROFINET |
| 34964 | PROFINET |
| 34980 | EtherCAT |
| 38589 | ABB Ranger 2003 |
| 38593 | ABB Ranger 2003 |
| 38000 | SNC GENe |
| 38011 | SNC GENe |
| 38014 | SNC GENe |
| 38200 | SNC GENe |
| 38210 | SNC GENe |
| 38301 | SNC GENe |
| 38400 | SNC GENe |
| 38600 | ABB Ranger 2003 |
| 38700 | SNC GENe |
| 38971 | ABB Ranger 2003 |
| 39129 | ABB Ranger 2003 |
| 39278 | ABB Ranger 2003 |
| 44818 | EtherNet/IP |
| 45678 | Foxboro/Invensys Foxboro DCS AIMAPI |
| 47808 | BACnet/IP |
| 50001 | Siemens Spectrum Power TG |
| 50018 | Siemens Spectrum Power TG |
| 50020 | Siemens Spectrum Power TG |
| 50025 | Siemens Spectrum Power TG |
| 50110 | Siemens Spectrum Power TG |
| 55000 | FL-net Reception |
| 55003 | FL-net Transmission |
| 55550 | Foxboor/Invensys Foxboro DCS FoxAPI |
| 56001 | Telvent OASyS DNA |
| 62900 | SNC GENe |
| 62911 | SNC GENe |
| 62924 | SNC GENe |
| 62930 | SNC GENe |
| 62938 | SNC GENe |
| 62956 | SNC GENe |
| 62963 | SNC GENe |
| 62981 | SNC GENe |
| 62985 | SNC GENe |
| 62992 | SNC GENe |
| 63012 | SNC GENe |
| 63027 | SNC GENe |
| 63041 | SNC GENe |
| 63075 | SNC GENe |
| 63079 | SNC GENe |
| 63082 | SNC GENe |
| 63088 | SNC GENe |
| 63094 | SNC GENe |
| 65443 | SNC GENe |
+-------+---------------------------------------+ |
# Default Scada Ports
- xflix
+-------+---------------------------------------+
| Port | Description |
+-------+---------------------------------------+
| 502 | Modbus |
| 1089 | Foundation Fieldbus HSE |
| 1090 | Foundation Fieldbus HSE |
| 1091 | Foundation Fieldbus HSE |
| 1541 | Foxboro/Invensys Foxboro DCS Informix |
| 1883 | MQ Telemetry Transport |
| 2222 | EtherNet/IP |
| 3480 | OPC UA Discovery Server |
| 4000 | Emerson/Fisher ROC Plus |
| 4592 | Project/SCADA Node Primary Port |
| 5050 | Telvent OASyS DNA |
| 5052 | Telvent OASyS DNA |
| 5065 | Telvent OASyS DNA |
| 5450 | OSIsoft PI Server |
| 10307 | ABB Ranger 2003 |
| 10311 | ABB Ranger 2003 |
| 10364 | ABB Ranger 2003 |
| 10407 | ABB Ranger 2003 |
| 10409 | ABB Ranger 2003 |
| 10412 | ABB Ranger 2003 |
| 10414 | ABB Ranger 2003 |
| 10428 | ABB Ranger 2003 |
| 10431 | ABB Ranger 2003 |
| 10447 | ABB Ranger 2003 |
| 10449 | ABB Ranger 2003 |
| 12316 | ABB Ranger 2003 |
| 12645 | ABB Ranger 2003 |
| 12647 | ABB Ranger 2003 |
| 13722 | ABB Ranger 2003 |
| 11001 | Johnson Controls Metasys N1 |
| 12135 | Telvent OASyS DNA |
| 13724 | ABB Ranger 2003 |
| 13782 | ABB Ranger 2003 |
| 14592 | SCADA Node Secondary Port |
| 18000 | Iconic Genesis32 GenBroker (TCP) |
| 19999 | DNP |
| 20000 | DNP3 |
| 34962 | PROFINET |
| 34963 | PROFINET |
| 34964 | PROFINET |
| 34980 | EtherCAT |
| 38589 | ABB Ranger 2003 |
| 38593 | ABB Ranger 2003 |
| 38000 | SNC GENe |
| 38011 | SNC GENe |
| 38014 | SNC GENe |
| 38200 | SNC GENe |
| 38210 | SNC GENe |
| 38301 | SNC GENe |
| 38400 | SNC GENe |
| 38600 | ABB Ranger 2003 |
| 38700 | SNC GENe |
| 38971 | ABB Ranger 2003 |
| 39129 | ABB Ranger 2003 |
| 39278 | ABB Ranger 2003 |
| 44818 | EtherNet/IP |
| 45678 | Foxboro/Invensys Foxboro DCS AIMAPI |
| 47808 | BACnet/IP |
| 50001 | Siemens Spectrum Power TG |
| 50018 | Siemens Spectrum Power TG |
| 50020 | Siemens Spectrum Power TG |
| 50025 | Siemens Spectrum Power TG |
| 50110 | Siemens Spectrum Power TG |
| 55000 | FL-net Reception |
| 55003 | FL-net Transmission |
| 55550 | Foxboor/Invensys Foxboro DCS FoxAPI |
| 56001 | Telvent OASyS DNA |
| 62900 | SNC GENe |
| 62911 | SNC GENe |
| 62924 | SNC GENe |
| 62930 | SNC GENe |
| 62938 | SNC GENe |
| 62956 | SNC GENe |
| 62963 | SNC GENe |
| 62981 | SNC GENe |
| 62985 | SNC GENe |
| 62992 | SNC GENe |
| 63012 | SNC GENe |
| 63027 | SNC GENe |
| 63041 | SNC GENe |
| 63075 | SNC GENe |
| 63079 | SNC GENe |
| 63082 | SNC GENe |
| 63088 | SNC GENe |
| 63094 | SNC GENe |
| 65443 | SNC GENe |
+-------+---------------------------------------+