SlideShare une entreprise Scribd logo
1  sur  37
Télécharger pour lire hors ligne
Real Life Hacking 101
1
Who am I ?
● Batard Florent
● http://code-artisan.io
● @artisan_code
● Security Engineer
– Ethical Hacker for 10 years
– Security Contests (0daysober)
– Globe Trotter (UK, USA, Swiss, France, Japan)
– Lately on the Defense side as a programmer
test
Summary
● Introduction
● Information gathering
● Indirect requests
● Direct requests
● System security
● Configuration errors
● Password policy
● Patching
● Web Security
– XSS
– SQL Injection
– CSRF
test
What is Hacking ?
Use or abuse a resources in way that was not predicted by the
creator in order to change the behavior
test
Attack chronology
● Information gathering
● Getting information about the target
● Indirect / Direct requests
● Fingerprinting
● Analysis
● Determing the security flaw
● Discover the tools to perform the attack
● Attack
● Exploitation
● Expand in the network
● Spread in the internal network
test
Information gathering
• Introduction
• Indirect requests
• Direct requests
• Fingerprinting
test
Introduction
● The first step of any attack is the information gathering
process
● Identify the entry point of the target
● List all the public information we can use
● Other information can be gathered with technical
tools
● The most effective way is the « social
engineering »
– Contact the target and ask him sensitive
information (Freshman, secretary...)
test
Indirect requests
● « Whois » database listing
● All the information asked at registration process
– Administrative informations
● Name, address, phone number
– Technical information
● DNS server
● Email addresses for social engineering
● IP range of the target
● All these information are public
test
WHOIS
● Use of the tool « whois »
● whois domain.tld ou whois IP address
Domain Information:
a. [Domain Name] WHIZZ-TECH.CO.JP
g. [Organization] Whizz Technology Co., Ltd.
l. [Organization Type] Company
m. [Administrative Contact] HS9536JP
n. [Technical Contact] HS9536JP
p. [Name Server] ns1.whizz-tech.co.jp
s. [Signing Key]
[State] Connected (2015/03/31)
[Registered Date] 2005/03/29
[Connected Date] 2005/06/18
[Last Update] 2014/04/01 01:41:01 (JST)
Contact Information: [ 担当者情報 ]
a. [JPNIC ハンドル ] HS9536JP
b. [ 氏名 ] 杉本 展将
c. [Last, First] Sugimoto, Hi-
royuki
d. [ 電子メイル ] hiroyuki@whi-
temap.net
f. [ 組織名 ] 有限会社ウィズテ
クノロジー
g. [Organization] Whizz Techno-
logy Co., Ltd.
k. [ 部署 ]
l. [Division]
m. [ 肩書 ] 代表取締役
n. [Title] President
o. [ 電話番号 ] 06-6242-7288
p. [FAX 番号 ]
y. [ 通知アドレス ]
[ 最終更新 ] 2005/03/29
12:02:01 (JST)
form@dom.jprs.jp
test
Indirect requests
● SNS
– Every bit of public information published can be
used against you
– Information are used to build password bank tailo-
red to hack you(https://github.com/Netflix/Scumblr)
● People Search
– https://pipl.com/
– http://www.peekyou.com/
test
Direct requests
● Active discoveries on the network
● Port scan
– Identify open ports
– Several methods can be used
● Fingerprinting
– Getting the banner of services
– Identify service and its version
– Identify the Operating System
test
Nmap scanning
● Nmap for fingerprinting
● Nmap -A x.x.x.x
test
Nmap Example
test
Other methods
● SNMP
● Identify SNMP community
– Get information on the target
● Netbios
● Communication protocol for windows
– Guest/Null account sometimes activated
● Enumerate shared_folder
● Enumerate users/groups/administrators
test
Social Engineering
● The art of manipulating people to make them reveal
sensitive information
● Phone the target pretending to be someone else
● The victim often doesn't realize what she is
doing
● We will use everything we discovered on indirect
requests
● Most of the time it's the most effective way to retrieve
useful information
● Difficult to protect your company
test
System vulnerabilities
• Configuration mistakes
• Passwords
• Patching
test
System vulnerability
● What is a « system » vulnerability ?
● Configuration mistake
– Leave the default configuration
– High privilege for low task
● Bad password policy
– Default password
– Weak password
● Bad patching policy
– New vulnerabilities but OS are not up to date
● Easy exploitation
test
System vulnerability
test
Configuration error
● Development configuration kept after production de-
ployment
● Devices
– Default SNMP community
– Installation password
● Applications
– Default password
– Debugging activated
– Example files
test
Password policy
● The most secure system will always be weak if protec-
ted by a too simple password
● Usually people will choose the easiest password
a system can accept
– Hacking is even easier if passwords aren't
strong enough
● Passwords should be encrypted in the
application
– If a hacker get into database, all passwords
will be revealed
● Users usually re-use the same password
everywhere
test
Password types
● Not accessible (stored in database)
● Hacker must interactively break the password
and cause noisy logs
● Encrypted/Hashed passwords
● Allow discrete offline attacks
● ClearText passwords
● = win!
test
Password attacks
● Interactive
● No encrypted version of the password
– Medusa
– Hydra
● Slow and noisy
● Offline
● Possess an encrypted version of password
– John The Ripper
– Cain
– L0phtcrack
● Quick and discrete but not always possible
test
Patching
● Update management
● Need a security policy in the company
● Last patches should always be deployed on ALL
machines
● One vulnerable computer can be the entry point
for the whole network
● As an attacker it's always more convenient to
attack the most vulnerable machine on the
network
● Tools to know : Metasploit, Nessus
test
Problems
● Vulnerabilities are often released publicly
● Accessible for anybody
● Automatic script to exploit them
● Typically
● Discovery through a vulnerability scanner like
Nessus
● Exploit the vulnerability with Metasploit
– At the end → total control of the target
test
Web Application Vulnerabilities
• Cross-Site Scripting
• SQL Injection
• CSRF Attack
test
Application Vulnerabilities
● Target a specific application
● Out of scope for system administrator
● Developers responsability
● The hacker can modify the behavior of the application
● Use of the application that wasn't planned by the
developers
● Nowadays, most likely in web applications
test
Parameters
● User can interact with website through parameters :
● GET : parameters sent in the URL
– search.php?query=toto
● POST : parameters sent in the message body
– Usually for forms submission
● These parameters can ALWAYS be tampered by
an attacker
● Tools to know : BurpSuite, Owasp ZAP,
Postman
test
Cross-Site Scripting
● Allow code execution in the browser , most likely in
Javascript
● Problem occurs when user inputs are interpreted
as regular client-side source code.
● Hacker can inject HTML tags and Javascript
inside the page
– Control over the display of the page
● Images
● Javascript (Framework & Components)
● Use your page for evil purpose
http://beefproject.com
test
XSS - Example
● Vulnerable source code
● Normal Behavior Hijacked
test
SQL Injection
● Langage used to query databases
● To select data :
– SELECT column_name FROM table WHERE
condition
● Exemple
– SELECT contenu FROM news WHERE id=1
● Used by website to retrieve persistent information
test
SQL Injection examples
● Original request :
● http://site/news.php?id=1
– SELECT * FROM news WHERE id = 1
– Return the news with the id : 1
● Hijacked request :
● http://site/news.php?id=1 OR 1=1
– SELECT * FROM news WHERE id = 1 OR
1=1 // TRUE
– Return all the news !
test
SQL Injection example
● Vulnerable code
● Normal behavior Hijacked
test
Goal for the hacker
● Hijack authentication process
● Explore the database
● Retrieve hidden information
– Passwords of users and admin
● Interaction with the system through database
● Read file
● Write files
● Command execution
test
Cross Site Request Forgery
● Scenario :
● http://mybank.com/?transfer=100&from=123&to=321
● You have a session active => request accepted
● What if I send you that link in a iframe or a mail ?
– I can forge an address to compromise you
– Session is still active so it will be accepted
– CSRF-token = unpredictable token we cannot forge
● We set email or reset password
test
What to do as a developer ?
● Learn the basics of security (www.owasp.org)
– OWASP Top 10
● Check your application source code
– OWASP ASVS http://code-artisan.io/owasp-asvs-3-0-cheatsheet/
● Add security tests case to your unit tests
– « OR 1 = 1 »
– « <script>alert(‘hello’)</script> »
● Check the security updates of your tools
– Web Frameworks Security Releases
– Change default configuration !
● Check your security with professional services
– Www.detectify.com OR https://vaddy.net/
– Yours truly
test
How to become a hacker ?
Train and learn
– WebGoat
– DVWA (Damn Vulnerable Web App)
– Kali Linux (Security Distribution with all tools)
● Check the tools :
– Metasploit
– SkipFish
– Nikto
– Wpscan
test
Conclusion
• Questions ?

Contenu connexe

Tendances

[CONFidence 2016] Leszek Miś - Honey(pot) flavored hunt for cyber enemy
[CONFidence 2016] Leszek Miś - Honey(pot) flavored hunt for cyber enemy[CONFidence 2016] Leszek Miś - Honey(pot) flavored hunt for cyber enemy
[CONFidence 2016] Leszek Miś - Honey(pot) flavored hunt for cyber enemy
PROIDEA
 

Tendances (20)

Basic Dynamic Analysis of Malware
Basic Dynamic Analysis of MalwareBasic Dynamic Analysis of Malware
Basic Dynamic Analysis of Malware
 
Cyber attacks 101
Cyber attacks 101Cyber attacks 101
Cyber attacks 101
 
ShmooCon 2015: No Budget Threat Intelligence - Tracking Malware Campaigns on ...
ShmooCon 2015: No Budget Threat Intelligence - Tracking Malware Campaigns on ...ShmooCon 2015: No Budget Threat Intelligence - Tracking Malware Campaigns on ...
ShmooCon 2015: No Budget Threat Intelligence - Tracking Malware Campaigns on ...
 
Ch0 1
Ch0 1Ch0 1
Ch0 1
 
Web security uploadv1
Web security uploadv1Web security uploadv1
Web security uploadv1
 
Basic malware analysis
Basic malware analysisBasic malware analysis
Basic malware analysis
 
RIoT (Raiding Internet of Things) by Jacob Holcomb
RIoT  (Raiding Internet of Things)  by Jacob HolcombRIoT  (Raiding Internet of Things)  by Jacob Holcomb
RIoT (Raiding Internet of Things) by Jacob Holcomb
 
Revealing the Attack Operations Targeting Japan by Shusei Tomonaga & Yuu Nak...
Revealing the Attack Operations Targeting Japan by  Shusei Tomonaga & Yuu Nak...Revealing the Attack Operations Targeting Japan by  Shusei Tomonaga & Yuu Nak...
Revealing the Attack Operations Targeting Japan by Shusei Tomonaga & Yuu Nak...
 
Fileless Malware Infections
Fileless Malware InfectionsFileless Malware Infections
Fileless Malware Infections
 
Malware analysis - What to learn from your invaders
Malware analysis - What to learn from your invadersMalware analysis - What to learn from your invaders
Malware analysis - What to learn from your invaders
 
Ethical hacking 101 - Singapore RSA 2019
Ethical hacking 101 - Singapore RSA 2019Ethical hacking 101 - Singapore RSA 2019
Ethical hacking 101 - Singapore RSA 2019
 
Pen Testing, Red Teaming, and More
Pen Testing, Red Teaming, and MorePen Testing, Red Teaming, and More
Pen Testing, Red Teaming, and More
 
A Threat Hunter Himself
A Threat Hunter HimselfA Threat Hunter Himself
A Threat Hunter Himself
 
Information gath
Information gathInformation gath
Information gath
 
Ch14 security
Ch14   securityCh14   security
Ch14 security
 
Metasploit
MetasploitMetasploit
Metasploit
 
The Hunter Games: How to Find the Adversary with Event Query Language
The Hunter Games: How to Find the Adversary with Event Query LanguageThe Hunter Games: How to Find the Adversary with Event Query Language
The Hunter Games: How to Find the Adversary with Event Query Language
 
[CONFidence 2016] Leszek Miś - Honey(pot) flavored hunt for cyber enemy
[CONFidence 2016] Leszek Miś - Honey(pot) flavored hunt for cyber enemy[CONFidence 2016] Leszek Miś - Honey(pot) flavored hunt for cyber enemy
[CONFidence 2016] Leszek Miś - Honey(pot) flavored hunt for cyber enemy
 
Hacking with Remote Admin Tools (RAT)
 Hacking with Remote Admin Tools (RAT) Hacking with Remote Admin Tools (RAT)
Hacking with Remote Admin Tools (RAT)
 
Analysis Of Adverarial Code - The Role of Malware Kits
Analysis Of Adverarial Code - The Role of Malware KitsAnalysis Of Adverarial Code - The Role of Malware Kits
Analysis Of Adverarial Code - The Role of Malware Kits
 

En vedette

NEHA PowerPoint FINAL
NEHA PowerPoint FINALNEHA PowerPoint FINAL
NEHA PowerPoint FINAL
Megan Jourdan
 
Status of-women-in-islam
Status of-women-in-islamStatus of-women-in-islam
Status of-women-in-islam
Asif Khan
 

En vedette (14)

black board
black boardblack board
black board
 
The 7 Toughest Challenges to Building Successful Products and Companies and h...
The 7 Toughest Challenges to Building Successful Products and Companies and h...The 7 Toughest Challenges to Building Successful Products and Companies and h...
The 7 Toughest Challenges to Building Successful Products and Companies and h...
 
NEHA PowerPoint FINAL
NEHA PowerPoint FINALNEHA PowerPoint FINAL
NEHA PowerPoint FINAL
 
Erakonnad
ErakonnadErakonnad
Erakonnad
 
RPKI Deployment Status in Bangladesh
RPKI Deployment Status in Bangladesh RPKI Deployment Status in Bangladesh
RPKI Deployment Status in Bangladesh
 
HD3000 Playable Graphics Games (Dx 10.1)
HD3000 Playable Graphics Games (Dx 10.1)HD3000 Playable Graphics Games (Dx 10.1)
HD3000 Playable Graphics Games (Dx 10.1)
 
Mulher Trabalhadora que amamenta
Mulher Trabalhadora que amamenta Mulher Trabalhadora que amamenta
Mulher Trabalhadora que amamenta
 
Informática
InformáticaInformática
Informática
 
Bodytech caso
Bodytech casoBodytech caso
Bodytech caso
 
Computer system architecture
Computer system architectureComputer system architecture
Computer system architecture
 
SHS Orientation_SY-2016-2017
SHS Orientation_SY-2016-2017SHS Orientation_SY-2016-2017
SHS Orientation_SY-2016-2017
 
Predictive Analytics World Germany 2015
Predictive Analytics World Germany 2015Predictive Analytics World Germany 2015
Predictive Analytics World Germany 2015
 
K to 12 SHS Voucher Program
K to 12  SHS Voucher ProgramK to 12  SHS Voucher Program
K to 12 SHS Voucher Program
 
Status of-women-in-islam
Status of-women-in-islamStatus of-women-in-islam
Status of-women-in-islam
 

Similaire à Real life hacking101

CISSP Week 14
CISSP Week 14CISSP Week 14
CISSP Week 14
jemtallon
 
[OWASP Poland Day] Application security - daily questions & answers
[OWASP Poland Day] Application security - daily questions & answers[OWASP Poland Day] Application security - daily questions & answers
[OWASP Poland Day] Application security - daily questions & answers
OWASP
 

Similaire à Real life hacking101 (20)

CISSP Week 14
CISSP Week 14CISSP Week 14
CISSP Week 14
 
2023 NCIT: Introduction to Intrusion Detection
2023 NCIT: Introduction to Intrusion Detection2023 NCIT: Introduction to Intrusion Detection
2023 NCIT: Introduction to Intrusion Detection
 
The Golden Rules - Detecting more with RSA Security Analytics
The Golden Rules  - Detecting more with RSA Security AnalyticsThe Golden Rules  - Detecting more with RSA Security Analytics
The Golden Rules - Detecting more with RSA Security Analytics
 
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
 
[OWASP Poland Day] Application security - daily questions & answers
[OWASP Poland Day] Application security - daily questions & answers[OWASP Poland Day] Application security - daily questions & answers
[OWASP Poland Day] Application security - daily questions & answers
 
Online Sync meetup: Metasploit 101 slides
Online Sync meetup: Metasploit 101 slidesOnline Sync meetup: Metasploit 101 slides
Online Sync meetup: Metasploit 101 slides
 
Secure coding guidelines
Secure coding guidelinesSecure coding guidelines
Secure coding guidelines
 
ETHICAL HACKING
ETHICAL HACKING ETHICAL HACKING
ETHICAL HACKING
 
Protecting Financial Networks from Cyber Crime
Protecting Financial Networks from Cyber CrimeProtecting Financial Networks from Cyber Crime
Protecting Financial Networks from Cyber Crime
 
The Supporting Role of Antivirus Evasion while Persisting
The Supporting Role of Antivirus Evasion while PersistingThe Supporting Role of Antivirus Evasion while Persisting
The Supporting Role of Antivirus Evasion while Persisting
 
No Easy Breach DerbyCon 2016
No Easy Breach DerbyCon 2016No Easy Breach DerbyCon 2016
No Easy Breach DerbyCon 2016
 
Sql securitytesting
Sql  securitytestingSql  securitytesting
Sql securitytesting
 
Secure Android Development
Secure Android DevelopmentSecure Android Development
Secure Android Development
 
INTERNSHIPREVIEW-ISHAQ (1) [Recovered].pptx
INTERNSHIPREVIEW-ISHAQ (1) [Recovered].pptxINTERNSHIPREVIEW-ISHAQ (1) [Recovered].pptx
INTERNSHIPREVIEW-ISHAQ (1) [Recovered].pptx
 
NETWORK PENETRATION TESTING
NETWORK PENETRATION TESTINGNETWORK PENETRATION TESTING
NETWORK PENETRATION TESTING
 
L27
L27L27
L27
 
Pen-Testing with Metasploit
Pen-Testing with MetasploitPen-Testing with Metasploit
Pen-Testing with Metasploit
 
Security .NET.pdf
Security .NET.pdfSecurity .NET.pdf
Security .NET.pdf
 
Ccsit cyberlympics 2017 workshop 3 - presentation
Ccsit cyberlympics 2017  workshop 3 - presentationCcsit cyberlympics 2017  workshop 3 - presentation
Ccsit cyberlympics 2017 workshop 3 - presentation
 
Big Bang Theory: The Evolution of Pentesting High Security Enviroments IT Def...
Big Bang Theory: The Evolution of Pentesting High Security Enviroments IT Def...Big Bang Theory: The Evolution of Pentesting High Security Enviroments IT Def...
Big Bang Theory: The Evolution of Pentesting High Security Enviroments IT Def...
 

Dernier

Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwait
Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills KuwaitKuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwait
Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwait
jaanualu31
 
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 

Dernier (20)

Work-Permit-Receiver-in-Saudi-Aramco.pptx
Work-Permit-Receiver-in-Saudi-Aramco.pptxWork-Permit-Receiver-in-Saudi-Aramco.pptx
Work-Permit-Receiver-in-Saudi-Aramco.pptx
 
Moment Distribution Method For Btech Civil
Moment Distribution Method For Btech CivilMoment Distribution Method For Btech Civil
Moment Distribution Method For Btech Civil
 
A CASE STUDY ON CERAMIC INDUSTRY OF BANGLADESH.pptx
A CASE STUDY ON CERAMIC INDUSTRY OF BANGLADESH.pptxA CASE STUDY ON CERAMIC INDUSTRY OF BANGLADESH.pptx
A CASE STUDY ON CERAMIC INDUSTRY OF BANGLADESH.pptx
 
Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwait
Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills KuwaitKuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwait
Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwait
 
Employee leave management system project.
Employee leave management system project.Employee leave management system project.
Employee leave management system project.
 
COST-EFFETIVE and Energy Efficient BUILDINGS ptx
COST-EFFETIVE  and Energy Efficient BUILDINGS ptxCOST-EFFETIVE  and Energy Efficient BUILDINGS ptx
COST-EFFETIVE and Energy Efficient BUILDINGS ptx
 
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced LoadsFEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
 
Thermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.pptThermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.ppt
 
Design For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the startDesign For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the start
 
Thermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - VThermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - V
 
Computer Networks Basics of Network Devices
Computer Networks  Basics of Network DevicesComputer Networks  Basics of Network Devices
Computer Networks Basics of Network Devices
 
A Study of Urban Area Plan for Pabna Municipality
A Study of Urban Area Plan for Pabna MunicipalityA Study of Urban Area Plan for Pabna Municipality
A Study of Urban Area Plan for Pabna Municipality
 
kiln thermal load.pptx kiln tgermal load
kiln thermal load.pptx kiln tgermal loadkiln thermal load.pptx kiln tgermal load
kiln thermal load.pptx kiln tgermal load
 
Generative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPTGenerative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPT
 
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
 
data_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdfdata_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdf
 
GEAR TRAIN- BASIC CONCEPTS AND WORKING PRINCIPLE
GEAR TRAIN- BASIC CONCEPTS AND WORKING PRINCIPLEGEAR TRAIN- BASIC CONCEPTS AND WORKING PRINCIPLE
GEAR TRAIN- BASIC CONCEPTS AND WORKING PRINCIPLE
 
AIRCANVAS[1].pdf mini project for btech students
AIRCANVAS[1].pdf mini project for btech studentsAIRCANVAS[1].pdf mini project for btech students
AIRCANVAS[1].pdf mini project for btech students
 
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptx
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptxS1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptx
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptx
 
Engineering Drawing focus on projection of planes
Engineering Drawing focus on projection of planesEngineering Drawing focus on projection of planes
Engineering Drawing focus on projection of planes
 

Real life hacking101

  • 2. Who am I ? ● Batard Florent ● http://code-artisan.io ● @artisan_code ● Security Engineer – Ethical Hacker for 10 years – Security Contests (0daysober) – Globe Trotter (UK, USA, Swiss, France, Japan) – Lately on the Defense side as a programmer
  • 3. test Summary ● Introduction ● Information gathering ● Indirect requests ● Direct requests ● System security ● Configuration errors ● Password policy ● Patching ● Web Security – XSS – SQL Injection – CSRF
  • 4. test What is Hacking ? Use or abuse a resources in way that was not predicted by the creator in order to change the behavior
  • 5. test Attack chronology ● Information gathering ● Getting information about the target ● Indirect / Direct requests ● Fingerprinting ● Analysis ● Determing the security flaw ● Discover the tools to perform the attack ● Attack ● Exploitation ● Expand in the network ● Spread in the internal network
  • 6. test Information gathering • Introduction • Indirect requests • Direct requests • Fingerprinting
  • 7. test Introduction ● The first step of any attack is the information gathering process ● Identify the entry point of the target ● List all the public information we can use ● Other information can be gathered with technical tools ● The most effective way is the « social engineering » – Contact the target and ask him sensitive information (Freshman, secretary...)
  • 8. test Indirect requests ● « Whois » database listing ● All the information asked at registration process – Administrative informations ● Name, address, phone number – Technical information ● DNS server ● Email addresses for social engineering ● IP range of the target ● All these information are public
  • 9. test WHOIS ● Use of the tool « whois » ● whois domain.tld ou whois IP address Domain Information: a. [Domain Name] WHIZZ-TECH.CO.JP g. [Organization] Whizz Technology Co., Ltd. l. [Organization Type] Company m. [Administrative Contact] HS9536JP n. [Technical Contact] HS9536JP p. [Name Server] ns1.whizz-tech.co.jp s. [Signing Key] [State] Connected (2015/03/31) [Registered Date] 2005/03/29 [Connected Date] 2005/06/18 [Last Update] 2014/04/01 01:41:01 (JST) Contact Information: [ 担当者情報 ] a. [JPNIC ハンドル ] HS9536JP b. [ 氏名 ] 杉本 展将 c. [Last, First] Sugimoto, Hi- royuki d. [ 電子メイル ] hiroyuki@whi- temap.net f. [ 組織名 ] 有限会社ウィズテ クノロジー g. [Organization] Whizz Techno- logy Co., Ltd. k. [ 部署 ] l. [Division] m. [ 肩書 ] 代表取締役 n. [Title] President o. [ 電話番号 ] 06-6242-7288 p. [FAX 番号 ] y. [ 通知アドレス ] [ 最終更新 ] 2005/03/29 12:02:01 (JST) form@dom.jprs.jp
  • 10. test Indirect requests ● SNS – Every bit of public information published can be used against you – Information are used to build password bank tailo- red to hack you(https://github.com/Netflix/Scumblr) ● People Search – https://pipl.com/ – http://www.peekyou.com/
  • 11. test Direct requests ● Active discoveries on the network ● Port scan – Identify open ports – Several methods can be used ● Fingerprinting – Getting the banner of services – Identify service and its version – Identify the Operating System
  • 12. test Nmap scanning ● Nmap for fingerprinting ● Nmap -A x.x.x.x
  • 14. test Other methods ● SNMP ● Identify SNMP community – Get information on the target ● Netbios ● Communication protocol for windows – Guest/Null account sometimes activated ● Enumerate shared_folder ● Enumerate users/groups/administrators
  • 15. test Social Engineering ● The art of manipulating people to make them reveal sensitive information ● Phone the target pretending to be someone else ● The victim often doesn't realize what she is doing ● We will use everything we discovered on indirect requests ● Most of the time it's the most effective way to retrieve useful information ● Difficult to protect your company
  • 16. test System vulnerabilities • Configuration mistakes • Passwords • Patching
  • 17. test System vulnerability ● What is a « system » vulnerability ? ● Configuration mistake – Leave the default configuration – High privilege for low task ● Bad password policy – Default password – Weak password ● Bad patching policy – New vulnerabilities but OS are not up to date ● Easy exploitation
  • 19. test Configuration error ● Development configuration kept after production de- ployment ● Devices – Default SNMP community – Installation password ● Applications – Default password – Debugging activated – Example files
  • 20. test Password policy ● The most secure system will always be weak if protec- ted by a too simple password ● Usually people will choose the easiest password a system can accept – Hacking is even easier if passwords aren't strong enough ● Passwords should be encrypted in the application – If a hacker get into database, all passwords will be revealed ● Users usually re-use the same password everywhere
  • 21. test Password types ● Not accessible (stored in database) ● Hacker must interactively break the password and cause noisy logs ● Encrypted/Hashed passwords ● Allow discrete offline attacks ● ClearText passwords ● = win!
  • 22. test Password attacks ● Interactive ● No encrypted version of the password – Medusa – Hydra ● Slow and noisy ● Offline ● Possess an encrypted version of password – John The Ripper – Cain – L0phtcrack ● Quick and discrete but not always possible
  • 23. test Patching ● Update management ● Need a security policy in the company ● Last patches should always be deployed on ALL machines ● One vulnerable computer can be the entry point for the whole network ● As an attacker it's always more convenient to attack the most vulnerable machine on the network ● Tools to know : Metasploit, Nessus
  • 24. test Problems ● Vulnerabilities are often released publicly ● Accessible for anybody ● Automatic script to exploit them ● Typically ● Discovery through a vulnerability scanner like Nessus ● Exploit the vulnerability with Metasploit – At the end → total control of the target
  • 25. test Web Application Vulnerabilities • Cross-Site Scripting • SQL Injection • CSRF Attack
  • 26. test Application Vulnerabilities ● Target a specific application ● Out of scope for system administrator ● Developers responsability ● The hacker can modify the behavior of the application ● Use of the application that wasn't planned by the developers ● Nowadays, most likely in web applications
  • 27. test Parameters ● User can interact with website through parameters : ● GET : parameters sent in the URL – search.php?query=toto ● POST : parameters sent in the message body – Usually for forms submission ● These parameters can ALWAYS be tampered by an attacker ● Tools to know : BurpSuite, Owasp ZAP, Postman
  • 28. test Cross-Site Scripting ● Allow code execution in the browser , most likely in Javascript ● Problem occurs when user inputs are interpreted as regular client-side source code. ● Hacker can inject HTML tags and Javascript inside the page – Control over the display of the page ● Images ● Javascript (Framework & Components) ● Use your page for evil purpose http://beefproject.com
  • 29. test XSS - Example ● Vulnerable source code ● Normal Behavior Hijacked
  • 30. test SQL Injection ● Langage used to query databases ● To select data : – SELECT column_name FROM table WHERE condition ● Exemple – SELECT contenu FROM news WHERE id=1 ● Used by website to retrieve persistent information
  • 31. test SQL Injection examples ● Original request : ● http://site/news.php?id=1 – SELECT * FROM news WHERE id = 1 – Return the news with the id : 1 ● Hijacked request : ● http://site/news.php?id=1 OR 1=1 – SELECT * FROM news WHERE id = 1 OR 1=1 // TRUE – Return all the news !
  • 32. test SQL Injection example ● Vulnerable code ● Normal behavior Hijacked
  • 33. test Goal for the hacker ● Hijack authentication process ● Explore the database ● Retrieve hidden information – Passwords of users and admin ● Interaction with the system through database ● Read file ● Write files ● Command execution
  • 34. test Cross Site Request Forgery ● Scenario : ● http://mybank.com/?transfer=100&from=123&to=321 ● You have a session active => request accepted ● What if I send you that link in a iframe or a mail ? – I can forge an address to compromise you – Session is still active so it will be accepted – CSRF-token = unpredictable token we cannot forge ● We set email or reset password
  • 35. test What to do as a developer ? ● Learn the basics of security (www.owasp.org) – OWASP Top 10 ● Check your application source code – OWASP ASVS http://code-artisan.io/owasp-asvs-3-0-cheatsheet/ ● Add security tests case to your unit tests – « OR 1 = 1 » – « <script>alert(‘hello’)</script> » ● Check the security updates of your tools – Web Frameworks Security Releases – Change default configuration ! ● Check your security with professional services – Www.detectify.com OR https://vaddy.net/ – Yours truly
  • 36. test How to become a hacker ? Train and learn – WebGoat – DVWA (Damn Vulnerable Web App) – Kali Linux (Security Distribution with all tools) ● Check the tools : – Metasploit – SkipFish – Nikto – Wpscan