Module 1_EHDF
Module 1_EHDF
SE EXTC, SEM-IV
3
COURSE OUTCOMES: STUDENTS SHOULD BE ABLE TO
4
5
6
7
8
ETHICAL HACKING
9
IMPORTANT TERMINOLOGIES
DOS : Denial of services i.e. flooding host with sufficient network traffic so
that it will not respond
Port scanning: Searching for vulnerabilities
10
ACCESS POINTS FOR HACKER
Modify logs
to cover their tracks
Steal files
sometimes destroy after stealing.
An expert hacker would steal and cover their tracks to remain undetected.
Modify files
To let you know they were there
To cause mischief.
Install backdoors
So that they can get in again.
Attack other systems
12
WHAT IS LEGAL & ILLEGAL?
Do’s:
Laws changes according to implementation region
Don’ts:
Accessing any system without permission
13
SOME PROTOCOL VULNERABILITIES
15
SOME PROTOCOL VULNERABILITIES
Address Resolution Protocol (ARP):
ARP maps IP addresses to MAC addresses, which is essential for
routing network traffic.
There is no way that the host can validate where the network packet
came from in the peer to peer network. This is a vulnerability and gives rise
to ARP spoofing. The attacker can exploit this if the attacker is on the same
LAN as the target or uses a compromised machine that is on the same
network.
The idea is that the attacker associates his MAC address with
the IP address of the target so that any traffic meant for the target is
received by the attacker.
16
Domain Name System (DNS):
DNS is a hierarchical system that converts these IP addresses into a
human-readable hostname. The most common vulnerability in DNS is cache
poisoning. Here the attacker replaces the legitimate IP address to send
the target audience to malicious websites.
DNS amplification attack -is a type of Distributed Denial of Service (DDoS) attack that uses
DNS servers to overwhelm a target system with DNS response traffic. The goal is to make the
target system unavailable for legitimate users.
17
File Transfer Protocol/Secure (FTP/S):
Most common FTP attacks use Cross-Site scripting when the attacker
uses a web application to send malicious code, in the form of a browser-side
script (or cookies) to the user.
The remote File Transfer Protocol (FTP) does not control connections and
encrypt its data. The usernames along with passwords are transmitted in clear
text which can be intercepted by any network sniffer or can even result in a
man-in-the-middle attack (MITM).
Cross-site scripting (XSS) is a cyberattack that involves injecting malicious code into a trusted website
or application. The code is then executed on the user's browser, allowing the attacker to steal data or
impersonate the user.
A man-in-the-middle (MITM) attack is a cyberattack where a hacker intercepts communications between
two parties to steal or alter data. The attacker can then use this data for financial gain or disruption.
18
HyperText Transfer Protocol/Secure (HTTP/S):
Its main features include authentication of the website accessed and
then protecting the privacy and integrity of the data that is exchanged.
A major vulnerability in HTTPS is the Drown attack which helps attackers
to break the encryption, steal credit card info and passwords.
Another serious bug is the Heartbleed bug which allows stealing of the
information which is protected by the TLS/SSL encryption which is used to
secure the Internet.
DROWN- is a serious vulnerability that affects HTTPS and other services that rely on SSL and TLS.
DROWN allows attackers to break the encryption and read or steal sensitive communications,
including passwords, credit card numbers, trade secrets, or financial data.
Heartbleed bug- The Heartbleed bug allows anyone on the Internet to read the memory of the
systems (secrete key) protected by the vulnerable versions of the OpenSSL software. This allows
attackers to steal data directly from the services and users and to impersonate services and users.
TLS/SSL- Transport Layer security/Secure Socket layer provides communication security and
privacy over the Internet for applications such as web, email, instant messaging (IM) and some
virtual private networks (VPNs). 19
🞆 Internet Message Access Protocol (IMAP):
When an email is sent via the internet, it goes through
unprotected communication channels. Usernames, passwords,
and messages can be intercepted themselves.
A Denial of Service(DoS) attack can also be carried out on the
mail server which results in unreceived and unsent emails.
Also, the email server can be injected with malware, which in
turn can be sent to clients using infected attachments.
20
Post Office Protocol (POP3):
An application-layer Internet protocol is used to retrieve emails from the remote
server to the client’s personal local machine. It can be used to view messages even
when you’re offline.
Vulnerabilities that target mailbox storage comprise of a Firewire direct memory
access or DMA attack that relies on using direct hardware access to read or write
directly to the main memory without any operating system interaction or supervision.
Login processes allow the user to connect via unencrypted pathways resulting in login
credentials being sent across the network as clear text.
A Firewire direct memory access (DMA) attack is a cyberattack that allows an attacker to gain
access to a computer's memory through different ports like FireWire, Thunderbolt, USB 4.0, ExpressCard,
PC Card, and PCI/PCIe hardware interfaces.. DMA attacks are dangerous because they can bypass
security measures like encryption and password protection.
21
🞆 Simple Mail Transfer Protocol (SMTP):
It is a communication application layer protocol and is used to
send emails.
Spammers and hackers can use an e-mail server to send spam or
malware through email under the pretense of the unsuspecting
open- mail relay owner.
Open mail relay is a Simple Mail Transfer Protocol (SMTP) server configured in such a way
that it allows anyone on the Internet to send e-mail through it.
22
Simple Network Management Protocol (SNMP):
It is used for gathering and organizing information regarding managed
devices on the IP networks
The SNMP reflection is a kind of Distributed Denial of Service or DDoS attack. These
attacks can generate attack volumes of hundreds of gigabits per second that can be
directed at attack targets from various broadband networks. The adversary sends out
a huge number of SNMP queries with a forged IP address (that is the victim’s
IP) to multiple connected devices which, in turn, reply to that forged IP address.
24
STEPS FOR ETHICAL HACKING
1 Performing Reconnaissance
2 Scanning and enumeration
3 Gaining Access
4 Maintaining access and placing backdoor
5 governing tracks or clearing logs
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.
❖ He may do so by using a search engine like maltego, researching the target say a
website (checking links, jobs, job titles, email, news, etc.), or a tool like
HTTPTrack to download the entire website for later enumeration.
❖ The hacker is able to determine the following: Staff names, positions, and email
addresses.
2. Scanning:
❖ This phase includes the usage of tools like dialers, port scanners, network mappers, sweepers,
and vulnerability scanners to scan data.
❖ Hackers are now probably seeking any information that can help them perpetrate attacks
such as computer names, IP addresses, and user accounts.
❖ Now that the hacker has some basic information, the hacker now moves to the next phase and
begins to test the network for other avenues of attacks.
❖ The hacker decides to use a couple of methods for this end to help map the network (i.e. Kali
Linux, Maltego and find an email to contact to see what email server is being used).
❖ The hacker looks for an automated email if possible or based on the information gathered he may
decide to email HR with an inquiry about a job posting.
❖ Maltego is an open-source intelligence forensic application. Which will help you to get more accurate
information and in a smarter way.
3. Gaining Access:
❖ In this phase, the hacker designs the blueprint of the network of the target
with the help of data collected during Phase 1 and Phase 2.
❖ 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. In this case, the owned system is sometimes referred to as a zombie system.
❖ Now that the hacker has multiple e-mail accounts, the hacker begins to test the accounts on the
domain.
❖ The hacker from this point creates a new administrator account for themselves based on the
naming structure and tries and blends in.
❖ As a precaution, the hacker begins to look for and identify accounts that have not been used for a
long time.
❖ The hacker assumes that these accounts are likely either forgotten or not used so they change the
password and elevate privileges to an administrator as a secondary account in order to maintain
access to the network.
❖ The hacker may also send out emails to other users with an exploited file such as a PDF with a
reverse shell in order to extend their possible access.
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.
❖ Most of the time is spent on the Reconnaissance process. Time spend gets reduced in
upcoming phases.
Protect Yourself: What and what not to do?
•Do not post information on social media that can be related to challenging questions
•Be careful of password requests emails. Services like Heroku, Gmail, and others will not request to type in
passwords for additional promotion or service.
•Always see the background services that are running on your device and never rely on others’ devices.
•Be sure to have an antivirus installed and set root passwords for installation.
Information
Gathering
1. Web application scanners that test for and simulate known attack
patterns
2. Protocol scanners that search for vulnerable protocols, ports and
network services.
3. Network scanners that help visualize networks and discover warning
signals like stray IP addresses, spoofed packets and suspicious packet
generation from a single IP address.
•Regular Updates: Provides daily updates for vulnerability checks, known as Network
Vulnerability Tests (NVTs).
55
NESSUS: Enterprise vulnerability management software
▪ Password cracking
▪ Penetration testing
▪ Social engineering attacks
PASSWORD AUTHENTICATION & PASSWORD
CRACKING
Types of password:
i. Plain text password
ii. Password hashing
iii. Password hash salting
PASSWORD GUESSING ATTACKS
1. Random Guesses: A random password guess rarely succeeds unless it’s a
common password, or based on a dictionary word. Knowing information about the
target identity enhances the likelihood of a successful guess by a threat actor
2. Dictionary Attacks: An automated technique utilizing a list of words from
dictionary against a valid account to reveal the password
3. Brute Force: Utilize a programmatic method to try all possible combinations for
a password. This method is efficient for passwords that are short in string
4. Credential Stuffing: Stolen credentials are comprised of lists of usernames,
email addresses, and passwords
5. Password Spraying: A credential-based attack that attempts to access many
accounts by using a few common passwords
SOCIAL ENGINEERING & HUMAN-BASED ATTACKS
1. Phishing & Vishing: Often leveraged for information gathering for other attacks, as
well as to plant malicious software on an endpoint. This malware could be used to siphon
off passwords.
2. Forced Password Changes and Resets: Resetting a password is the act of a forced
password change by someone else, such as from the service desk or an application owner.
3. Eavesdropping: Password exposure occurring because of being overheard. Password
eavesdropping may be either inadvertent or intentional and can encompass both voice-
based and digital eavesdropping
4. Shoulder Surfing: To gain knowledge of credentials through observation. A threat
actor physically observes or uses an electronic device like a camera to collect passwords and
use them for an attack.
5. Passwords for Purchase: A rogue insider could sell credentials and claim they were
breached, giving them plausible deniability. This insider threat is of particularly concern
with privileged users, whose credentials could give access to the enterprise’s most sensitive
assets.
HASH-BASED ATTACKS ON PASSWORDS
1. Pass-the-Hash Attack(PtH): PtH are a type of attack that involves stealing hashed
credentials from one computer and using them to gain unauthorized access to other
computers on the network. The attackers does not need to crack the actual password,
but rather used stored hash value of the password to impersonate the legitimate users.
The password hash remains static for every session until the password itself changes.
However, changing the password frequently or using one-time passwords
(OTPs) is a good defense to keep the hash different between the sessions.
Types of Malware
❑ Viruses: A piece of code that inserts itself into an application and executes when the app is
run. Once inside a network, a virus may be used to steal sensitive data, launch DDoS attacks
or conduct ransomware attacks.
❑ Worms: It target vulnerabilities in operating systems to install themselves into networks.
They may gain access in several ways: through backdoors built into software, through
unintentional software vulnerabilities, or through flash drives.
❑ Spyware: It collects information about users’ activities without their knowledge or consent.
This can include passwords, PINs, payment information and unstructured messages.
❑ Trojan Horse: It disguises itself as desirable code or software. Once downloaded by
unsuspecting users, the Trojan can take control of victims’ systems for malicious purposes.
Trojans may hide in games, apps, or even software patches
❑ Logic bombs: A malicious program that is triggered when a logical condition is met, such
as after a number of transactions have been processed, or on a specific date. Malware such
as worms often contain logic bombs, behaving in one manner, then changing tactics on a
specific date and time.
❑ Ransomware: Software that uses encryption to disable a target’s access to its data until a
ransom is paid.
❑ Backdoors: A malware type that negates normal authentication procedures to access a
system. As a result, remote access is granted to resources within an application, such as
databases and file servers, giving perpetrators the ability to remotely issue system
commands and update malware.
❑ Rootkits: It is a software that gives malicious actors remote control of a victim’s computer
with full administrative privileges. Rootkits can be injected into applications, kernels,
hypervisors, or firmware. They spread through phishing, malicious attachments, malicious
downloads, and compromised shared drives.
❑ Key loggers: A type of spyware that monitors user activity. Keyloggers have legitimate
uses; businesses can use them to monitor employee activity and families may use them to
keep track of children’s online behaviors.