ป้องกัน WordPress ของคุณด้วย .htaccess ใครกลัวโดน Hack เอาไปลอง

เริ่มโดย BeerKingMan, 05 เมษายน 2012, 19:30:53

หัวข้อก่อนหน้า - หัวข้อถัดไป

0 สมาชิก และ 1 ผู้มาเยือน กำลังดูหัวข้อนี้

BeerKingMan

เห็นหลายคนบ่นๆเรื่อง .htaccess กันเยอะ เอ๊า จัดให้ซ่ะหน่อย



พื้นฐานทั่วไป มันควรจะเป็นแบบนี้

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress



ป้องกันไฟส์ wp-config.php เพราะมันคือหัวใจหลักของ WP

<Files wp-config.php>
order allow,deny
deny from all
</Files>


Admin เข้าได้จาก IP เครื่องเราเท่านั้น(ป้องกัน admin folder ทั้งหมดเข้าได้แค่เรา)

order deny,allow
allow from 202.090.21.1 (replace with your IP address)
deny from all


แบน IP พวกชอบแสปม

<Limit GET POST>
order allow,deny
deny from 202.090.21.1
allow from all
</Limit>


ป้องกันอย่างอื่นแล้ว อย่าลืมป้องกันไฟส์ .htaccess นะ

<Files ~ "^.*\.([Hh][Tt][Aa])">
order allow,deny
deny from all
satisfy all
</Files>


ถ้ามันมีประโยชน์กด + ให้ด้วยนะครับ ถ้าไม่เกิดประโยชน์กับใคร ก็กดปิดไปเลยครับ  :wanwan017:

adsene5438

ขอบคุณครับ อีกอันหนึ่ง ระวังตัวนี้ด้วย

hxxt://www.xxxxx.com/wp-content/uploads

ของดีอยู่ที่นี้แหละ


iLhay

ถ้า IP เป็น dynamic คุณจะต้องเปลี่ยนทุกๆครั้งที่ IP คุณเปลี่ยนน่ะสิ ="=

แต่ถ้า static ก็ไม่มีปัญหา

nice trips
[direct=https://bangmod.cloud/wordpress-hosting/]Wordpress Hosting

[/direct]
[direct=https://bangmod.cloud/wordpress-hosting/]Wordpress Hosting[/direct] เริ่มต้นปีละ 790 บาท NVMe SSD เร็ว 9000MB/s เร็วกว่านี้ไม่มีอีกแล้ว
[direct=https://bangmod.cloud/cloud-server]Cloud Server[/direct] เริ่มต้นเพียงเดือนละ 159 บาท พร้อมใช้ภายใน 1 นาที ผ่านระบบอัตโนมัติมีทั้ง Linux / Windows / DirectAdmin
สอบถามข้อมูลและแจ้งปัญหา 02-105-4417 ตลอด 24 ชั่วโมง

stvip16


Freedomlover

เพิ่มเติม  การตั้งชื่อ user พยายามหลีกเลี่ยงชื่อที่เดาได้ง่าย  เช่น admin,test,.....  หรือชื่อโหลๆ  เช่น peter , alex,.... (ฝรั่งชอบเดาชื่อพวกนี้เข้ามา) ให้เปลี่ยนเป็นอย่างอื่นครับ
[direct=https://www.jaideawhosting.com/web-hosting/]โฮสติ้ง[/direct] คุณภาพสูง ราคาเริ่มต้น 50 บาท/เดือน ทดลองใช้ฟรี 30 วัน
[direct=https://www.jaideawhosting.com/vps-hosting/]SSD VPS[/direct] แรงๆ
จดโดเมนเพียง 400 บาท/ปี
ด้วยประสบการณ์กว่า 12 ปี  Tel 0840640213

nornak

[direct=http://www.lunla.in.th]LunLa[/direct] ... ก็แค่อยากให้ชีวิต มีแต่ความลั้ลลา

เกมส์เกมส์.com

+1 ให้ครับ ว่าแต่เอาไปวางไว้ที่ไหนเหรอครับ ตัวป้องกัน ป้องกัน admin folder
[direct=http://www.thaiseoboard.com/index.php/topic,191657.0.html]##โปรโมชั่น ## seo ลุ้นเสียว 1000 บาท/คีย์ +++  3คีย์แถม 1 คีย์+++ รับทำ seo แฟนเพจ top 10 เพียง 3000/คีย์[/direct]

siamseo


queen110

มีประโยชน์มาก เคยโดนไปครั้งนึงถึงกับเซ็ง

Muller

ถ้าผมเอามารวมกันทั้ง 4 แบบ เป็น


<Files wp-config.php>
order allow,deny
deny from all
</Files>
order deny,allow
allow from 202.090.21.1 (replace with your IP address)
deny from all
<Limit GET POST>
order allow,deny
deny from 202.090.21.1
allow from all
</Limit>
<Files ~ "^.*\.([Hh][Tt][Aa])">
order allow,deny
deny from all
satisfy all
</Files>


แล้ว save ทั้งหมดเป็น .htaccess จะได้ไหมครับ
ข้อแตกต่างของคนสำเร็จกับคนล้มเหลวก็คื[direct=http://womenbreastenhancement.com]อ[/direct] ความคิด

@StarexVIP

อ้างถึงจาก: BeerKingMan ใน 05 เมษายน 2012, 19:30:53
เห็นหลายคนบ่นๆเรื่อง .htaccess กันเยอะ เอ๊า จัดให้ซ่ะหน่อย



พื้นฐานทั่วไป มันควรจะเป็นแบบนี้

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress



ป้องกันไฟส์ wp-config.php เพราะมันคือหัวใจหลักของ WP

<Files wp-config.php>
order allow,deny
deny from all
</Files>


Admin เข้าได้จาก IP เครื่องเราเท่านั้น(ป้องกัน admin folder ทั้งหมดเข้าได้แค่เรา)

order deny,allow
allow from 202.090.21.1 (replace with your IP address)
deny from all


แบน IP พวกชอบแสปม

<Limit GET POST>
order allow,deny
deny from 202.090.21.1
allow from all
</Limit>


ป้องกันอย่างอื่นแล้ว อย่าลืมป้องกันไฟส์ .htaccess นะ

<Files ~ "^.*\.([Hh][Tt][Aa])">
order allow,deny
deny from all
satisfy all
</Files>


ถ้ามันมีประโยชน์กด + ให้ด้วยนะครับ ถ้าไม่เกิดประโยชน์กับใคร ก็กดปิดไปเลยครับ  :wanwan017:

+1 ขอเก็บครับ  :wanwan017:
[direct=http://www.plcmitsubishi.in.th/]plc mitsubishi[/direct]

kunura

[direct=http://www.jabpid.com/]งานออนไลน์[/direct][direct=http://grcthai.it2sale.com/]GRC THAI[/direct][direct=http://www.incomeza.com/]งานออนไลน์ได้เงินจริง[/direct][direct=http://www.zonemaya.com/search_video/]search video[/direct]
thaiomc.com ติดไวรัส ห้ามเอามาทำลายเซ็นอีก ไม่งั้นจะลบ user เลย!

Muller

ใครบอกหน่อยครับ....ทั้ง 5 แบบ เอาไปใช้ยังไง ....เอามารวมเป็นไฟล์เดียวกันหรือแยกเป็นไฟล์ไป... :wanwan044:
ข้อแตกต่างของคนสำเร็จกับคนล้มเหลวก็คื[direct=http://womenbreastenhancement.com]อ[/direct] ความคิด

Bajita


ownermylife

[direct=http://www.รับพ่นสีฝุ่น.com]รับพ่นสีฝุ่น[/direct]

Muller

อ้างถึงจาก: Muller ใน 06 เมษายน 2012, 00:09:51
ใครบอกหน่อยครับ....ทั้ง 5 แบบ เอาไปใช้ยังไง ....เอามารวมเป็นไฟล์เดียวกันหรือแยกเป็นไฟล์ไป... :wanwan044:

ตอบหน่อยค๊าบ....... :wanwan017:
ข้อแตกต่างของคนสำเร็จกับคนล้มเหลวก็คื[direct=http://womenbreastenhancement.com]อ[/direct] ความคิด

supaman

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress

<Files wp-config.php>
order allow,deny
deny from all
</Files>

order deny,allow
allow from 202.090.21.1 (replace with your IP address)
deny from all

<Limit GET POST>
order allow,deny
deny from 202.090.21.1
allow from all
</Limit>


<Files ~ "^.*\.([Hh][Tt][Aa])">
order allow,deny
deny from all
satisfy all
</Files>


Copy ไปใส่ต่อจากไฟล์ .htaccess ที่ท่านมีอยู่ใน wordpress หรือว่าจะสร้าง .htaccess ขึ้นมาใหม่แล้วเอาไปวางในตำแหน่งเดียวกับ wp-config.php อ่ะครับ งงตัวเอง  :wanwan006:

supaman

หรือใครไม่อยากจัดการอะไรมาก แนะนำ plugin ตัวนี้ครับ Limit Login Attempts
http://wordpress.org/extend/plugins/limit-login-attempts/

แม้จะไม่ได้ครอบคลุมทั้งหมด แต่ก็คงทำให้ผู้ประสงค์ไม่ดีลำบากขึ้นมาหน่อย ไฟล์ 155 kb

aodify

<Files ~ "^.*\.([Hh][Aa])">   ตัวแดงนี้ ต้องเปลี่ยนไหมครับ ใส่เป็นอย่างอื่นได้ไหม
order allow,deny
deny from all
satisfy all
</Files>

+1
ขอบคุณครับ
[direct=http://www.myhappyy.com/]MyHappyy[/direct] - Heathly & Beauty