+ All Categories
Home > Documents > Dan Catalin VASILE - Hacking the Wordpress EcoSystem€¦ · – [email protected] / @DanCVASILE. ......

Dan Catalin VASILE - Hacking the Wordpress EcoSystem€¦ · – [email protected] / @DanCVASILE. ......

Date post: 13-May-2018
Category:
Upload: dangthuy
View: 221 times
Download: 2 times
Share this document with a friend
34
Hacking the Wordpress Ecosystem Hacking the Wordpress Ecosystem Wordpress Ecosystem Wordpress Ecosystem
Transcript
Page 1: Dan Catalin VASILE - Hacking the Wordpress EcoSystem€¦ · – dan@pentest.ro / @DanCVASILE. ... WordpressSecurity Checklist project on OWASP ... Dan Catalin VASILE - Hacking the

Hacking the

Wordpress Ecosystem

Hacking the

Wordpress EcosystemWordpress EcosystemWordpress Ecosystem

Page 2: Dan Catalin VASILE - Hacking the Wordpress EcoSystem€¦ · – dan@pentest.ro / @DanCVASILE. ... WordpressSecurity Checklist project on OWASP ... Dan Catalin VASILE - Hacking the

About Me

Dan Catalin VASILE

• Information Security Consultant

• Researcher / Writer / Presenter• Researcher / Writer / Presenter

• OWASP Romania Board Member

• Online presence

– http://www.pentest.ro

[email protected] / @DanCVASILE

Page 3: Dan Catalin VASILE - Hacking the Wordpress EcoSystem€¦ · – dan@pentest.ro / @DanCVASILE. ... WordpressSecurity Checklist project on OWASP ... Dan Catalin VASILE - Hacking the

Hacking the Wordpress Ecosystem

WHY?

About the talk

Page 4: Dan Catalin VASILE - Hacking the Wordpress EcoSystem€¦ · – dan@pentest.ro / @DanCVASILE. ... WordpressSecurity Checklist project on OWASP ... Dan Catalin VASILE - Hacking the

More numbers

About the talk

Page 5: Dan Catalin VASILE - Hacking the Wordpress EcoSystem€¦ · – dan@pentest.ro / @DanCVASILE. ... WordpressSecurity Checklist project on OWASP ... Dan Catalin VASILE - Hacking the

Finding Wordpress!

About the talk

Page 6: Dan Catalin VASILE - Hacking the Wordpress EcoSystem€¦ · – dan@pentest.ro / @DanCVASILE. ... WordpressSecurity Checklist project on OWASP ... Dan Catalin VASILE - Hacking the

Scope

Page 7: Dan Catalin VASILE - Hacking the Wordpress EcoSystem€¦ · – dan@pentest.ro / @DanCVASILE. ... WordpressSecurity Checklist project on OWASP ... Dan Catalin VASILE - Hacking the

TO SCARE!!!!

Scope

Attacks on:Attacks on:

- The Worpress platform

- Plugins

- Themes

- Infrastructure

- Humans

Page 8: Dan Catalin VASILE - Hacking the Wordpress EcoSystem€¦ · – dan@pentest.ro / @DanCVASILE. ... WordpressSecurity Checklist project on OWASP ... Dan Catalin VASILE - Hacking the

and TO REPAIR.

Scope

Focus on:Focus on:

- Infrastructure

- Installation process

- Protective server side measures

- Protective client side measures

- Reviewing source code

- Maintenance

Page 9: Dan Catalin VASILE - Hacking the Wordpress EcoSystem€¦ · – dan@pentest.ro / @DanCVASILE. ... WordpressSecurity Checklist project on OWASP ... Dan Catalin VASILE - Hacking the

Wordpress Ecosystem

Infrastructure

Base platformUsers

Themes Plugins

Page 10: Dan Catalin VASILE - Hacking the Wordpress EcoSystem€¦ · – dan@pentest.ro / @DanCVASILE. ... WordpressSecurity Checklist project on OWASP ... Dan Catalin VASILE - Hacking the

Hacking the infrastructure

Physical security

Page 11: Dan Catalin VASILE - Hacking the Wordpress EcoSystem€¦ · – dan@pentest.ro / @DanCVASILE. ... WordpressSecurity Checklist project on OWASP ... Dan Catalin VASILE - Hacking the

Hacking the infrastructure

Common web server vulnerabilities

• Overflows

• DoS• DoS

• Remote command execution

• XSS in internal tools

• Security Misconfiguration

… just no name a few& more

http://httpd.apache.org/security/vulnerabilities_22.html

Page 12: Dan Catalin VASILE - Hacking the Wordpress EcoSystem€¦ · – dan@pentest.ro / @DanCVASILE. ... WordpressSecurity Checklist project on OWASP ... Dan Catalin VASILE - Hacking the

Hacking the infrastructure

PHP vulnerabilities

• DoS

• Overflows

• Remote command execution• Remote command execution

• SQL injection

• XSS

• Source code disclosure

• RFI

• CSRF

&more

Page 13: Dan Catalin VASILE - Hacking the Wordpress EcoSystem€¦ · – dan@pentest.ro / @DanCVASILE. ... WordpressSecurity Checklist project on OWASP ... Dan Catalin VASILE - Hacking the

Hacking the Wordpress platform

One example from the CVE Database

Page 14: Dan Catalin VASILE - Hacking the Wordpress EcoSystem€¦ · – dan@pentest.ro / @DanCVASILE. ... WordpressSecurity Checklist project on OWASP ... Dan Catalin VASILE - Hacking the

Hacking the plugins

How many plugins are there?

27,596 PLUGINS, 536,317,915 DOWNLOADS

(as of October 2013)

How many of them are vulnerable? ☺☺☺☺How many of them are vulnerable? ☺☺☺☺

Not as many as you’ve expected. CVE lists ‘only’ 164 vulnerabilities (not all related to plugins)

Fear not! New plugins everyday & new disclosures on old plugins.

Page 15: Dan Catalin VASILE - Hacking the Wordpress EcoSystem€¦ · – dan@pentest.ro / @DanCVASILE. ... WordpressSecurity Checklist project on OWASP ... Dan Catalin VASILE - Hacking the

Hacking the themes

Themes can be vulnerable!

They sometimes come up with other plugins

necessary to get the functionality needednecessary to get the functionality needed

Think about TimThumb vulnerability!

Page 16: Dan Catalin VASILE - Hacking the Wordpress EcoSystem€¦ · – dan@pentest.ro / @DanCVASILE. ... WordpressSecurity Checklist project on OWASP ... Dan Catalin VASILE - Hacking the

Hacking the themes

What is TimThumb?A small php script for cropping, zooming and resizing web images (jpg, png, gif). Perfect for use on blogs and other applications.

The problem!“TimThumb” essentially, caches even remote files locally, without “TimThumb” essentially, caches even remote files locally, without doing any proper sanitization.

The problem for hackersThe file “timthumb.php” does however, check if to see if the target file is actually an image or not. This timthumb file is also quite often renamed to something else and is used in many themes.

Page 17: Dan Catalin VASILE - Hacking the Wordpress EcoSystem€¦ · – dan@pentest.ro / @DanCVASILE. ... WordpressSecurity Checklist project on OWASP ... Dan Catalin VASILE - Hacking the

TimThumb hack

The easiest way to trick TimThumb into believing a remotely stored image

(that also contains evil PHP code) is an actual image (with timthumbcraft)

Page 18: Dan Catalin VASILE - Hacking the Wordpress EcoSystem€¦ · – dan@pentest.ro / @DanCVASILE. ... WordpressSecurity Checklist project on OWASP ... Dan Catalin VASILE - Hacking the

TimThumb hack

Uploading the file

Page 19: Dan Catalin VASILE - Hacking the Wordpress EcoSystem€¦ · – dan@pentest.ro / @DanCVASILE. ... WordpressSecurity Checklist project on OWASP ... Dan Catalin VASILE - Hacking the

TimThumb hack

Additional problems with the TimThumb hack

- When uploading the image, the php script will be located in

the cache directory with a ‘random’ name

Page 20: Dan Catalin VASILE - Hacking the Wordpress EcoSystem€¦ · – dan@pentest.ro / @DanCVASILE. ... WordpressSecurity Checklist project on OWASP ... Dan Catalin VASILE - Hacking the

TimThumb hack

We’re IN!

Page 21: Dan Catalin VASILE - Hacking the Wordpress EcoSystem€¦ · – dan@pentest.ro / @DanCVASILE. ... WordpressSecurity Checklist project on OWASP ... Dan Catalin VASILE - Hacking the

Hacking the users

Last but not least, hacking the human element:

- Social engineering

- Phishing- Phishing

- Exploiting bad habits

Page 22: Dan Catalin VASILE - Hacking the Wordpress EcoSystem€¦ · – dan@pentest.ro / @DanCVASILE. ... WordpressSecurity Checklist project on OWASP ... Dan Catalin VASILE - Hacking the

Let’s fix it

Let’s start fixing the Wordpress Ecosystem

Short recap:

- Infrastructure- Infrastructure

- Wordpress base platform

- Wordpress plugins

- Wordpress themes

- Users

Page 23: Dan Catalin VASILE - Hacking the Wordpress EcoSystem€¦ · – dan@pentest.ro / @DanCVASILE. ... WordpressSecurity Checklist project on OWASP ... Dan Catalin VASILE - Hacking the

Fixing the Infrastructure

INFRASTRUCTURE

- Choose a decent data-center

- Use encryption for physical disks- Use encryption for physical disks

- Use secure communication channels with the server (SSH, SFTP); do you still use FTP? You should be banned from the world.

- Keep the Web Server, PHP and Database updated to the latest version

- Secure configurations (disable directory listing, secure php.ini configuration, etc.)

- Log and analyze

Page 24: Dan Catalin VASILE - Hacking the Wordpress EcoSystem€¦ · – dan@pentest.ro / @DanCVASILE. ... WordpressSecurity Checklist project on OWASP ... Dan Catalin VASILE - Hacking the

Fixing the Wordpress platform

WORDPRESS PLATFORM - INSTALLATION

- Always download the platform from a trusted source; use https://wordpress.org/download/source; use https://wordpress.org/download/

- Change the default ‘admin’ username

- Set a strong password

- Change the default ‘wp_’ table prefix

- Set an insane database password

- Move wp-config.php outside /public_html

Page 25: Dan Catalin VASILE - Hacking the Wordpress EcoSystem€¦ · – dan@pentest.ro / @DanCVASILE. ... WordpressSecurity Checklist project on OWASP ... Dan Catalin VASILE - Hacking the

Fixing the Wordpress platform

WORDPRESS PLATFORM - MAINTENANCE

- BACKUP!!! (BackWPup plugin)

- Update!

- Use SSL for authentication

- Use CAPTCHA for logging in (Captcha on Login

plugin)

- Limit the access to /wp-admin (form .htaccess)

- Source code audit

Page 26: Dan Catalin VASILE - Hacking the Wordpress EcoSystem€¦ · – dan@pentest.ro / @DanCVASILE. ... WordpressSecurity Checklist project on OWASP ... Dan Catalin VASILE - Hacking the

Fixing the themes

THEMES

- Update

- Review the code

Page 27: Dan Catalin VASILE - Hacking the Wordpress EcoSystem€¦ · – dan@pentest.ro / @DanCVASILE. ... WordpressSecurity Checklist project on OWASP ... Dan Catalin VASILE - Hacking the

Fixing the plugins

PLUGINS

- Delete unused plugins- Delete unused plugins

- Update

- Review ratings and user comments

- Source code audit

Page 28: Dan Catalin VASILE - Hacking the Wordpress EcoSystem€¦ · – dan@pentest.ro / @DanCVASILE. ... WordpressSecurity Checklist project on OWASP ... Dan Catalin VASILE - Hacking the

Fixing the users

USERS

- Awareness

- Set user roles and give only the privileges they - Set user roles and give only the privileges they need

- Log & audit user actions (ARYO Activity Log plugin)

- Personal computer security

- Enforce the use of strong passwords (Minimum Password Strength plugin)

Page 29: Dan Catalin VASILE - Hacking the Wordpress EcoSystem€¦ · – dan@pentest.ro / @DanCVASILE. ... WordpressSecurity Checklist project on OWASP ... Dan Catalin VASILE - Hacking the

Further actions

Install one or more security plugins

• Login Security Solution

• AntiVirus• AntiVirus

• WP Security Scan

• WordPress File Monitor Plus

• OSE Firewall Security

• Block Bad Queries

• Wordfence

Page 30: Dan Catalin VASILE - Hacking the Wordpress EcoSystem€¦ · – dan@pentest.ro / @DanCVASILE. ... WordpressSecurity Checklist project on OWASP ... Dan Catalin VASILE - Hacking the

Further actions

Monitor the website from an external party

• WebsiteDefender• WebsiteDefender

• Pingdom

• Change Detection

Page 31: Dan Catalin VASILE - Hacking the Wordpress EcoSystem€¦ · – dan@pentest.ro / @DanCVASILE. ... WordpressSecurity Checklist project on OWASP ... Dan Catalin VASILE - Hacking the

Further actions

Source code audit

Page 32: Dan Catalin VASILE - Hacking the Wordpress EcoSystem€¦ · – dan@pentest.ro / @DanCVASILE. ... WordpressSecurity Checklist project on OWASP ... Dan Catalin VASILE - Hacking the

What to do

If you know what you’re doing, do the whole ecosystem yourself.

Otherwise go with a managed solution:Otherwise go with a managed solution:

• Wordpress.org

• Wpengine.com

• Godaddy.com

Etc.

Page 33: Dan Catalin VASILE - Hacking the Wordpress EcoSystem€¦ · – dan@pentest.ro / @DanCVASILE. ... WordpressSecurity Checklist project on OWASP ... Dan Catalin VASILE - Hacking the

Goal

Wordpress Security Checklist project on OWASPhttps://www.owasp.org/index.php/OWASP_Wordpress_Security_Checklist_Project

My part:

- Establish the structure- Establish the structure

- Contribute with content

I need help for:

- Content

- Plugin suggestions and reviews

- Source code audits

Page 34: Dan Catalin VASILE - Hacking the Wordpress EcoSystem€¦ · – dan@pentest.ro / @DanCVASILE. ... WordpressSecurity Checklist project on OWASP ... Dan Catalin VASILE - Hacking the

Questions

Thank you!


Recommended