EH UNIT 1
EH UNIT 1
BY
MRS. SNEHA SHIRKAR
Textbook(s):
1) Certified Ethical Hacker Study Guide v9, Sean-Philip Oriyano, Sybex; Study Guide Edition,2016
2) CEH official Certified Ethical Hacking Review Guide, Wiley India Edition, 2007
Additional Reference(s):
1) Certified Ethical Hacker: Michael Gregg, Pearson Education,1st Edition, 2013
2) Certified Ethical Hacker: Matt Walker, TMH,2011
Unit 1 Chapter 1: Introduction
❖Terminology,
❖Hacking Technology Types,
❖Ethical Hacking Phases,
❖Hacktivism,
❖Hacker Classes,
❖Skills Required for an Ethical Hacker,
❖Vulnerability Research,
❖Ways to Conduct Ethical Hacking
What Is Security?
Information security, sometimes shortened
to InfoSec, is the practice of preventing
unauthorized access, use, disclosure, disruption,
modification, inspection, recording or destruction
of information.
The information or data may take any form, e.g.
electronic or physical.
Information security's primary focus is the balanced
protection of the confidentiality, integrity and
availability of data while maintaining a focus on
efficient policy implementation, all without
hampering organization productivity.
Key principles of information security
Terminology
❖Ethical Hacking:
❖To crack passwords or to steal data?
❖No, it is much more than that.
❖Ethical hacking is to scan vulnerabilities and to find potential
threats on a computer or network.
❖An ethical hacker finds the weak points or loopholes in a
computer, web application or network and reports them to the
organization
What is Hacking?
Cracking Password –
● Hackers will get your credentials through a technique known as key-logging.
Ethical Hacking Phases
1. Reconnaissance
❖ This is the first phase where the Hacker tries to collect information about
the target. It may include Identifying the Target, finding out the target’s IP
Address Range, Network, DNS records, etc.
❖ The hacker has finished enumerating and scanning the network and
now decides that they have some options to gain access to the
network.
4. Maintaining Access:
❖ Once a hacker has gained access, they want to keep that access for
future exploitation and attacks.
❖ Once the hacker owns the system, they can use it as a base to launch
additional attacks.
5. Clearing Tracks (so no one can reach them):
❖ Prior to the attack, the attacker would change their MAC address and run the
attacking machine through at least one VPN to help cover their identity.
❖ They will not deliver a direct attack or any scanning technique that would be
deemed “noisy”.
❖ Once access is gained and privileges have been escalated, the hacker seeks
to cover their tracks. This includes clearing out Sent emails, clearing server
logs, temp files, etc.
❖ The hacker will also look for indications of the email provider alerting the
user or possible unauthorized logins under their account.
Hacktivism
Who are “Anonymous”?
● There are many hacktivist groups worldwide, all working towards different,
through sometimes the same, goal of disrupting or exposing the inner
workings of government or private organizations in the name of transparency
and the public good
❖ While not all hacktivists have malicious intent, their attacks can have real-life
consequences.
❖ For example, personal information exposed by hacktivists may be
picked up by other bad actors to carry out cyberattacks.
❖ Not only that, but hacktivist attacks can expose sensitive information,
like where a person lives, which can be dangerous if found by the
wrong people.
❖ In some cases, hacktivists may use their skills to fight for a cause,
even if the outcome is malicious
1. Computer Networking Skills
● One of the most important skills to become an ethical hacker is
networking skills.
● The computer network is nothing but the interconnection of multiple
devices, generally termed as Hosts connected using multiple paths to
send/receive data or media.
● Understanding networks like DHCP, Supernetting, Subnetting, and
more will provide ethical hackers to explore the various
interconnected computers in a network and the potential security
threats that this might create, as well as how to handle those threats.
2. Computer Skills
● Computer skills are knowledge and ability which allow one to use
computers and related technology.
● Typically, basic computer skills include data processing, managing
computer files, and creating presentations.
● Advanced computer skills include managing databases, programming,
and running calculations in spreadsheets.
● Some of the most essential computer skills are MS Office,
Spreadsheets, Email, Database Management, Social Media, Web,
Enterprise systems, etc.
● An ethical hacker needs to be a computer systems expert.
3. Linux Skills
● Linux is a community of open-source Unix like operating systems that
are based on the Linux Kernel.
● It is a free and open-source operating system and the source code can
be modified and distributed to anyone commercially or non
commercially under the GNU General Public License.
● The main reason to learn Linux for an ethical hacker is, in terms of
security, Linux is more secure than any other operating system.
● It does not mean that Linux is 100 percent secure it has some
malware for it but is less vulnerable than any other operating system.
So, it does not require any anti-virus software.
4. Programming Skills
● Another most important skill to become an ethical hacker is
Programming Skills. So what does the word programming in the
computer world actually means?
● It means, “The act of writing code understood by a computational
device to perform various instructions.” So, to get better at
programming, one will be writing a lot of code!
● Before one writes code he/she must choose the best programming
language for his/her programming.
5. Basic Hardware Knowledge
● Computer hardware comprises the physical parts of a computer, like
the central processing unit (CPU), monitor, mouse, keyboard,
computer data storage, graphics card, sound card, speakers and
motherboard, etc.
● By contrast, the software is the set of instructions that can be stored
and run by hardware.
● For example, suppose one wants to hack a machine that is controlled
by a computer.
● First, he needs to know about the machine or how it works. Last, he
has to get access to the computer that controls the machine.
● Now, the machine will have a very good software security system;
however, hackers don’t care about hardware security, so he can play
with the hardware if he can access it.
● If one doesn’t know about hardware, then how will he/she know how
the motherboard works, how USBs to transfer data, or how CMOS or
BIOS work together, etc.?
● So one must have basic hardware knowledge also to become an
ethical hacker.
6. Reverse Engineering
● Reverse Engineering is a process of recovering the design,
requirement specifications, and functions of a product from an
analysis of its code.
● It builds a program database and generates information from this.
● The objective of reverse engineering is to expedite the maintenance
work by improving the understandability of a system and to produce
the necessary documents for a legacy system.
● In software security, reverse engineering is widely used to ensure that
the system lacks any major security flaws or vulnerabilities.
● It helps to make a system robust, thereby protecting it from hackers
and spyware.
● Some developers even go as far as hacking their system to identify
vulnerabilities – a system referred to as ethical hacking.
7. Cryptography Skills
● Cryptography is the study and application of techniques for reliable
communication in the presence of third parties called adversaries.
● It deals with developing and analyzing protocols that prevent
malicious third parties from retrieving information being shared
between two entities thereby following the various aspects of
information security.
● Cryptography deals with converting a normal text/message known as
plain text to a non-readable form known as ciphertext during the
transmission to make it incomprehensible to hackers
8. Database Skills
It falls in the preparatory pre-attack phase, where all the details regarding an
organization’s network architecture, application types, and physical location of
the target system are collected.
Post Footprinting, the hacker gets a better understanding and picture of the
location, where the desired information is stored, and how it can be accessed
What is Footprinting in Ethical
Hacking
❖ Footprinting in Ethical Hacking is basically the ethical and legal use of
Footprinting to safeguard the systems from hacking or any cyber attack.
❖ You can hack into the system to identify vulnerabilities, open ports of the system,
and many more.
❖ Knowing these reduce the chances of an attack, even though the threats always
exist.
Types of Footprinting
There are 2 types of Footprinting:
• Active Footprinting
• Passive Footprinting
Active Footprinting
When the hacker tries to perform footprinting by getting directly in touch with the
targeted system, it is known as Active Footprinting.
Passive Footprinting
On the other hand, when the attacker gathers information about the target system
through openly available sources, it is known as Passive Footprinting. There are many
such sources available on the internet from where hackers can get the necessary
information about the organizations or individuals.
❖ Information Gathering Methodology
There are two types of traditional methods of information gathering:
❖ Passive information gathering does not require direct interaction with the target
organization as compared to active information gathering.
❖ Passive information gathering, the client probes the target system for
information using the intermediate system
In passive information gathering, when we perform information gathering, we have
four intentions. These are as follows:
• We want to gather all the available information on the network about the target and
about the target actively or passively.
• We want to find the versions of web servers, platforms, operating systems, etc.
• We want to perform techniques like DNS fingerprinting, Whois lookup, other queries
related to network and organization.
• We want to identify vulnerabilities and exploits so that we can launch the attack.
Active Information Gathering
From figure 1 above, we can see that the current IP address is 93.184.216.34. The A
record only supports IPV4 addresses. Later in this post, we'll see how to point a
domain to an IPV6 address using another DNS record type.
Use of a record
The main use of A record is for IP address lookup. Using an A record, a web browser
is able to load a website using the domain name. As a result, we can access
websites on the internet without knowing their IP addresses.
Another use of A record is in the domain name system-based blackhole list (DNSBL).
Here, the A record is used to block mail from known spam sources.
❖ Traceroute in Footprinting
❖ E-Mail Tracking
Mail Transfer Agents
Unit 1 Chapter 3:Social Engineering
Common Types of Attacks
Social Engineering
❖ Social engineering is the term used for a broad range of malicious activities
accomplished through human interactions.
❖ Then, the attacker moves to gain the victim’s trust and provide stimuli
for subsequent actions that break security practices, such as revealing
sensitive information or granting access to critical resources.
❖ Traits of Social Engineering Attacks
❖ Fear
❖ Excitement
❖ Curiosity
❖ Anger
❖ Guilt
❖ Sadness
❖ Urgency:
Quid Pro Quo, "something for something" in Latin, involves a request for
information in exchange for a compensation.
● Example: the attacker asks the victim's password claiming to be a
researcher doing an experiment, in exchange for money.
Quid pro quo attacks are relatively easy to detect given the asymmetrical
value of the information compared to the compensation, which is opposite
for the attacker and the victim. In these cases the best countermeasure
remains the victim integrity and ability to identify, ignore and report.
Access Tailgating Attacks
❑ Whereas a single ping will tell whether one specified host computer exists on the network, a
ping sweep consists of ICMP (Internet Control Message Protocol) echo requests sent to
multiple hosts.
❑ To do this, the ping requires an address to send the echo request to, which can be an IP
address or a web server domain name.
Nmap Command Switches
❑ Nmap is probably the most famous reconnaissance tool among Pentesters and
Hacker.
❑ It is essentially a port scanner that helps you scan networks and identify
various ports and services available in the network, besides also providing
further information on targets, including reverse DNS names, operating system
guesses, device types, and MAC addresses
Nmap is Linux command-line tool for network exploration and security auditing.
This tool is generally used by hackers and cybersecurity enthusiasts and even by
network and system administrators. It is used for the following purposes:
• Real time information of a network
• Detailed information of all the IPs activated on your network
• Number of ports open in a network
• Provide the list of live hosts
• Port, OS and Host scanning
Working with Nmap Command
1. To scan a System with Hostname and IP address. First, Scan using Hostname
nmap www.geeksforgeeks.org
nmap -T4 for Timing
● SYN scanning involves the establishment of a half connection with the destined target.
● SYN scanning does not involve a full connection establishment, and thus it is also referred to as a
half-open scanning technique.
● SYN scanning attack involves the mechanism where an SYN packet is sent to an open
connection.
● There are two conditions that arrive at this mechanism.
● First, if the response/result from the computer or server is SYN-ACK, then it directly
indicates an open port in the connection.
● The client then unknowingly sent RST packet, and it makes the server believe that client
has not yet asked for the connection establishment and the port remains in the open
state.
● Second is the case when a server sends an RST packet from a destined port showing
that the port is closed and secured.
● In such cases, the hacker sends a huge volume of SYN packets then the server accepts
those packets but no communication or connection establishment between Client and
server takes place there.
An SYN Scanning is preferred by attackers because SYN scanning is generally adopted by hackers as it
is fast in execution and easy to cause harm to the computer/server using the SYN Scanning process.
Another advantage of SYN Scanning that hackers find is the speed with which open ports are detected.
To prevent SYN Scanning attacks, users/ organizations with computer systems should ensure the
following:
● Proper firewalls are set up in a computer network system which blocks suspicious calls to the
user setup.
● Proper security is present by ensuring that there is ‘No open ports’ present in the cyber network
setup that can be used by cyber attackers to breach the vulnerability of the system.
Stealth
What is a non-stealthy scan?
A TCP connection works through a three-way handshake, where a client and a server communicate in a
particular manner before establishing a connection. This communication happens in the following steps:
● The client sends a TCP packet to the server with the SYN flag set
● The server responds to the client with a TCP packet with the SYN and ACK flags set if it says a probed
port is open
● If the port is closed, the server will respond with a TCP packet with the RST flag set
● In case the port is open, the client will respond to the server with an ACK
The communication above is known as a three-way handshake and must happen before a TCP connection
can be established between a client and server.
❖ A non-stealthy scan will implement the TCP “connect()” method, which is enabled by
operating systems for connection to target hosts.
❖ This scan employs the three-way-handshake described above and will only respond with a
list of hosts with open ports as specified at the onset of the scan.
❖ This scan is easily detected, due to the numerous attempts by the scanner to establish a
connection to many ports on a target host over a short period of time.
❖ Also remember that login attempts which fail will most certainly be logged and can be
retrieved during a security audit.
What are stealthy network recon strategies?
In computer security and hacking, stealth is considered the ability to remain undetected within a
network as we perform activities, whether malicious or not.
These activities will often be counteractive to the defense mechanisms and may or may not be
authorized. We of course encourage you to ONLY run the commands here with authorization from
the network owners.
The two main perspectives here are:
● Identification of ports and services for defense: This will be true for the Blue Team
● Identification of ports and services for attacking: This will be true for the Red Team
There are a couple of stealth scans that can be executed. These include inverse mapping, half-open,
X-mas tree, UDP, null and more.
Stealth scans
❖ A stealth scan (sometimes known as a half open scan) is much like a
full open scan with a minor difference that makes it less suspicious on
the victim's device.
❖ The primary difference is that a full TCP three-way handshake does
not occur. Looking at the following diagram, the initiator (device A)
would send a TCP SYN packet to device B for the purpose of
determining whether a port is open.
❖ Device B will respond with a SYN/ACK packet to the initiator (device A)
if the port is open. Next, device A will send an RST to terminate the
connection.
❖ If the port is closed, device B will sent an RST packet:
Inverse mapping
★ This is one of the most effective stealth scans that can be performed within the
network.
★ The idea is to greatly reduce the speeds at which port scans take place.
★ The attacker introduces a delay that prevents host-based IDS or firewalls from
picking up excess attempts to connect to a TCP port.
★ Even though this scan has great success in achieving stealth, the major
disadvantage would be the amount of time that it takes to complete a scan.
★ The only way of detecting this scan is by analyzing traffic log files.
XMAS
★ It is used to identify listening ports on the targeted system.
★ The scan manipulates the URG, PSH and FIN flags of the TCP header.
★ This is also called as inverse TCP scanning.
★ This works by sending packets set with PSH, URG, FIN flags. The targets do not
respond if the ports are open and send a reset response if ports are closed.
NULL
nmap -s<scan_type> <target_host>
❖ Because the hacker is not using his own computer, thus the victim can
only block the zombie IP, not the hacker. Therefore, idle scan is a very
stealthy scan.
Packet 64 shows that 192.168.52.135 (zombie) send SYN frame to
the victim. however, actually the one who send this frame is the
source (192.168.52.136).
❖ Alternately, you can set your browser home page to point to an anonymizer, so
that every subsequent web access will be anonymized.
❖ Apart from this, you can choose to anonymously provide passwords and other
information to sites that request you, without revealing any other information,
such as your IP address.
❑ SNMP (Simple Network Management Protocol) is an application layer protocol that utilizes
the UDP protocol to manage routers, hubs, and switches on an IP network. SNMP is a widely
used protocol that is enabled on a wide range of operating systems, including Windows
Server, Linux servers, and network devices such as routers and switches.
❑ On a target system, SNMP enumeration is used to list user accounts, passwords, groups,
system names, and devices.
❖ Component:
❖ SNMP Enumeration is made up of three major parts: