SlideShare a Scribd company logo
WordPress Security 101++
Introduction
Break down
● Security basics
● Attacker motives
● Clean up
● Prevention
● Auditing!
whoami
● Robert Rowley
● Security guy
● Websites, Server, Social Engineering, Mobile
● DreamHost security “one size fits all” person
DreamHost
● 1million+ websites
● Huge WordPress install base.
YOU!
● Security core concepts
● It is easy
Security core concepts
● Backups
● Passwords
● Updates
● Monitoring
Backups
● Keep them regularly
● Keep them secure and off site
Passwords
● Easy!
● “Passphrase” alphanumeric and other characters
● Better!
● Two factor.
Updates
● Automate if possible.
● On the first day it's already too late.
Monitoring
● Prevent the attack from going unnoticed.
The bad guys
Fruit?
Low hanging fruit
Bots!
Why? Why? Why? Why? Why? Why? Why?
Why? Why? Why? Why? Why? Why? Why?
Why? Why? Why? Why?
Why? Why? Why? Why? Why? Why? Why?
Why? Why? Why? Why? Why? Why? Why?
Why? Why? Why? Why? Why? Why? Why?
Why? Why? Why? Why? Why? Why? Why?
Why? Why? Why? Why? Why? Why? Why?
Why? Why? Why? Why? Why? Why? Why?
Why? Why? Why? Why? Why? Why? Why?
Why? Why? Why? Why? Why? Why? Why?
Why? Why? Why? Why? Why? Why? Why?
Why? Why? Why? Why? Why? Why?
Why? Why? Why? Why? Why? Why?
Why? Why? Why? Why? Why? Why?
Why? Why? Why? Why? Why? Why?
Why? Why? Why? Why? Why? Why?
Attacker motivation
Why? Why? Why? Why?
Why? Why? Why?
Why? Why? Why?
Why?Why? Why?
Why? Why?
Why? Why?
Why?Why? Why?
Why?
WHY?WHY?
$ $ $ $ $ $ $ $
$$ $ $ $
$ $$ $ $ $ $ $$ $ $
$ $ $$ $ $ $ $ $$ $
$ $ $ $$ $ $ $ $ $$
$ $ $ $ $$ $ $ $ $
$ $ $ $ $$ $ $
$ $ $ $ $ $ $$
$ $ $ $ $ $ $
$ $ $ $ $ $ $ $
Attacker motivation
 $$
How?
● Software vulnerabilities
Arbitrary file uploads, Code execution, LFI/RFI SQLi
● Password compromise
Spyware/Brute force
● Host based attacks
Are you on a shared host? (cloud?)
Show your work!
How does a compromised site equal profit?
● Phishing (Identity theft)
● BlackHat SEO (Affiliate services efraud)
● Traffic Theft (Malware)
● Spam (All of the above)
● Backdoor installations (All of the above)
Graphs
● DreamHost attack logs
● Actual traffic from 8/20/2011 → 02/16/2012
Graph: zenCart
You're not helping!!!
Clean up ALL THE THINGS!!!!
Not that hard
●All
●The
●Things
If you plan to audit, do that first!
● Take the site offline
● Backup ALL THE THINGS:
● Files
● Databases
● Logs
Update ALL THE software!!!
● Core software
● Plugins
● Themes?
● Other?
Check ALL THE files!!!
● Does this belong here?
● Backups help
Change ALL THE passwords!!!
● Set the policy
● Need more? Use two-factor.
Re-install ALL THE THINGS!!!
● Backups.
● Re-install.
● No backups? Can't re-install?
● Just one line …. what? What? WHAT?
● Magical “find”
find ALL THE insecure permissions!!
Permissions issues:
find /path/ -type d -perm 777 -print
better:
find /path/ -type d -exec chmod 755 {} ; -print
alternative:
find /path/ -type d -perm 777 -exec chmod 755 {} ; -print
find /path/ -type f -exec chmod 644 {} ; -print
find ALL THE backdoors!!!
find /path/ -name “*php” -exec grep “fingerprint” {} ; -print
find /path/ -name “*php” -exec grep “fingerprint” {} ; -exec rm {} ; -print
(or use chmod 0 {} instead of rm {} )
find /path/ -name “*php” -exec grep “all|the|things” {} ; -print
Destroy ALL THE backdoors!!!
find /path/ -name “*php” -exec 
● grep “FilesMan|eval(base64_decode(|eval(gzinflate(“ {} ; 
● -exec chmod 0 {} ; -or -exec 
● grep “(base64_decode){10,}|(){30,}” {} ; 
● -exec sed -i.backup “/(base64_decode){10,}|(){30,}/d” {} ; -print
●
●
Spot ALL THE “diff”erences!
● Use “diff” to compare directories.
● Works best with backups (or just download WP)
$ diff omgfire.com omgfire.com_lastbackup
Only in omgfire.com: this_could_be_a_backdoor.php
Common subdirectories: omgfire.com/wp-admin and
omgfire.com_lastbackup/wp-admin
diff omgfire.com/wp-config.php
omgfire.com_lastbackup/wp-config.php
1d0
< <? /* this is a little bit of code changed! */ ?>
Pay for ALL THE fixes!!!
● The good, the bad and the ugly
Preventative
Server options
● Firewall
mod_security, cloudflare
● Database
Restrict by hostname
Site configuration
● File Monitoring
● Stop using FTP
● HTTPS
● Lock down directory/file permission
Wordpress tricks
● Enable auto-update
● Don't login as “admin”
● Database table prefix
● Disable PHP/CGI in upload/include directories
● Plugins!
Security Plugins
Backups Prevention Cleanup Monitoring Authentication
File Monitor
plus X
VaultPress
X X
Google Auth.
Yubikey
Etc...
X
Exploit Scanner
/ X
Backup Buddy
X
Security Services
Backups Prevention Cleanup Monitoring Price
Cloudflare
X /
Free-20+5/month
VaultPress
X / X
15-350/month
StoptheHacker
X
Free-100+/month
URLvoid.com
Various others X
Free
Sucuri
X X
90-290/month
Auditing
Who logged in?
● Via SSH: “last”
● Via WordPress: “simple login log” plugin
Digging in with timestamps.
$ ls -la omgfire.com/backdoor.php
-rw-rw-r-- 1 user grp 0 Feb 13 21:52 omgfire.com/backdoor.php
$ grep 21:52: logs/omgfire.com/access.log.2012-02-13
123.125.71.31 - - [13/Feb/2012:21:52:53 -0800]
"POST /wp-content/plugins/hello.php HTTP/1.1" 200 158 "-"
"Mozilla"
Digging in with HTTP logs
$ awk '{print $7}' access.log | sort | uniq -c | sort -n
Digging in with HTTP logs
$ awk '{print $7}' access.log | sort | uniq -c | sort -n
1 /phpMyAdmin-2.2.3/index.php
1 /phpMyAdmin-2.5.5-pl1/index.php
1 /phpMyAdmin-2.5.5/index.php
1 /phpMyAdmin-2.5.6-rc2/index.php
1 /phpMyAdmin/index.php
1 /phpmyadmin1/index.php
1 /pma/index.php
1 /web/phpMyAdmin/index.php
1 /websql/index.php
2 /phpmyadmin/index.php
4 /robots.txt
242 /
Ask your host!
● You may not be alone.
followup
● Take ownership and post your experience
● Help the next website owner.
Further reading
http://codex.wordpress.org/Hardening_WordPress

More Related Content

Similar to Wordpress Security 101

Rob "Mubix" Fuller: Attacker Ghost Stories
Rob "Mubix" Fuller: Attacker Ghost StoriesRob "Mubix" Fuller: Attacker Ghost Stories
Rob "Mubix" Fuller: Attacker Ghost Stories
Area41
 
Attacker Ghost Stories (CarolinaCon / Area41 / RVASec)
Attacker Ghost Stories (CarolinaCon / Area41 / RVASec)Attacker Ghost Stories (CarolinaCon / Area41 / RVASec)
Attacker Ghost Stories (CarolinaCon / Area41 / RVASec)Rob Fuller
 
Anatomy of PHP Shells
Anatomy of PHP ShellsAnatomy of PHP Shells
Anatomy of PHP Shells
Vedran Krivokuca
 
Hacking Vulnerable Websites to Bypass Firewalls
Hacking Vulnerable Websites to Bypass FirewallsHacking Vulnerable Websites to Bypass Firewalls
Hacking Vulnerable Websites to Bypass Firewalls
Netsparker
 
Twas the night before Malware...
Twas the night before Malware...Twas the night before Malware...
Twas the night before Malware...
DoktorMandrake
 
Course_Presentation cyber --------------.pptx
Course_Presentation cyber --------------.pptxCourse_Presentation cyber --------------.pptx
Course_Presentation cyber --------------.pptx
ssuser020436
 
Pen Testing Development
Pen Testing DevelopmentPen Testing Development
Pen Testing Development
CTruncer
 
Columbus WordCamp 2015
Columbus WordCamp 2015Columbus WordCamp 2015
Columbus WordCamp 2015
Jason Packer
 
Sensible scaling
Sensible scalingSensible scaling
Sensible scaling
Rowan Merewood
 
Automating MySQL operations with Puppet
Automating MySQL operations with PuppetAutomating MySQL operations with Puppet
Automating MySQL operations with Puppet
Kris Buytaert
 
5 Bare Minimum Things A Web Startup CTO Must Worry About
5 Bare Minimum Things A Web Startup CTO Must Worry About5 Bare Minimum Things A Web Startup CTO Must Worry About
5 Bare Minimum Things A Web Startup CTO Must Worry About
Indus Khaitan
 
PHP SA 2014 - Releasing Your Open Source Project
PHP SA 2014 - Releasing Your Open Source ProjectPHP SA 2014 - Releasing Your Open Source Project
PHP SA 2014 - Releasing Your Open Source Project
xsist10
 
Fun with Macros & Other Sneaky Tricks to Avoid Detection - SANS Manchester 2020
Fun with Macros & Other Sneaky Tricks to Avoid Detection - SANS Manchester 2020Fun with Macros & Other Sneaky Tricks to Avoid Detection - SANS Manchester 2020
Fun with Macros & Other Sneaky Tricks to Avoid Detection - SANS Manchester 2020
Greg Bailey
 
Introduction To ICT Security Audit OWASP Day Malaysia 2011
Introduction To ICT Security Audit OWASP Day Malaysia 2011Introduction To ICT Security Audit OWASP Day Malaysia 2011
Introduction To ICT Security Audit OWASP Day Malaysia 2011Linuxmalaysia Malaysia
 
12 tricks to avoid hackers breaks your CI / CD
12 tricks to avoid hackers breaks your  CI / CD12 tricks to avoid hackers breaks your  CI / CD
12 tricks to avoid hackers breaks your CI / CD
Daniel Garcia (a.k.a cr0hn)
 
How to Shot Web - Jason Haddix at DEFCON 23 - See it Live: Details in Descrip...
How to Shot Web - Jason Haddix at DEFCON 23 - See it Live: Details in Descrip...How to Shot Web - Jason Haddix at DEFCON 23 - See it Live: Details in Descrip...
How to Shot Web - Jason Haddix at DEFCON 23 - See it Live: Details in Descrip...
bugcrowd
 
Scraping the web with Laravel, Dusk, Docker, and PHP
Scraping the web with Laravel, Dusk, Docker, and PHPScraping the web with Laravel, Dusk, Docker, and PHP
Scraping the web with Laravel, Dusk, Docker, and PHP
Paul Redmond
 
Go with the Flow - A Guide to a WordPress Workflow
Go with the Flow - A Guide to a WordPress WorkflowGo with the Flow - A Guide to a WordPress Workflow
Go with the Flow - A Guide to a WordPress Workflow
Ann Cascarano
 
Web Exploitation
Web ExploitationWeb Exploitation
Web Exploitation
UTD Computer Security Group
 
2010 11 pubcon_hendison-hosting
2010 11 pubcon_hendison-hosting2010 11 pubcon_hendison-hosting
2010 11 pubcon_hendison-hosting
shendison
 

Similar to Wordpress Security 101 (20)

Rob "Mubix" Fuller: Attacker Ghost Stories
Rob "Mubix" Fuller: Attacker Ghost StoriesRob "Mubix" Fuller: Attacker Ghost Stories
Rob "Mubix" Fuller: Attacker Ghost Stories
 
Attacker Ghost Stories (CarolinaCon / Area41 / RVASec)
Attacker Ghost Stories (CarolinaCon / Area41 / RVASec)Attacker Ghost Stories (CarolinaCon / Area41 / RVASec)
Attacker Ghost Stories (CarolinaCon / Area41 / RVASec)
 
Anatomy of PHP Shells
Anatomy of PHP ShellsAnatomy of PHP Shells
Anatomy of PHP Shells
 
Hacking Vulnerable Websites to Bypass Firewalls
Hacking Vulnerable Websites to Bypass FirewallsHacking Vulnerable Websites to Bypass Firewalls
Hacking Vulnerable Websites to Bypass Firewalls
 
Twas the night before Malware...
Twas the night before Malware...Twas the night before Malware...
Twas the night before Malware...
 
Course_Presentation cyber --------------.pptx
Course_Presentation cyber --------------.pptxCourse_Presentation cyber --------------.pptx
Course_Presentation cyber --------------.pptx
 
Pen Testing Development
Pen Testing DevelopmentPen Testing Development
Pen Testing Development
 
Columbus WordCamp 2015
Columbus WordCamp 2015Columbus WordCamp 2015
Columbus WordCamp 2015
 
Sensible scaling
Sensible scalingSensible scaling
Sensible scaling
 
Automating MySQL operations with Puppet
Automating MySQL operations with PuppetAutomating MySQL operations with Puppet
Automating MySQL operations with Puppet
 
5 Bare Minimum Things A Web Startup CTO Must Worry About
5 Bare Minimum Things A Web Startup CTO Must Worry About5 Bare Minimum Things A Web Startup CTO Must Worry About
5 Bare Minimum Things A Web Startup CTO Must Worry About
 
PHP SA 2014 - Releasing Your Open Source Project
PHP SA 2014 - Releasing Your Open Source ProjectPHP SA 2014 - Releasing Your Open Source Project
PHP SA 2014 - Releasing Your Open Source Project
 
Fun with Macros & Other Sneaky Tricks to Avoid Detection - SANS Manchester 2020
Fun with Macros & Other Sneaky Tricks to Avoid Detection - SANS Manchester 2020Fun with Macros & Other Sneaky Tricks to Avoid Detection - SANS Manchester 2020
Fun with Macros & Other Sneaky Tricks to Avoid Detection - SANS Manchester 2020
 
Introduction To ICT Security Audit OWASP Day Malaysia 2011
Introduction To ICT Security Audit OWASP Day Malaysia 2011Introduction To ICT Security Audit OWASP Day Malaysia 2011
Introduction To ICT Security Audit OWASP Day Malaysia 2011
 
12 tricks to avoid hackers breaks your CI / CD
12 tricks to avoid hackers breaks your  CI / CD12 tricks to avoid hackers breaks your  CI / CD
12 tricks to avoid hackers breaks your CI / CD
 
How to Shot Web - Jason Haddix at DEFCON 23 - See it Live: Details in Descrip...
How to Shot Web - Jason Haddix at DEFCON 23 - See it Live: Details in Descrip...How to Shot Web - Jason Haddix at DEFCON 23 - See it Live: Details in Descrip...
How to Shot Web - Jason Haddix at DEFCON 23 - See it Live: Details in Descrip...
 
Scraping the web with Laravel, Dusk, Docker, and PHP
Scraping the web with Laravel, Dusk, Docker, and PHPScraping the web with Laravel, Dusk, Docker, and PHP
Scraping the web with Laravel, Dusk, Docker, and PHP
 
Go with the Flow - A Guide to a WordPress Workflow
Go with the Flow - A Guide to a WordPress WorkflowGo with the Flow - A Guide to a WordPress Workflow
Go with the Flow - A Guide to a WordPress Workflow
 
Web Exploitation
Web ExploitationWeb Exploitation
Web Exploitation
 
2010 11 pubcon_hendison-hosting
2010 11 pubcon_hendison-hosting2010 11 pubcon_hendison-hosting
2010 11 pubcon_hendison-hosting
 

More from Robert Rowley

WordPress Security (know your enemy WordCamp Kyoto)
WordPress Security (know your enemy WordCamp Kyoto)WordPress Security (know your enemy WordCamp Kyoto)
WordPress Security (know your enemy WordCamp Kyoto)
Robert Rowley
 
Detecting and Defending Your Privacy Against State-Actor Surveillance
Detecting and Defending Your Privacy Against State-Actor SurveillanceDetecting and Defending Your Privacy Against State-Actor Surveillance
Detecting and Defending Your Privacy Against State-Actor Surveillance
Robert Rowley
 
Privacy; Past, Present and Future
Privacy; Past, Present and FuturePrivacy; Past, Present and Future
Privacy; Past, Present and Future
Robert Rowley
 
State of Web App Security 2012
State of Web App Security 2012State of Web App Security 2012
State of Web App Security 2012
Robert Rowley
 
Juice Jacking 101
Juice Jacking 101Juice Jacking 101
Juice Jacking 101
Robert Rowley
 
Nmap Scripting Engine and http-enumeration
Nmap Scripting Engine and http-enumerationNmap Scripting Engine and http-enumeration
Nmap Scripting Engine and http-enumeration
Robert Rowley
 
Teaching Your WAF New Tricks
Teaching Your WAF New TricksTeaching Your WAF New Tricks
Teaching Your WAF New Tricks
Robert Rowley
 

More from Robert Rowley (7)

WordPress Security (know your enemy WordCamp Kyoto)
WordPress Security (know your enemy WordCamp Kyoto)WordPress Security (know your enemy WordCamp Kyoto)
WordPress Security (know your enemy WordCamp Kyoto)
 
Detecting and Defending Your Privacy Against State-Actor Surveillance
Detecting and Defending Your Privacy Against State-Actor SurveillanceDetecting and Defending Your Privacy Against State-Actor Surveillance
Detecting and Defending Your Privacy Against State-Actor Surveillance
 
Privacy; Past, Present and Future
Privacy; Past, Present and FuturePrivacy; Past, Present and Future
Privacy; Past, Present and Future
 
State of Web App Security 2012
State of Web App Security 2012State of Web App Security 2012
State of Web App Security 2012
 
Juice Jacking 101
Juice Jacking 101Juice Jacking 101
Juice Jacking 101
 
Nmap Scripting Engine and http-enumeration
Nmap Scripting Engine and http-enumerationNmap Scripting Engine and http-enumeration
Nmap Scripting Engine and http-enumeration
 
Teaching Your WAF New Tricks
Teaching Your WAF New TricksTeaching Your WAF New Tricks
Teaching Your WAF New Tricks
 

Recently uploaded

GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
James Anderson
 
Climate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing DaysClimate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing Days
Kari Kakkonen
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
Safe Software
 
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
Neo4j
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
Ana-Maria Mihalceanu
 
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
Neo4j
 
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
Neo4j
 
Large Language Model (LLM) and it’s Geospatial Applications
Large Language Model (LLM) and it’s Geospatial ApplicationsLarge Language Model (LLM) and it’s Geospatial Applications
Large Language Model (LLM) and it’s Geospatial Applications
Rohit Gautam
 
RESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for studentsRESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for students
KAMESHS29
 
Free Complete Python - A step towards Data Science
Free Complete Python - A step towards Data ScienceFree Complete Python - A step towards Data Science
Free Complete Python - A step towards Data Science
RinaMondal9
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
Alan Dix
 
Introduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - CybersecurityIntroduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - Cybersecurity
mikeeftimakis1
 
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
James Anderson
 
UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6
DianaGray10
 
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
SOFTTECHHUB
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
Guy Korland
 
Removing Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software FuzzingRemoving Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software Fuzzing
Aftab Hussain
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
Laura Byrne
 
Artificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopmentArtificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopment
Octavian Nadolu
 
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex ProofszkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
Alex Pruden
 

Recently uploaded (20)

GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
 
Climate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing DaysClimate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing Days
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
 
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
 
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
 
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
 
Large Language Model (LLM) and it’s Geospatial Applications
Large Language Model (LLM) and it’s Geospatial ApplicationsLarge Language Model (LLM) and it’s Geospatial Applications
Large Language Model (LLM) and it’s Geospatial Applications
 
RESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for studentsRESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for students
 
Free Complete Python - A step towards Data Science
Free Complete Python - A step towards Data ScienceFree Complete Python - A step towards Data Science
Free Complete Python - A step towards Data Science
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
 
Introduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - CybersecurityIntroduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - Cybersecurity
 
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
 
UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6
 
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
 
Removing Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software FuzzingRemoving Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software Fuzzing
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
 
Artificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopmentArtificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopment
 
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex ProofszkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
 

Wordpress Security 101

  • 3. Break down ● Security basics ● Attacker motives ● Clean up ● Prevention ● Auditing!
  • 4. whoami ● Robert Rowley ● Security guy ● Websites, Server, Social Engineering, Mobile ● DreamHost security “one size fits all” person
  • 5. DreamHost ● 1million+ websites ● Huge WordPress install base.
  • 6. YOU! ● Security core concepts ● It is easy
  • 7. Security core concepts ● Backups ● Passwords ● Updates ● Monitoring
  • 8. Backups ● Keep them regularly ● Keep them secure and off site
  • 9. Passwords ● Easy! ● “Passphrase” alphanumeric and other characters ● Better! ● Two factor.
  • 10. Updates ● Automate if possible. ● On the first day it's already too late.
  • 11. Monitoring ● Prevent the attack from going unnoticed.
  • 15. Bots!
  • 16. Why? Why? Why? Why? Why? Why? Why? Why? Why? Why? Why? Why? Why? Why? Why? Why? Why? Why? Why? Why? Why? Why? Why? Why? Why? Why? Why? Why? Why? Why? Why? Why? Why? Why? Why? Why? Why? Why? Why? Why? Why? Why? Why? Why? Why? Why? Why? Why? Why? Why? Why? Why? Why? Why? Why? Why? Why? Why? Why? Why? Why? Why? Why? Why? Why? Why? Why? Why? Why? Why? Why? Why? Why? Why? Why? Why? Why? Why? Why? Why? Why? Why? Why? Why? Why? Why? Why? Why? Why? Why? Why? Why? Why? Why? Why? Why? Why? Why? Why? Why? Why? Why? Why? Why? Why? Why? Why? Why? Why? Why? Why? Attacker motivation Why? Why? Why? Why? Why? Why? Why? Why? Why? Why? Why?Why? Why? Why? Why? Why? Why? Why?Why? Why? Why? WHY?WHY?
  • 17. $ $ $ $ $ $ $ $ $$ $ $ $ $ $$ $ $ $ $ $$ $ $ $ $ $$ $ $ $ $ $$ $ $ $ $ $$ $ $ $ $ $$ $ $ $ $ $$ $ $ $ $ $ $ $ $ $$ $ $ $ $ $ $ $ $ $$ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ Attacker motivation  $$
  • 18. How? ● Software vulnerabilities Arbitrary file uploads, Code execution, LFI/RFI SQLi ● Password compromise Spyware/Brute force ● Host based attacks Are you on a shared host? (cloud?)
  • 19. Show your work! How does a compromised site equal profit? ● Phishing (Identity theft) ● BlackHat SEO (Affiliate services efraud) ● Traffic Theft (Malware) ● Spam (All of the above) ● Backdoor installations (All of the above)
  • 20. Graphs ● DreamHost attack logs ● Actual traffic from 8/20/2011 → 02/16/2012
  • 22.
  • 23.
  • 25. Clean up ALL THE THINGS!!!!
  • 27. If you plan to audit, do that first! ● Take the site offline ● Backup ALL THE THINGS: ● Files ● Databases ● Logs
  • 28. Update ALL THE software!!! ● Core software ● Plugins ● Themes? ● Other?
  • 29. Check ALL THE files!!! ● Does this belong here? ● Backups help
  • 30. Change ALL THE passwords!!! ● Set the policy ● Need more? Use two-factor.
  • 31. Re-install ALL THE THINGS!!! ● Backups. ● Re-install. ● No backups? Can't re-install? ● Just one line …. what? What? WHAT? ● Magical “find”
  • 32. find ALL THE insecure permissions!! Permissions issues: find /path/ -type d -perm 777 -print better: find /path/ -type d -exec chmod 755 {} ; -print alternative: find /path/ -type d -perm 777 -exec chmod 755 {} ; -print find /path/ -type f -exec chmod 644 {} ; -print
  • 33. find ALL THE backdoors!!! find /path/ -name “*php” -exec grep “fingerprint” {} ; -print find /path/ -name “*php” -exec grep “fingerprint” {} ; -exec rm {} ; -print (or use chmod 0 {} instead of rm {} ) find /path/ -name “*php” -exec grep “all|the|things” {} ; -print
  • 34. Destroy ALL THE backdoors!!! find /path/ -name “*php” -exec ● grep “FilesMan|eval(base64_decode(|eval(gzinflate(“ {} ; ● -exec chmod 0 {} ; -or -exec ● grep “(base64_decode){10,}|(){30,}” {} ; ● -exec sed -i.backup “/(base64_decode){10,}|(){30,}/d” {} ; -print ● ●
  • 35. Spot ALL THE “diff”erences! ● Use “diff” to compare directories. ● Works best with backups (or just download WP) $ diff omgfire.com omgfire.com_lastbackup Only in omgfire.com: this_could_be_a_backdoor.php Common subdirectories: omgfire.com/wp-admin and omgfire.com_lastbackup/wp-admin diff omgfire.com/wp-config.php omgfire.com_lastbackup/wp-config.php 1d0 < <? /* this is a little bit of code changed! */ ?>
  • 36. Pay for ALL THE fixes!!! ● The good, the bad and the ugly
  • 38. Server options ● Firewall mod_security, cloudflare ● Database Restrict by hostname
  • 39. Site configuration ● File Monitoring ● Stop using FTP ● HTTPS ● Lock down directory/file permission
  • 40. Wordpress tricks ● Enable auto-update ● Don't login as “admin” ● Database table prefix ● Disable PHP/CGI in upload/include directories ● Plugins!
  • 41. Security Plugins Backups Prevention Cleanup Monitoring Authentication File Monitor plus X VaultPress X X Google Auth. Yubikey Etc... X Exploit Scanner / X Backup Buddy X
  • 42. Security Services Backups Prevention Cleanup Monitoring Price Cloudflare X / Free-20+5/month VaultPress X / X 15-350/month StoptheHacker X Free-100+/month URLvoid.com Various others X Free Sucuri X X 90-290/month
  • 44. Who logged in? ● Via SSH: “last” ● Via WordPress: “simple login log” plugin
  • 45. Digging in with timestamps. $ ls -la omgfire.com/backdoor.php -rw-rw-r-- 1 user grp 0 Feb 13 21:52 omgfire.com/backdoor.php $ grep 21:52: logs/omgfire.com/access.log.2012-02-13 123.125.71.31 - - [13/Feb/2012:21:52:53 -0800] "POST /wp-content/plugins/hello.php HTTP/1.1" 200 158 "-" "Mozilla"
  • 46. Digging in with HTTP logs $ awk '{print $7}' access.log | sort | uniq -c | sort -n
  • 47. Digging in with HTTP logs $ awk '{print $7}' access.log | sort | uniq -c | sort -n 1 /phpMyAdmin-2.2.3/index.php 1 /phpMyAdmin-2.5.5-pl1/index.php 1 /phpMyAdmin-2.5.5/index.php 1 /phpMyAdmin-2.5.6-rc2/index.php 1 /phpMyAdmin/index.php 1 /phpmyadmin1/index.php 1 /pma/index.php 1 /web/phpMyAdmin/index.php 1 /websql/index.php 2 /phpmyadmin/index.php 4 /robots.txt 242 /
  • 48. Ask your host! ● You may not be alone.
  • 49. followup ● Take ownership and post your experience ● Help the next website owner.

Editor's Notes

  1. Welcome I want so show security is easy, I&apos;m giving out the keys to the castle and want everyone to be able to do this.
  2. Security Concepts Know your attacker Cleanup Prevention Auditing
  3. Robert R – Silly acronyms like CISSP 10ish years experience in multiple arenas of security (mobile, websites, administration, networking) Customer facing security concerns at Dreamhost.
  4. Goes beyond wordpress, but we see it all and monitor it, which makes for a great conversation piece!
  5. It&apos;s all about how easy security is. Everything goes back to the core concepts so lets get into that!
  6. Backups, password (policy) mgmnt, updating software, monitor
  7. Keep them often, keep them secure. Check them regularly. Do not presume anyone is keeping backups, be certain.
  8. Did you lock your car here? Who is at fault if it&apos;s broken into (that&apos;s right , the burglar!) Choosing good passwords isn&apos;t about if you can remember the password to login, it&apos;s about policy. Do you feel it&apos;s necessary to have a unique password that will stop someone from getting into your site/FTP (if not? Just set it to abc123, password, or secret) More on policy, you have to think about where you can log in to your site&apos;s admin pages (is this network secure/safe? Back to car analogy regarding where you park it) Many of the remainder of the topics in this talk actually come down to this type of decision. For example lets think of backups as “how important is it that you have a copy of your site&apos;s data if it&apos;s lost?” Your answer is what you base your backup policies on!
  9. Following right on in from passwords and policies. The longer you leave a site at the last security update, the longer you&apos;re exposing the domain to an attack. If there is a critical security update in the patch, then you need to upgarde ASAP (unless your site is not on the internet) Why ASAP? I&apos;ll show some graphs, but in the infamous words of MC Frontalot, “it&apos;s already too late.”
  10. It&apos;s really a stop-gap concept. “It&apos;s already too late.” Sooner the better for incident response. You need to know ASAP about these events to be able to take action.
  11. Knowing what you&apos;re up against is important! Knowing is half the battle! Common threats Low hanging fruit Ties back in to best practices Review monitored logs of attacks Attacker motivation Commonly seen activity
  12. It&apos;s well known attackers go for the easy target. No matter how much you think “i&apos;m too small to be targetted” it&apos;s not about that, every website is a possible target if not for anything more than to act as a small part in a bigger attack (add another bot to the pile!).
  13. It&apos;s all automated (well mostly, but those are more unique cases) Bots hit sites every day, I know this because I monitor them, and unless there is an ritlain fueled obsessive compulsive freak of a person out there doing the same repetative attacks on tens of thousands of sites a date then these are bots.
  14. You may ask yourself, why?
  15. Money This is just the majority of attacks we see, which are connected to cyber criminal gangs. There are alternatives such as anonymous (who do it for awareness/causes) and cough governments (for espionage) but the vast majority is just gangs who want money.
  16. Arbitrary file uploads (upload backdoors) Code execution (backdoor access) Password compromise (they can do what you can do) LFI/RFI (backdoors) SQLi (get your Dbs)
  17. Phishing (Identity theft) BlackHat SEO (Affiliate services efrauding) Traffic Theft (Malware) Spam (All of the above) Backdoor installations (All of the above)
  18. This is not to say the software listed is any less secure (each has patched the vulnerability) These are attempts, not successes All attacks were blocked
  19. zencart
  20. e107
  21. Lets call this “rimrum.php” Not part of wordpress core
  22. OK lets get into some important steps in a cleanup.
  23. Check for changes in files/db/logins (back to best practices) Check for upgrades Passowrd security It&apos;s easy , unless you weren&apos;t paying attention, then it&apos;s certainly far moer difficult! Services (my god ...) DIY. … My god it&apos;s only one line!
  24. Why? Quarantine so the attackers can do no further harm. (to your visitors or your site)
  25. Before you put things back online
  26. Again before you put things back online
  27. If someone had the key to your front door, would you not change it?
  28. Shwo the find one-liner Note WP&apos;s built in file integrity rebuilder
  29. Directories and file permissions
  30. Backdoors! Bah!
  31. Shwo the find one-liner Note WP&apos;s built in file integrity rebuilder
  32. Good – companies that release fixes for free, work with hosting providres, never play the blame game. Bad – companies that have no contributions to security community, high costs. Ugly – high costs, blame game posts in their blog! Charlatans (snakeoil) – how will they interact with you as a customer if they openly berate people on their blog?
  33. Server side Site side Wordpress specific tricks Review
  34. permissions, firewalls (mod_sec, cloudflare, htaccess) Database server (hostname access)
  35. Monitor with rsync/git/svn on your backup server Stop using FTP! Https (who logged in today using the open wifi?) Permissions, always important.
  36. Https logins, or two factor Admin, don&apos;t make your login name guessable Table prefixes help but don&apos;t prevent SQLi If you&apos;re uploading images, why would you execute them as PHP? How many plugins and themes do you have installed that are not in use?
  37. There are a lot of options, just search for “security” in the plugins reposatory. Be warned, many end up unmaintained. Some claim to cover everything, but none cover all of your needs.
  38. List/graph Cloudflare, vaultpress, sitemonitor, stopthehacker, sucuri Anyone in the audience from these services? “make checks payable to...” or talk with them after.
  39. Most of these will be techniques I will quickly cover that are all handled via SSH Soryr, advanced topic. I can go over details in person.
  40. Not supported with WP panel Use “last” command via SSH, this will verify if it was a SSH/FTP password compromise.
  41. Tiemstamp coorealation with file creations, logs, etc... Note the POST request … shady!
  42. Awk/grep/sort madness!
  43. Awk/grep/sort madness!
  44. It doesn&apos;t hurt to ask, and it&apos;s entirely possible they are familiar with that specific type of attack.
  45. Do not be ashamed to post about your site being compromised, if anything it may help. Help not only you, your visitors, but the next webmaster that sees a similar attack against their site. Build a network of individual site owners who are all actively reporting these compormises, will be paying it forward.
  46. No seriously, wordpress and automattic take security seriouesly. Following the steps in this URL which is well written will show you specific details on what to do. I just didn&apos;t want to waste time talking about only what&apos;s on this URL.