2011-11-25 4 views
2

나는 1.5.25를 실행 중이고 어떻게 든 .htaccess 파일이 내 루트에 계속 생성됩니다.Joomla 사이트 .htaccess가 계속 해킹 당함

ErrorDocument 400 http:// redirected url index.php                              
ErrorDocument 404 http:// redirected url index.php index.php                              
ErrorDocument 500 http://redirected url /index.php 

<IfModule mod_rewrite.c>                               
RewriteEngine On                               
RewriteCond %{HTTP_REFERER} ^.*(google|ask|yahoo|baidu|youtube|wikipedia|qq|excite|altavista|msn|netscape|aol|hotbot|goto|infoseek|mamma|alltheweb|lycos|search|metacrawler|bing|dogpile|facebook|twitter|blog|live|myspace|mail|yandex|rambler|ya|aport|linkedin|flickr)\.(.*)                              
RewriteRule ^(.*)$ http://redirected url index.php [R=301,L]                              
</IfModule> 

삭제 한 경우에도 .htaccess 파일을 누가 생성하는지 확인하는 방법을 알고 싶습니다. 어떤 스크립트가 이것을 생성하는지 알아내는 곳이 있습니까? 어떤 사용자가 그것을 생성합니까?

전에이 문제가 발생한 사람은 누구입니까? .htaccess 파일을 생성하고 변경하지 못하게하는 방법이 있습니까? 644 권한 설정을 적용하는 것이 도움이되지 않는 것 같습니다.

참고 : 나는

+0

이 질문은 프로그래밍에 관한 내용이므로 오프 사이트로 보입니다. http://security.stackexchange.com/ – bummi

답변

0

어쩌면 좋은 먼저 확인이 (crontab을 -l)를 할 어떤 cronjobs가 있는지 확인하는 것입니다 index.php를 리디렉션 된 URL에 실제 리디렉션 URL을 변경했습니다. 일부 호스팅 패널에는 정리 작업이 있으며 UI를 사용하여 .htaccess 만 수정할 수 있습니다 (데이터베이스에 먼저 저장됩니다).

이렇게하면 진행될 수도 있습니다. http://www.infoq.com/articles/inotify-linux-file-system-event-monitoring

+0

$ crontab -l은 (는) 저에게별로 알려주지 않습니다. 모든 행은 주석 처리됩니다. 나는 SSH를 사용하여 DreamHost 서버에 연결 했으므로 그 파일 검사기 응용 프로그램을 설치할 수 있다고 생각하지 않습니다. – Churchill

+0

이전 답변이 Windows 전용이었던 것처럼 내 대답이 업데이트되었습니다. 이것은 당신의 요구를 훨씬 잘 충족시켜야합니다. – MartinIB

4

Erm 권한 644는 파일을 쓸 수 있음을 나타냅니다. 나는 서버가 어떻게 설정되었고, 소유자가 당신 (ftp 사용자)인지 '아무도'웹 서버인지 여부를 모른다.

Joomla의 오래된 버전이거나 취약한 부가 기능이 있습니다. 누군가가 취약점을 사용하여 파일 시스템에 '웹 셸'을 삭제했을 가능성이 큽니다. 이를 통해 파일에 연결할 수 있으며 파일 편집, 파일 업로드, 임의의 명령 실행을위한 제어 패널을 제공합니다.

서버의 다른 계정이 손상되어 해당 계정 내의 파일이 서버 범위에 도달하거나 적어도 서버의 쓰기 가능한 파일/폴더에 접근하여 편집 할 수 있습니다.

실제로 웹 보안 전문가의 도움을 받아야하지만 여기서 직접 분석하고 싶은 경우 몇 가지 조치를 취해야합니다.

서버에서 '찾기'명령을 사용하여 파일 시스템을 검색하여 마지막 x 일 또는 마지막 x 시간 동안 변경된 파일을 찾을 수도 있습니다.

사이트를 오프라인으로 설정하고 호스트에게 연락하여 문제를 설명하고 제공 할 수있는 정보를 확인해야합니다. 파일을 다운로드하고 첫 번째 조치로서 강력한 바이러스 스캐너를 통해 실행해야합니다 (요즘 대부분의 웹 셸을 식별합니다).

에서 다음 단어/패턴 파일을 통해

검색 - 그렙 또는 유사한이 유용하다 :

웹 \ s의의 * 쉘

R57

에 의해 \ *이 s의 해킹 c99

base64_decode

Th \ s *가있는 e 행은 정규 표현식입니다. 마지막은 많은 오탐을 제공 할 것입니다. 각 파일에서 의심스러운 파일, Joomla 코드처럼 보이지 않는 파일을 검사하십시오 (분명히 약간의 친숙 함이 필요합니다).

업그레이드 Joomla 및 최신 버전이있는 모든 애드온을 업그레이드하십시오. 'joomla'에 대해 http://exploit-db.com/을 (를) 검색하여 추가 기능이 있는지 확인하십시오.

http://www.exploit-db.com/search/?action=search&filter_page=1&filter_exploit_text=joomla&filter_platform=0&filter_type=0&filter_lang_id=0

이 확인 될 수있는 많은 다른 많은 일들이 있고, 아마도 확인해야합니다 -하지만 이러한 좋은 출발점입니다 -하지만 난 그게 사람의 도움을 유지하는 것이 가장 좋습니다 것을 강조 할 이 물건에 경험이 있어요. 해킹 해킹 서비스는 일반적으로 £ 500부터 시작하여 약 £ 1,000 ($ 800 - $ 1600)로 상승합니다. 다시 사이트를 넣었을 때

라이브, 오프 짧은 열린 태그는 다음과 같은 기능을 php.ini 파일에서이 disable_functions 지시어 disable_functions = 간부, 경유를 통해 사용할 수 있는지 확인

떨어져 있습니다 register_globals의가 있는지 확인 당신은 당신의 .htaccess 파일에 대한 코드 아래 사용할 수 있습니다 shell_exec, 시스템, proc_open,는 popen, curl_exec, curl_multi_exec, parse_ini_file, show_source

1

## Disallow access to htaccess.txt and configuration.php-dist 
RewriteRule ^(htaccess\.txt|configuration\.php-dist)$ - [F,L] 
,536,913 63,210

다음은 당신이 당신 .htaccess 파일을 편집하고 줌라 사이트에 대한 완전한 보호와 함께 제공되는 아래 코드 아래에 사용할 수있는 보안 줌라 사이트에 대한 보안 htaccess로 파일

########## End - Advanced server protection rules exceptions #### 

RewriteRule ^(images/stories/*\.(jpe[g,2]?|jpg|png|gif|bmp|css|js|swf|ico|htm[l]?))$ $1 [L] 
RewriteCond %{REQUEST_FILENAME} -f 
RewriteCond %{HTTP_REFERER} !^http://www\.xxx\.com [NC] 
RewriteRule \.(jpe[g,2]?|jpg|png|gif|bmp|css|js|swf|ico|htm[l]?)$ - [F,L] 

## Disallow visual fingerprinting of Joomla! sites (module position dump) 

RewriteCond %{QUERY_STRING} (^|&)tmpl=component [NC] 
RewriteRule ^(.*)$ $1 [L] 
RewriteCond %{QUERY_STRING} (^|&)tp= [NC,OR] 
RewriteCond %{QUERY_STRING} (^|&)template= [NC,OR] 
RewriteCond %{QUERY_STRING} (^|&)tmpl= [NC] 
RewriteRule ^(.*)$ - [F,L] 

## Disallow PHP Easter Eggs (can be used in fingerprinting attacks to determine 
## your PHP version). See http://www.0php.com/php_easter_egg.php and 
## http://osvdb.org/12184 for more information 
RewriteCond %{QUERY_STRING} =PHP[a-z0-9]{8}-[a-z0-9]{4}-[a-z0-9]{4}-[a-z0-9]{4}-[a-z0-9]{12} [NC] 
RewriteRule ^(.*)$ - [F,L] 

## Back-end protection 
## This also blocks fingerprinting attacks browsing for XML and INI files 
RewriteRule ^(administrator[/]?)$ administrator/index.php [L] 
RewriteRule ^(administrator/index.htm[l]?)$ $1 [L] 
RewriteRule ^(administrator/index.php)$ $1 [L] 
RewriteRule ^(administrator/index[2,3].php)$ $1 [L] 
RewriteRule ^(administrator/(components|modules|templates|images|plugins)/.*\.(jpe[g,2]?|jpg|png|gif|bmp|css|js|swf|htm[l]?))$ $1 [L] 
RewriteRule ^administrator/(.*)$ - [F,L] 

## Explicitly allow access only to XML-RPC's xmlrpc/index.php or plain xmlrpc/ directory 
RewriteRule ^(xmlrpc/index\.php)$ $1 [L] 
RewriteRule ^xmlrpc/(.*)$ - [F,L] 

## Disallow front-end access for certain Joomla! system directories 
RewriteRule ^(includes/js/.*)$ $1 [L] 
RewriteRule ^(cache|includes|language|libraries|logs|tmp)/.*$ - [F,L] 

## Allow limited access for certain Joomla! system directories with client-accessible content 
RewriteRule ^((components|modules|plugins|templates)/.*\.(jp[g,2,eg]?|png|gif|bmp|css|js|swf|ico|htm[l]?))$ $1 [L] 
RewriteRule ^((components|modules|plugins|templates)/.*index\.php(.*))$ $1 [L] 
RewriteRule ^(templates/.*\.php)$ $1 [L] 
RewriteRule ^(components|modules|plugins|templates)/.*$ - [F,L] 

## Disallow access to htaccess.txt and configuration.php-dist 
RewriteRule ^(htaccess\.txt|configuration\.php-dist)$ - [F,L] 

## SQLi first line of defense 
## May cause problems on legitimate requests 

RewriteCond %{QUERY_STRING} concat.*\([NC,OR] 
RewriteCond %{QUERY_STRING} union.*select.*\([NC,OR] 
RewriteCond %{QUERY_STRING} union.*all.*select.* [NC] 
RewriteRule ^(.*)$ - [F,L] 

########## End - Advanced server protection 
3

에 대한 몇 가지 더 설정입니다. 또한 Joomla Core SEF를 사용하여 URL을 업데이트합니다 (사용 설정해야 함). 관리자 패널로 이동하여 Apache의 Mode/ReadWrite를 업데이트하십시오.

당신은 코드

RewriteEngine On   
DirectoryIndex index.php index.html 

IndexIgnore * 
Options +FollowSymLinks All -Indexes 

FileETag MTime Size 
ExpiresActive On 

# Default expiration: 1 hour after request 
ExpiresDefault "now plus 1 hour" 

# CSS and JS expiration: 1 week after request 
ExpiresByType text/css "now plus 1 week" 
ExpiresByType application/javascript "now plus 1 week" 
ExpiresByType application/x-javascript "now plus 1 week" 

# Image files expiration: 1 year after request 
ExpiresByType image/bmp "now plus 1 year" 
ExpiresByType image/gif "now plus 1 year" 
ExpiresByType image/jpeg "now plus 1 year" 
ExpiresByType image/jp2 "now plus 1 year" 
ExpiresByType image/pipeg "now plus 1 year" 
ExpiresByType image/png "now plus 1 year" 
ExpiresByType image/svg+xml "now plus 1 year" 
ExpiresByType image/tiff "now plus 1 year" 
ExpiresByType image/vnd.microsoft.icon "now plus 1 year" 
ExpiresByType image/x-icon "now plus 1 year" 
ExpiresByType image/ico "now plus 1 year" 
ExpiresByType image/icon "now plus 1 year" 
ExpiresByType text/ico "now plus 1 year" 
ExpiresByType application/ico "now plus 1 year" 
ExpiresByType image/vnd.wap.wbmp "now plus 1 year" 
ExpiresByType application/vnd.wap.wbxml "now plus 1 year" 
ExpiresByType application/smil "now plus 1 year" 

# Audio files expiration: 1 year after request 
ExpiresByType audio/basic "now plus 1 year" 
ExpiresByType audio/mid "now plus 1 year" 
ExpiresByType audio/midi "now plus 1 year" 
ExpiresByType audio/mpeg "now plus 1 year" 
ExpiresByType audio/x-aiff "now plus 1 year" 
ExpiresByType audio/x-mpegurl "now plus 1 year" 
ExpiresByType audio/x-pn-realaudio "now plus 1 year" 
ExpiresByType audio/x-wav "now plus 1 year" 

# Movie files expiration: 1 year after request 
ExpiresByType application/x-shockwave-flash "now plus 1 year" 
ExpiresByType x-world/x-vrml "now plus 1 year" 
ExpiresByType video/x-msvideo "now plus 1 year" 
ExpiresByType video/mpeg "now plus 1 year" 
ExpiresByType video/mp4 "now plus 1 year" 
ExpiresByType video/quicktime "now plus 1 year" 
ExpiresByType video/x-la-asf "now plus 1 year" 
ExpiresByType video/x-ms-asf "now plus 1 year" 

########## End - Optimal expiration time 

########## Begin - block bandwidth hoggers 

SetEnvIf user-agent "Indy Library" stayout=1 
SetEnvIf user-agent "libwww-perl" stayout=1 
SetEnvIf user-agent "Wget" stayout=1 

# The following rules are for bandwidth-hogging download tools 
SetEnvIf user-agent "Download Demon" stayout=1 
SetEnvIf user-agent "GetRight" stayout=1 
SetEnvIf user-agent "GetWeb!" stayout=1 
SetEnvIf user-agent "Go!Zilla" stayout=1 
SetEnvIf user-agent "Go-Ahead-Got-It" stayout=1 
SetEnvIf user-agent "GrabNet" stayout=1 
SetEnvIf user-agent "TurnitinBot" stayout=1 

# This line denies access to all of the above tools 
deny from env=stayout 
########## End - block bandwidth hoggers 


# Compress text, html, javascript, css, xml, kudos to Komra.de 
AddOutputFilterByType DEFLATE text/plain text/html text/xml text/css application/xml application/xhtml+xml application/rss+xml application/javascript application/x-javascript 
########## End - Automatic compression of resources 

########## Begin - Google Apps redirection, by Sashi 
Redirect 301 /mail http://mail.google.com/a/ 
########## End - Google Apps redirection 

########## Begin - Redirect index.php to/

RewriteCond %{THE_REQUEST} ^.*/index\.php$ 
RewriteRule ^index\.php$ http://www.example.com/ [R,L] 
########## End - Redirect index.php to/

########## Begin - Redirect non-www to www 
RewriteCond %{HTTP_HOST} !^www\. [NC] 
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R,L] 
########## End - Redirect non-www to www 

########## Begin - Redirect www to non-www 
## WARNING: Comment out the non-www to www rule if you choose to use this 
#RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC] 
#RewriteRule ^(.*)$ http://%1/$1 [R,L] 
########## End - Redirect non-www to www 

########## Begin - Redirect example.com to www.example.com 
RewriteCond %{HTTP_HOST} ^example.com [NC] 
RewriteRule ^(.*)$ http://www.example.com/$1 [L,R] 
########## End - Redirect example.com to www.example.com 

########## Begin - Force HTTPS for certain pages 

RewriteCond %{HTTPS} ^off$ [NC] 

RewriteRule ^foobar\.html$ https://www.example.com/foobar.html [L,R] 
# Add mode rules below this line 


########## Block bad user agents 

RewriteCond %{HTTP_USER_AGENT} ^BlackWidow [OR] 
RewriteCond %{HTTP_USER_AGENT} ^Bot\ mailto:[email protected] [OR] 
RewriteCond %{HTTP_USER_AGENT} ^ChinaClaw [OR] 
RewriteCond %{HTTP_USER_AGENT} ^Custo [OR] 
RewriteCond %{HTTP_USER_AGENT} ^DISCo [OR] 
RewriteCond %{HTTP_USER_AGENT} ^Download\ Demon [OR] 
RewriteCond %{HTTP_USER_AGENT} ^eCatch [OR] 
RewriteCond %{HTTP_USER_AGENT} ^EirGrabber [OR] 
RewriteCond %{HTTP_USER_AGENT} ^EmailSiphon [OR] 
RewriteCond %{HTTP_USER_AGENT} ^EmailWolf [OR] 
RewriteCond %{HTTP_USER_AGENT} ^Express\ WebPictures [OR] 
RewriteCond %{HTTP_USER_AGENT} ^ExtractorPro [OR] 
RewriteCond %{HTTP_USER_AGENT} ^EyeNetIE [OR] 
RewriteCond %{HTTP_USER_AGENT} ^FlashGet [OR] 
RewriteCond %{HTTP_USER_AGENT} ^GetRight [OR] 
RewriteCond %{HTTP_USER_AGENT} ^GetWeb! [OR] 
RewriteCond %{HTTP_USER_AGENT} ^Go!Zilla [OR] 
RewriteCond %{HTTP_USER_AGENT} ^Go-Ahead-Got-It [OR] 
RewriteCond %{HTTP_USER_AGENT} ^GrabNet [OR] 
RewriteCond %{HTTP_USER_AGENT} ^Grafula [OR] 
RewriteCond %{HTTP_USER_AGENT} ^HMView [OR] 
RewriteCond %{HTTP_USER_AGENT} HTTrack [NC,OR] 
RewriteCond %{HTTP_USER_AGENT} ^Image\ Stripper [OR] 
RewriteCond %{HTTP_USER_AGENT} ^Image\ Sucker [OR] 
RewriteCond %{HTTP_USER_AGENT} Indy\ Library [NC,OR] 
RewriteCond %{HTTP_USER_AGENT} ^InterGET [OR] 
RewriteCond %{HTTP_USER_AGENT} ^Internet\ Ninja [OR] 
RewriteCond %{HTTP_USER_AGENT} ^JetCar [OR] 
RewriteCond %{HTTP_USER_AGENT} ^JOC\ Web\ Spider [OR] 
RewriteCond %{HTTP_USER_AGENT} ^larbin [OR] 
RewriteCond %{HTTP_USER_AGENT} ^LeechFTP [OR] 
RewriteCond %{HTTP_USER_AGENT} ^Mass\ Downloader [OR] 
RewriteCond %{HTTP_USER_AGENT} ^MIDown\ tool [OR] 
RewriteCond %{HTTP_USER_AGENT} ^Mister\ PiX [OR] 
RewriteCond %{HTTP_USER_AGENT} ^Navroad [OR] 
RewriteCond %{HTTP_USER_AGENT} ^NearSite [OR] 
RewriteCond %{HTTP_USER_AGENT} ^NetAnts [OR] 
RewriteCond %{HTTP_USER_AGENT} ^NetSpider [OR] 
RewriteCond %{HTTP_USER_AGENT} ^Net\ Vampire [OR] 
RewriteCond %{HTTP_USER_AGENT} ^NetZIP [OR] 
RewriteCond %{HTTP_USER_AGENT} ^Octopus [OR] 
RewriteCond %{HTTP_USER_AGENT} ^Offline\ Explorer [OR] 
RewriteCond %{HTTP_USER_AGENT} ^Offline\ Navigator [OR] 
RewriteCond %{HTTP_USER_AGENT} ^PageGrabber [OR] 
RewriteCond %{HTTP_USER_AGENT} ^Papa\ Foto [OR] 
RewriteCond %{HTTP_USER_AGENT} ^pavuk [OR] 
RewriteCond %{HTTP_USER_AGENT} ^pcBrowser [OR] 
RewriteCond %{HTTP_USER_AGENT} ^RealDownload [OR] 
RewriteCond %{HTTP_USER_AGENT} ^ReGet [OR] 
RewriteCond %{HTTP_USER_AGENT} ^SiteSnagger [OR] 
RewriteCond %{HTTP_USER_AGENT} ^SmartDownload [OR] 
RewriteCond %{HTTP_USER_AGENT} ^SuperBot [OR] 
RewriteCond %{HTTP_USER_AGENT} ^SuperHTTP [OR] 
RewriteCond %{HTTP_USER_AGENT} ^Surfbot [OR] 
RewriteCond %{HTTP_USER_AGENT} ^tAkeOut [OR] 
RewriteCond %{HTTP_USER_AGENT} ^Teleport\ Pro [OR] 
RewriteCond %{HTTP_USER_AGENT} ^VoidEYE [OR] 
RewriteCond %{HTTP_USER_AGENT} ^Web\ Image\ Collector [OR] 
RewriteCond %{HTTP_USER_AGENT} ^Web\ Sucker [OR] 
RewriteCond %{HTTP_USER_AGENT} ^WebAuto [OR] 
RewriteCond %{HTTP_USER_AGENT} ^WebCopier [OR] 
RewriteCond %{HTTP_USER_AGENT} ^WebFetch [OR] 
RewriteCond %{HTTP_USER_AGENT} ^WebGo\ IS [OR] 
RewriteCond %{HTTP_USER_AGENT} ^WebLeacher [OR] 
RewriteCond %{HTTP_USER_AGENT} ^WebReaper [OR] 
RewriteCond %{HTTP_USER_AGENT} ^WebSauger [OR] 
RewriteCond %{HTTP_USER_AGENT} ^Website\ eXtractor [OR] 
RewriteCond %{HTTP_USER_AGENT} ^Website\ Quester [OR] 
RewriteCond %{HTTP_USER_AGENT} ^WebStripper [OR] 
RewriteCond %{HTTP_USER_AGENT} ^WebWhacker [OR] 
RewriteCond %{HTTP_USER_AGENT} ^WebZIP [OR] 
RewriteCond %{HTTP_USER_AGENT} ^Widow [OR] 
RewriteCond %{HTTP_USER_AGENT} ^WWWOFFLE [OR] 
RewriteCond %{HTTP_USER_AGENT} ^Xaldon\ WebSpider [OR] 
RewriteCond %{HTTP_USER_AGENT} ^Zeus 
## Note: The final RewriteCond must NOT use the [OR] flag. 

## Return 403 Forbidden error. 
RewriteRule .* - [F] 

ServerSignature Off 
RewriteCond %{REQUEST_METHOD} ^(HEAD|TRACE|DELETE|TRACK) [NC,OR] 
RewriteCond %{THE_REQUEST} (\\r|\\n|%0A|%0D) [NC,OR] 

RewriteCond %{HTTP_REFERER} (<|>|’|%0A|%0D|%27|%3C|%3E|%00) [NC,OR] 
RewriteCond %{HTTP_COOKIE} (<|>|’|%0A|%0D|%27|%3C|%3E|%00) [NC,OR] 
RewriteCond %{REQUEST_URI} ^/(,|;|:|<|>|”>|”<|/|\\\.\.\\).{0,9999} [NC,OR] 

RewriteCond %{HTTP_USER_AGENT} ^$ [OR] 
RewriteCond %{HTTP_USER_AGENT} ^(java|curl|wget) [NC,OR] 
RewriteCond %{HTTP_USER_AGENT} (winhttp|HTTrack|clshttp|archiver|loader|email|harvest|extract|grab|miner) [NC,OR] 
RewriteCond %{HTTP_USER_AGENT} (libwww-perl|curl|wget|python|nikto|scan) [NC,OR] 
RewriteCond %{HTTP_USER_AGENT} (<|>|’|%0A|%0D|%27|%3C|%3E|%00) [NC,OR] 

#Block mySQL injects 
RewriteCond %{QUERY_STRING} (;|<|>|’|”|\)|%0A|%0D|%22|%27|%3C|%3E|%00).*(/\*|union|select|insert|cast|set|declare|drop|update|md5|benchmark) [NC,OR] 

RewriteCond %{QUERY_STRING} \.\./\.\. [OR] 

RewriteCond %{QUERY_STRING} (localhost|loopback|127\.0\.0\.1) [NC,OR] 
RewriteCond %{QUERY_STRING} \.[a-z0-9] [NC,OR] 
RewriteCond %{QUERY_STRING} (<|>|’|%0A|%0D|%27|%3C|%3E|%00) [NC] 
# Note: The final RewriteCond must NOT use the [OR] flag. 

# Return 403 Forbidden error. 
RewriteRule .* index.php [F] 

########## Begin - File injection protection 

RewriteCond %{REQUEST_METHOD} GET 
RewriteCond %{QUERY_STRING} [a-zA-Z0-9_]\=http:\/\/(.*) 
RewriteRule ^(.*)$ - [F,L] 

########## End 


## Allow UddeIM CAPTCHA 
RewriteRule ^(components/com_uddeim/captcha15\.php)$ $1 [L] 

## Allow Phil Taylor's Turbo Gears 
RewriteRule ^(plugins/system/GoogleGears/gears-manifest\.php) $1 [L] 

## Allow JoomlaWorks AllVideos 
RewriteRule ^(plugins/content/jw_allvideos/includes/jw_allvideos_scripts\.php) $1 [L] 

# Add more rules to single PHP files here 

## Allow Agora attachments, but not PHP files in that directory! 
RewriteCond %{REQUEST_FILENAME} -f 
RewriteCond %{REQUEST_FILENAME} !(\.php)$ 
RewriteRule ^(components/com_agora/img/members/.*) $1 [L] 

# Add more rules for allowing full access (except PHP files) on more directories here 

## Uncomment to allow full access to the cache directory (strongly not recommended!) 
#RewriteRule ^(cache/.*)$ $1 [L] 

## Uncomment to allow full access to the tmp directory (strongly not recommended!) 
#RewriteRule ^(tmp/.*)$ $1 [L] 

# Add more full access rules here 

########## End - Advanced server protection rules exceptions #### 

RewriteRule ^(images/stories/*\.(jpe[g,2]?|jpg|png|gif|bmp|css|js|swf|ico|htm[l]?))$ $1 [L] 
RewriteCond %{REQUEST_FILENAME} -f 
RewriteCond %{HTTP_REFERER} !^http://www\.example\.com [NC] 
RewriteRule \.(jpe[g,2]?|jpg|png|gif|bmp|css|js|swf|ico|htm[l]?)$ - [F,L] 

## Disallow visual fingerprinting of Joomla! sites (module position dump) 

RewriteCond %{QUERY_STRING} (^|&)tmpl=component [NC] 
RewriteRule ^(.*)$ $1 [L] 
RewriteCond %{QUERY_STRING} (^|&)tp= [NC,OR] 
RewriteCond %{QUERY_STRING} (^|&)template= [NC,OR] 
RewriteCond %{QUERY_STRING} (^|&)tmpl= [NC] 
RewriteRule ^(.*)$ - [F,L] 

## Disallow PHP Easter Eggs (can be used in fingerprinting attacks to determine 
## your PHP version). See http://www.0php.com/php_easter_egg.php and 
## http://osvdb.org/12184 for more information 
RewriteCond %{QUERY_STRING} =PHP[a-z0-9]{8}-[a-z0-9]{4}-[a-z0-9]{4}-[a-z0-9]{4}-[a-z0-9]{12} [NC] 
RewriteRule ^(.*)$ - [F,L] 

## Back-end protection 
## This also blocks fingerprinting attacks browsing for XML and INI files 
RewriteRule ^(administrator[/]?)$ administrator/index.php [L] 
RewriteRule ^(administrator/index.htm[l]?)$ $1 [L] 
RewriteRule ^(administrator/index.php)$ $1 [L] 
RewriteRule ^(administrator/index[2,3].php)$ $1 [L] 
RewriteRule ^(administrator/(components|modules|templates|images|plugins)/.*\.(jpe[g,2]?|jpg|png|gif|bmp|css|js|swf|htm[l]?))$ $1 [L] 
RewriteRule ^administrator/(.*)$ - [F,L] 

## Explicitly allow access only to XML-RPC's xmlrpc/index.php or plain xmlrpc/ directory 
RewriteRule ^(xmlrpc/index\.php)$ $1 [L] 
RewriteRule ^xmlrpc/(.*)$ - [F,L] 

## Disallow front-end access for certain Joomla! system directories 
RewriteRule ^(includes/js/.*)$ $1 [L] 
RewriteRule ^(cache|includes|language|libraries|logs|tmp)/.*$ - [F,L] 

## Allow limited access for certain Joomla! system directories with client-accessible content 
RewriteRule ^((components|modules|plugins|templates)/.*\.(jp[g,2,eg]?|png|gif|bmp|css|js|swf|ico|htm[l]?))$ $1 [L] 
RewriteRule ^((components|modules|plugins|templates)/.*index\.php(.*))$ $1 [L] 
RewriteRule ^(templates/.*\.php)$ $1 [L] 
RewriteRule ^(components|modules|plugins|templates)/.*$ - [F,L] 

## Disallow access to htaccess.txt and configuration.php-dist 
RewriteRule ^(htaccess\.txt|configuration\.php-dist)$ - [F,L] 

## SQLi first line of defense 
## May cause problems on legitimate requests 

RewriteCond %{QUERY_STRING} concat.*\([NC,OR] 
RewriteCond %{QUERY_STRING} union.*select.*\([NC,OR] 
RewriteCond %{QUERY_STRING} union.*all.*select.* [NC] 
RewriteRule ^(.*)$ - [F,L] 

########## End - Advanced server protection 

########## Begin - Basic antispam Filter 
## I removed some common words, tweak to your liking 

RewriteCond %{query_string} \bviagra\b [NC,OR] 
RewriteCond %{query_string} \bambien\b [NC,OR] 
RewriteCond %{query_string} \bblue\spill\b [NC,OR] 
RewriteCond %{query_string} \bcialis\b [NC,OR] 
RewriteCond %{query_string} \bcocaine\b [NC,OR] 
RewriteCond %{query_string} \bejaculation\b [NC,OR] 
RewriteCond %{query_string} \berectile\b [NC,OR] 
RewriteCond %{query_string} \berections\b [NC,OR] 
RewriteCond %{query_string} \bhoodia\b [NC,OR] 
RewriteCond %{query_string} \bhuronriveracres\b [NC,OR] 
RewriteCond %{query_string} \bimpotence\b [NC,OR] 
RewriteCond %{query_string} \blevitra\b [NC,OR] 
RewriteCond %{query_string} \blibido\b [NC,OR] 
RewriteCond %{query_string} \blipitor\b [NC,OR] 
RewriteCond %{query_string} \bphentermin\b [NC,OR] 
RewriteCond %{query_string} \bprosac\b [NC,OR] 
RewriteCond %{query_string} \bsandyauer\b [NC,OR] 
RewriteCond %{query_string} \btramadol\b [NC,OR] 
RewriteCond %{query_string} \btroyhamby\b [NC,OR] 
RewriteCond %{query_string} \bultram\b [NC,OR] 
RewriteCond %{query_string} \bunicauca\b [NC,OR] 
RewriteCond %{query_string} \bvalium\b [NC,OR] 
RewriteCond %{query_string} \bviagra\b [NC,OR] 
RewriteCond %{query_string} \bvicodin\b [NC,OR] 
RewriteCond %{query_string} \bxanax\b [NC,OR] 
RewriteCond %{query_string} \bypxaieo\b [NC] 
RewriteRule ^(.*)$ - [F,L] 

########## End - Basic antispam Filter 

########## Begin - Joomla! core SEF Section 
# 
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}] 
RewriteCond %{REQUEST_URI} !^/index.php 
RewriteCond %{REQUEST_URI} (/|\.php|\.html|\.htm|\.feed|\.pdf|\.raw|\.ini|\.zip|\.json|/[^.]*)$ [NC] 
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteRule (.*) index.php [L] 
# 
########## End - Joomla! core SEF Section 
+0

http://www.xxx.com에서 http : //www.yoursitename으로 업데이트하십시오.co.kr에서 찾아서 바꾸지 마십시오. – user484156

+0

필터 목록이 좋을 것 같습니다. 호스트에서 해당 파일을 변경하여 모든 페이지로드시 메모리에 저장되고 재검사되지 않도록 아파치 conf 파일 또는 .htaccess 파일에 넣는 것이 좋습니다. – tristanbailey

1

이하로 사용할 수 있습니다 내 htaccess로 파일에 해킹 누군가와 심각한 문제를 가지고 내 유일한 해결책은 파일이 설사 해킹 할 수 있도록했다. 먼저 .htaccess 파일과 모든 해킹 된 PHP 파일을 정리했습니다. 그런 다음 .htaccess 파일에서 파일 권한을 444 (644는 여전히 액세스 허용)로 변경했습니다. 그런 다음 내 계정에 쉘 액세스를 사용하여 파일을 "변경 불가능"하게 만들었습니다. 이는 변경 될 수 없음을 의미합니다! #를 위해 chattr + 난 루트 액세스 권한이있는 파일을 변경할 수 없습니다, 지금

을 .htaccess로 : 당신이 당신의 리눅스 서버에 계정에 쉘 액세스 할 때

는 다음과 같이 입력!

그것은 당신이 입력이 취소해야합니다 # 위해 chattr -i htaccess로

당신이 당신의 계정에 쉘 액세스 할 수있는 파일을 변경할 수 있도록 당신이 입력에 대한 웹 호스트를 요구하지 않는 경우.

Linux가 아닌 계정의 경우 웹 서버 유형에 따라 Google 또는 Bing에 "파일 작성 불가능"을 입력하십시오. 이렇게하면 필요한 정보를 얻을 수 있습니다.

관련 문제