Suggestion:
file: banned_ip.php
code:
$ip_check = tep_get_ip_address();
Since
tep_get_ip_address() can allow either the values of the
HTTP_X_FORWARDED_FOR or
HTTP_CLIENT_IP header (if set) to be the ip address ahead of the dependable
REMOTE_ADDR, and because it is possible to spoof both of those headers, it might be better to stick with REMOTE_ADDR as the ip address to check for banned IPs in the db. That would also be consistent with the fact that
REMOTE_ADDR is used as the ip address that is banned in the banned.php file.
I know that where the webserver is a part of a cluster configuration, this can also cause false IP addresses to be banned, if you however depend on tep_get_ip_address() to check IPs in the db, that may allow for this addon to be completely bypassed if an attacker got to thinking about sending spoofed
HTTP_X_FORWARDED or
HTTP_CLIENT_IP ip addresses with their attacks.
code suggestion:
$ip_check = ( false !== isset( $_SERVER ) ) ? $_SERVER[ "REMOTE_ADDR" ] : getenv( "REMOTE_ADDR" );
Or more simply:
$ip_check = $_SERVER[ "REMOTE_ADDR" ]
- Stop Oscommerce hacks dead in their tracks with
osC_Sec (see discussion
here)
- Another discussion about infected files
::here::
- A discussion on file permissions
::here::
- Site hacked? Should you upgrade or not, some thoughts
::here::
-
Ignore this link - just a
honeypot site to test my ideas out for osC_Sec and allow the site to be picked up by attackers.
- Fix the admin login bypass exploit
here
-
Aegis Security: New security addon I am developing, a remake of osC_Sec in PHP 5 with a number of fixes