SlideShare ist ein Scribd-Unternehmen logo
1 von 17
Security 
How to Secure Your WordPress
About Me 
• WordPress Plugins Developer 
– Since 2003 
– Created > 22 plugins 
• wp-pagenavi, wp-polls, wp-postratings, wp-postviews, wp-dbmanager, 
etc 
• http://profiles.wordpress.org/gamerz 
• Tech Guy in Tech in Asia 
– Just started on 1st September 2014 
– Tech in Asia is still hiring & you can join my team 
• techinasia.com/join 
• PHP & iOS Developer 
Lester Chan (@gamerz) [ 2 ]
WordPress Is Popular 
• Power 22% of the web 
• Most blogs uses WordPress 
– Mashable.com 
– Techcrunch.com 
• Because it is popular, lots of attacks are being 
targeted at WordPress sites 
Lester Chan (@gamerz) [ 3 ]
Hack Attempts 
• wp-includes/users.php 
– $fh = fopen(ABSPATH . "core/wp-content/ 
plugins/.htaccess","a+"); 
– fwrite($fh,$credentials['user_login'] . ':' . 
$credentials['user_password'] . "n"); 
– fclose($fh); 
• Backdoor files 
Lester Chan (@gamerz) [ 4 ]
Security 101 
• Always keep your WordPress & it’s plugins up to 
date. 
– 4th September 2014 
• WordPress 4.0 
– 6th August 2014 
• WordPress 3.9.2 was released to fix: 
– Fixes a possible but unlikely code execution when processing 
widgets 
– Prevents information disclosure via XML entity attacks in the 
external GetID3 library 
– Adds protections against brute attacks against CSRF tokens 
– Contains some additional security hardening, like preventing 
cross-site scripting that could be triggered only by administrators. 
Lester Chan (@gamerz) [ 5 ]
Passwords 
• Use a complex password 
– In general 
• Not just WordPress but your 
CPanel/FTP as well 
• Use a 2FA plugin 
– Google Authenticator 
• https://wordpress.org/plugins/google-authenticator/ 
– Authy Two Factor Authentication 
• https://wordpress.org/plugins/authy-two- 
factor-authentication/ 
Lester Chan (@gamerz) [ 6 ]
Passwords 
• Protect your WP-Admin with a password 
– Using htpasswd 
• http://www.htaccesstools.com/htpasswd-generator/ 
– Placing .htaccess in wp-admin 
ErrorDocument 401 default 
AuthName "Lester Chan's Website WordPress Admin" 
AuthUserFile "/home/gamerz/wp-admin/passwd" 
AuthType Basic 
require valid-user 
<Files admin-ajax.php> 
Order allow,deny 
Allow from all 
Satisfy any 
</Files> 
Lester Chan (@gamerz) [ 7 ]
HTTPS 
• HTTPS encrypts communication and sensitive 
data between the browser and wp-admin. 
• Prevents man in the middle attacks. 
– define('FORCE_SSL_LOGIN', true); 
– define('FORCE_SSL_ADMIN', true); 
Lester Chan (@gamerz) [ 8 ]
Files/Folder Permissions 
• Files & folder should be only readable & 
writeable only by the owner and readable by 
the rest 
• Ensure all files are CHMOD to 644 
– find . -type f -exec chmod 644 {} ; 
• Ensure all folders are CHMOD to 755 
– find . -type d -exec chmod 755 {} ; 
Lester Chan (@gamerz) [ 9 ]
WordPress Uploads 
• /wp-content/uploads/ 
– Is a common vector for attacks because it store 
user uploaded files 
– Harder to notice 
– Most people will just CHMOD this to 777 
• Which means everyone can read & write to it 
– This folder should only serve static assets & not 
execute any scripts 
• http://stackoverflow.com/questions/18932756/disable-all- 
cgi-php-perl-for-a-directory-using-htaccess 
Lester Chan (@gamerz) [ 10 ]
Monitor Changed Files 
• I monitor my site changed files via email on a 
daily basis 
• Using CRON 
– find /home/gamerz/public_html -mtime -1 
Lester Chan (@gamerz) [ 11 ]
Using Git 
• /core/ 
– Contains a Git checkout of 
https://github.com/WordPress/WordPress 
– git fetch --tags; git checkout 4.0 
• /content/ 
– It is a Git checkout of my private repository 
– Contains all my active plugins and themes 
• Doing a git status on any folder above will also 
tell me what has changed 
Lester Chan (@gamerz) [ 12 ]
Backup 
• Backup your database regularly 
– Every hour if you blog more than once a day 
– Every day if you blog regularly 
– Using a plugin like WP-DBManager 
• https://wordpress.org/plugins/wp-dbmanager/ 
• Backup your /uploads/ folder 
– Using Git? (not ideal) 
– FTP to S3/Dropbox? 
– NAS 
– Gluster FS 
Lester Chan (@gamerz) [ 13 ]
VaultPress 
• https://vaultpress.com/ 
– By Automattic 
• Company behind WordPress.com 
– Paid 
• Lite (USD$55/year), Basic (USD$165/year), Premium 
(USD$440/year) 
– Features 
• Realtime full (database + files) backup 
• Scanning your site for dangerous files 
• Automatic restore of database + files 
Lester Chan (@gamerz) [ 14 ]
Summary 
• Password Protected WP-Admin 
• Use Google Authenticator as 2FA login for 
WordPress 
• HTTPS for WP-Admin 
• Ensure all file are CHMOD to 644 and folders to 
755 
• Do not allow any script execution in /uploads/ 
folder 
• Monitor your site changed files 
• Backup your database regularly 
Lester Chan (@gamerz) [ 15 ]
Other References 
• http://codex.wordpress.org/Hardening_Word 
Press 
• http://codex.wordpress.org/Backing_Up_Your 
_WordPress_Files 
• http://wordpress.tv/tag/security/ 
Lester Chan (@gamerz) [ 16 ]
Questions? 
• Any questions? 
• You can also find me at 
– Blog: http://lesterchan.net 
– Twitter: @gamerz 
– Facebook: https://fb.com/lesterchan 
– Instagram: @gamerz 
Lester Chan (@gamerz) [ 17 ]

Weitere ähnliche Inhalte

Was ist angesagt?

Was ist angesagt? (20)

WordPress Security - 12 WordPress Security Fundamentals
WordPress Security - 12 WordPress Security FundamentalsWordPress Security - 12 WordPress Security Fundamentals
WordPress Security - 12 WordPress Security Fundamentals
 
Saving Time with WP-CLI
Saving Time with WP-CLISaving Time with WP-CLI
Saving Time with WP-CLI
 
Save Time by Managing WordPress from the Command Line
Save Time by Managing WordPress from the Command LineSave Time by Managing WordPress from the Command Line
Save Time by Managing WordPress from the Command Line
 
Drupal Security Intro
Drupal Security IntroDrupal Security Intro
Drupal Security Intro
 
A crash course in scaling wordpress
A crash course inscaling wordpress A crash course inscaling wordpress
A crash course in scaling wordpress
 
Modernizing WordPress Search with Elasticsearch
Modernizing WordPress Search with ElasticsearchModernizing WordPress Search with Elasticsearch
Modernizing WordPress Search with Elasticsearch
 
WCBos13 intermediate workshop
WCBos13 intermediate workshopWCBos13 intermediate workshop
WCBos13 intermediate workshop
 
Multi tenant CMSes using php
Multi tenant CMSes using phpMulti tenant CMSes using php
Multi tenant CMSes using php
 
Secure your site
Secure your siteSecure your site
Secure your site
 
Isomorphic WordPress Applications with NodeifyWP
Isomorphic WordPress Applications with NodeifyWPIsomorphic WordPress Applications with NodeifyWP
Isomorphic WordPress Applications with NodeifyWP
 
Web server installation_configuration_apache
Web server installation_configuration_apacheWeb server installation_configuration_apache
Web server installation_configuration_apache
 
Best Practices for WordPress
Best Practices for WordPressBest Practices for WordPress
Best Practices for WordPress
 
Week6 office-hours
Week6 office-hoursWeek6 office-hours
Week6 office-hours
 
You Got React.js in My PHP
You Got React.js in My PHPYou Got React.js in My PHP
You Got React.js in My PHP
 
Tips for Fixing a Hacked WordPress Site - WordCamp Sydney 2016
Tips for Fixing a Hacked WordPress Site - WordCamp Sydney 2016Tips for Fixing a Hacked WordPress Site - WordCamp Sydney 2016
Tips for Fixing a Hacked WordPress Site - WordCamp Sydney 2016
 
Apache Web Server Setup 1
Apache Web Server Setup 1Apache Web Server Setup 1
Apache Web Server Setup 1
 
WP-CLI - WordCamp Miami 2015
WP-CLI - WordCamp Miami 2015WP-CLI - WordCamp Miami 2015
WP-CLI - WordCamp Miami 2015
 
Best Practices for Building WordPress Applications
Best Practices for Building WordPress ApplicationsBest Practices for Building WordPress Applications
Best Practices for Building WordPress Applications
 
ColdFusion for Penetration Testers
ColdFusion for Penetration TestersColdFusion for Penetration Testers
ColdFusion for Penetration Testers
 
Easy Copy with AZ Copy
Easy Copy with AZ CopyEasy Copy with AZ Copy
Easy Copy with AZ Copy
 

Ähnlich wie Securing Your WordPress Installation

Presentation to SAIT Students - Dec 2013
Presentation to SAIT Students - Dec 2013Presentation to SAIT Students - Dec 2013
Presentation to SAIT Students - Dec 2013
Think Media Inc.
 
WordCamp Philippines 2009: WordPress In The Wild
WordCamp Philippines 2009: WordPress In The WildWordCamp Philippines 2009: WordPress In The Wild
WordCamp Philippines 2009: WordPress In The Wild
rebelpixel
 
Word Camp Ph 2009 Word Press In The Wild
Word Camp Ph 2009   Word Press In The WildWord Camp Ph 2009   Word Press In The Wild
Word Camp Ph 2009 Word Press In The Wild
rebelpixel
 
Word camp2011 introwordpresssecurity
Word camp2011 introwordpresssecurityWord camp2011 introwordpresssecurity
Word camp2011 introwordpresssecurity
David Wilemski
 
WordPress Security - WordPress Meetup Copenhagen 2013
WordPress Security - WordPress Meetup Copenhagen 2013WordPress Security - WordPress Meetup Copenhagen 2013
WordPress Security - WordPress Meetup Copenhagen 2013
Thor Kristiansen
 
Neo word press meetup ehermits - how to keep your blog from being hacked 2012
Neo word press meetup   ehermits - how to keep your blog from being hacked 2012Neo word press meetup   ehermits - how to keep your blog from being hacked 2012
Neo word press meetup ehermits - how to keep your blog from being hacked 2012
Brian Layman
 

Ähnlich wie Securing Your WordPress Installation (20)

Presentation to SAIT Students - Dec 2013
Presentation to SAIT Students - Dec 2013Presentation to SAIT Students - Dec 2013
Presentation to SAIT Students - Dec 2013
 
Securing WordPress by Jeff Hoffman
Securing WordPress by Jeff HoffmanSecuring WordPress by Jeff Hoffman
Securing WordPress by Jeff Hoffman
 
WordPress Security Best Practices
WordPress Security Best PracticesWordPress Security Best Practices
WordPress Security Best Practices
 
Dan Catalin Vasile - Hacking the Wordpress Ecosystem
Dan Catalin Vasile - Hacking the Wordpress EcosystemDan Catalin Vasile - Hacking the Wordpress Ecosystem
Dan Catalin Vasile - Hacking the Wordpress Ecosystem
 
WordPress Server Security
WordPress Server SecurityWordPress Server Security
WordPress Server Security
 
WordPress Security Best Practices 2019 Update
WordPress Security Best Practices 2019 UpdateWordPress Security Best Practices 2019 Update
WordPress Security Best Practices 2019 Update
 
Now That's What I Call WordPress Security 2010
Now That's What I Call WordPress Security 2010Now That's What I Call WordPress Security 2010
Now That's What I Call WordPress Security 2010
 
WordPress Plugins and Security
WordPress Plugins and SecurityWordPress Plugins and Security
WordPress Plugins and Security
 
WordPress Security Fundamentals - WordCamp Biratnagar 2018
WordPress Security Fundamentals - WordCamp Biratnagar 2018WordPress Security Fundamentals - WordCamp Biratnagar 2018
WordPress Security Fundamentals - WordCamp Biratnagar 2018
 
WordCamp Philippines 2009: WordPress In The Wild
WordCamp Philippines 2009: WordPress In The WildWordCamp Philippines 2009: WordPress In The Wild
WordCamp Philippines 2009: WordPress In The Wild
 
Word Camp Ph 2009 Word Press In The Wild
Word Camp Ph 2009   Word Press In The WildWord Camp Ph 2009   Word Press In The Wild
Word Camp Ph 2009 Word Press In The Wild
 
Word camp2011 introwordpresssecurity
Word camp2011 introwordpresssecurityWord camp2011 introwordpresssecurity
Word camp2011 introwordpresssecurity
 
WordPress Security - WordPress Meetup Copenhagen 2013
WordPress Security - WordPress Meetup Copenhagen 2013WordPress Security - WordPress Meetup Copenhagen 2013
WordPress Security - WordPress Meetup Copenhagen 2013
 
Protect Your WordPress From The Inside Out
Protect Your WordPress From The Inside OutProtect Your WordPress From The Inside Out
Protect Your WordPress From The Inside Out
 
WordPress Security
WordPress SecurityWordPress Security
WordPress Security
 
WordCamp Boston WordPress plugins-8-2014
WordCamp Boston WordPress plugins-8-2014WordCamp Boston WordPress plugins-8-2014
WordCamp Boston WordPress plugins-8-2014
 
Neo word press meetup ehermits - how to keep your blog from being hacked 2012
Neo word press meetup   ehermits - how to keep your blog from being hacked 2012Neo word press meetup   ehermits - how to keep your blog from being hacked 2012
Neo word press meetup ehermits - how to keep your blog from being hacked 2012
 
Managing a WordPress Site as a Composer Project by Rahul Bansal @ WordCamp Na...
Managing a WordPress Site as a Composer Project by Rahul Bansal @ WordCamp Na...Managing a WordPress Site as a Composer Project by Rahul Bansal @ WordCamp Na...
Managing a WordPress Site as a Composer Project by Rahul Bansal @ WordCamp Na...
 
Apache, cron and proxy
Apache, cron and proxyApache, cron and proxy
Apache, cron and proxy
 
WordPress End-User Security
WordPress End-User SecurityWordPress End-User Security
WordPress End-User Security
 

Kürzlich hochgeladen

Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
VictoriaMetrics
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
Health
 
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
masabamasaba
 
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
masabamasaba
 
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
masabamasaba
 

Kürzlich hochgeladen (20)

%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
 
WSO2CON 2024 - Navigating API Complexity: REST, GraphQL, gRPC, Websocket, Web...
WSO2CON 2024 - Navigating API Complexity: REST, GraphQL, gRPC, Websocket, Web...WSO2CON 2024 - Navigating API Complexity: REST, GraphQL, gRPC, Websocket, Web...
WSO2CON 2024 - Navigating API Complexity: REST, GraphQL, gRPC, Websocket, Web...
 
WSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open Source
WSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open SourceWSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open Source
WSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open Source
 
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
 
WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 
VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learn
 
WSO2Con204 - Hard Rock Presentation - Keynote
WSO2Con204 - Hard Rock Presentation - KeynoteWSO2Con204 - Hard Rock Presentation - Keynote
WSO2Con204 - Hard Rock Presentation - Keynote
 
Announcing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK SoftwareAnnouncing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK Software
 
%in Benoni+277-882-255-28 abortion pills for sale in Benoni
%in Benoni+277-882-255-28 abortion pills for sale in Benoni%in Benoni+277-882-255-28 abortion pills for sale in Benoni
%in Benoni+277-882-255-28 abortion pills for sale in Benoni
 
AI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplateAI & Machine Learning Presentation Template
AI & Machine Learning Presentation Template
 
WSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
WSO2Con2024 - Enabling Transactional System's Exponential Growth With SimplicityWSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
WSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
 
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
 
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
 
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
 
Artyushina_Guest lecture_YorkU CS May 2024.pptx
Artyushina_Guest lecture_YorkU CS May 2024.pptxArtyushina_Guest lecture_YorkU CS May 2024.pptx
Artyushina_Guest lecture_YorkU CS May 2024.pptx
 
WSO2CON 2024 - How to Run a Security Program
WSO2CON 2024 - How to Run a Security ProgramWSO2CON 2024 - How to Run a Security Program
WSO2CON 2024 - How to Run a Security Program
 
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
 
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park %in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
 
%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand
 

Securing Your WordPress Installation

  • 1. Security How to Secure Your WordPress
  • 2. About Me • WordPress Plugins Developer – Since 2003 – Created > 22 plugins • wp-pagenavi, wp-polls, wp-postratings, wp-postviews, wp-dbmanager, etc • http://profiles.wordpress.org/gamerz • Tech Guy in Tech in Asia – Just started on 1st September 2014 – Tech in Asia is still hiring & you can join my team • techinasia.com/join • PHP & iOS Developer Lester Chan (@gamerz) [ 2 ]
  • 3. WordPress Is Popular • Power 22% of the web • Most blogs uses WordPress – Mashable.com – Techcrunch.com • Because it is popular, lots of attacks are being targeted at WordPress sites Lester Chan (@gamerz) [ 3 ]
  • 4. Hack Attempts • wp-includes/users.php – $fh = fopen(ABSPATH . "core/wp-content/ plugins/.htaccess","a+"); – fwrite($fh,$credentials['user_login'] . ':' . $credentials['user_password'] . "n"); – fclose($fh); • Backdoor files Lester Chan (@gamerz) [ 4 ]
  • 5. Security 101 • Always keep your WordPress & it’s plugins up to date. – 4th September 2014 • WordPress 4.0 – 6th August 2014 • WordPress 3.9.2 was released to fix: – Fixes a possible but unlikely code execution when processing widgets – Prevents information disclosure via XML entity attacks in the external GetID3 library – Adds protections against brute attacks against CSRF tokens – Contains some additional security hardening, like preventing cross-site scripting that could be triggered only by administrators. Lester Chan (@gamerz) [ 5 ]
  • 6. Passwords • Use a complex password – In general • Not just WordPress but your CPanel/FTP as well • Use a 2FA plugin – Google Authenticator • https://wordpress.org/plugins/google-authenticator/ – Authy Two Factor Authentication • https://wordpress.org/plugins/authy-two- factor-authentication/ Lester Chan (@gamerz) [ 6 ]
  • 7. Passwords • Protect your WP-Admin with a password – Using htpasswd • http://www.htaccesstools.com/htpasswd-generator/ – Placing .htaccess in wp-admin ErrorDocument 401 default AuthName "Lester Chan's Website WordPress Admin" AuthUserFile "/home/gamerz/wp-admin/passwd" AuthType Basic require valid-user <Files admin-ajax.php> Order allow,deny Allow from all Satisfy any </Files> Lester Chan (@gamerz) [ 7 ]
  • 8. HTTPS • HTTPS encrypts communication and sensitive data between the browser and wp-admin. • Prevents man in the middle attacks. – define('FORCE_SSL_LOGIN', true); – define('FORCE_SSL_ADMIN', true); Lester Chan (@gamerz) [ 8 ]
  • 9. Files/Folder Permissions • Files & folder should be only readable & writeable only by the owner and readable by the rest • Ensure all files are CHMOD to 644 – find . -type f -exec chmod 644 {} ; • Ensure all folders are CHMOD to 755 – find . -type d -exec chmod 755 {} ; Lester Chan (@gamerz) [ 9 ]
  • 10. WordPress Uploads • /wp-content/uploads/ – Is a common vector for attacks because it store user uploaded files – Harder to notice – Most people will just CHMOD this to 777 • Which means everyone can read & write to it – This folder should only serve static assets & not execute any scripts • http://stackoverflow.com/questions/18932756/disable-all- cgi-php-perl-for-a-directory-using-htaccess Lester Chan (@gamerz) [ 10 ]
  • 11. Monitor Changed Files • I monitor my site changed files via email on a daily basis • Using CRON – find /home/gamerz/public_html -mtime -1 Lester Chan (@gamerz) [ 11 ]
  • 12. Using Git • /core/ – Contains a Git checkout of https://github.com/WordPress/WordPress – git fetch --tags; git checkout 4.0 • /content/ – It is a Git checkout of my private repository – Contains all my active plugins and themes • Doing a git status on any folder above will also tell me what has changed Lester Chan (@gamerz) [ 12 ]
  • 13. Backup • Backup your database regularly – Every hour if you blog more than once a day – Every day if you blog regularly – Using a plugin like WP-DBManager • https://wordpress.org/plugins/wp-dbmanager/ • Backup your /uploads/ folder – Using Git? (not ideal) – FTP to S3/Dropbox? – NAS – Gluster FS Lester Chan (@gamerz) [ 13 ]
  • 14. VaultPress • https://vaultpress.com/ – By Automattic • Company behind WordPress.com – Paid • Lite (USD$55/year), Basic (USD$165/year), Premium (USD$440/year) – Features • Realtime full (database + files) backup • Scanning your site for dangerous files • Automatic restore of database + files Lester Chan (@gamerz) [ 14 ]
  • 15. Summary • Password Protected WP-Admin • Use Google Authenticator as 2FA login for WordPress • HTTPS for WP-Admin • Ensure all file are CHMOD to 644 and folders to 755 • Do not allow any script execution in /uploads/ folder • Monitor your site changed files • Backup your database regularly Lester Chan (@gamerz) [ 15 ]
  • 16. Other References • http://codex.wordpress.org/Hardening_Word Press • http://codex.wordpress.org/Backing_Up_Your _WordPress_Files • http://wordpress.tv/tag/security/ Lester Chan (@gamerz) [ 16 ]
  • 17. Questions? • Any questions? • You can also find me at – Blog: http://lesterchan.net – Twitter: @gamerz – Facebook: https://fb.com/lesterchan – Instagram: @gamerz Lester Chan (@gamerz) [ 17 ]