CEH Day 2
CEH Day 2
Omar Santos
@santosomar
theartofhacking.org
What we covered yesterday (DAY 1)
Social Engineering
Denial-of-Service
theartofhacking.org
DAY 2
Cryptography
IoT Hacking
Cloud Computing
theartofhacking.org
DISCLAIMER | WARNING
The information provided on this training is for educational purposes only. The
author, O’Reilly, or any other entity is in no way responsible for any misuse of
the information.
Some of the tools and technologies that you will learn in this training class may be
illegal depending on where you reside. Please check with your local laws.
Please practice and use all the tools that are shown in this training in a lab that is not
connected to the Internet or any other network.
theartofhacking.org
What this class is and is not…
theartofhacking.org
Resources:
CEH Review: https://cehreview.com
The Art of Hacking: https://theartofhacking.org
GitHub: https://theartofhacking.org/github theartofhacking.org
https://cehreview.com theartofhacking.org
https://learning.oreilly.com/videos/certified-ethical-hacker/9780135647455
theartofhacking.org
https://learning.oreilly.com/certifications/9780136758433
theartofhacking.org
Cryptography
theartofhacking.org
The word cryptography or cryptology
comes from the Greek word kryptós,
What is which means a secret.
Cryptography?
It is the study of the techniques used for
encryption and secure communications.
theartofhacking.org
Cryptographers are always constructing
and analyzing protocols for preventing
unauthorized users from reading private
messages as well as the following areas
Why of information security:
Cryptography?
• Data confidentiality
• Data integrity
• Authentication
• Nonrepudiation
theartofhacking.org
• Virtual private networks (VPNs)
Examples of the • Ecommerce
use of • Secure email transfer
cryptography • Credit card chips
• many more…
theartofhacking.org
What is …the study of how to crack encryption
cryptanalysis? algorithms or their implementations.
theartofhacking.org
A cipher is a set of rules, which can also
Ciphers be called an algorithm, about how to
perform encryption or decryption.
theartofhacking.org
This type of cipher substitutes one
Substitution character for another.
theartofhacking.org
theartofhacking.org
theartofhacking.org
This is similar to substitution, but instead
of using a single alphabet, it can use
Polyalphabetic multiple alphabets and switch between
them by some trigger character in the
encoded message.
theartofhacking.org
This method uses many different options,
including the rearrangement of letters.
Transposition
T S S R
H I E E
I S C T
theartofhacking.org
Encryption algorithms can operate on
Block and Stream
blocks of data at a time, or bits and bytes
Ciphers of data, based on the type of cipher.
theartofhacking.org
A block cipher is a symmetric key cipher
(meaning the same key is used to encrypt
and decrypt) that operates on a group of
bits called a block.
Block Ciphers Examples:
• Advanced Encryption Standard (AES)
• Triple Digital Encryption Standard (3DES)
• Digital Encryption Standard (DES)
• Blowfish
• International Data Encryption Algorithm (IDEA)
theartofhacking.org
A stream cipher is a symmetric key cipher
(meaning the same key is used to encrypt
and decrypt), where the plaintext data to
Stream Ciphers be encrypted is done a bit at a time
against the bits of the key stream, also
called a cipher digit stream.
theartofhacking.org
A symmetric encryption algorithm, also
Symmetric known as a symmetric cipher, uses the
Algorithms same key to encrypt the data and decrypt
the data.
theartofhacking.org
An example of an asymmetric algorithm is a
public key algorithm.
theartofhacking.org
EVE
DEREK HANNAH
theartofhacking.org
• Hashing is a method used to verify data
integrity.
• It is a one-way function.
theartofhacking.org
• Individuals and organizations deploy VPNs to
provide data integrity, authentication, and data
encryption to ensure confidentiality of the
packets sent over an unprotected network or
the Internet.
• VPNs are designed to avoid the cost of
What Are unnecessary leased lines.
• Individuals also use VPNs to remain
VPNs? anonymous online.
• Even threat actors use VPN technologies to
encrypt data from compromised sites,
command and control communications, and to
maintain anonymity for the purposes of
malfeasance in underground sites and darknet
marketplaces.
theartofhacking.org
• Point-to-Point Tunneling Protocol (PPTP)
• Layer 2 Forwarding (L2F) protocol
Example VPN •
•
Layer 2 Tunneling Protocol (L2TP)
Generic Routing Encapsulation (GRE)
Technologies • Multiprotocol Label Switching (MPLS)
• Internet Protocol Security (IPsec)
• Secure Sockets Layer (SSL)
theartofhacking.org
Site-to-Site
VPNs
theartofhacking.org
Remote Access
VPNs
theartofhacking.org
Additional Crypto Details and References:
https://cehreview.com/go/crypto
theartofhacking.org
Hacking Wireless Networks
theartofhacking.org
A few questions before we get started…
theartofhacking.org
Which of the following best describes an attack where the threat
actor creates a rogue access point and configures it exactly the
same as the existing wireless network?
a) Evil Twin
a) Wireless Twin
a) Evil AP
theartofhacking.org
Whiteboard
Explanation of
Rogue and Evil
Twins
theartofhacking.org
Whiteboard
Explanation of
DeAuth Attacks
theartofhacking.org
DeAuth
theartofhacking.org
Which of the following is a methodology used by attackers
to find wireless access points wherever they may be?
a) Wireless Driving
a) War Driving
a) Evil Twin
theartofhacking.org
Which of the following is true about WEP?
a) WEP keys exists in two sizes: 48-bit (5 byte) and 104-bit (13 byte). In addition, WEP uses a 40-bit
initialization vector (IV), which is prepended to the pre-shared key (PSK). When you configure a
wireless infrastructure device with WEP the IVs are sent in the clear.
a) WEP keys exists in two sizes: 40-bit (5 byte) and 104-bit (13 byte). In addition, WEP uses a 40-bit
initialization vector (IV), which is prepended to the pre-shared key (PSK). When you configure a
wireless infrastructure device with WEP the IVs are sent encrypted with RC4.
a) WEP keys exists in two sizes: 40-bit (5 byte) and 104-bit (13 byte). In addition, WEP uses a 24-bit
initialization vector (IV), which is prepended to the pre-shared key (PSK). When you configure a
wireless infrastructure device with WEP the IVs are sent encrypted with AES.
a) WEP keys exists in two sizes: 40-bit (5 byte) and 104-bit (13 byte). In addition, WEP uses a 24-bit
initialization vector (IV), which is prepended to the pre-shared key (PSK). When you configure a
wireless infrastructure device with WEP the IVs are sent in the clear.
theartofhacking.org
Which of the following is an attack against the WPA and
WPA2 protocols?
a) KRACK
a) WPA Buster
theartofhacking.org
Which of the following describes a KARMA attack?
theartofhacking.org
WEP Deficiencies
• WEP must be avoided and many wireless network devices no longer support it.
• WEP keys exists in two sizes: 40-bit (5 byte) and 104-bit (13 byte).
• In addition, WEP uses a 24-bit initialization vector (IV), which is prepended to the
pre-shared key (PSK). When you configure a wireless infrastructure device with
WEP, the IVs are sent in the clear.
theartofhacking.org
More WEP Problems
theartofhacking.org
WPA Handshake
theartofhacking.org
theartofhacking.org
Attacking the Preferred Network Lists
theartofhacking.org
theartofhacking.org
Wireless Networks, IoT, and Mobile Devices Hacking
(video course with tons of demos – FREE with Safari Subscription)
https://cehreview.com/go/wireless
theartofhacking.org
Buffer Overflows
theartofhacking.org
Introduction to Buffer Overflows
theartofhacking.org
H E L L O
H E L L O W O R L
D
theartofhacking.org
heap
theartofhacking.org
heap
theartofhacking.org
EIP
• The Instruction pointer register.
• Stores the address of the next instruction to be executed.
• Its value is incremented after every instruction execution
(depending on the size of an instruction).
theartofhacking.org
ESP
• The Stack pointer register.
• Stores the address of the top of the stack. This is the
address of the last element on the stack.
• The stack grows downward in memory(from higher
address values to lower address values).
• Subsequently, ESP points to the value in stack at the
lowest memory address.
theartofhacking.org
EBP
• The Base pointer register.
• The EBP register usually set to ESP at the start of the
function.
• This is done to keep tab of function parameters and local
variables.
• Local variables are accessed by subtracting offsets
from EBP and function parameters are accessed by
adding offsets to it.
theartofhacking.org
,
theartofhacking.org
WHAT IS SHELLCODE?
theartofhacking.org
https://github.com/rapid7/metasploit-framework/wiki/How-to-use-msfvenom theartofhacking.org
theartofhacking.org
Hacking Web Servers and
Web Applications
theartofhacking.org
Web Application
Penetration Testing
Methodologies
theartofhacking.org
https://www.owasp.org/index.php/OWASP_Testing_Project theartofhacking.org
theartofhacking.org
* For your reference only
theartofhacking.org
What is a Web Application?
theartofhacking.org
THE TRADITIONAL WEB APPLICATION ARCHITECTURE
theartofhacking.org
theartofhacking.org
theartofhacking.org
OPENID AUTHENTICATION FLOW
theartofhacking.org
WEBHOOK MODE EXAMPLE REQUEST
WEBHOOK MODE
EXAMPLE RESPONSE
theartofhacking.org
Understand how Gather needed
the application information
works • credentials, tokens,
• Purpose (e.g. app API configurations
configuration)
• Functions (e.g.
account
provisioning)
theartofhacking.org
theartofhacking.org
Packet Tampering
CSRF
Click-Jacking
Directory
Traversal
FORGED TOKEN
DIRECT OBJECT
REFERENCE
SQL Injection
theartofhacking.org
theartofhacking.org
theartofhacking.org
theartofhacking.org
Dozens of vulnerable applications,
VMs, and websites that you can use
to practice your skills.
https://theartofhacking.org/lab
theartofhacking.org
https://theartofhacking.org/github
theartofhacking.org
Mobile testing Lab Setup
Android/iOS Emulator
Burpsuite
Proxy all emulator traffic through Burpsuite to web service
theartofhacking.org
Reconnaissance and
Profiling Web Applications
theartofhacking.org
Typical Web Attack/Test Process
theartofhacking.org
Web Application Mapping
Techniques
Manual crawl
Walking through the
application one page at a time
Hybrid approach
Use an automated scanner,
but tell it were to look
Automated
crawl/spidering
Point and click
Use an automated scanner
theartofhacking.org
Vulnerability Discovery
theartofhacking.org
Automated Scanning
theartofhacking.org
How Automated Web Scanners Work
theartofhacking.org
Verification of Results
Is it really a vulnerability, or just a false positive?
theartofhacking.org
Interception Proxy
theartofhacking.org
How an Interception Proxy Works
theartofhacking.org
Authentication and
Session Management
Vulnerabilities
theartofhacking.org
theartofhacking.org
theartofhacking.org
There are several ways that an attacker can perform a session
hijack and where a session token could be compromised:
❑ Predicting session tokens: this is why it is important to use non-
predictable tokens, as previously discussed in this section.
❑ Session sniffing: by collecting packets of unencrypted web
sessions.
❑ Man-in-the-middle attacks: where the attacker sits in the path
between the client and the web server.
❑ Man-in-the-browser attack: similar approach as man-in-the-middle
attacks; however, in this case browser (or extension or plugin) is
compromised and used to intercept and manipulate web sessions
between the user and the web server.
theartofhacking.org
Cross-site Scripting (XSS)
&
Cross-site Request Forgery
(CSRF)
theartofhacking.org
theartofhacking.org
theartofhacking.org
You typically find XSS vulnerabilities in:
theartofhacking.org
Cross-site request forgery (CSRF or
XSRF) attacks occur when
unauthorized commands are
transmitted from a user that is
trusted by the application.
theartofhacking.org
UserName
= Santos’;drop table
users; truncate
audit_log;--
theartofhacking.org
Source: OWASP
https://www.owasp.org/index.php/Injection_Prevention_Cheat_Sheet
https://www.owasp.org/index.php/SQL_Injection_Prevention_Cheat_Sheet
theartofhacking.org
When does SQL injection happen?
theartofhacking.org
Data is not validated, filtered, or sanitized by
the application.
theartofhacking.org
When bad data is used within object-relational
mapping (ORM) search parameters to extract
additional, sensitive records.
theartofhacking.org
Data is not validated, filtered, or sanitized by
the application.
theartofhacking.org
Used to access files and directories that are
stored outside the web root folder.
theartofhacking.org
DEMO – XXE
theartofhacking.org
https://www.owasp.org/index.php/OWASP_Zed_Attack_Proxy_Project
theartofhacking.org
DEMO – ZAP
theartofhacking.org
Which of the following is NOT an example of an HTTP method?
a) PUT
a) DELETE
a) TRACE
a) REST
theartofhacking.org
Which of the following are examples of code injection
vulnerabilities?
a) SQL injection
a) Object injection
theartofhacking.org
Refer to the following string:
omar' or '1'=‘1
This string is an example of what type of attack?
a) XSS
b) XSRF
c) CSRF
d) SQL Injection
theartofhacking.org
Which of the following is not true?
a) Once an authenticated session has been established, the session ID (or token) is
temporarily equivalent to the strongest authentication method used by the application, like
username and passwords, one-time passwords, client-based digital certificates, and
others.
a) The the session ID (or token) is temporarily equivalent to the strongest authentication
method used by the application prior to authentication.
theartofhacking.org
What type of vulnerabilities can be triggered by using the
parameters in the following URL?
http://store.h4cker.org/?search=cars&results=20&search=bikes
a)XSS
b)SQL injection
c) HTTP Parameter Pollution (HPP)
d)Command injection
theartofhacking.org
What type of vulnerabilities can be triggered by using the
parameters in the following URL?
http://web.h4cker.org/changepassd?user=omar
a) SQL injection
b) Insecure Direct Object Reference
c) Indirect Object Reference
d) XSS
theartofhacking.org
BONUS: What type of vulnerabilities can be triggered by
using the following string?
<img src=javascri&
#x70t:alert('X&#
x53S')>
theartofhacking.org
Hacking Mobile Platforms
theartofhacking.org
What you need to know…
theartofhacking.org
Overview of OWASP Mobile Top 10
https://www.owasp.org/index.php/Mobile_Top_10_2016-Top_10
theartofhacking.org
https://www.owasp.org/index.php/Mobile_Top_10_2016-Top_10
theartofhacking.org
https://www.owasp.org/index.php/Mobile_Top_10_2016-Top_10
theartofhacking.org
Other Client-based Attacks Still Apply
• Phishing
• Framing (iFrame-based attacks)
• Clickjacking
• Man-in-the-mobile / Man-in-the-browser
• Buffer overflows
• Data Caching
• XSS / CSRF
• Brute-force
• Weak input validation
• Command execution
theartofhacking.org
Phone / Device Specific
theartofhacking.org
App Sandboxing Issues
Sandbox Sandbox
APP
APP
User Systems
User Systems
Data Resources
Data Resources
theartofhacking.org
theartofhacking.org
theartofhacking.org
theartofhacking.org
theartofhacking.org
theartofhacking.org
IOS TESTING GUIDE
https://github.com/OWASP/owasp-mstg#ios-testing-guide
theartofhacking.org
ANDROID SECURITY
https://source.android.com/security/
theartofhacking.org
theartofhacking.org
theartofhacking.org
Additional Resources for Mobile Device Security
• Hacking Android
https://cehreview.com/go/hacking_android
• Hacking iOS
https://cehreview.com/go/hacking_ios
theartofhacking.org
https://cehreview.com/mobile-api-lab.pdf
theartofhacking.org
IoT Hacking
theartofhacking.org
IoT or IoE?
Internet of Everything
(IoE) is another term
that refers to IoT
devices, processes,
and people.
theartofhacking.org
Examples of IoT Components
theartofhacking.org
theartofhacking.org
theartofhacking.org
theartofhacking.org
theartofhacking.org
EC-Council IoT Architecture Terms
theartofhacking.org
theartofhacking.org
Short-range Wireless Medium-range Long-range Wireless Wired IoT Operating Systems
Wireless Communication
• Bluetooth Low Energy • Ha-Low • Low-power Wide- • Ethernet • RIOT OS
(BLE) area Networking
• LTE-Advanced (LPWAN): • Multimedia over • ARM mbed OS
• Light-Fidelity (LiFi) o LoRaWAN Coax Alliance
o Sigfox (MoCA) • RealSense OS X
• Near Field o Neul
Communication (NFC) • Power-line • Nucleous RTOS
• Very Small Aperture Communication
• QR Codes and Terminal (VSAT) (PLC) • Brillo
Barcodes
• Cellular • INSTEON • Contiki
• Radio Frequency
Identification (RFID) • Zephyr
• Zigbee
theartofhacking.org
Security Challenges
theartofhacking.org
• Why are so many insecure devices on the
Flawed, market?
• A Manufacturer’s Perspective
Insecure • The Device Production Cycle
Devices • Software development in an agile market
• Clash of Cultures
• Developers and the Security Puzzle
theartofhacking.org
• Security and product confidence
• Me-too manufacturing
Plug n’ Pray • Cutting development costs
• Security is not an extra
theartofhacking.org
DETAILED REVIEW OF IOT
TECHNOLOGIES AND
SECURITY FLAWS
https://cehreview.com/go/iot
theartofhacking.org
Challenges of IoT
theartofhacking.org
OWASP IoT Project Demo
https://cehreview.com/go/owasp-iot.html
theartofhacking.org
OWASP IoT Testing Guide Demo
https://cehreview.com/go/owasp-iot-testing-guide.html
theartofhacking.org
Cloud Computing
theartofhacking.org
Infrastructure-as-a-Service (IaaS)
SYS ADMINS • VMs, containers, and other abstracted hardware typically
controlled via APIs.
• Examples AWS (EC2), Azure, Rackspace, Google Cloud,
etc.
Platform-as-a-Service (PaaS)
DEVELOPERS • Dev tools, configuration management, deployment platforms.
• Examples Intel MashMaker, Google App Engine, Salesforce,
Azure, AWS, etc.
Software-as-a-Service (Saas)
END USERS /
CUSTOMERS • Software services to subscribers.
• Examples, Salesforce CRM, Google Docs/Drive, G-Suite,
WebEx, etc.
theartofhacking.org
NIST SP 800-145
https://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-145.pdf
theartofhacking.org
NIST SP 500-322
https://nvlpubs.nist.gov/nistpubs/SpecialPublications/NIST.SP.500-322.pdf
theartofhacking.org
Cloud Computing Reference Architecture
https://nvlpubs.nist.gov/nistpubs/SpecialPublications/NIST.SP.500-322.pdf theartofhacking.org
Hybrid Cloud
https://nvlpubs.nist.gov/nistpubs/SpecialPublications/NIST.SP.500-322.pdf theartofhacking.org
NIST SP 500-291 v2
https://www.nist.gov/sites/default/files/documents/itl/cloud/NIST_SP-500-291_Version-2_2013_June18_FINAL.pdf
theartofhacking.org
Cloud “Actors”
https://www.nist.gov/sites/default/files/documents/itl/cloud/NIST_SP-500-291_Version-2_2013_June18_FINAL.pdf theartofhacking.org
Cloud Service Orchestration
https://www.nist.gov/sites/default/files/documents/itl/cloud/NIST_SP-500-291_Version-2_2013_June18_FINAL.pdf theartofhacking.org
Technical Requirements
https://www.nist.gov/sites/default/files/documents/itl/cloud/NIST_SP-500-291_Version-2_2013_June18_FINAL.pdf theartofhacking.org
The Combined Conceptual Reference Diagram
theartofhacking.org
A broader perspective…
theartofhacking.org
Application Portability and Interoperability Is the Key
theartofhacking.org
Cloud Computing Threats
theartofhacking.org
Penetration • Different policies depending on the provider.
• Testing boundaries.
Testing in the • Some cloud providers allow for you to run
Cloud your tools from the cloud infrastructure itself.
theartofhacking.org
• Cloud Firewalls
Cloud Security • Cloud DLP
• Cloud Threat Intelligence
Services • Cloud Access Security Broker (CASB)
theartofhacking.org
https://cloudsecurityalliance.org
theartofhacking.org
Which of the following is a government-wide program
that provides a standardized approach to security
assessment, authorization, and continuous monitoring
for cloud products and services?
a) FedRAMP
b) NIST Cloud Architecture
c) Cloud Security Alliance
d) NIST Cloud Certification
theartofhacking.org
In NIST Cloud Computing Reference Architecture, which
of the following is the intermediary for providing
connectivity between the cloud and the subscriber?
a) Cloud Provider
b) Cloud Broker
c) Cloud Auditor
d) Cloud Carrier
theartofhacking.org
Which of the following are considered threats to cloud
computing?
a) Data Breaches
b) Abuse of Services
c) Insiders
d) Insecure Interfaces
e) A and B
f) A, B, C, and D
theartofhacking.org
An attacker sets up a VM on the same physical cloud
host as the target’s VM. He then takes advantage of
the shared physical resources to steal data. Which of
the following describes this attack?
a) VM Escape
b) Side Channel
c) VM Flood
d) Session Riding
e) Cloud Squatting
theartofhacking.org
Which of the following is used in a session-riding
attack?
theartofhacking.org
Thank you!
Don’t forget to check out your other resources:
theartofhacking.org