PDA

Zobacz pełną wersję : Register globals OFF htaccess



czarofnik
28-03-2007, 17:18
czytakem pomoc i szukałem na forum

mam w htaccess
php_flag register_globals off


admin twierdzi ze jest na serwie na off a u mnie na stornie w PA wyświetla,
Następujące ustawienia PHP na serwerze nie są optymalne ze względów bezpieczeństwa i zalecana jest ich zmiana:

Zmienna PHP register_globals ustawiona jest ’ON’ zamiast ’OFF’mam juz dzis dosć joomli ostanio przezylem jakis atak ktory pojechał mi strone na jeden dzien
moze ktoś juz spotkał się z takim tematem !?


MOj HTaccess


##
# @version $Id: htaccess.txt 4756 2006-08-25 16:07:11Z stingrey $
# @package Joomla
# @copyright Copyright (C) 2005 Open Source Matters. All rights reserved.
# @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
# Joomla! is Free Software
##


################################################## ###
# READ THIS COMPLETELY IF YOU CHOOSE TO USE THIS FILE
#
# The line just below this section: 'Options FollowSymLinks' may cause problems
# with some server configurations. It is required for use of mod_rewrite, but may already
# be set by your server administrator in a way that dissallows changing it in
# your .htaccess file. If using it causes your server to error out, comment it out (add # to
# beginning of line), reload your site in your browser and test your sef url's. If they work,
# it has been set by your server administrator and you do not need it set here.
#
# Only use one of the two SEF sections that follow. Lines that can be uncommented
# (and thus used) have only one #. Lines with two #'s should not be uncommented
# In the section that you don't use, all lines should start with #
#
# For Standard SEF, use the standard SEF section. You can comment out
# all of the RewriteCond lines and reduce your server's load if you
# don't have directories in your root named 'component' or 'content'
#
# If you are using a 3rd Party SEF or the Core SEF solution
# uncomment all of the lines in the '3rd Party or Core SEF' section
#
################################################## ###

##### SOLVING PROBLEMS WITH COMPONENT URL's that don't work #####
# SPECIAL NOTE FOR SMF USERS WHEN SMF IS INTEGRATED AND BRIDGED
# OR ANY SITUATION WHERE A COMPONENT's URL's AREN't WORKING
#
# In both the 'Standard SEF', and '3rd Party or Core SEF' sections the line:
# RewriteCond %{REQUEST_URI} ^(/component/option,com) [NC,OR] ##optional - see notes##
# May need to be uncommented. If you are running your Joomla/Mambo from
# a subdirectory the name of the subdirectory will need to be inserted into this
# line. For example, if your Joomla/Mambo is in a subdirectory called '/test/',
# change this:
# RewriteCond %{REQUEST_URI} ^(/component/option,com) [NC,OR] ##optional - see notes##
# to this:
# RewriteCond %{REQUEST_URI} ^(/test/component/option,com) [NC,OR] ##optional - see notes##
#
################################################## ###


## Can be commented out if causes errors, see notes above.
Options FollowSymLinks

AddType application/x-httpd-php5 .php


#
# mod_rewrite in use

RewriteEngine On


# Uncomment following line if your webserver's URL
# is not directly related to physical file paths.
# Update Your Joomla/MamboDirectory (just / for root)

# RewriteBase /


########## Begin - Joomla! core SEF Section
############# Use this section if using ONLY Joomla! core SEF
## ALL (RewriteCond) lines in this section are only required if you actually
## have directories named 'content' or 'component' on your server
## If you do not have directories with these names, comment them out.
#
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
#RewriteCond %{REQUEST_URI} ^(/component/option,com) [NC,OR] ##optional - see notes##
RewriteCond %{REQUEST_URI} (/|\.htm|\.php|\.html|/[^.]*)$ [NC]
RewriteRule ^(content/|component/) index.php
#
########## End - Joomla! core SEF Section



########## Begin - 3rd Party SEF Section
############# Use this section if you are using a 3rd party (Non Joomla! core) SEF extension - e.g. OpenSEF, 404_SEF, 404SEFx, SEF Advance, etc
#
#RewriteCond %{REQUEST_URI} ^(/component/option,com) [NC,OR] ##optional - see notes##
#RewriteCond %{REQUEST_URI} (/|\.htm|\.php|\.html|/[^.]*)$ [NC]
#RewriteCond %{REQUEST_FILENAME} !-f
#RewriteCond %{REQUEST_FILENAME} !-d
#RewriteRule (.*) index.php
#
########## End - 3rd Party SEF Section



########## Begin - Rewrite rules to block out some common exploits
## If you experience problems on your site block out the operations listed below
## This attempts to block the most common type of exploit `attempts` to Joomla!
#
# Block out any script trying to set a mosConfig value through the URL
RewriteCond %{QUERY_STRING} mosConfig_[a-zA-Z_]{1,21}(=|\%3D) [OR]
# Block out any script trying to base64_encode crap to send via URL
RewriteCond %{QUERY_STRING} base64_encode.*\(.*\) [OR]
# Block out any script that includes a <script> tag in URL
RewriteCond %{QUERY_STRING} (\<|%3C).*script.*(\>|%3E) [NC,OR]
# Block out any script trying to set a PHP GLOBALS variable via URL
RewriteCond %{QUERY_STRING} GLOBALS(=|\[|\%[0-9A-Z]{0,2}) [OR]
# Block out any script trying to modify a _REQUEST variable via URL
RewriteCond %{QUERY_STRING} _REQUEST(=|\[|\%[0-9A-Z]{0,2})
# Send all blocked request to homepage with 403 Forbidden error!
RewriteRule ^(.*)$ index.php [F,L]
#
########## End - Rewrite rules to block out some common exploits
php_flag register_globals off

zwiastun
28-03-2007, 20:51
1. Nie wierz adminowi, masz komunikat+ PHP info jedno z nich na pewno nie kłamie
2. To, że miałes atak, to wcale jeszcze nie znaczy, że z powodu register_globals
Powodu trzeba dociec, może jakiś dziurawy komponent?

A swoją drogą, masz J 1.0.1, 1.0.2, czy 1.0.12
Bo każesz wróżyć z fusów

czarofnik
29-03-2007, 00:57
Ta wersja Joomla! [ 1.0.11 Stable ] pochodzi sprzed:231 dni


taką mam a adminowi nie mam co nie ufać bo to mój przyjaciel :))

a jak sprawdzić czy mówi prawdę?

bo to było tak
jednego pewnego dnia chłopaki z administracji serwisu napisali ze nie mogą sie zalogować jako admini, ja tez nie moglem zgłosiłem do pionu technicznego z serwerowni powiedzieli ze jest ok

ale nie moglem nadpisywać plików ani zakładać katalogów i każdy nadpisany plik po takiej akcji miał rozmiar 0kb później gdy problem rozwiązali nadpisałem pliki admina i pokazało w PA ze register globals mam na on
a wcześniej było na off. to wszystko teraz z fusów już nie musisz wróżyć chyba ze coś ominąłem

zwiastun
29-03-2007, 01:42
?????
To i tak jednak dalej wróżenie...
Ustawienia php sprawdzasz w menu system, w zakładce PHP, tam poczytaj, jak jest z register globals.
O włamie piszesz, że był, ale nie piszesz, na czym polegał, to że się nie można było zalogować, to niekoniecznie efekt włamu. Skoro RG sygnalizowało się wcześniej OFF, a teraz ON, to przecie ani myszki, ani chomiczki tego nie zrobiły.
No i ewentualna sprawa włamu:
1. A czemu masz 1.0.11 skoro wiadomo, że są luki w bezpieczeństwie?
2. Czy wszystkie dodatkowo instalowane skłądniki to bezpieczne wersje?

czarofnik
29-03-2007, 10:27
dobra sprawdze w PHP : i napisze

a jaka wersja jest bezpieczna ???!!!

szuman
30-03-2007, 09:04
bez ujmy, ale to, że przyjaciel wcale nie oznacza, że się na wszystkim zna i zawsze przyzna się do tego, że się nie zna. Co do przyczyny ataku, to najlepiej, jakbyś wkleił kilka linijek z logów serwera. Przedwczoraj też miałem małe kuku, podmienili mi configuration.php i wrzucili index.html do kat. głównego. Akurat byłem na swojej stronie, więc od razu poprawiłem. Rano admin serwera wyłączył register_globals, a wczoraj wieczorem sprawdziłem logi ponownie i dwukrotnie atak był powtarzany, ale już bez powodzenia. Myślę, że kluczową rolą jest ustawienie zmiennej RG i jeśli Joomla woła o to, to trzeba zrobić tak, aby wołanie ustało. Z doświadczenia to mówie, latem zeszłego roku miałem 4 włamania w ciągu pieciu dni i zadne update'y nie pomogly, dopiero wyłączenie rg.

sokam
05-04-2007, 14:36
Witam ja też używam wersji Joomla! 1.0.11 Stable [ Sunbow ] 28 August 2006 20:00 UTC
Joomla! Emulacja Register Globals OFF (wył.)
Register Globals [Rejestruj globalne zmienne]:: ON (wł.)
Magic Quotes [Magiczne sekwencje sterujące]:: OFF (wył.)
Safe Mode [Tryb bezpieczny]:: ON (wł.)
File Uploads [Wczytywanie plików]:: ON (wł.)
Session auto start [Automatyczny start sesji]:: OFF (wył.)
Gdzie należy zmienic te wartości ? bo niechce żeby mi ktoś stronke shakował