Ethical Hacking Unit1,2
Ethical Hacking Unit1,2
Definition: The practice of using hacking techniques for defensive purposes, with
authorized permission, to identify vulnerabilities and weaknesses in computer
systems.
Goals:
Ethical hacking can also be used to provide valuable insights into the latest attack
techniques and trends. This information can be used to develop new security
measures and improve existing ones. Ethical hackers can also help to raise
awareness about the importance of cybersecurity and educate organizations and
individuals about how to protect themselves from cyberattacks.
Ethical Considerations:
Ethical hackers must adhere to a strict code of ethics. They must obtain written
authorization from the system owner before conducting any hacking activities. This
is essential to ensure that they have the legal right to access and test the system.
Ethical hackers must also respect privacy and confidentiality. They should only
access and collect information that is necessary for their investigation. They must
avoid causing damage or disruption to systems.
Ethical hackers should take care to minimize the impact of their activities on the
system and its users. Finally, ethical hackers must report vulnerabilities responsibly
to the system owner. They should provide detailed information about the
vulnerability and how it can be exploited. They should also offer recommendations
for remediation.
Hacking Laws
Ethical hackers must operate within the bounds of the law. They must ensure that
they have the necessary authorization to conduct their activities and that they are
not violating any laws. Failure to comply with the law can result in serious legal
consequences.
In addition to these federal laws, there may also be state and local laws that apply
to hacking activities. It is important for ethical hackers to be aware of the laws in
their jurisdiction and to ensure that they are complying with all applicable laws.
Techniques:
There are two main types of footprinting and reconnaissance: passive and active.
Passive Footprinting: Using search engines, social media, and other public sources.
Passive footprinting involves gathering information about a target system or
network from publicly available sources. This can include information about the
organization's website, social media profiles, employees, and other publicly
available information. For example, an ethical hacker might use a search engine to
find the organization's website and social media profiles. They might then analyze
this information to identify potential vulnerabilities, such as weak passwords or
outdated software
Active Footprinting: Using tools like ping scans, traceroute, and WHOIS to gather
network information. Active footprinting involves actively probing a target system or
network to gather information. This can include using tools like ping scans,
traceroute, and WHOIS to identify potential vulnerabilities and weaknesses. For
example, an ethical hacker might use a ping scan to identify the target system's IP
address. They might then use traceroute to map the network topology. This
information can be used to identify potential vulnerabilities, such as open ports or
misconfigured services.
DNS footprinting: This involves using DNS records to gather information about a
target system or network. For example, an ethical hacker might use DNS records
to identify the target system's IP address, domain name, and mail servers.
Whois lookup: This involves using the Whois database to gather information about
a target system or network's domain name. For example, an ethical hacker might
use Whois to find out the name and contact information of the organization that
owns the domain name.
Scanning is a critical step in the ethical hacking process that involves identifying
open ports, services, and vulnerabilities on a target system. It allows ethical
hackers to gain a deeper understanding of a system's security posture and identify
potential weaknesses that could be exploited by malicious actors.
Types of Scanning
There are several types of scanning that ethical hackers can perform:
The system hacking cycle is a framework that outlines the typical steps involved in
a hacking attack. It is often used by ethical hackers to understand and analyze the
techniques used by malicious actors. While the specific steps may vary depending
on the attacker's goals and the target system's configuration, the general cycle
typically includes the following phases:
● Phases:
o Planning: Gathering information and setting goals.
o Access: Gaining unauthorized access to the target system.
o Maintenance: Maintaining access and escalating privileges.
o Covering Tracks: Removing evidence of the attack.
● Ethical Hackers: Use this cycle to identify vulnerabilities and test security
measures.
Enumeration
Purpose: Gathering information about a target system's users, groups, and shares.
● User enumeration: Identifying user accounts on the target system. This can
be done using tools like Netcat, Nmap, or specialized enumeration tools.
● Group enumeration: Identifying groups on the target system. This can be
done using tools like Netcat, Nmap, or specialized enumeration tools.
● Share enumeration: Identifying shares on the target system. This can be
done using tools like Netcat, Nmap, or specialized enumeration tools.
● Service enumeration: Identifying services running on the target system. This
can be done using tools like Nmap or specialized enumeration tools.
● Techniques:
o NetBIOS Enumeration: Using tools like nbtscan.
o LDAP Enumeration: Using tools like ldapsearch.
o SMB Enumeration: Using tools like smbclient.
Cracking Passwords
Password cracking is the process of attempting to guess or brute force passwords
to gain unauthorized access to a system. Attackers often use password cracking
techniques to gain access to accounts with high-level privileges. Password
cracking can be a time-consuming process, especially for long and complex
passwords. However, attackers can use specialized tools and techniques to speed
up the process.
Trojans and backdoors are malicious programs that allow attackers to gain
unauthorized access to a system.
· Backdoors: Backdoors are hidden access points that allow attackers to bypass
normal security controls and gain unauthorized access to a system.
● Types of Trojans:
o Remote Access Trojans (RATs): Allow remote control of a system.
o Downloaders: Download and install other malware.
o Keyloggers: Record keystrokes.
o Rootkits: Hide malicious code within the operating system.
o Screen capturers: These Trojans capture screenshots of the victim's
screen.
Viruses, worms, and rootkits are other types of malicious code that can infect and
damage computer systems.
UNIT-2
Sniffers
Sniffers are network monitoring tools that capture and analyze network traffic.
They can be used for legitimate purposes, such as troubleshooting network
problems or monitoring network performance. However, they can also be used for
malicious purposes, such as eavesdropping on communications or stealing data.
Types of Sniffing
· Passive Sniffing is a non-invasive method of capturing network traffic. Passive
sniffers do not interfere with the network in any way. They simply listen to the
traffic and record it. This makes them ideal for legitimate purposes, such as
troubleshooting network problems or monitoring network performance. Passive
sniffers can also be used to detect malicious activity on the network.
Passive sniffing is less intrusive and more difficult to detect, but it may not be able
to capture all of the traffic on the network.
Active sniffing is more intrusive and easier to detect, but it can capture all of the
traffic on the network.
There are a number of different tools that can be used for sniffing. Some of the
most popular tools include Wireshark, tcpdump, and Kismet. These tools can be
used to capture and analyze network traffic in real time, or to save traffic for later
analysis.
Ethical Considerations
Phishing:
Phishing is a type of social engineering attack that attempts to trick individuals into
revealing sensitive information, such as passwords or credit card numbers.
Phishing attacks are often carried out through email, but they can also be
conducted through other channels, such as instant messaging or social media.
Methods of Phishing
Process of Phishing
DoS attacks are attacks that aim to disrupt or deny service to legitimate users of a
network or system. These attacks can be carried out by flooding a target with
excessive traffic or by exploiting vulnerabilities in the target system.
● Volume-based attacks: These attacks flood the target with excessive traffic,
overwhelming its resources. This can be done by sending a large number of
packets to the target, or by using specialized tools that can generate a high
volume of traffic.
For example, a simple flood attack involves sending a large number of SYN
packets to the target, which can exhaust its resources and prevent it from
responding to legitimate requests
● Resource-exhaustion attacks: These attacks consume the target's
resources, such as CPU or memory, making it unable to provide service. This
can be done by sending the target requests that require a lot of processing
power or memory, or by exploiting vulnerabilities in the target system that
allow an attacker to consume its resources.
For example, a ping flood attack involves sending a large number of ICMP
ping requests to the target, which can consume its CPU resources.
● Application-layer attacks: These attacks exploit vulnerabilities in specific
applications or protocols to disrupt service. This can be done by sending
crafted requests that exploit vulnerabilities in the target application, or by
sending requests that are designed to crash the application.
For example in a SQL injection attack , which involves injecting malicious
SQL code into a web application to gain unauthorized access to the
database.
Bots are automated programs that can be used to perform tasks on a network.
They can be benign or malicious, depending on their intended purpose. For
example, search engine bots are used to index websites, while malicious bots can
be used to launch attacks or spread spam.
1. Infection: Attackers infect computers with botnet malware. This can be done
through various means, such as email attachments, malicious websites, or
exploits.
2. Command and Control: Attackers establish a command and control (C&C)
infrastructure to communicate with the infected computers. This can be
done through various means, such as IRC channels, peer-to-peer networks,
or specialized C&C servers.
3. Task Allocation: Attackers assign tasks to the infected computers, such as
launching DoS attacks or sending spam. This can be done through the C&C
infrastructure.
4. Execution: The infected computers carry out the assigned tasks. This can
result in a variety of malicious activities, such as DoS attacks, spam
campaigns, and data theft.
Types of Vulnerabilities