Unit-4 Cryptography
Unit-4 Cryptography
Trojans Horses
Trojans and backdoors are types of malware used to infect and compromise
computer systems
A Trojan horse is a program with an overt effect and a covert effect.
An overt channel is the normal and legitimate way that programs communicate
within a computer system or network.
A covert channel uses programs or communications paths in ways that were not
intended.
Trojans can use covert channels to communicate. Some client Trojans use covert
channels to send instructions to the server component on the compromised system.
Trojan horses can make copies of themselves a propagating Trojan horse
Trojan horse hides in an independent program that performs a useful or appealing
function or appears to perform that function.
Along with the apparent function, however, the program performs some other
unauthorized operation
A typical Trojan horse tricks a user into running a program, often an attractive or
helpful one. When the unsuspecting user runs the program, it does indeed perform
the expected function.
But its real purpose is often to penetrate the defenses of the system by usurping the
user’s legitimate privileges and thus obtaining information that the penetrator isn’t
authorized to access.
An example of this would be the modern rootkit, which is a script that controls a
small suite of programs that create an administrative level account on the targeted
system, and then create a backdoor.
Backdoor is an unmonitored entrance way that evades the security mechanisms,
through which the attacker can later gain convenient access.
Backdoors
Backdoor is a program or a set of related programs that a hacker installs on a target
system to allow access to the system at a later time.
A backdoor can be embedded in a malicious Trojan.
The objective of installing a backdoor on a system is to give hackers access into the
system at a time of their choosing.
The key is that the hacker knows how to get into the backdoor undetected and is
able to use it to hack the system further and look for important information.
TYPES OF TROJANS:
1.Remote Access Trojans -
A remote access Trojan (RAT) is a malware program that opens a backdoor, enabling
administrative control over the victim’s computer. RATs are typically downloaded together
with a seemingly legitimate program, like a game, or are sent to the target as an email
attachment. Once the attacker compromises the host’s system, they can use it to distribute
RATs to additional vulnerable computers, establishing a botnet.
RAT can be deployed as a malicious payload using exploit toolkits such as Metasploit. After a
successful installation, RAT achieves direct connectivity to the command-and-control (C&C)
server, controlled by the attackers. The attackers accomplish this using the predefined
open TCP port on the compromised device.
Because RAT provides administrative control, the attacker can do almost anything on the
victim’s computer, for example:
Monitor user behavior via spyware or keyloggers
Access sensitive details, including social security numbers and credit card
Activate a system’s recording video and webcam
Take screenshots
Distribute malware and viruses
Format drives
Download, alter, or delete files and file systems
3. Destructive Trojans –
A destructive Trojan is a virus designed to destroy or delete files. Destructive Trojans have
more typical virus characteristics than other types of Trojans but do not always result in
data theft.
Destructive Trojans may not be detected by antivirus software. Once a destructive Trojan
infects a computer system, it randomly deletes files, folders, and registry entries, often
resulting in OS failures. A destructive Trojan is usually in program form or manipulated to
strike like a logic bomb programmed and specified by the attacker.
Destructive Trojans are viruses, but they do not self-replicate like other viruses or worms.
Destructive Trojans are written as simple crude batch files with commands like "DEL,"
"DELTREE" or "FORMAT." This code is usually compiled as ".exe" or ".com" files, such as
BAT2COM. Thus, it is difficult to determine if a computer system infection is caused by a
destructive Trojan.
Computing platforms that are susceptible to destructive Trojans include:
Windows: Commonly attacked platform
Linux: Increased attacks have been reported.
Apple firmware has been attacked by destructive compiled AppleScript Trojans that invade
privacy and compromise security. Additionally, personal digital assistants (PDA) reportedly
have been attacked by destructive and data-stealing Trojans.
Certain tools help prevent destructive Trojans, including rollback software, antivirus
software and anti-Trojan software.
4. Proxy Trojans –
A proxy Trojan is a virus which hijacks and turns the host computer into a proxy
server, part of a botnet, from which an attacker can stage anonymous activities
and attacks.
The whole point of a proxy Trojan is to hide the attacker, making it harder to
trace the true origin of an attack since the attacks will look like they are coming
from random and multiple directions because of the proxy bots.
A proxy Trojan, as the name suggests, is a kind of Trojan malware which
creates proxy servers out of infected computers for staging anonymous
attacks.
Like all Trojans, the proxy is spread disguised as legitimate software downloads
and attachments or piggy-backing on legitimate downloads and attachments.
This Trojan gives the attacker a lot of opportunity to do malicious activities
such as credit card fraud, hacking and other illegal activities since it masks the
true location of the attacker.
Aside from that, it can collect information from the host computer and send it
to the attacker.
5. FTP Trojans –
An FTP Trojan is a special type of Trojan allowing the attacker to access a machine using the
FTP Protocol.
Generally, a Trojan is a type of virus entering a system in an undetected manner and
accessing all confidential data, thereby causing trouble by compromising or exposing data.
One of the ways a Trojan can manifest itself is in the form of a genuine program performing
malicious functions.
An FTP Trojan installs an FTP server on the victim’s machine allowing the attacker to gain
access to sensitive data through the FTP Protocol. The Trojan opens port 21 and makes it
accessible to the attacker or a group of individuals. Some password attacks can also be
employed where only the attacker gains access to the system. The system tries to download
and upload files from the victim system.
The types of information affected include:
Credit card information
All types of username and password information
Confidential data
Email addresses to propagate
Using the victim’s computer as a source for propagating other attacks
Sr.No Basis of
. Comparison WORMS VIRUS
Detection
and Worms can be detected and removed by Antivirus software is used for
5. Protection the Antivirus and firewall. protection against viruses.
Installation of Antivirus
software
Never open email
attachments
Keep your operating system and
Avoid usage of pirated
system in updated state
software
Avoid clicking on links from
Keep your operating
untrusted or unknown websites
system updated
Avoid opening emails from
Keep your browser
unknown sources
updated as old versions
Use antivirus software and a are vulnerable to linking
10. Prevention firewall to malicious websites
SNIFFING -
Sniffing is the process of monitoring and capturing all the packets passing through a given
network using sniffing tools. It is a form of “tapping phone wires” and get to know about the
conversation. It is also called wiretapping applied to the computer networks.
There is so much possibility that if a set of enterprise switch ports is open, then one of their
employees can sniff the whole traffic of the network. Anyone in the same physical location
can plug into the network using Ethernet cable or connect wirelessly to that network and
sniff the total traffic.
In other words, Sniffing allows you to see all sorts of traffic, both protected and
unprotected. In the right conditions and with the right protocols in place, an attacking party
may be able to gather information that can be used for further attacks or to cause other
issues for the network or system owner.
What can be sniffed?
One can sniff the following sensitive information from a network −
Email traffic
FTP passwords
Web traffics
Telnet passwords
Router configuration
Chat sessions
DNS traffic
How it works
A sniffer normally turns the NIC of the system to the promiscuous mode so that it listens to
all the data transmitted on its segment.
Promiscuous mode refers to the unique way of Ethernet hardware, in particular, network
interface cards (NICs), that allows an NIC to receive all traffic on the network, even if it is not
addressed to this NIC. By default, a NIC ignores all traffic that is not addressed to it, which is
done by comparing the destination address of the Ethernet packet with the hardware
address (a.k.a. MAC) of the device. While this makes perfect sense for networking, non-
promiscuous mode makes it difficult to use network monitoring and analysis software for
diagnosing connectivity issues or traffic accounting.
A sniffer can continuously monitor all the traffic to a computer through the NIC by decoding
the information encapsulated in the data packets.
Types of Sniffing
Sniffing can be either Active or Passive in nature.
Passive Sniffing - In passive sniffing, the traffic is locked but it is not altered in any way.
Passive sniffing allows listening only. It works with Hub devices. On a hub device, the traffic
is sent to all the ports. In a network that uses hubs to connect systems, all hosts on the
network can see the traffic. Therefore, an attacker can easily capture traffic going through.
Active Sniffing - In active sniffing, the traffic is not only locked and monitored, but it may
also be altered in some way as determined by the attack. Active sniffing is used to sniff a
switch-based network. It involves injecting address resolution packets (ARP) into a target
network to flood on the switch content addressable memory (CAM) table. CAM keeps track
of which host is connected to which port.
PHISING – Phishing is a fraud technique where a malicious actor sends messages
impersonating a legitimate individual or organization, usually via email or other messaging
system. Many cyber attackers distribute malicious attachments and links through phishing
emails to trick unsuspecting users into downloading malware.
In most phishing attacks, attackers extract sensitive information from the victim, such as
user credentials and account details. Exploiting human weaknesses to bypass security
controls is often easier than breaking through digital defenses. Many people easily mistake
phishing emails for legitimate messages.
Vishing, which is short for "voice phishing," is when someone uses the phone to try
to steal information. The attacker may pretend to be a trusted friend or relative or to
represent them.
Example of Vishing- In 2019, there was a vishing campaign that targeted members of the
UK’s parliament and their staffers. The attack was part of an assault that involved at least 21
million spam emails targeting UK lawmakers.
Email Phishing- In an email phishing scam, the attacker sends an email that looks
legitimate, designed to trick the recipient into entering information in reply or on a
site that the hacker can use to steal or sell their data.
Example of Email Phishing- Hackers used LinkedIn to grab contact information from
employees at Sony and targeted them with an email phishing campaign. They got away with
over 100 terabytes of data.
An HTTPS phishing attack is carried out by sending the victim an email with a link to
a fake website. The site may then be used to fool the victim into entering their
private information.
Example of HTTPS Phishing- Hacker group Scarlet Widow searches for the employee emails
of companies and then targets them with HTTPS phishing. When the user gets a mostly
empty email, they click on the little link that is there, taking the first step into Scarlet
Widow's web.
Pop-up phishing often uses a pop-up about a problem with your computer’s security
or some other issue to trick you into clicking. You are then directed to download a
file, which ends up being malware, or to call what is supposed to be a support
center.
Example of Pop-up Phishing- Users have sometimes received pop-ups saying they can
qualify for AppleCare renewal, which would supposedly avail them of extended protection
for their Apple devices. However, the offer is fake.
Whaling- A whaling attack is a phishing attack that targets a senior executive. These
individuals often have deep access to sensitive areas of the network, so a successful
attack can result in access to valuable info.
Example of Whaling- A founder of Levitas, an Australian hedge fund was the target of a
whaling attack that led the individual to a fake connection using a fraudulent Zoom link.
After following the link, they had malware installed on their system, and the company lost
$800.000.
Clone Phishing- A clone phishing attack involves a hacker making an identical copy of
a message the recipient already received. They may include something like
“resending this” and put a malicious link in the email.
Example of Clone Phishing- In a recent attack, a hacker copied the information from a
previous email and used the same name as a legitimate contact that had messaged the
victim about a deal. The hacker pretended to be a CEO named Giles Garcia and referenced
the email Mr. Garcia had previously sent. The hacker then proceeded to pretend to carry on
the previous conversation with the target, as if they really were Giles Garcia.
Image phishing uses images with malicious files in them meant to help a hacker steal
your account info or infect your computer.
Example of Image Phishing- Hackers have made use of AdGholas to hide malicious code
written in JavaScript inside images and HTML files. When someone clicked on an image
generated by AdGholas, malware would be downloaded onto their computer that could be
used to phish for their personal information
Search Engine Phishing- A search engine phishing attack involves an attacker making
fake products that look attractive. When these pop up in a search engine, the target
is asked to enter sensitive information before purchasing, which then goes to a
hacker.
Example of Search Engine Phishing- In 2020, Google said that they found 25 billion spam
pages every day, like the one put up by hackers pretending to be from the travel company
Booking.com. An ad would pop up in users’ search results that looked like it was from
booking.com and included the site’s address and the kind of wording users would expect
from a real ad by the company. After users clicked, they were prompted to enter sensitive
login information that was then transmitted to hackers.
Website Spoofing- With website spoofing, a hacker creates a fake website that looks
legitimate. When you use the site to log in to an account, your info is collected by
the attacker.
Example of Website Spoofing- Hackers made a fake Amazon website that looked nearly
identical to the real Amazon.com but had a different Uniform Resource Locator (URL). All
other details, including fonts and images, looked legitimate. Attackers were hoping that
users would put in their username and password.
government, or someone you know ( like your friends, relatives, boss, neighbors, colleagues, vendors,
etc.). Hackers try to sound as genuine as possible. They attach malware in email attachments such as
PDF files, Microsoft Office files, folders, images, etc. When you download such an attachment, the
CROSS-SITE SCRIPTING
Cross-site scripting (also known as XSS) is a web security vulnerability that allows an attacker
to compromise the interactions that users have with a vulnerable application. It allows an
attacker to circumvent the same origin policy, which is designed to segregate different
websites from each other. Cross-site scripting vulnerabilities normally allow an attacker to
masquerade as a victim user, to carry out any actions that the user is able to perform, and
to access any of the user's data. If the victim user has privileged access within the
application, then the attacker might be able to gain full control over all of the application's
functionality and data.
WORKING- Cross-site scripting works by manipulating a vulnerable web site so that it
returns malicious JavaScript to users. When the malicious code executes inside a victim's
browser, the attacker can fully compromise their interaction with the application.
There are three main types of XSS attacks. These are:
Reflected XSS, where the malicious script comes from the current HTTP request.
Stored XSS, where the malicious script comes from the website's database.
DOM-based XSS, where the vulnerability exists in client-side code rather than server-
side code.
Distributed Network Attacks are often referred to as Distributed Denial of Service (DDoS)
attacks. This type of attack takes advantage of the specific capacity limits that apply to any
network resources – such as the infrastructure that enables a company’s website. The DDoS
attack will send multiple requests to the attacked web resource – with the aim of exceeding
the website’s capacity to handle multiple requests… and prevent the website from
functioning correctly.
Typical targets for DDoS attacks include:
Internet shopping sites
Online casinos
Any business or organisation that depends on providing online services
How a DDoS attack works
Network resources – such as web servers – have a finite limit to the number of requests that
they can service simultaneously. In addition to the capacity limit of the server, the channel
that connects the server to the Internet will also have a finite bandwidth / capacity.
Whenever the number of requests exceeds the capacity limits of any component of the
infrastructure, the level of service is likely to suffer in one of the following ways:
The response to requests will be much slower than normal.
Some – or all – users’ requests may be totally ignored.
Usually, the attacker’s ultimate aim is the total prevention of the web resource’s normal
functioning – a total ‘denial of service’. The attacker may also request payment for stopping
the attack. In some cases, a DDoS attack may even be an attempt to discredit or damage a
competitor’s business.
SMURF ATTACK
A Smurf attack is a distributed denial-of-service (DDoS) attack in which an attacker floods a
victim’s server with spoofed Internet Protocol (IP) and Internet Control Message Protocol
(ICMP) packets. As a result, the target’s system is rendered inoperable. This type of attack
gets its name from a DDoS. Smurf malware tool that was widely used in the 1990s. The small
ICMP packet generated by the malware tool can cause significant damage to a victim’s
system, hence the name Smurf.
How Does a Smurf Attack Work?
Smurf attacks are similar to a form of denial-of-service (DoS) attacks called ping floods, since
they’re accomplished by flooding a victim’s computer with ICMP Echo Requests. The steps in
a Smurf attack are as follows:
1. Attacker locates the target’s IP address: An attacker identifies the target victim’s IP
address.
2. Attacker creates spoofed data packet: Smurf malware is used to create a spoofed
data packet, or ICMP Echo Request, that has its source address set to the real IP
address of the victim.
3. Attacker sends ICMP Echo Requests: The attacker deploys ICMP Echo Requests to
the victim’s network, causing all connected devices within the network to respond to
the ping via ICMP Echo Reply packets.
4. Victim is flooded with ICMP replies: The victim then receives a flood of ICMP Echo
Reply packets, resulting in a denial-of-service to legitimate traffic.
5. Victim’s server becomes overloaded: With enough ICMP Reply packets forwarded,
the victim’s server is overloaded and potentially rendered inoperable.
Buffer Overflow Attack - A buffer is a temporary area for data storage. When more data
(than was originally allocated to be stored) gets placed by a program or system process, the
extra data overflows. It causes some of that data to leak out into other buffers, which can
corrupt or overwrite whatever data they were holding.
In a buffer-overflow attack, the extra data sometimes holds specific instructions for actions
intended by a hacker or malicious user; for example, the data could trigger a response that
damages files, changes data or unveils private information.
Attacker would use a buffer-overflow exploit to take advantage of a program that is waiting
on a user’s input. There are two types of buffer overflows: stack-based and heap-based.
Heap-based, which are difficult to execute and the least common of the two, attack an
application by flooding the memory space reserved for a program. Stack-based buffer
overflows, which are more common among attackers, exploit applications and programs by
using what is known as a stack memory space used to store user input.
TEARDROP ATTACK
A teardrop attack is a type of denial-of-service (DoS) attack (an attack that attempts to make
a computer resource unavailable by flooding a network or server with requests and data.)
The attacker sends fragmented packets to the target server, and in some cases where
there’s a TCP/IP vulnerability, the server is unable to reassemble the packet, causing
overload.
TCP/IP implementations differ slightly from platform to platform. Some operating systems—
especially older versions of Windows and Linux— contain a TCP/IP fragmentation
reassembly bug. Teardrop attacks are designed to exploit this weakness. In a teardrop
attack, the client sends an intentionally fragmented information packet to a target device.
Since the packets overlap, an error occurs when the device tries to reassemble the packet.
The attack takes advantage of that error to cause a fatal crash in the operating system or
application that handles the packet.
In the SYN flooding attack, the hacker, pretending as a client, sends the TCP SYN connection
requests at a higher rate than the victim machine can process. It is a kind of resource
exhausting DoS attack. The hackers can do the SYN flood attack in three different ways:
1. Direct SYN Flood Attack
In this method, the hacker initiates the attack using his own IP address. He sends multiple
SYN requests to the server. However, when the server responds with SYN-ACK, as an
acknowledgment, he doesn’t respond with ACK but keeps sending the new SYN request to
the victim server.
While the server waits for ACK, the arrival of SYN packets preserves the Server resources
with a half-open connection session for a certain time, which eventually makes the server
unable to operate normally and deny the requests from the legitimate client.
In this direct attack method, to ensure the SYN/ACK packets are ignored, the hacker
configures the firewall accordingly or restricts the traffic to outgoing SYN requests. Since the
hackers use their own IP addresses, the attackers are more vulnerable to detect. This attack
is rarely used.
2. SYN Spoofed Attack
As an alternative to avoid being detected, the malicious attack sends the SYN packets from
spoofed/forged IP addresses. Upon receiving the SYN request, the server sends the SYN-ACK
to the forged IP address and waits for a response. Since the spoofed source didn’t send the
packets, they don’t respond.
For this kind of SYN flood attack, the attackers choose the IP addresses, which are not in use,
which ensures the system never responds back to the SYN-ACK response.
3. DDoS (Distributed Denial of Service) SYN attack
In this variant of SYN flood attack, the victim server receives SYN packets simultaneously
from several infected computers under the control of the attacker. This combination of
hijacked machines is called a botnet.
SESSION HIJACKING
Session hijacking is a technique used by hackers to gain access to a target’s computer or
online accounts. In a session hijacking attack, a hacker takes control of a user’s browsing
session to gain access to their personal information and passwords. This article will explain
what session hijacking is, how it works, and how to prevent it from happening.
How Does Session Hijacking Work?
A session hijacker can take control of a user’s session in several ways. One common method
is to use a packet sniffer to intercept the communication between the user and the server,
which allows the hacker to see what information is being sent and received. They can then
use this information to log in to the account or access sensitive data.
Session hijacking can also be performed by deploying malware to infect the user’s
computer. This gives the hacker direct access to the machine, enabling them to then hijack
any active sessions.
SPOOFING VS HIJACKING
In spoofing hackers’ main goal is to win the trust of the target (Victim) by convincing him
that they are interacting with a trusted source. After winning trust, hackers can easily enter
the target system, spread the malicious code of the malware, and steal useful information
such as passwords, PINs, etc., that the target stores in the system. In spoofing, the hacker’s
main objective is to psychologically manipulate the target and win their trust. For example,
hackers create a clone of a banking website that completely appears to be legal but when
the target enters sensitive information then the whole information is sent to the hacker,
which the hacker can use for their own benefit or for other purposes.
In Hijacking, a hacker can take complete control of a target computer system or hijack a
network connection. Once hijacked, the hacker can take control of the target user’s
computer system and even easily read and modify the transmitted data or messages. In
hijacking, the main goal of a hacker is to take control of a target computer system or
network connection to steal information without getting known to the target that they are
getting hacked or hijacked. For example, hackers take all the control of the target Computer
System and use its camera to gather sensitive information and spy.
Topics to
Discuss Spoofing Hijacking
TCP/IP Hijacking:
TCP/IP hijacking is a man-in-the-middle network attack. This is a network attack where an
authorized user can gain access to another user’s or client’s authorized network connection.
After hijacking a TCP/IP session, an attacker is able to easily read and modify the transferred
packets and the hacker is also able to send its own requests to the user. For TCP/IP
hijacking, attackers use DOS attacks and IP spoofing.
TCP/IP Hijacking Process:
The first major goal of an attacker is to obtain the IPs of two devices that communicate
using the same network or connection. To do this, the attacker monitors the data
transmission on the network until the IP of the device is obtained.
After successfully grabbing the user IP. Hackers can easily attack the connection.
In order to gain access to the connection, the hacker put down the connection of another
user through a DOS attack, and the user’s connection waits for reconnection.
By spoofing the disconnected user’s IP, hackers can easily restore communication.
CAPTCHA
CAPTCHA (Completely Automated Public Turing test to tell Computers and Humans Apart) is
a type of security measure known as challenge-response authentication. CAPTCHA helps
protect you from spam and password decryption by asking you to complete a simple test
that proves you are human and not a computer trying to break into a password protected
account.
A CAPTCHA test is made up of two simple parts: a randomly generated sequence of letters
and/or numbers that appear as a distorted image, and a text box. To pass a the test and
prove your human identity, simply type the characters you see in the image into the text
box.
Working of Captcha :
Quite simply, CAPTCHA works by asking end users to perform some task that a
software bot cannot do. If the user can do the task correctly, it provides authentication to
the service that the user is a human being and not a spambot and allows the user to
continue.
Tests often involve JPEG or GIF images because while bots can identify the existence of an
image by reading source code, they cannot tell what the image depicts.
Because some CAPTCHA images are difficult to interpret, human users are usually given the
option to request a new CAPTCHA test.