Computer >> คอมพิวเตอร์ >  >> การเขียนโปรแกรม >> HTML

วิธีการรักษาความปลอดภัยเว็บไซต์? (คู่มือการรักษาความปลอดภัยของเว็บไซต์ฉบับสมบูรณ์)

การแฮ็กเกิดขึ้นหลายครั้งด้วยเหตุผลที่สามารถป้องกันได้ทั้งหมด:การอัปเดตไม่เสร็จทันเวลา รหัสผ่านที่ไม่ปลอดภัย และอื่นๆ

เรารู้เรื่องนี้ได้อย่างไร? เราได้ช่วยไซต์ที่ถูกแฮ็กมากกว่า 25,000 ไซต์และมีประสบการณ์อย่างมากกับความปลอดภัยของเว็บไซต์ .

ในคู่มือการรักษาความปลอดภัยเว็บไซต์นี้ เราจะแสดงวิธีรักษาความปลอดภัยเว็บไซต์ :

  • แม้ว่า... คุณยังใหม่ต่อการรักษาความปลอดภัยของเว็บไซต์และไม่เข้าใจความหมายทั้งหมด
  • แม้ว่า... คุณเคยพยายามและล้มเหลวในการรักษาความปลอดภัยเว็บไซต์ของคุณมาก่อน
  • แม้ว่า... คุณรู้สึกท่วมท้นและไม่รู้ว่าจะเริ่มต้นจากตรงไหน
  • แม้ว่า… คุณเคยคิดว่า “ฉันไม่คู่ควรกับแฮกเกอร์ – แล้วทำไมต้องพยายามด้วย”

แต่ที่สำคัญกว่านั้น เราจะพูดถึงวิธีคิดเกี่ยวกับความปลอดภัยของเว็บไซต์ตั้งแต่แรก ด้วยวิธีนี้ คุณพร้อมที่จะทำการตัดสินใจที่ถูกต้องสำหรับเว็บไซต์ของคุณ

TL;DR: วิธีที่ง่ายที่สุดในการรักษาความปลอดภัยเว็บไซต์ของคุณคือการติดตั้งปลั๊กอินความปลอดภัย เหมาะอย่างยิ่งสำหรับผู้ที่ไม่มีเวลาดูแลความปลอดภัยของเว็บไซต์ เพียงแค่ตั้งค่าและลืมปลั๊กอิน แต่ถ้าคุณสามารถจ่ายเวลาและแบนด์วิดธ์ได้ เราขอแนะนำให้คุณอ่านและใช้มาตรการเหล่านี้

ความปลอดภัยของเว็บไซต์คืออะไร

แม้ว่าการทำตามขั้นตอนต่างๆ เพื่อรักษาความปลอดภัยของเว็บไซต์จะเป็นเรื่องดี แต่สิ่งสำคัญคือต้องตระหนักว่าการรักษาความปลอดภัยของเว็บไซต์เป็นกระบวนการที่ต่อเนื่อง แฮกเกอร์เป็นกลุ่มที่สร้างสรรค์ ดังนั้นภัยคุกคามจึงมีวิวัฒนาการอย่างต่อเนื่อง

คุณจะเห็นในบทความด้านล่างว่าปลั๊กอินความปลอดภัยที่ดีจะทำหน้าที่ส่วนใหญ่ในแง่ของมัลแวร์ แต่การระมัดระวังและระมัดระวังคือสิ่งที่ขัดขวางการรักษาความปลอดภัยของเว็บไซต์

จะรักษาความปลอดภัยเว็บไซต์จากแฮกเกอร์ได้อย่างไร (ขั้นตอนที่สามารถดำเนินการได้)

หากต้องการมีแผนดำเนินการได้เพื่อรักษาความปลอดภัยให้กับเว็บไซต์ของคุณ ขั้นตอนแรกคือการทำความเข้าใจว่าเว็บไซต์ถูกแฮ็กได้อย่างไร จากการวิจัยของเรา เว็บไซต์ส่วนใหญ่ถูกแฮ็กผ่าน 3 วิธีต่อไปนี้:

วิธีการรักษาความปลอดภัยเว็บไซต์? (คู่มือการรักษาความปลอดภัยของเว็บไซต์ฉบับสมบูรณ์)
สาเหตุที่เว็บไซต์ถูกแฮ็ก

  • 90+% → ช่องโหว่ในปลั๊กอินหรือธีม
  • 5+% → ชื่อผู้ใช้และ/หรือรหัสผ่านที่ถูกบุกรุก
  • <1% → บริการโฮสต์เว็บแย่

การแจกจ่ายนี้ควรเป็นพื้นฐานของวิธีการวางแผนการรักษาความปลอดภัยของเว็บไซต์ และการจัดสรรเวลาและทรัพยากรให้มากที่สุด

1. ปกป้องเว็บไซต์ของคุณจากช่องโหว่

แฮกเกอร์มองหาเว็บไซต์ที่มีช่องโหว่อยู่เสมอ ไม่ว่าเว็บไซต์จะใหญ่หรือเล็ก พวกเขามีมากมายที่จะได้รับจากการแฮ็คเว็บไซต์ใด ๆ จากประสบการณ์ของเรา การแฮ็กมากกว่า 90% เกิดขึ้นเนื่องจากแฮ็กเกอร์ระบุช่องโหว่และใช้ประโยชน์จากช่องโหว่นั้น

มาดูให้ลึกขึ้นอีกนิดว่าช่องโหว่คืออะไร นี่เป็นสิ่งสำคัญที่ต้องทำความเข้าใจ เพื่อที่คุณจะได้กำหนดกลยุทธ์การรักษาความปลอดภัยของเว็บไซต์ได้อย่างรอบคอบในอนาคต

จุดอ่อนคืออะไรกันแน่?

เว็บไซต์ของคุณประกอบด้วย 3 องค์ประกอบหลัก:WordPress, ปลั๊กอิน และธีม สิ่งเหล่านี้เป็นซอฟต์แวร์โดยพื้นฐาน และเช่นเดียวกับซอฟต์แวร์อื่น ๆ พวกเขามีข้อบกพร่องซึ่งทำให้พวกเขาทำงานผิดพลาดในบางครั้ง

ข้อบกพร่องอาจมีผลตามมาหลายประการ:บางอย่างอาจทำให้เว็บไซต์ของคุณช้าลง หรือเกิดข้อผิดพลาดเมื่อมีคนเข้าชม สิ่งเหล่านี้น่ารำคาญและเป็นปัญหา แต่สิ่งที่ร้ายแรงกว่านั้นทำให้ผู้ใช้ที่ไม่ได้รับอนุญาต (เช่น แฮกเกอร์) เข้าถึงเว็บไซต์ของคุณได้ บั๊กประเภทนี้เรียกว่าช่องโหว่

ประเภทของช่องโหว่

ช่องโหว่สามารถสรุปได้ดังที่เราทำในย่อหน้าก่อนหน้าว่าเป็นข้อบกพร่องในโค้ด อย่างไรก็ตาม มีบางประเภทที่ครอบตัดบ่อยกว่าประเภทอื่นๆ:

  • ซอฟต์แวร์ที่ล้าสมัย:การอัปเดตหลัก ปลั๊กอิน และธีมเป็นสิ่งสำคัญ
  • การจัดการบทบาทของผู้ใช้ที่ไม่ดี:อย่าให้ผู้ใช้ทุกคนมีสิทธิ์เข้าถึงระดับผู้ดูแลระบบเต็มรูปแบบ
  • อินพุตที่ไม่ถูกสุขอนามัย:ฟิลด์อินพุตจำเป็นต้องตรวจสอบอินพุตก่อนจัดเก็บและ/หรือดำเนินการ

แฮ็คได้บนเว็บไซต์ที่ไม่ปลอดภัย

ช่องโหว่นั้นเชื่อมโยงอย่างใกล้ชิดกับประเภทการโจมตีที่อนุญาต และมักพูดถึงสลับกัน การโจมตีที่พบบ่อยที่สุดที่ WordPress ประสบคือ:

  • การแทรกโค้ด:ที่โค้ดที่เป็นอันตรายถูกแทรกผ่านช่องป้อนข้อมูลและดำเนินการโดยโค้ดของเว็บไซต์หรือฐานข้อมูล รูปแบบการแทรกโค้ดที่มักพบในการฉีด SQL ซึ่งถือว่าร้ายแรงมากสำหรับแอปพลิเคชันที่ขับเคลื่อนด้วยฐานข้อมูล เช่น WordPress
  • การโจมตีแบบ Cross-site scripting:ช่องโหว่ประเภทนี้จะขโมยคุกกี้ของผู้ใช้เพื่อแอบอ้างเป็นคุกกี้ หรือแม้แต่จี้เซสชัน การเข้าถึงของผู้ใช้ที่เป็นเป้าหมายจะถูกใช้เพื่อโจมตีเว็บไซต์ของคุณ
  • การโจมตีด้วยกำลังเดรัจฉาน:ตามชื่อที่สื่อถึง การโจมตีประเภทนี้ไม่มีกลเม็ดเด็ดเดี่ยว แฮ็กเกอร์โจมตีหน้าเข้าสู่ระบบของคุณด้วยชื่อผู้ใช้และรหัสผ่านร่วมกันเพื่อพยายามค้นหาชื่อที่ถูกต้อง
  • SEO spam:สแปมทั้งหมดเป็นเรื่องร้ายแรง แต่การโจมตีนี้กระทบกับจุดที่ทำร้ายเว็บไซต์มากที่สุด:SEO เจ้าของเว็บไซต์ใช้ทรัพยากรในการทำงานกับ SEO ของตน เฉพาะสำหรับแฮ็กเกอร์ที่จะใช้ประโยชน์จากการแทรกป๊อปอัปและลิงก์ไปยังรายการในตลาดที่ผิดกฎหมายหรือสีเทา การโจมตีด้วยสแปม SEO นั้นยังตรวจจับได้ยาก และบ่อยครั้งเว็บไซต์จะได้รับผลกระทบจากสแปมก่อนที่จะรู้ตัวว่าติดไวรัสตั้งแต่แรก
  • การโจมตีแบบฟิชชิ่ง:ในการโจมตีเหล่านี้ แฮ็กเกอร์พยายามปลอมตัวเป็นหน่วยงานที่ถูกต้องตามกฎหมายเพื่อหลอกให้ผู้ใช้ยอมให้ข้อมูลของตนโดยเต็มใจ ฟิชชิงทำงานควบคู่ไปกับอีเมลและเว็บไซต์ที่ถูกแฮ็กเพื่อรับข้อมูลรับรองเหล่านี้

จุดอ่อนมีผลอย่างไร?

ปลั๊กอินและธีมได้รับการติดตั้งบนเว็บไซต์หลายพันแห่ง ดังนั้น ผลกระทบของข้อบกพร่องนี้จึงขยายใหญ่ขึ้นอย่างมาก

ผู้พัฒนาปลั๊กอินและธีมที่มีความรับผิดชอบพยายามอุดช่องโหว่ด้านความปลอดภัยเหล่านี้ในผลิตภัณฑ์ของตนโดยเผยแพร่การอัปเดต นี่เป็นเหตุผลสำคัญว่าทำไมเราจึงแนะนำให้เลือกใช้ปลั๊กอินระดับพรีเมียมทุกครั้งที่ทำได้ การบำรุงรักษาซอฟต์แวร์เป็นประจำไม่สามารถเน้นได้เพียงพอในกลยุทธ์การรักษาความปลอดภัยของเว็บไซต์

เยี่ยมมาก ข้อบกพร่องได้รับการแก้ไขแล้ว ตอนนี้เราปลอดภัยแล้วใช่ไหม ก็ไม่เชิง การค้นพบช่องโหว่เป็นช่วงเวลาที่อันตรายสำหรับเจ้าของเว็บไซต์

จะเกิดอะไรขึ้นเมื่อมีการค้นพบช่องโหว่

นักวิจัยด้านความปลอดภัยมักค้นพบช่องโหว่ พวกเขาเปิดเผยสิ่งที่ค้นพบกับปลั๊กอินหรือผู้พัฒนาธีม ดังที่เราได้กล่าวไว้ในส่วนก่อนหน้า นักพัฒนาที่รับผิดชอบจะแข่งขันกันเพื่อแก้ไขปัญหาและเผยแพร่การอัปเดต

เมื่อช่องโหว่ได้รับการแก้ไข นักวิจัยด้านความปลอดภัยจะเผยแพร่สิ่งที่ค้นพบ ผู้พัฒนาได้ออกตัวแก้ไขแล้ว ดังนั้นเว็บไซต์จึงปลอดภัยใช่ไหม?

ไม่เท่าไหร่

แฮกเกอร์ยังอ่านเกี่ยวกับช่องโหว่ดังกล่าว และมองหาเว็บไซต์ที่ยังไม่ได้อัปเดตเวอร์ชันของตน ช่องโหว่สาธารณะมักจะดึงดูดแฮ็กเกอร์มือใหม่ (หรือที่เรียกว่าสคริปต์ตัวเล็ก) เพราะตอนนี้พวกเขาสามารถใช้ประโยชน์จากเว็บไซต์โดยไม่ต้องใช้ความพยายาม พวกเขารู้อย่างแม่นยำว่าเป้าหมายอยู่ที่ไหน

สิ่งที่คุณต้องทำเพื่อรักษาความปลอดภัยให้กับไซต์จากช่องโหว่

ตอนนี้เราพูดถึงขั้นตอนที่เป็นรูปธรรมที่คุณสามารถทำได้เพื่อรับรองความปลอดภัยของเว็บไซต์และรักษาความปลอดภัยเว็บไซต์จากแฮกเกอร์ ขั้นตอนเหล่านี้อาจดูเหมือนง่าย แต่เป็นวิธีที่มีประสิทธิภาพในการรักษาความปลอดภัยให้เว็บไซต์ของคุณ

1. สำรองข้อมูล

การสำรองข้อมูลเป็นส่วนที่ประเมินค่าต่ำที่สุดของกลยุทธ์ความปลอดภัย เราไม่สามารถเน้นย้ำถึงความสำคัญของการสำรองข้อมูลเป็นประจำได้มากพอ พวกเขาเป็นเครือข่ายความปลอดภัยของคุณ สิ่งเดียวที่คุณวางใจได้เมื่อสิ่งต่างๆ ไปทางทิศใต้ การสำรองข้อมูลช่วยให้คุณกลับมายืนได้อีกครั้งอย่างรวดเร็ว

อย่างไรก็ตาม ปลั๊กอินสำรองบางตัวไม่ได้ถูกสร้างขึ้นอย่างเท่าเทียมกัน หลายคนล้มเหลวเมื่อคุณต้องการมากที่สุด:ในช่วงเวลาของการฟื้นฟู มีหลายปัจจัยในการเลือกปลั๊กอินที่เหมาะสม โดยคำนึงถึงเกณฑ์เหล่านี้อย่างแน่นหนา เราได้ตรวจสอบปลั๊กอินสำรอง WordPress อันดับต้น ๆ ที่มีอยู่

2. อัปเดตปลั๊กอินและธีมอยู่เสมอ

นี่อาจฟังดูชัดเจนมาก โดยเฉพาะอย่างยิ่งหากคุณอ่านส่วนก่อนหน้าเกี่ยวกับความสำคัญของการอัปเดต อย่างไรก็ตาม มันง่ายมากที่จะเพิกเฉยต่อการแจ้งเตือนสีแดงบนแดชบอร์ด เพื่อที่จะทำสิ่งที่เร่งด่วนมากขึ้น

ดังนั้นเราจะย้ำ นักพัฒนาปลั๊กอินและธีมเผยแพร่การอัปเดตพร้อมการแก้ไขความปลอดภัย แม้ว่าคุณจะเลือกที่จะชะลอการติดตั้งการอัปเดต (แต่โปรดอย่าทำเช่นนั้น) อย่างน้อยก็ควรดำเนินการดังกล่าวหลังจากอ่านบันทึกประจำรุ่นแล้ว

3. เลือกปลั๊กอินและธีมคุณภาพดี

ณ จุดนี้ เราได้แสดงให้เห็นอย่างเพียงพอแล้วว่าปลั๊กอินและธีมส่วนกลางสำหรับเว็บไซต์ของคุณเป็นอย่างไร แม้ว่าไม่น่าจะมีซอฟต์แวร์ที่เข้าใจผิดได้อย่างสมบูรณ์ แต่ก็มีปัจจัยสำคัญที่ต้องคำนึงถึงในขณะที่เลือกปลั๊กอินและธีมที่เหมาะสมสำหรับเว็บไซต์ของคุณ:

  • มีการอัปเดตปลั๊กอินเป็นประจำหรือไม่ :ปลั๊กอินหรือธีมที่นักพัฒนาดูแลอย่างสม่ำเสมอมักจะได้รับแพตช์ความปลอดภัยหากพบช่องโหว่
  • ปลั๊กอินเป็นที่นิยมหรือไม่ :นี่คือดาบสองคม ปลั๊กอินยอดนิยมที่มีการติดตั้งหลายล้านครั้งจะเป็นเป้าหมายของแฮกเกอร์ แต่ปลั๊กอินเหล่านี้มักจะปลอดภัยกว่าเพราะมีผู้คนจำนวนมากคอยติดตามอยู่
  • เป็นปลั๊กอินพรีเมียมหรือไม่ :ปลั๊กอินแบบชำระเงินสนับสนุนงานของนักพัฒนา ดังนั้นจึงมีโอกาสถูกละทิ้งน้อยกว่าปลั๊กอินฟรี ไม่ได้หมายความว่าซอฟต์แวร์โอเพ่นซอร์สไม่เคยปลอดภัย แต่สำหรับผลิตภัณฑ์ระดับพรีเมียม คุณจะต้องจ่ายเงินสำหรับการสนับสนุนลูกค้าและคุณภาพของผลิตภัณฑ์
  • อย่าติดตั้งปลั๊กอินและธีมที่เป็นโมฆะ :ซอฟต์แวร์พรีเมียมที่ให้บริการฟรีนั้นมีปัญหาในหลายระดับ ซอฟต์แวร์ที่เป็นโมฆะมักมีมัลแวร์หรือแบ็คดอร์ที่จะอนุญาตให้แฮกเกอร์เข้าถึงเว็บไซต์ของคุณเมื่อติดตั้งแล้ว

4. ใช้ไฟร์วอลล์

ไม่มีวิธีป้องกันแฮกเกอร์หรือบอทที่พวกเขาออกแบบให้โจมตีเว็บไซต์เช่นคุณ อย่างไรก็ตาม เราสามารถลดความน่าจะเป็นได้มากโดยการติดตั้งไฟร์วอลล์
นี่คือรายการไฟร์วอลล์ WordPress ที่ดีที่สุดให้เลือก

2. Protect your username and password

We’ve found around 5% of hacked websites were vulnerable to attack because of weak passwords. This may seem a small number when compared to outright malicious activity, but it is still significant enough to command your attention.

Losing the admin password to your site is like losing keys to your home or car. With the key, the thief has complete control over your prized possessions. Likewise, with the password, hackers have complete access to your website. At this point, not even a firewall or a security plugin can prevent hackers from causing damage to your website.

The need for strong passwords continues to be very strongly advocated, but because of the difficulties associated with it, it’s often ignored by website users.

Before we go into mechanisms to have strong credentials, let’s address some common questions people have about them.

How is it possible to steal a password?

The answer may come as a surprise:the hacker tries to guess the password. By this, we don’t mean they are trying out various passwords manually, but there are bots to do this. This is also known as a brute force attack, or if the bot is guessing words, a dictionary attack.

These attacks work very well because of several reasons:

  • Easy-to-guess passwords: common words, short words, the word ‘password’ itself in different permutations
  • Data from previous hacks: there is a reason why people recommend using different passwords for different services and websites

How to safeguard against password theft

วิธีการรักษาความปลอดภัยเว็บไซต์? (คู่มือการรักษาความปลอดภัยของเว็บไซต์ฉบับสมบูรณ์)

1. Use a strong password

Strong passwords use a combination of letters, numbers, and symbols in random configurations, because those are hard to crack. It may take hacker bots years to get find the correct one.

You could try creating a strong password on your own, or use a password generator. Then you can use plugins to enforce strong passwords.

Strong, hard-to-crack passwords can be difficult to remember, so we recommend using password managers like LastPass.

2. Limit login attempts

A good way to thwart a brute force attack is to block attackers after multiple failed login attempts. This is an effective mechanism, since, this type of attack consists of hackers’ bots repeatedly trying different passwords.

MalCare firewall comes integrated with this feature. Limiting login attempts is a highly effective way to secure your website without many downsides

วิธีการรักษาความปลอดภัยเว็บไซต์? (คู่มือการรักษาความปลอดภัยของเว็บไซต์ฉบับสมบูรณ์)

If an authorised user has inadvertently reached this point, they can click through the link to find a captcha confirming they are indeed human.

3. Implement two-factor authentication

Several services use two-factor authentication during the login process, which essentially means you need to have two (ideally) separate tokens to access your account. Most commonly, these involve a combination of passwords and a limited-time token like a pin code or QR code sent to your email or a device.

There are several plugins that implement two-factor authentication or 2FA, and they vary depending on the services they provide. 2FA comes integrated in MalCare’s security suite as well.

4. Implement CAPTCHA protection

CAPTCHAs can only be resolved by humans. They are designed to prevent hacker bots from accessing an account. You can use it to protect your website.

Here’s a neat little article by Kinsta that’ll help you get started.

5. Use a firewall

Certain website security firewalls like MalCare’s also keep track of malicious IPs at a global level. The firewall learns from all the sites with the plugin installed. It then automatically blocks bad IPs even before they have attempted to crack your password. This, in combination with limit-login capability, can protect your site from hackers trying to force their way in.

วิธีการรักษาความปลอดภัยเว็บไซต์? (คู่มือการรักษาความปลอดภัยของเว็บไซต์ฉบับสมบูรณ์)

3. Choose a good web hosting provider

There is a tendency to blame the web host for anything that goes wrong with a website. While web hosts are generally responsible for many aspects of a website, they are rarely at fault when a website gets hacked.

In fact, the opposite is generally true, web hosts improve website security.

Of course, there are some web hosts who play a role in the compromise of websites hosted on their server. It rarely happens, but when it does, it’s a major incident that compromises thousands of websites.

4. Install an SSL certificate

Secure Sockets Layer, more commonly known as SSL, is a security protocol that encrypts all communication to and from a website. Once installed, it appears as a padlock at the beginning of your website’s URL.

The benefits of using an SSL certificate are as follows:

  • All data passing to and from your website is encrypted
  • It is a badge of trust for your website. In fact, most browsers will flag sites without SSL as ‘Not secure’ in the address bar.
  • Google loves websites with an SSL certificate and even rewards them with a higher ranking.

Easily install an SSL certificate on your website. It barely takes any time, and it is well worth the effort spent.

Good website security practices

As we said at the outset, website security is an ongoing practice. In this section, we are listing out practices that are good to inculcate in your overall website security strategy. Once you get into the habit of doing so, the small investment of your time and effort will pay for itself many times over with a secure website.

1. Change your password frequently

We understand that setting difficult-to-guess passwords is tricky, especially because they are often synonymous with difficult-to-remember. We can also imagine the dismay at being asked to change this most excellent password regularly.

The reason is that passwords are the weakest links in security; especially if you use the same passwords for multiple accounts. Even if one site experiences a breach, you can safely assume that all your accounts are potentially compromised. There are news stories about breaches every few weeks–and those are just the reported ones. Something to keep in mind.

Regularly can also mean different things to different people. Some financial institutions, like banks, mandate that passwords be changed every 90 days. Using a password manager is the way forward.

2. Review website users + track new admin users

Hackers often leave behind admin users, so that they can regain access to a site. Hence, reviewing admin users on a regular basis can improve website security.

Secondly, website collaborators can change. If a user no longer needs access, it is best to remove their access. The reason is two-fold:you don’t want the user to make any more changes to your website; their inactive accounts can be compromised by hackers.

Over time, as we build our site with newer content and design, we keep adding new users to our site. We should review these users periodically. You may be following good security practices yourself, but another user getting compromised will cause your site to be affected.

When adding users, give only necessary access levels as far as possible. For instance, If someone is only writing articles don’t give them admin access.

3. Set up activity log on your site

We are big fans of having activity logs for our website. It has saved our bacon multiple times.

Hackers don’t use core WordPress APIs to modify a website, therefore many of the changes they make will not reflect in an activity log. However, they can leave footprints behind, such as creating admin accounts for themselves to access the site. These unexpected actions can help detect hacks.

Conversely, if changes are made by a collaborator, then activity logs can help avoid unnecessary panic, when you see changes made to your website.

4. Block PHP in the Uploads folder

A whole class of vulnerabilities (Remote Code Execution, to be precise) lets hackers upload malicious PHP files to the Uploads folder. The hacker can then use it to execute any code they want on your website. In other words, they have complete control over your website.

The attack can be neutered effectively if you block the execution of PHP files in the Uploads folder. ไม่ต้องกังวล. Blocking PHP files in the Uploads folder is safe because they shouldn’t be present there, in the first place. Uploads folder is where you store your media, not scripts.

If you are using, MalCare security plugin, you can block PHP execution in the Uploads folder with the click of a button. For Apache/Litespeed based sites, we can add rules to htaccess to enforce this protection.

Things to avoid when securing your website

A quick Google search will give you numerous tips and strategies to secure your website. Several security plugins will also present multiple options to protect your site against password crackers. Securing your website is a great deal about what you should do; however, there are also some things you should avoid.

The reasons vary for each of the points we talk about below, but at its core, there should be a tangible security benefit to your measures—especially if you are asking your users to jump through additional security hoops. For example, if you apply both captcha and 2-factor authentication, getting into your site becomes trying, with little additional benefit.

You may get an additional sense of security from applying all available options, but in cost-benefit analysis, they don’t cut mustard.

1. Hide wp-login page

You’ll see this one on a lot of forums:change the wp-login page to a custom URL for your site. The logic is, if the hackers can’t find the login page, they can’t use brute force attacks to gain entry to your site.

There are a few flaws with this:

  • WordPress also lets you log in using XML-RPC
  • It will make your site difficult to use. If you forget the special URL you have created for yourself in lieu of wp-login, then recovering from this can be difficult.
  • If you use a common URL or the default one that comes with the security plugin, it will be easy for the hackers to guess anyway, therefore defeating the purpose entirely.
  • Hiding this page involves applying complicated settings to your site which can have other unexpected side effects.

Therefore, in our opinion, it is just not worth the effort.

2. Geo-blocking

Another commonly recommended security measure is geo-blocking. You may not need or expect legitimate traffic from certain countries, and hence decide to restrict access. MalCare supports this feature, but we don’t recommend you do this because:

  • IPs for regions are not perfect and can have errors.
  • If you block yourself out by mistake, reverting this will be difficult.
  • You might end up blocking good bots such as Google which can harm your site.

A good firewall can and will protect your website against malicious bots and undesirable traffic. We’ve covered the benefits of firewalls in a previous section.

3. Password protect wp-admin directory

The wp-admin folder is one of the most crucial folders on your website. Naturally, it attracts a lot of attention from hackers. Therefore, protecting it with a password may seem like a brilliant move, but it’s counterproductive.

Password protecting your wp-admin directory breaks AJAX functionality on your WordPress website. AJAX is a coding technique that loads parts of your website from the server without changing the currently displayed page.

If this sounds like gobbledegook, it essentially means that it makes your website dynamic, without constantly reloading it for users every time something changes.

Think about scrolling on the newsfeed of a social networking site. New stories or tweets load while you are still reading the ones already on your screen, and you can refresh the newsfeed when you want to load the new content.

4. Hide WordPress version

The logic behind hiding the WordPress version of your website is related to security updates. If your website doesn’t have the latest version of WordPress, a hacker may be able to exploit a vulnerability that exists in an older version.

However, hiding your WordPress version has no benefit whatsoever. There are several ways to determine a website’s WordPress version:inspecting the site’s frontend code, checking the RSS feed, etc. All of which are legitimate, incidentally.

The way to combat WordPress vulnerabilities in older versions is to keep your version updated to the latest one. Many website administrators are afraid that updating a live site may cause something to break. Therefore, it is best to do so on a staging site first.

What to do if your website has been hacked?

วิธีการรักษาความปลอดภัยเว็บไซต์? (คู่มือการรักษาความปลอดภัยของเว็บไซต์ฉบับสมบูรณ์)

If your site has been hacked recently, it is even more important for you to be extremely diligent about the security of your site. If not done correctly, it can lead to the site getting hacked repeatedly and the whole situation becoming a total nightmare.

  • Clean the malware first :Use a good security plugin, like MalCare, to automatically remove malware without a trace.
  • Update everything :As we said before, software updates are vital. Make sure you have the latest versions of WordPress, themes and plugins. If you don’t, there is a good chance this is the reason your website got hacked in the first place.
  • Review every admin user: Scrutinise every admin account carefully. We’ve said this already in this article, but hackers create admin accounts to regain access to a website that they have hacked, in case the malware has been discovered.
  • Change all passwords: Assume your credentials have been compromised and change passwords. Hopefully you do not use the same password for different products and services, otherwise you should change those passwords as well.
  • Change DB credentials (if possible): The wp-config.php file contains the credentials the WordPress site uses to connect to the database of the site. In many cases, access to the database is restricted even if the DB credentials are compromised. However, with some hosts, hackers can use this information to directly modify the database. This can cause the site to be reinfected.
  • Change security keys: WordPress uses security keys to manage sessions for logged-in users. Read more about what they are and how to make a website secure by changing them.
  • Set up a WordPress firewall: We’ve already covered this in detail in this article. A WordPress firewall is your best defence against malicious bots and bad traffic.

บทสรุป

We started this article on how to secure a website with a clear signpost:the first step is to think about website security in the right way. It is an ongoing process. A good standard practice to have in any organization is to conduct periodic website security audits.

The threat landscape is constantly changing, and hackers will find more creative ways to defeat defences. Security experts remain constantly vigilant, and this is the main takeaway from all of what we have learned in our years of research:don’t get complacent.

Have thoughts to share? Drop us a line, or connect with us on social media. Love to hear your thoughts.

FAQs

What is website security?

Website security is putting together a plan to protect your website and users from hackers and their malware. It involves understanding the components of your website, how they work together and what vulnerabilities they have.

Once this foundation is in place, then you need to formulate a comprehensive security plan to protect against vulnerabilities. This involves a series of configuration steps, implementation of policies, and keeping up to date with respect to threats.

A key factor in achieving website security is to understand that it is not a one-time activity. Security evolves, because threats evolve.


Why website security is important?

WordPress is used by millions of people, so it is probably secure, right? Yes and no.

Yes, because WordPress core files are secure, and even when a vulnerability is discovered, it is addressed very quickly.

No, because your website isn’t just the WordPress core. It is a combination of plugins and themes, used to help make your website more functional, interactive and attractive. These plugins and themes extend the functionality of WordPress, but also increase the opportunities for vulnerabilities. Good plugin and theme developers will fix vulnerabilities quickly. However the danger is significantly greater.

To protect your website—including the time, money and other resources you have invested in it—and to safeguard your visitors from having their data and identities stolen, you need to secure your website. If you are WordPress user, you can go through our wordpress security guide to secure your site.


How to secure a website from hackers?

You can take several steps to secure your website from hackers: 

1. Keep your WordPress, plugins and themes up to date
2. Install a good firewall
3. Implement login protection
4. Install SSL 
5. Use two-factor authentication for logins
6. Review user roles regularly
7. Set up an activity log