Google 虚拟主机申请

Getting hacked is not a very exciting thing. If we can prevent it, we will have some peace of mind. Getting hacked can happen in many ways, such as getting infected with a Trojan from another website. Then the website's Ftp data was stolen, using Joomla and not updating to the new version, or installing component modules and not following the updates, are channels for hackers to penetrate the system.

Google 虚拟主机申请

Getting hacked is not a very exciting thing. If we can prevent it, we will have some peace of mind. Getting hacked can happen in many ways, such as getting infected with a Trojan from another website. Then the website's Ftp data was stolen, using Joomla and not updating to the new version, or installing component modules and not following the updates, are channels for hackers to penetrate the system.

การโดนแฮกเป็นสิ่งไม่น่าพิศมัยนัก ถ้าเราป้องกันได้ก็จะอุ่นใจได้บ้าง การโดนแฮกสามารถโดนได้หลายทาง เช่น

  • ไปติดโทรจันมาจากเว็บอื่น แล้วโดนขโมยข้อมูล Ftp ของเว็บ
  • ใช้จูมล่า แล้วไม่อัพเดต เป็นรุ่นใหม่ หรือ ลงคอมโพเน้น โมดูลไป ไม่ตามอัพเดต ก็เป็นช่องทางให้ Hacker เข้ามาเจาะระบบได้
  • Hosting ที่ใช้มีการตั้งค่าที่ไม่ปลอดภัย


วันนี้จะมาแนะนำ plugin ของ joomla! ชื่อ jHackGuard ของ เว็บ SiteGround ซึ่ง เขียนมาจากประสบการณ์ที่เขาดูแลเว็บที่เป็นจูมล่าบนโฮสเขาเองซึ่ง jHackGuard จะเป็นด่านป้องกันเว็บที่ทำด้วยจูมล่า

ป้องกันอะไรบ้าง

  • SQL Injections
  • Remote URL/File Inclusions
  • Remote Code Executions
  • XSS Based Attacks!


การติดตั้ง
เมื่อติดตั้งเสร็จก็ เปิดใช้งานแค่นี้ครับ ได้แล้ว โหลดได้ที่ http://extensions.joomla.org/extensions/access-a-security/site-security/site-protection/13233?qh=YToxOntpOjA7czoxMDoiamhhY2tndWFyZCI7fQ%3D%3D

หรืออยากได้เร็ว
http://www.colorpack.net/images/jhackguard.zip

แถม เพิ่มความมั่นใจอีกชั้นด้วย การป้องกันที่ .htaccess เพิ่ม code ลงไป ที่ไฟล์ .htaccess หลังจากบันทัดที่มีคำว่า
########## End - Joomla! core SEF Section

เพิ่ม code ด้านล่างลงไป

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} ^.*(localhost|loopback|127.0.0.1).* [NC,OR]
RewriteCond %{QUERY_STRING} ^.*.[A-Za-z0-9].* [NC,OR]
RewriteCond %{QUERY_STRING} ^.*(<|>|?|%0A|%0D|%27|%3C|%3E|%00).* [NC]

RewriteCond %{QUERY_STRING} proc/self/environ [OR]

บทความต้นฉบับจาก colorpack.net: มาป้องกันการโดนแฮก Joomla! ด้วย jHackGuard