20
WORDPRESS SECURITY – BATTENING DOWN THE HATCHES @brechtrycka ert

WordPress Security - Battening down the hatches

Embed Size (px)

Citation preview

Page 1: WordPress Security - Battening down the hatches

WORDPRESS SECURITY – BATTENING DOWN THE

HATCHES@brechtryckaert

Page 2: WordPress Security - Battening down the hatches

@BRECHTRYCKAERT - WordPress Specialist bij Combell.com

- Auteur van WordPress Security 101 ebook (Kindle, Kobo, iBooks, Gumroad)

Page 3: WordPress Security - Battening down the hatches

WIE WERD AL EENS SLACHTOFFER VAN HACKING?

Page 4: WordPress Security - Battening down the hatches

SOORTEN HACKS Backdoors & Shells Pharma hack Drive By Downloads Malafide redirects

Page 5: WordPress Security - Battening down the hatches

HOE GERAKEN HACKERS BINNEN?

Oorzaken van hacking

Lekken in thema's en plug-ins

Verouderde versies Wordpress

Server config & andere oorzaken

Page 6: WordPress Security - Battening down the hatches

HOE KUNNEN WE DE BEVEILIGING VERSCHERPEN?

Waar aanpakken?

SERVER WORDPRESS

Page 7: WordPress Security - Battening down the hatches

SECURITY BINNEN WORDPRESS De basics:Security plugin (iThemes, Wordfence, Sucuri, ...)Sterke wachtwoorden“admin” gebruiker uit den boze

Page 8: WordPress Security - Battening down the hatches

SECURITY BINNEN WORDPRESS Maar ook:2-factor authentication (bvb Clef)Inactieve plugins en thema’s verwijderenUPDATES! UPDATES! UPDATES!Geen core-file tweaken!

Page 9: WordPress Security - Battening down the hatches

SECURITY OP SERVER-NIVEAU

Verschillende tweaks aan de wp-config.phpAanpassingen aan .htaccessMappen 755-rechten, files 644.Robots.txt

Page 10: WordPress Security - Battening down the hatches

SECURITY OP SERVER-NIVEAU: WP-CONFIG.PHPdefine( 'DISALLOW_FILE_EDIT', true );=> uitschakelen thema & plugin editor

define('WP_AUTO_UPDATE_CORE', true); add_filter( 'auto_update_plugin', '__return_true' ); add_filter( 'auto_update_theme', '__return_true' );=> forceert automatische updates van WordPress (alle releases) alsook plugins en thema’s.

Page 11: WordPress Security - Battening down the hatches

SECURITY OP SERVER-NIVEAU: .HTACCESS

Blokkeer de includes

# Block the include-only files.<IfModule mod_rewrite.c>RewriteEngine OnRewriteBase /RewriteRule ^wp-admin/includes/ - [F,L]RewriteRule !^wp-includes/ - [S=3]RewriteRule ^wp-includes/[^/]+\.php$ - [F,L]RewriteRule ^wp-includes/js/tinymce/langs/.+\.php - [F,L]RewriteRule ^wp-includes/theme-compat/ - [F,L]</IfModule>

Page 12: WordPress Security - Battening down the hatches

SECURITY OP SERVER-NIVEAU: .HTACCESS

Beperk backend access

Afzonderlijke .htaccess voor in /wp-admin

# Limit backend acces.order deny,allowdeny from allallow from xx.xx.xx.xx

Page 13: WordPress Security - Battening down the hatches

SECURITY OP SERVER-NIVEAU: .HTACCESS

Blokkeer Track & Trace en vermijd XSS attack

#Block track & traceRewriteEngine OnRewriteCond %{REQUEST_METHOD} ^TRACERewriteRule .* - [F]

Page 14: WordPress Security - Battening down the hatches

SECURITY OP SERVER-NIVEAU: .HTACCESS

Afzonderlijke .htaccess in /wp-content/uploads/

#Block PHP execution<Files *.php>deny from all</Files>

Page 15: WordPress Security - Battening down the hatches

SECURITY OP SERVER-NIVEAU: FILE PERMISSIONS

Mappen 755 Bestanden 644

Geen 777!!!

Page 16: WordPress Security - Battening down the hatches

SECURITY OP SERVER-NIVEAU: ROBOTS.TXT Vermijd dat bots kritieke locaties kunnen crawlen Voeg volgende toe als robots.txt: User-agent: *

Disallow: /feed/Disallow: /trackback/Disallow: /wp-admin/Disallow: /wp-content/Disallow: /wp-includes/Disallow: /xmlrpc.phpDisallow: /wp-

Page 17: WordPress Security - Battening down the hatches

SECURITY: USER & EXTERN Security op de pc’s/mac’s van eindgebruiker Illegale/”gevonden” software UPDATES UPDATES UPDATES!!! Komt meestal neer op het heropvoeden van de gebruiker

Page 18: WordPress Security - Battening down the hatches

SECURITY: USER & EXTERN

CDN, bijvoorbeeld CloudFlare

Page 19: WordPress Security - Battening down the hatches

PENETRATION TESTING!

WPScan (http://www.wpscan.org)Sucuri Sitecheck (https://sitecheck.sucuri.net/)

Page 20: WordPress Security - Battening down the hatches

VRAGEN???

Contacteer me! Twitter: @brechtryckaert

Blog: http://brechtryckaert.be

50% korting op mijn e-book: https://gum.co/WPS101/WCNL2015