SlideShare una empresa de Scribd logo
1 de 47
Descargar para leer sin conexión
What should I do when
my website got hack?
Sumedt Jitpukdebodin
Security Engineer
I-SECURE Co., Ltd.
# whoami
• Name: Sumedt Jitpukdebodin
• Jobs: Security Engineer@I-SECURE Co., Ltd.
• Hobbies: Hacking, Forensic, Cartoon, Series
(Recommended: Mr Robot), Etc.
• Website: www.techsuii.com,
www.r00tsec.com
• Social Network: @materaj, fb.com/
sumedt.jitpukdebodin
# ls objective
• Web Application Threat Growth Statistic
• Web Server x Web Application
• Sample of access.log
• How to start web application attack analysis
• Tools for analysis
• How to defend web application
Web Application Threat
Growth Statistic
Web Application Threat Growth Statistic
By Imperva's Web Application Attack Report (October 2014)
http://www.imperva.com/DefenseCenter/WAAR
Web Application Threat Growth Statistic
By McAfee Labs Threats Report (Febuary 2015)
http://www.mcafee.com/us/resources/reports/rp-quarterly-threat-q4-2014.pdf
# top target
• WordPress is the most attacked Content Management System (CMS)
• PHP applications suffer three times as many Cross Site Scripting attacks as .NET
applications
PHP applications suffer almost 3X more Cross Site Scripting (XSS) attacks than ASP
applications.
PHP applications suffer almost 2X more Directory Traversal (DT) attacks than ASP
applications.
ASP applications suffer almost 2X more SQL Injection attacks than PHP applications.
• Websites containing some form of consumer information suffer up to 59% of the
attacks.
# top target
# stats target
# stats target
Web Server
X
Web Application
Web Server X Web Application
Sample of access.log
# cat access.log
# cat access.log | grep -v bot | more
# man access.log
114.109.95.176 - - [26/Oct/2014:07:07:40 -0400] "GET /2014/09/09/how-to-
setup-dns-server-in-ubuntu/ HTTP/1.1" 200 58536 "https://www.google.co.th/"
"Mozilla/5.0 (Windows NT 6.1;WOW64) AppleWebKit/537.36 (KHTML, like
Gecko) Chrome/38.0.2125.104 Safari/537.36"
LogFormat "%h %l %u %t "%r" %>s %b "%{Referer}i" "%{User-agent}i""
combined
# man access.log
114.109.95.176 - - [26/Oct/2014:07:07:40 -0400] "GET /2014/09/09/how-to-
setup-dns-server-in-ubuntu/ HTTP/1.1" 200 58536 "https://www.google.co.th/"
"Mozilla/5.0 (Windows NT 6.1;WOW64) AppleWebKit/537.36 (KHTML, like
Gecko) Chrome/38.0.2125.104 Safari/537.36"
Client IP
# man access.log
114.109.95.176 - - [26/Oct/2014:07:07:40 -0400] "GET /2014/09/09/how-to-
setup-dns-server-in-ubuntu/ HTTP/1.1" 200 58536 "https://www.google.co.th/"
"Mozilla/5.0 (Windows NT 6.1;WOW64) AppleWebKit/537.36 (KHTML, like
Gecko) Chrome/38.0.2125.104 Safari/537.36"
identity of the user determined by identd
# man access.log
114.109.95.176 - - [26/Oct/2014:07:07:40 -0400] "GET /2014/09/09/how-to-
setup-dns-server-in-ubuntu/ HTTP/1.1" 200 58536 "https://www.google.co.th/"
"Mozilla/5.0 (Windows NT 6.1;WOW64) AppleWebKit/537.36 (KHTML, like
Gecko) Chrome/38.0.2125.104 Safari/537.36"
user name determined by HTTP authentication
# man access.log
114.109.95.176 - - [26/Oct/2014:07:07:40 -0400] "GET /2014/09/09/how-to-
setup-dns-server-in-ubuntu/ HTTP/1.1" 200 58536 "https://www.google.co.th/"
"Mozilla/5.0 (Windows NT 6.1;WOW64) AppleWebKit/537.36 (KHTML, like
Gecko) Chrome/38.0.2125.104 Safari/537.36"
the time the server finished processing the request
# man access.log
114.109.95.176 - - [26/Oct/2014:07:07:40 -0400] "GET /2014/09/09/how-to-
setup-dns-server-in-ubuntu/ HTTP/1.1" 200 58536 "https://www.google.co.th/"
"Mozilla/5.0 (Windows NT 6.1;WOW64) AppleWebKit/537.36 (KHTML, like
Gecko) Chrome/38.0.2125.104 Safari/537.36"
request line from the client
# man access.log
114.109.95.176 - - [26/Oct/2014:07:07:40 -0400] "GET /2014/09/09/how-to-
setup-dns-server-in-ubuntu/ HTTP/1.1" 200 58536 "https://www.google.co.th/"
"Mozilla/5.0 (Windows NT 6.1;WOW64) AppleWebKit/537.36 (KHTML, like
Gecko) Chrome/38.0.2125.104 Safari/537.36"
status code
# man access.log
114.109.95.176 - - [26/Oct/2014:07:07:40 -0400] "GET /2014/09/09/how-to-
setup-dns-server-in-ubuntu/ HTTP/1.1" 200 58536 "https://www.google.co.th/"
"Mozilla/5.0 (Windows NT 6.1;WOW64) AppleWebKit/537.36 (KHTML, like
Gecko) Chrome/38.0.2125.104 Safari/537.36"
size of the response
# man access.log
114.109.95.176 - - [26/Oct/2014:07:07:40 -0400] "GET /2014/09/09/how-to-
setup-dns-server-in-ubuntu/ HTTP/1.1" 200 58536 "https://www.google.co.th/"
"Mozilla/5.0 (Windows NT 6.1;WOW64) AppleWebKit/537.36 (KHTML, like
Gecko) Chrome/38.0.2125.104 Safari/537.36"
Referer
# man access.log
114.109.95.176 - - [26/Oct/2014:07:07:40 -0400] "GET /2014/09/09/how-to-
setup-dns-server-in-ubuntu/ HTTP/1.1" 200 58536 "https://www.google.co.th/"
"Mozilla/5.0 (Windows NT 6.1;WOW64) AppleWebKit/537.36 (KHTML, like
Gecko) Chrome/38.0.2125.104 Safari/537.36"
User-agent
# awk { print %d } access.log
• awk ‘{print $1}’ access.log # ip address (%h)
• awk ‘{print $2}’ access.log # RFC 1413 identity (%l)
• awk ‘{print $3}’ access.log # userid (%u)
• awk ‘{print $4,5}’ access.log # date/time (%t)
• awk ‘{print $9}’ access.log # status code (%>s)
• awk ‘{print $10}’ access.log # size (%b)
• awk -F” ‘{print $2}’ access.log # request line (%r)
• awk -F” ‘{print $4}’ access.log # referer
How to start
web application attack
analysis
The Art Of War
OWASP Top 10 2013
• A1-Injection
• A2-Broken Authentication and Session Management
• A3-Cross-Site Scripting (XSS)
• A4-Insecure Direct Object Reference
• A5-Security Misconfiguration
• A6-Sensitive Data Exposure
• A7-Missing Function
• A8-Cross-Site Request Forgery(CSRF)
• A9-Using Components with known vulnerabilities
• A10-Unvalidated Redirect and Forwards
Log path
• /var/log/apache2/
• /var/log/nginx/
• C:WindowsSystem32LogFilesW3SVC1
SQL Injection
• Filter: union, order by, select, concat,
group_concat, version, %27, %27%20,
%2527, --, exec, varchar,cast
Example filter SQLi
• cat access.log | grep union | more
Local File Inclusion
Remote File Inclusion
• Filter: ../, /etc/passwd, windows/system32/
drivers/etc/hosts, ../boot.ini, =http://, =php://
Example filter LFI & RFI
• cat access.log | grep “/etc/passwd” | more
XSS
• Filter: javascript, document.cookie, img src,
alert
Example filter XSS
• cat access.log | grep “alert” | more
Brute Forcing
• cat access.log| grep “POST” | grep “login.php | more
Shellshock
• Filter: () {
Example filter
Shellshock
• cat access.log | grep "() {" | more
Tools for analysis
# ls /opt/
• Splunk (Limit 500 MB/day)
• Elastic Search + LogStach + Kibana
• Elastic Search + Graylog2
• Apache-Scalp
• OSSEC
• Etc.
Splunk
ELK
Graylog2
How to defend web
application attack
What should I do
when my website got hack?
• Shut it down ?
• Get website back with backup ?
• Before website back
• Find the root clause, Fix the vulnerability.
• If not web application, try another view with hacker
view.
# apt-get upgrade
• Secure Coding
• OWASP - https://www.owasp.org/index.php/
OWASP_Secure_Coding_Practices_-_Quick_Reference_Guide
• Mozilla - https://wiki.mozilla.org/WebAppSec/Secure_Coding_Guidelines
• Web Application Firewall
• Naxsi
• ModSecurity
• AQTRONIX for IIS
• Penetration Testing
End
%00

Más contenido relacionado

La actualidad más candente

Attacking AWS: the full cyber kill chain
Attacking AWS: the full cyber kill chainAttacking AWS: the full cyber kill chain
Attacking AWS: the full cyber kill chain
SecuRing
 

La actualidad más candente (20)

Bug Bounty for - Beginners
Bug Bounty for - BeginnersBug Bounty for - Beginners
Bug Bounty for - Beginners
 
Attacking AWS: the full cyber kill chain
Attacking AWS: the full cyber kill chainAttacking AWS: the full cyber kill chain
Attacking AWS: the full cyber kill chain
 
Attacking Drupal
Attacking DrupalAttacking Drupal
Attacking Drupal
 
Ekoparty 2017 - The Bug Hunter's Methodology
Ekoparty 2017 - The Bug Hunter's MethodologyEkoparty 2017 - The Bug Hunter's Methodology
Ekoparty 2017 - The Bug Hunter's Methodology
 
Rest API Security
Rest API SecurityRest API Security
Rest API Security
 
Android Pentesting
Android PentestingAndroid Pentesting
Android Pentesting
 
Mutillidae and the OWASP Top 10 by Adrian Crenshaw aka Irongeek
Mutillidae and the OWASP Top 10 by Adrian Crenshaw aka IrongeekMutillidae and the OWASP Top 10 by Adrian Crenshaw aka Irongeek
Mutillidae and the OWASP Top 10 by Adrian Crenshaw aka Irongeek
 
Syntribos API Security Test Automation
Syntribos API Security Test AutomationSyntribos API Security Test Automation
Syntribos API Security Test Automation
 
Approaching the unknown - Windows Phone application security assessment guide
Approaching the unknown - Windows Phone application security assessment guideApproaching the unknown - Windows Phone application security assessment guide
Approaching the unknown - Windows Phone application security assessment guide
 
CROSS-SITE REQUEST FORGERY - IN-DEPTH ANALYSIS 2011
CROSS-SITE REQUEST FORGERY - IN-DEPTH ANALYSIS 2011CROSS-SITE REQUEST FORGERY - IN-DEPTH ANALYSIS 2011
CROSS-SITE REQUEST FORGERY - IN-DEPTH ANALYSIS 2011
 
Bug Bounty #Defconlucknow2016
Bug Bounty #Defconlucknow2016Bug Bounty #Defconlucknow2016
Bug Bounty #Defconlucknow2016
 
Red Team vs Blue Team on AWS - RSA 2018
Red Team vs Blue Team on AWS - RSA 2018Red Team vs Blue Team on AWS - RSA 2018
Red Team vs Blue Team on AWS - RSA 2018
 
CMS Hacking Tricks - DerbyCon 4 - 2014
CMS Hacking Tricks - DerbyCon 4 - 2014CMS Hacking Tricks - DerbyCon 4 - 2014
CMS Hacking Tricks - DerbyCon 4 - 2014
 
BEST PRACTICES OF WEB APPLICATION SECURITY By SAMVEL GEVORGYAN
BEST PRACTICES OF WEB APPLICATION SECURITY By SAMVEL GEVORGYANBEST PRACTICES OF WEB APPLICATION SECURITY By SAMVEL GEVORGYAN
BEST PRACTICES OF WEB APPLICATION SECURITY By SAMVEL GEVORGYAN
 
Workshop KrakYourNet2016 - Web applications hacking Ruby on Rails example
Workshop KrakYourNet2016 - Web applications hacking Ruby on Rails example Workshop KrakYourNet2016 - Web applications hacking Ruby on Rails example
Workshop KrakYourNet2016 - Web applications hacking Ruby on Rails example
 
Django (Web Applications that are Secure by Default)
Django �(Web Applications that are Secure by Default�)Django �(Web Applications that are Secure by Default�)
Django (Web Applications that are Secure by Default)
 
The WAF book intro protection elements v1.0 lior rotkovitch
The WAF book intro protection elements v1.0 lior rotkovitchThe WAF book intro protection elements v1.0 lior rotkovitch
The WAF book intro protection elements v1.0 lior rotkovitch
 
Bug Bounty 101
Bug Bounty 101Bug Bounty 101
Bug Bounty 101
 
Threat Hunting Web Shells Using Splunk
Threat Hunting Web Shells Using SplunkThreat Hunting Web Shells Using Splunk
Threat Hunting Web Shells Using Splunk
 
Spa Secure Coding Guide
Spa Secure Coding GuideSpa Secure Coding Guide
Spa Secure Coding Guide
 

Destacado

Destacado (20)

Bde presentatie bakker_bart_20170920
Bde presentatie bakker_bart_20170920Bde presentatie bakker_bart_20170920
Bde presentatie bakker_bart_20170920
 
Anomaly Detection in Time-Series Data using the Elastic Stack by Henry Pak
Anomaly Detection in Time-Series Data using the Elastic Stack by Henry PakAnomaly Detection in Time-Series Data using the Elastic Stack by Henry Pak
Anomaly Detection in Time-Series Data using the Elastic Stack by Henry Pak
 
ProRail Laurens Koppenol & Paul van der Voort
ProRail Laurens Koppenol & Paul van der VoortProRail Laurens Koppenol & Paul van der Voort
ProRail Laurens Koppenol & Paul van der Voort
 
Technology and AI sharing - From 2016 to Y2017 and Beyond
Technology and AI sharing - From 2016 to Y2017 and BeyondTechnology and AI sharing - From 2016 to Y2017 and Beyond
Technology and AI sharing - From 2016 to Y2017 and Beyond
 
Datasnap web client
Datasnap web clientDatasnap web client
Datasnap web client
 
Elasticsearch 5.0 les nouveautés
Elasticsearch 5.0 les nouveautésElasticsearch 5.0 les nouveautés
Elasticsearch 5.0 les nouveautés
 
Google Big Data Expo
Google Big Data ExpoGoogle Big Data Expo
Google Big Data Expo
 
Big Data Analytics to Enhance Security
Big Data Analytics to Enhance SecurityBig Data Analytics to Enhance Security
Big Data Analytics to Enhance Security
 
Bde presentation dv
Bde presentation dvBde presentation dv
Bde presentation dv
 
De groote de man Ingrid de Poorter
De groote de man Ingrid de PoorterDe groote de man Ingrid de Poorter
De groote de man Ingrid de Poorter
 
Notilyze SAS
Notilyze SASNotilyze SAS
Notilyze SAS
 
Incident response on a shoestring budget
Incident response on a shoestring budgetIncident response on a shoestring budget
Incident response on a shoestring budget
 
Building Blocks Big Data Expo
Building Blocks Big Data ExpoBuilding Blocks Big Data Expo
Building Blocks Big Data Expo
 
Presentatie big data expo swarovski
Presentatie big data expo swarovskiPresentatie big data expo swarovski
Presentatie big data expo swarovski
 
Dell hans timmerman v1.1
Dell hans timmerman v1.1Dell hans timmerman v1.1
Dell hans timmerman v1.1
 
Java start01 in 2hours
Java start01 in 2hoursJava start01 in 2hours
Java start01 in 2hours
 
If-If-If-If
If-If-If-IfIf-If-If-If
If-If-If-If
 
Crossyn
CrossynCrossyn
Crossyn
 
Accenture Big Data Expo
Accenture Big Data ExpoAccenture Big Data Expo
Accenture Big Data Expo
 
Digital transformation - Jo Caudron
Digital transformation - Jo CaudronDigital transformation - Jo Caudron
Digital transformation - Jo Caudron
 

Similar a What should I do when my website got hack?

Web Application Penetration Testing Introduction
Web Application Penetration Testing IntroductionWeb Application Penetration Testing Introduction
Web Application Penetration Testing Introduction
gbud7
 
Identifying Web Servers: A First-look Into the Future of Web Server Fingerpri...
Identifying Web Servers: A First-look Into the Future of Web Server Fingerpri...Identifying Web Servers: A First-look Into the Future of Web Server Fingerpri...
Identifying Web Servers: A First-look Into the Future of Web Server Fingerpri...
Jeremiah Grossman
 

Similar a What should I do when my website got hack? (20)

(WEB301) Operational Web Log Analysis | AWS re:Invent 2014
(WEB301) Operational Web Log Analysis | AWS re:Invent 2014(WEB301) Operational Web Log Analysis | AWS re:Invent 2014
(WEB301) Operational Web Log Analysis | AWS re:Invent 2014
 
The top 10 security issues in web applications
The top 10 security issues in web applicationsThe top 10 security issues in web applications
The top 10 security issues in web applications
 
Romulus OWASP
Romulus OWASPRomulus OWASP
Romulus OWASP
 
Applciation footprinting, discovery and enumeration
Applciation footprinting, discovery and enumerationApplciation footprinting, discovery and enumeration
Applciation footprinting, discovery and enumeration
 
Web Security - Introduction
Web Security - IntroductionWeb Security - Introduction
Web Security - Introduction
 
Web Security - Introduction v.1.3
Web Security - Introduction v.1.3Web Security - Introduction v.1.3
Web Security - Introduction v.1.3
 
Web hackingtools cf-summit2014
Web hackingtools cf-summit2014Web hackingtools cf-summit2014
Web hackingtools cf-summit2014
 
Starwest 2008
Starwest 2008Starwest 2008
Starwest 2008
 
Cyber Crime / Cyber Secuity Testing Architecture by MRITYUNJAYA HIKKALGUTTI (...
Cyber Crime / Cyber Secuity Testing Architecture by MRITYUNJAYA HIKKALGUTTI (...Cyber Crime / Cyber Secuity Testing Architecture by MRITYUNJAYA HIKKALGUTTI (...
Cyber Crime / Cyber Secuity Testing Architecture by MRITYUNJAYA HIKKALGUTTI (...
 
Security Analyst Workshop - 20200212
Security Analyst Workshop - 20200212Security Analyst Workshop - 20200212
Security Analyst Workshop - 20200212
 
Security Analyst Workshop - 20190314
Security Analyst Workshop - 20190314Security Analyst Workshop - 20190314
Security Analyst Workshop - 20190314
 
Owasp web application security trends
Owasp web application security trendsOwasp web application security trends
Owasp web application security trends
 
[2.1] Web application Security Trends - Omar Ganiev
[2.1] Web application Security Trends - Omar Ganiev[2.1] Web application Security Trends - Omar Ganiev
[2.1] Web application Security Trends - Omar Ganiev
 
Penetration Testing Basics
Penetration Testing BasicsPenetration Testing Basics
Penetration Testing Basics
 
Web Application Penetration Testing Introduction
Web Application Penetration Testing IntroductionWeb Application Penetration Testing Introduction
Web Application Penetration Testing Introduction
 
AppSec Tel Aviv - OWASP Top 10 For JavaScript Developers
AppSec Tel Aviv - OWASP Top 10 For JavaScript Developers AppSec Tel Aviv - OWASP Top 10 For JavaScript Developers
AppSec Tel Aviv - OWASP Top 10 For JavaScript Developers
 
Identifying Web Servers: A First-look Into the Future of Web Server Fingerpri...
Identifying Web Servers: A First-look Into the Future of Web Server Fingerpri...Identifying Web Servers: A First-look Into the Future of Web Server Fingerpri...
Identifying Web Servers: A First-look Into the Future of Web Server Fingerpri...
 
Application Security Workshop
Application Security Workshop Application Security Workshop
Application Security Workshop
 
DVWA BruCON Workshop
DVWA BruCON WorkshopDVWA BruCON Workshop
DVWA BruCON Workshop
 
Web hackingtools 2015
Web hackingtools 2015Web hackingtools 2015
Web hackingtools 2015
 

Más de Sumedt Jitpukdebodin

Más de Sumedt Jitpukdebodin (14)

How to create your own hack environment
How to create your own hack environmentHow to create your own hack environment
How to create your own hack environment
 
Phishing
PhishingPhishing
Phishing
 
Which side are you
Which side are youWhich side are you
Which side are you
 
Endpoint is not enough
Endpoint is not enoughEndpoint is not enough
Endpoint is not enough
 
Antivirus is hopeless
Antivirus is hopelessAntivirus is hopeless
Antivirus is hopeless
 
Purple team is awesome
Purple team is awesomePurple team is awesome
Purple team is awesome
 
R u hacked
R u hackedR u hacked
R u hacked
 
Web architecture mechanism and threats
Web architecture   mechanism and threatsWeb architecture   mechanism and threats
Web architecture mechanism and threats
 
Fundamental of malware analysis
Fundamental of malware analysisFundamental of malware analysis
Fundamental of malware analysis
 
Security awareness training
Security awareness trainingSecurity awareness training
Security awareness training
 
Hacking with paper
Hacking with paperHacking with paper
Hacking with paper
 
DDoS handlering
DDoS handleringDDoS handlering
DDoS handlering
 
Incident response before:after breach
Incident response before:after breachIncident response before:after breach
Incident response before:after breach
 
Web Architecture - Mechanism and Threats
Web Architecture - Mechanism and ThreatsWeb Architecture - Mechanism and Threats
Web Architecture - Mechanism and Threats
 

Último

在线制作约克大学毕业证(yu毕业证)在读证明认证可查
在线制作约克大学毕业证(yu毕业证)在读证明认证可查在线制作约克大学毕业证(yu毕业证)在读证明认证可查
在线制作约克大学毕业证(yu毕业证)在读证明认证可查
ydyuyu
 
一比一原版(Flinders毕业证书)弗林德斯大学毕业证原件一模一样
一比一原版(Flinders毕业证书)弗林德斯大学毕业证原件一模一样一比一原版(Flinders毕业证书)弗林德斯大学毕业证原件一模一样
一比一原版(Flinders毕业证书)弗林德斯大学毕业证原件一模一样
ayvbos
 
Top profile Call Girls In Dindigul [ 7014168258 ] Call Me For Genuine Models ...
Top profile Call Girls In Dindigul [ 7014168258 ] Call Me For Genuine Models ...Top profile Call Girls In Dindigul [ 7014168258 ] Call Me For Genuine Models ...
Top profile Call Girls In Dindigul [ 7014168258 ] Call Me For Genuine Models ...
gajnagarg
 
75539-Cyber Security Challenges PPT.pptx
75539-Cyber Security Challenges PPT.pptx75539-Cyber Security Challenges PPT.pptx
75539-Cyber Security Challenges PPT.pptx
Asmae Rabhi
 
一比一原版(Offer)康考迪亚大学毕业证学位证靠谱定制
一比一原版(Offer)康考迪亚大学毕业证学位证靠谱定制一比一原版(Offer)康考迪亚大学毕业证学位证靠谱定制
一比一原版(Offer)康考迪亚大学毕业证学位证靠谱定制
pxcywzqs
 
Russian Escort Abu Dhabi 0503464457 Abu DHabi Escorts
Russian Escort Abu Dhabi 0503464457 Abu DHabi EscortsRussian Escort Abu Dhabi 0503464457 Abu DHabi Escorts
Russian Escort Abu Dhabi 0503464457 Abu DHabi Escorts
Monica Sydney
 
Indian Escort in Abu DHabi 0508644382 Abu Dhabi Escorts
Indian Escort in Abu DHabi 0508644382 Abu Dhabi EscortsIndian Escort in Abu DHabi 0508644382 Abu Dhabi Escorts
Indian Escort in Abu DHabi 0508644382 Abu Dhabi Escorts
Monica Sydney
 
PowerDirector Explination Process...pptx
PowerDirector Explination Process...pptxPowerDirector Explination Process...pptx
PowerDirector Explination Process...pptx
galaxypingy
 
原版制作美国爱荷华大学毕业证(iowa毕业证书)学位证网上存档可查
原版制作美国爱荷华大学毕业证(iowa毕业证书)学位证网上存档可查原版制作美国爱荷华大学毕业证(iowa毕业证书)学位证网上存档可查
原版制作美国爱荷华大学毕业证(iowa毕业证书)学位证网上存档可查
ydyuyu
 
pdfcoffee.com_business-ethics-q3m7-pdf-free.pdf
pdfcoffee.com_business-ethics-q3m7-pdf-free.pdfpdfcoffee.com_business-ethics-q3m7-pdf-free.pdf
pdfcoffee.com_business-ethics-q3m7-pdf-free.pdf
JOHNBEBONYAP1
 

Último (20)

Power point inglese - educazione civica di Nuria Iuzzolino
Power point inglese - educazione civica di Nuria IuzzolinoPower point inglese - educazione civica di Nuria Iuzzolino
Power point inglese - educazione civica di Nuria Iuzzolino
 
在线制作约克大学毕业证(yu毕业证)在读证明认证可查
在线制作约克大学毕业证(yu毕业证)在读证明认证可查在线制作约克大学毕业证(yu毕业证)在读证明认证可查
在线制作约克大学毕业证(yu毕业证)在读证明认证可查
 
一比一原版(Flinders毕业证书)弗林德斯大学毕业证原件一模一样
一比一原版(Flinders毕业证书)弗林德斯大学毕业证原件一模一样一比一原版(Flinders毕业证书)弗林德斯大学毕业证原件一模一样
一比一原版(Flinders毕业证书)弗林德斯大学毕业证原件一模一样
 
Top profile Call Girls In Dindigul [ 7014168258 ] Call Me For Genuine Models ...
Top profile Call Girls In Dindigul [ 7014168258 ] Call Me For Genuine Models ...Top profile Call Girls In Dindigul [ 7014168258 ] Call Me For Genuine Models ...
Top profile Call Girls In Dindigul [ 7014168258 ] Call Me For Genuine Models ...
 
"Boost Your Digital Presence: Partner with a Leading SEO Agency"
"Boost Your Digital Presence: Partner with a Leading SEO Agency""Boost Your Digital Presence: Partner with a Leading SEO Agency"
"Boost Your Digital Presence: Partner with a Leading SEO Agency"
 
Nagercoil Escorts Service Girl ^ 9332606886, WhatsApp Anytime Nagercoil
Nagercoil Escorts Service Girl ^ 9332606886, WhatsApp Anytime NagercoilNagercoil Escorts Service Girl ^ 9332606886, WhatsApp Anytime Nagercoil
Nagercoil Escorts Service Girl ^ 9332606886, WhatsApp Anytime Nagercoil
 
2nd Solid Symposium: Solid Pods vs Personal Knowledge Graphs
2nd Solid Symposium: Solid Pods vs Personal Knowledge Graphs2nd Solid Symposium: Solid Pods vs Personal Knowledge Graphs
2nd Solid Symposium: Solid Pods vs Personal Knowledge Graphs
 
APNIC Policy Roundup, presented by Sunny Chendi at the 5th ICANN APAC-TWNIC E...
APNIC Policy Roundup, presented by Sunny Chendi at the 5th ICANN APAC-TWNIC E...APNIC Policy Roundup, presented by Sunny Chendi at the 5th ICANN APAC-TWNIC E...
APNIC Policy Roundup, presented by Sunny Chendi at the 5th ICANN APAC-TWNIC E...
 
75539-Cyber Security Challenges PPT.pptx
75539-Cyber Security Challenges PPT.pptx75539-Cyber Security Challenges PPT.pptx
75539-Cyber Security Challenges PPT.pptx
 
Meaning of On page SEO & its process in detail.
Meaning of On page SEO & its process in detail.Meaning of On page SEO & its process in detail.
Meaning of On page SEO & its process in detail.
 
一比一原版(Offer)康考迪亚大学毕业证学位证靠谱定制
一比一原版(Offer)康考迪亚大学毕业证学位证靠谱定制一比一原版(Offer)康考迪亚大学毕业证学位证靠谱定制
一比一原版(Offer)康考迪亚大学毕业证学位证靠谱定制
 
Russian Escort Abu Dhabi 0503464457 Abu DHabi Escorts
Russian Escort Abu Dhabi 0503464457 Abu DHabi EscortsRussian Escort Abu Dhabi 0503464457 Abu DHabi Escorts
Russian Escort Abu Dhabi 0503464457 Abu DHabi Escorts
 
Vip Firozabad Phone 8250092165 Escorts Service At 6k To 30k Along With Ac Room
Vip Firozabad Phone 8250092165 Escorts Service At 6k To 30k Along With Ac RoomVip Firozabad Phone 8250092165 Escorts Service At 6k To 30k Along With Ac Room
Vip Firozabad Phone 8250092165 Escorts Service At 6k To 30k Along With Ac Room
 
best call girls in Hyderabad Finest Escorts Service 📞 9352988975 📞 Available ...
best call girls in Hyderabad Finest Escorts Service 📞 9352988975 📞 Available ...best call girls in Hyderabad Finest Escorts Service 📞 9352988975 📞 Available ...
best call girls in Hyderabad Finest Escorts Service 📞 9352988975 📞 Available ...
 
Indian Escort in Abu DHabi 0508644382 Abu Dhabi Escorts
Indian Escort in Abu DHabi 0508644382 Abu Dhabi EscortsIndian Escort in Abu DHabi 0508644382 Abu Dhabi Escorts
Indian Escort in Abu DHabi 0508644382 Abu Dhabi Escorts
 
Best SEO Services Company in Dallas | Best SEO Agency Dallas
Best SEO Services Company in Dallas | Best SEO Agency DallasBest SEO Services Company in Dallas | Best SEO Agency Dallas
Best SEO Services Company in Dallas | Best SEO Agency Dallas
 
PowerDirector Explination Process...pptx
PowerDirector Explination Process...pptxPowerDirector Explination Process...pptx
PowerDirector Explination Process...pptx
 
原版制作美国爱荷华大学毕业证(iowa毕业证书)学位证网上存档可查
原版制作美国爱荷华大学毕业证(iowa毕业证书)学位证网上存档可查原版制作美国爱荷华大学毕业证(iowa毕业证书)学位证网上存档可查
原版制作美国爱荷华大学毕业证(iowa毕业证书)学位证网上存档可查
 
pdfcoffee.com_business-ethics-q3m7-pdf-free.pdf
pdfcoffee.com_business-ethics-q3m7-pdf-free.pdfpdfcoffee.com_business-ethics-q3m7-pdf-free.pdf
pdfcoffee.com_business-ethics-q3m7-pdf-free.pdf
 
20240510 QFM016 Irresponsible AI Reading List April 2024.pdf
20240510 QFM016 Irresponsible AI Reading List April 2024.pdf20240510 QFM016 Irresponsible AI Reading List April 2024.pdf
20240510 QFM016 Irresponsible AI Reading List April 2024.pdf
 

What should I do when my website got hack?

  • 1. What should I do when my website got hack? Sumedt Jitpukdebodin Security Engineer I-SECURE Co., Ltd.
  • 2. # whoami • Name: Sumedt Jitpukdebodin • Jobs: Security Engineer@I-SECURE Co., Ltd. • Hobbies: Hacking, Forensic, Cartoon, Series (Recommended: Mr Robot), Etc. • Website: www.techsuii.com, www.r00tsec.com • Social Network: @materaj, fb.com/ sumedt.jitpukdebodin
  • 3. # ls objective • Web Application Threat Growth Statistic • Web Server x Web Application • Sample of access.log • How to start web application attack analysis • Tools for analysis • How to defend web application
  • 5. Web Application Threat Growth Statistic By Imperva's Web Application Attack Report (October 2014) http://www.imperva.com/DefenseCenter/WAAR
  • 6. Web Application Threat Growth Statistic By McAfee Labs Threats Report (Febuary 2015) http://www.mcafee.com/us/resources/reports/rp-quarterly-threat-q4-2014.pdf
  • 7. # top target • WordPress is the most attacked Content Management System (CMS) • PHP applications suffer three times as many Cross Site Scripting attacks as .NET applications PHP applications suffer almost 3X more Cross Site Scripting (XSS) attacks than ASP applications. PHP applications suffer almost 2X more Directory Traversal (DT) attacks than ASP applications. ASP applications suffer almost 2X more SQL Injection attacks than PHP applications. • Websites containing some form of consumer information suffer up to 59% of the attacks.
  • 12. Web Server X Web Application
  • 14. # cat access.log # cat access.log | grep -v bot | more
  • 15. # man access.log 114.109.95.176 - - [26/Oct/2014:07:07:40 -0400] "GET /2014/09/09/how-to- setup-dns-server-in-ubuntu/ HTTP/1.1" 200 58536 "https://www.google.co.th/" "Mozilla/5.0 (Windows NT 6.1;WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/38.0.2125.104 Safari/537.36" LogFormat "%h %l %u %t "%r" %>s %b "%{Referer}i" "%{User-agent}i"" combined
  • 16. # man access.log 114.109.95.176 - - [26/Oct/2014:07:07:40 -0400] "GET /2014/09/09/how-to- setup-dns-server-in-ubuntu/ HTTP/1.1" 200 58536 "https://www.google.co.th/" "Mozilla/5.0 (Windows NT 6.1;WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/38.0.2125.104 Safari/537.36" Client IP
  • 17. # man access.log 114.109.95.176 - - [26/Oct/2014:07:07:40 -0400] "GET /2014/09/09/how-to- setup-dns-server-in-ubuntu/ HTTP/1.1" 200 58536 "https://www.google.co.th/" "Mozilla/5.0 (Windows NT 6.1;WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/38.0.2125.104 Safari/537.36" identity of the user determined by identd
  • 18. # man access.log 114.109.95.176 - - [26/Oct/2014:07:07:40 -0400] "GET /2014/09/09/how-to- setup-dns-server-in-ubuntu/ HTTP/1.1" 200 58536 "https://www.google.co.th/" "Mozilla/5.0 (Windows NT 6.1;WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/38.0.2125.104 Safari/537.36" user name determined by HTTP authentication
  • 19. # man access.log 114.109.95.176 - - [26/Oct/2014:07:07:40 -0400] "GET /2014/09/09/how-to- setup-dns-server-in-ubuntu/ HTTP/1.1" 200 58536 "https://www.google.co.th/" "Mozilla/5.0 (Windows NT 6.1;WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/38.0.2125.104 Safari/537.36" the time the server finished processing the request
  • 20. # man access.log 114.109.95.176 - - [26/Oct/2014:07:07:40 -0400] "GET /2014/09/09/how-to- setup-dns-server-in-ubuntu/ HTTP/1.1" 200 58536 "https://www.google.co.th/" "Mozilla/5.0 (Windows NT 6.1;WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/38.0.2125.104 Safari/537.36" request line from the client
  • 21. # man access.log 114.109.95.176 - - [26/Oct/2014:07:07:40 -0400] "GET /2014/09/09/how-to- setup-dns-server-in-ubuntu/ HTTP/1.1" 200 58536 "https://www.google.co.th/" "Mozilla/5.0 (Windows NT 6.1;WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/38.0.2125.104 Safari/537.36" status code
  • 22. # man access.log 114.109.95.176 - - [26/Oct/2014:07:07:40 -0400] "GET /2014/09/09/how-to- setup-dns-server-in-ubuntu/ HTTP/1.1" 200 58536 "https://www.google.co.th/" "Mozilla/5.0 (Windows NT 6.1;WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/38.0.2125.104 Safari/537.36" size of the response
  • 23. # man access.log 114.109.95.176 - - [26/Oct/2014:07:07:40 -0400] "GET /2014/09/09/how-to- setup-dns-server-in-ubuntu/ HTTP/1.1" 200 58536 "https://www.google.co.th/" "Mozilla/5.0 (Windows NT 6.1;WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/38.0.2125.104 Safari/537.36" Referer
  • 24. # man access.log 114.109.95.176 - - [26/Oct/2014:07:07:40 -0400] "GET /2014/09/09/how-to- setup-dns-server-in-ubuntu/ HTTP/1.1" 200 58536 "https://www.google.co.th/" "Mozilla/5.0 (Windows NT 6.1;WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/38.0.2125.104 Safari/537.36" User-agent
  • 25. # awk { print %d } access.log • awk ‘{print $1}’ access.log # ip address (%h) • awk ‘{print $2}’ access.log # RFC 1413 identity (%l) • awk ‘{print $3}’ access.log # userid (%u) • awk ‘{print $4,5}’ access.log # date/time (%t) • awk ‘{print $9}’ access.log # status code (%>s) • awk ‘{print $10}’ access.log # size (%b) • awk -F” ‘{print $2}’ access.log # request line (%r) • awk -F” ‘{print $4}’ access.log # referer
  • 26. How to start web application attack analysis
  • 27. The Art Of War
  • 28. OWASP Top 10 2013 • A1-Injection • A2-Broken Authentication and Session Management • A3-Cross-Site Scripting (XSS) • A4-Insecure Direct Object Reference • A5-Security Misconfiguration • A6-Sensitive Data Exposure • A7-Missing Function • A8-Cross-Site Request Forgery(CSRF) • A9-Using Components with known vulnerabilities • A10-Unvalidated Redirect and Forwards
  • 29. Log path • /var/log/apache2/ • /var/log/nginx/ • C:WindowsSystem32LogFilesW3SVC1
  • 30. SQL Injection • Filter: union, order by, select, concat, group_concat, version, %27, %27%20, %2527, --, exec, varchar,cast
  • 31. Example filter SQLi • cat access.log | grep union | more
  • 32. Local File Inclusion Remote File Inclusion • Filter: ../, /etc/passwd, windows/system32/ drivers/etc/hosts, ../boot.ini, =http://, =php://
  • 33. Example filter LFI & RFI • cat access.log | grep “/etc/passwd” | more
  • 34. XSS • Filter: javascript, document.cookie, img src, alert
  • 35. Example filter XSS • cat access.log | grep “alert” | more
  • 36. Brute Forcing • cat access.log| grep “POST” | grep “login.php | more
  • 38. Example filter Shellshock • cat access.log | grep "() {" | more
  • 40. # ls /opt/ • Splunk (Limit 500 MB/day) • Elastic Search + LogStach + Kibana • Elastic Search + Graylog2 • Apache-Scalp • OSSEC • Etc.
  • 42. ELK
  • 44. How to defend web application attack
  • 45. What should I do when my website got hack? • Shut it down ? • Get website back with backup ? • Before website back • Find the root clause, Fix the vulnerability. • If not web application, try another view with hacker view.
  • 46. # apt-get upgrade • Secure Coding • OWASP - https://www.owasp.org/index.php/ OWASP_Secure_Coding_Practices_-_Quick_Reference_Guide • Mozilla - https://wiki.mozilla.org/WebAppSec/Secure_Coding_Guidelines • Web Application Firewall • Naxsi • ModSecurity • AQTRONIX for IIS • Penetration Testing