38
8 WAYS TO HACK A WORDPRESS SITE WordCamp Porto 2013 Daniel Kanchev

8 Ways to Hack a WordPress website

Embed Size (px)

DESCRIPTION

Presented by Daniel Kanchev

Citation preview

Page 1: 8 Ways to Hack a WordPress website

8 WAYS TO HACK A WORDPRESS SITE

WordCamp Porto 2013 Daniel Kanchev

Page 2: 8 Ways to Hack a WordPress website

Before We Begin…• 7+ Years of WordPress

experience

• 5 years with SiteGround

• Love FOSS

• Addicted to extreme and not so secure sports

Page 3: 8 Ways to Hack a WordPress website

Why should YOU care?

Page 4: 8 Ways to Hack a WordPress website

1. OUTDATED WORDPRESS CORE

Page 5: 8 Ways to Hack a WordPress website

1. OUTDATED WORDPRESS CORE

• WP 3.7.1 - MAINTENANCE RELEASE • WP 3.6.1 - SECURITY RELEASE • WP 3.5.2 - SECURITY RELEASE • WP 3.5.1 - SECURITY RELEASE • WP 3.4.2 - SECURITY RELEASE • WP 3.4.1 - SECURITY RELEASE • WP 3.3.3 - SECURITY RELEASE • WP 3.3.2 - SECURITY RELEASE • WP 3.3.1 - SECURITY RELEASE • WP 3.2.1 - MAINTENANCE RELEASE

Page 6: 8 Ways to Hack a WordPress website

1. OUTDATED WORDPRESS CORE

• WP 3.7.1 - MAINTENANCE RELEASE • WP 3.6.1 - SECURITY RELEASE • WP 3.5.2 - SECURITY RELEASE • WP 3.5.1 - SECURITY RELEASE • WP 3.4.2 - SECURITY RELEASE • WP 3.4.1 - SECURITY RELEASE • WP 3.3.3 - SECURITY RELEASE • WP 3.3.2 - SECURITY RELEASE • WP 3.3.1 - SECURITY RELEASE • WP 3.2.1 - MAINTENANCE RELEASE

80%

Page 7: 8 Ways to Hack a WordPress website

UPDATE, UPDATE, UPDATE!

Page 8: 8 Ways to Hack a WordPress website

2. OUTDATED PLUGINS/THEMES

Page 9: 8 Ways to Hack a WordPress website

“Checkmarx’s research lab identified that more than 20% of the 50 most popular WordPress plugins are vulnerable to common Web attacks, such as SQL Injection”

http://www.checkmarx.com/wp-content/uploads/2013/06/The-Security-State-of-WordPress-Top-50-Plugins.pdf

WP PLUGINS SECURITY STATE

Page 10: 8 Ways to Hack a WordPress website

• timthumb.php Security Vulnerability

• W3 Total Cache Vulnerability

NOTABLE EXAMPLES

Page 11: 8 Ways to Hack a WordPress website

LIVE DEMONSTRATION

Page 12: 8 Ways to Hack a WordPress website

3. UPDATED BUT STILL VULNERABLE

Page 13: 8 Ways to Hack a WordPress website

“8 out of 10 sites included base64 encoding in their themes.”

Siobhan McKeown

FREE THEMES/PLUGINS ?!

Page 14: 8 Ways to Hack a WordPress website

TRUSTED DEVELOPERS

Page 15: 8 Ways to Hack a WordPress website

USE WAF

Page 16: 8 Ways to Hack a WordPress website

4. WEAK LOGIN DETAILS

Page 17: 8 Ways to Hack a WordPress website

Do you log in with username “admin” ?

Page 18: 8 Ways to Hack a WordPress website
Page 19: 8 Ways to Hack a WordPress website

KEEPCALM

AND LET ME

SHOW YOU WHY

Page 20: 8 Ways to Hack a WordPress website

CHANGE THE ADMIN USER

UPDATE wp_users SET user_login = ‘Yourname+_admin’ where user_login = ‘admin’;

Page 21: 8 Ways to Hack a WordPress website

STRONG PASSWORDS

Comedy is acting out optimism!

Use a whole sentence or a favourite quote:

Page 22: 8 Ways to Hack a WordPress website

5. MALWARE

Page 23: 8 Ways to Hack a WordPress website

SECURE YOUR COMPUTERS• Keep your OS and all programs updated

• Install Anti-Virus software

• Use personal firewalls

• Open sites via HTTPS whenever possible

• Use SSH or SFTP instead of FTP

Page 24: 8 Ways to Hack a WordPress website

6. VULNERABLE SERVER SOFTWARE

Page 25: 8 Ways to Hack a WordPress website

WATCHA TALKIN ABOUT

Page 26: 8 Ways to Hack a WordPress website

SOME EXAMPLES

• PHP-CGI Vulnerability - versions before 5.3.12/5.4.2

• MySQL/MariaDB Vulnerability - versions before 5.5.25

• Apache range header DoS - versions before 2.2.20

Page 27: 8 Ways to Hack a WordPress website

• Update server software

• Follow security bulletins

• Hire professional sysadmins

Page 28: 8 Ways to Hack a WordPress website

7. INCORRECTLY CONFIGURED SERVER

Page 29: 8 Ways to Hack a WordPress website

APACHE SYMLINK VULNERABILITY

public_html/fred.txt —> /home/otheracct/public_html/wp-config.php

Add to httpd.conf or .htaccess file: SymLinksIfOwnerMatch

The Problem:

The Solution:

Page 30: 8 Ways to Hack a WordPress website

• Find a good host

• Hire professional sysadmins

Page 31: 8 Ways to Hack a WordPress website

8. WRONG PERMISSIONS + ISOLATION

Page 32: 8 Ways to Hack a WordPress website

• Folders: 755 • Files: 644 • wp-config.php: 444

THE CORRECT PERMISSIONS

Page 33: 8 Ways to Hack a WordPress website

SSH COMMAND TO CORRECT PERMISSIONS

• find /wordpress -type d -exec chmod 755 {} \; !

!

• find /wordpress -type f -exec chmod 644 {} \;

Page 34: 8 Ways to Hack a WordPress website

GENERAL GUIDELINES• Use Secret Keys - http://api.wordpress.org/secret-

key/1.1/salt

• Move wp-config.php to parent folder

• Use SSL for wp-login.php

• Allow admin access only from certain IPs

Page 35: 8 Ways to Hack a WordPress website

QUESTIONS ?

Page 36: 8 Ways to Hack a WordPress website

THANK YOU!

Daniel Kanchev

@dvkanchev [email protected]

Page 37: 8 Ways to Hack a WordPress website

http://slideshare.net/siteground

Page 38: 8 Ways to Hack a WordPress website

REFERENCES• http://blog.sucuri.net/2013/05/from-a-site-compromise-to-full-

root-access-symlinks-to-root-part-i.html

• http://httpd.apache.org/security/CVE-2011-3192.txt

• http://thehackernews.com/2012/06/cve-2012-2122-serious-mysql.html

• http://blog.spiderlabs.com/2012/05/php-cgi-exploitation-by-example.html

• http://www.checkmarx.com/wp-content/uploads/2013/06/The-Security-State-of-WordPress-Top-50-Plugins.pdf