Ethical Hacking
Ethical Hacking
Ethical Hacking
● System admins are unable to verify the data is as the sender intended it. A bit-flipping
attack is an attack on a cryptographic cipher: the attacker changes the cipher text in such a
way as to result in a predictable change of the plain text, although the attacker doesn’t
learn the plain text itself.
● This type of attack isn’t directed against the cipher but against a message or series of
messages. In the extreme, this can become a DoS attack against all messages on a particular
channel using that cipher. The attack is especially dangerous when the attacker knows
the format of the message.
● When bit-flipping attack is applied to digital signatures attacker may be able to change a
promissory note stating “I owe you $10.00” into one stating “I owe you $10,000.”
GOALS ATTACKERS TRY TO ACHIEVE…
● MAC address spoofing :
● is an authentication attack because it allows an unauthorized
device to connect to the network when Media Access Control (MAC) filtering is in place,
such as on a wireless network.
● By spoofing the MAC address of a legitimate wireless station, an intruder can take on that
station’s identity and use the network.
ETHICAL HACKERS SKILL SET
● knowledgeable about computer programming, networking, and operating systems.
● In-depth knowledge about highly targeted platforms (such as Windows, Unix, and Linux) is also
a requirement.
● Patience, persistence, and immense perseverance are important qualities for ethical
hackers because of the length of time and level of concentration required for most attacks
to pay off.
● Networking, web programming, and database skills are all useful in performing ethical
hacking and vulnerability testing.
● an ethical hacker will act as part of a “tiger team” who has been hired to test network and
computer systems and find vulnerabilities.
● In this case, each member of the team will have distinct specialties, and the ethical hacker may
need more specialized skills in one area of computer systems and networking. Most ethical
hackers are knowledgeable about security areas and related issues but don’t necessarily have a
strong command of the countermeasures that can prevent attacks.
ETHICAL HACKING TERMINOLOGY
● Threat:
An environment or situation that could lead to a potential breach of security.
Ethical hackers look for and prioritize threats when performing a security analysis.
Malicious hackers and their use of software and hacking techniques are themselves threats to
an organization’s information security.
● Exploit:
A piece of software or technology that takes advantage of a bug, glitch, or vulnerability,
leading to unauthorized access, privilege escalation, or denial of service on a
computer system.
Malicious hackers are looking for exploits in computer systems to open the door to an initial
attack.
Most exploits are small strings of computer code that, when executed on a system, expose
vulnerability.
Experienced hackers create their own exploits, but it is not necessary to have any programming
skills to be an ethical hacker as many
hacking software programs have ready-made exploits that can be launched against a
computer system or network. An exploit is a defined way to breach the security of an IT system
through a vulnerability.
ETHICAL HACKING TERMINOLOGY
● Vulnerability:
The existence of a software flaw, logic design, or implementation error that can lead to an
unexpected and undesirable event executing bad or damaging instructions to the system.
● Exploit code is written to target a vulnerability and cause a fault in the system in order to
retrieve valuable data.
ETHICAL HACKING TERMINOLOGY
● Target of Evaluation:
Target of Evaluation (TOE) A system, program, or network that is the subject of a
security analysis or attack.
Ethical hackers are usually concerned with high-value TOEs,systems that contain sensitive
information such as account numbers, passwords, Social Security numbers, or other confidential
data. It is the goal of the ethical hacker to test hacking tools against the high-value TOEs to
determine the vulnerabilities and patch them to protect against exploits and exposure of
sensitive data.
● Attack:
An attack occurs when a system is compromised based on a vulnerability. Many
attacks are perpetuated via an exploit. Ethical hackers use tools to find systems that may be
vulnerable to an exploit because of the operating system, network configuration, or applications
installed on the systems, and to prevent an attack.
ETHICAL HACKING TERMINOLOGY
● Remote : The exploit is sent over a network and exploits security vulnerabilities
without any prior access to the vulnerable system. Hacking attacks against corporate computer
systems or networks initiated from the outside world are considered remote. Most people
think of this type of attack when they hear the term hacker, but in reality most attacks are
in the next category..
● Local : The exploit is delivered directly to the computer system or network, which
requires prior access to the vulnerable system to increase privileges.
● Information security policies should be created in such a way that only those who need access to
information should be allowed access and they should have the lowest level of access to
perform their job function.
● These concepts are commonly referred as “need to know” and “least privilege” and, when
used properly, would prevent local exploits.
● Most hacking attempts occur from within an organization and are perpetuated by
employees, contractors, or others in a trusted position.
● In order for an insider to launch an attack, they must have higher privileges than necessary
based on the concept of “need to know.” This can be accomplished by privilege escalation
or weak security safeguards.
PHASES IN ETHICAL HACKING
● Ethical Hacker follows the similar steps as a malicious hacker.
● The steps to gain main entry in computing system are similar to those of malicious
hackers.
Reconnaissance
•Passive, Active
•Information gathering
•Social Engineering
•Dumpster diving
•Sniffing n/w
•TOE
•Web server and OS version
company is using
•Active-rattling the door knobs
2. SCANNING
● It involves taking the info collected during reconnaissance and use it to examine the
network.
Tools employed
•Dialers, Port Scanners, ICMP Scanners,
•Ping Sweeps
•Network Mappers
•Vulnerability Scanners
Hackers are seeking any information that can help them
perpetrate an attack on a target such as the following:
Computer names,(OS),Installed software, IP addresses
User accounts
3. GAINING ACCESS
● The real hacking takes place.
The hacking attack can be delivered to the target system via a local area
network (LAN), either wired or wireless; local access to a PC; the
Internet; or offline.
Examples include stackbased buffer overflows, denial of service, and
session hijacking.
Gaining access is known in the hacker world as owning the system
because once a system has been hacked, the hacker has control and can
use that system as they wish.
3. MAINTAINING ACCESS
Once a hacker has gained access to a target system, they want to keep that access for
future exploitation and attacks.
Sometimes, hackers harden the system from other hackers orsecurity personnel by
securing their exclusive access with backdoors, rootkits, and Trojans.
Once the hacker owns the system, they can use it as a base to launch additional attacks.
In this case, the owned system is sometimes referred to as a zombie system.
5. COVERING TRACKS
they cover their tracks to avoid detection by security personnel, to continue to use
the owned system, to remove evidence of hacking, or to avoid legal action.
Hackers try to remove all traces of the attack,
such as log files or intrusion detection system (IDS) alarms.
Examples of activities during this phase of the attack include
Steganography
Using a tunneling protocol
Altering log files
IDENTIFYING THE TYPE OF HACKING
TECHNOLOGIES
● Many tools exist to find the vulnerabilities, running exploits and compromising the system.
● Once vulnerability is found-trojans, malwares, backdoors, exploits
● Buffer overflows and SQL injection are the other methods to gain access to the system.-
application servers that contain databases of information
● Areas where weakness can be exploited:
○ Operating system: many admins install with default settings- vulnerabilities
unpatched
○ Applications: Not tested to vulnerabilities while writing code,; feature driven-
develop robust applications in short time-deadlines..
○ Shrink-Wrap code: off the shelf programs come with extra features that common user
is unaware of- can be used to exploit the system. Macros in MS Word
Mis configurations: Systems can also be misconfigured or left at the lowest common
security settings to increase ease of use for the user; this may result in vulnerability and
an attack.
IDENTIFYING THE TYPE OF ETHICAL
●
HACKS
In the initial discussion with the client, one of the questions that should be asked is
whether there are any specific areas of concern, such as wireless networks or
social engineering.
● This enables the ethical hacker to customize the test to be performed to the
needs of the client.
● Otherwise, security audits should include attempts to access data from all of the
following methods..
● Remote Network
● Remote Dial up Network
● Local Network
● Stolen Equipment
● Social Engineering
● Physical Entry
REMOTE NETWORK
● Remote Network A remote network hack attempts to simulate an intruder
launching an attack over the Internet.
● The ethical hacker tries to break or find vulnerability in the outside defenses of the
network, such as firewall, proxy, or router vulnerabilities.
● War dialing is the process of repetitive dialing to find an open system and is an
example of such an attack.
● The ethical hacker must gain direct access to the local network in order to
launch this type of attack.
● Wireless LANs (WLANs) fall in this category and have added an entirely new
avenue of attack as radio waves travel through building structures.
● Because the WLAN signal can be identified and captured outside the
building, hackers no longer have to gain physical access to the building and
network to perform an attack on the LAN.
● Additionally, the huge growth of WLANs has made this an increasing source of
attack and potential risk to many organizations.
STOLEN EQUIPMENT
● A stolen-equipment hack simulates theft of a critical information resource such as a
laptop owned by an employee.
● Many times laptops disappear and are not reported quickly enough to allow the
security administrator to lock that device out of the network.
SOCIAL ENGINEERING
● A social-engineering attack checks the security and integrity of the
organization’s employees by using the telephone or face-to-face communication
to gather information for use in an attack.
● Social-engineering scenarios usually consist of a hacker calling the help desk and
talking the help desk employee into giving out confidential security information.
PHYSICAL ENTRY
Physical Entry A physical-entry attack attempts to compromise the
organization’s physical premises.
An ethical hacker who gains physical access can plant viruses, Trojans, root
kits, or hardware key loggers (physical device used to record keystrokes)
directly on systems in the target network.
● Additionally, confidential documents that are not stored in a secure location can
be gathered by the hacker.
● Lastly, physical access to the building would allow a hacker to plant a rogue
device such as a wireless access point on the network.
● These devices could then be used by the hacker to access the LAN from a remote
location.
UNDERSTANDING TESTING TYPES
● Black-box testing:
● involves performing a security evaluation and testing with no prior knowledge of the
network infrastructure or system to be tested.
● This testing is much faster than the other two methods as the ethical hacker
can jump right to the attack phase, thus bypassing all the information-
gathering, reconnaissance, and scanning phases.
● Many security audits consist of white-box testing to avoid the additional time and
expense of black-box testing.
GRAY-BOX TESTING
● Gray-box testing involves performing a security evaluation and testing internally.
● The purpose of this test is to simulate the most common form of attack, those that
are initiated from within the network.
● Ethical hacker does not “fix” or patch any of the security holes
they may find in the target of evaluation. This is a common
misconception
PERFORMING A PENETRATION TEST
● The ethical hacker usually does not perform any patching or
implementation of countermeasures.
● The final goal or deliverable is really the findings of the test and an
analysis of the associated risks. The test is what leads to the findings in the
final report and must be well documented.
● Taking remote control of a computer when you have not been authorized to do so
● (commonly known as spamming)
● Redirecting a web browser to another site that is not authorized by the user
● Displaying advertisements that cause the user to have to close out of the web
browser (pop-up windows)
● Collecting personal information using keystroke logging
● Changing the default web page of the browser
● Misleading users so they click on a web page link or duplicating a similar web page
to mislead a user
● The SPY ACT is important in that it starts to recognize annoying pop-ups and
spam as more than mere annoyances and as real hacking attempts. The SPY ACT
lays a foundation for prosecuting hackers that use spam, pop-ups, and links in
emails.
18 USC §1029 AND 1030
● The U.S. Code categorizes and defines the laws of the United States by titles.
● Title 18 details “Crimes and Criminal Procedure.”
● Section 1029 criminalizes the misuse of computer passwords and other access
devices such as token cards.
● This statute criminalizes the spreading of viruses and worms and breaking into
computer systems by unauthorized individuals.
US STATE LAWS
● In addition to federal laws, many states have their own laws associated with
hacking and auditing computer networks and systems.
● When performing penetration testing, review the applicable state laws to ensure
that you are staying on the right side of the law.
● In many cases, a signed testing contract and NDA will suffice as to the
intent and nature of the testing.
● The National Security Institute has a website listing all the state laws
applicable to computer crimes.
● The URL is http://nsi.org/Library/Compsec/computerlaw/statelaws.html
FEDERAL MANAGERS FINANCIAL
INTEGRITY ACT
● The Federal Managers Financial Integrity Act of 1982 (FMFIA) is basically a
responsibility act to ensure that those managing financial accounts are
doing so with the utmost responsibility and are ensuring the protection
of the assets.
● This description can be construed to encompass all measurable safeguards to
protect the assets from a hacking attempt.
● The act essentially ensures that Funds, property, and other assets are
safeguarded against waste, unauthorized use, or misappropriation.
● Most records and government documents can be obtained via the FoIA.
● Any information gathered using this act is fair game when you are performing
reconnaissance and information gathering about a potential target.
FEDERAL INFORMATION SECURITY
MANAGEMENT ACT (FISMA)
● The Federal Information Security Management Act (FISMA) basically gives
ethical hackers the power to do the types of testing they perform and
makes it a mandatory requirement for government agencies.
● FISMA requires that each federal agency develop, document, and implement an
agency wide information security program to provide information security
for the information and information systems that support the operations and
assets of the agency, including those provided or managed by another
agency, contractor, or other source.
● Periodic assessments of the risk and magnitude of the harm that could
result from the unauthorized access, use, disclosure, disruption, modification, or
destruction of information and information systems that support the
operations and assets of the agency
FEDERAL INFORMATION SECURITY
MANAGEMENT ACT (FISMA)
● Policies and procedures that are based on risk assessments, cost-
effectively reduce information security risks to an acceptable level, and ensure
that information security is addressed throughout the life cycle of each agency
information system
● The Patriot Act was enacted primarily to deal with terrorist activity but
can also be construed as a wiretap mechanism to discover and prevent hacking
attempts..
THE GOVERNMENT PAPERWORK
ELIMINATION ACT (GPEA)
● The Government Paperwork Elimination Act (GPEA) of 1998 requires federal
agencies to
allow people the option of using electronic communications when
interacting with a government agency.
● When you’re performing an outside remote attack, the data may be stored on
servers in another country and the laws of that country may apply. It is better
to be safe than sorry, so do the research prior to engaging in a penetration test
for an international entity.
● In some countries, laws may be more lenient than in the United States, and
this fact may work to your advantage as you perform information gathering.
SCANNING AND SCRUTINIZING
GATHERED INFO
100
80
60
40
20
0
Scanning Scrutiny Launch
Contents
● Reconnaissance is a catchall term for watching the hacking target and gathering
information about how, when, and where they do things. By identifying
patterns of behavior, of people or systems, an enemy could find and
exploit a loophole
COMPETITIVE INTELLIGENCE
● Competitive intelligence means information gathering about competitors’
products, marketing, and technologies. Most competitive intelligence is
nonintrusive to the company being investigated and is benign in nature—it’s
used for product comparison or as a sales and marketing tactic to better
understand how competitors are positioning their products or services.
● Several tools exist for the purpose of competitive intelligence gathering and can
be used by hackers to gather in formation about a potential target.
COMPETITIVE INTELLIGENCE
INFORMATION GATHERING
METHODOLOGY
FOOT PRINTING
● Footprinting is defined as the process of creating a blueprint or map of
an organization’s network and systems.
● 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 nonintrusive methods.
● For example, the organization’s own web page may provide a personnel
directory or a list of employee bios, which may prove useful if the hacker
needs to use a social-engineering attack to reach the objective.
● The information the hacker is looking for during the foot printing phase is
anything that gives clues as to the network architecture, server, and
application types where valuable data is stored.
● Before an attack or exploit can be launched, the operating system and version as
well as application types must be uncovered so the most effective attack can be
launched against the target.
Here are some of the pieces of information to be gathered about a target during foot
printing:
FOOTPRINTING
● Domain name
● Network blocks
● Network services and applications
● System architecture
● Intrusion detection system
● Authentication mechanisms
● Specific IP addresses
● Access control mechanisms
● Phone numbers
● Contact addresses
● Once this information is compiled, it can give a hacker better insight into the
organization, where valuable information is stored, and how it can be accessed.
TOOLS IN FOOTPRINTING
● Domain name lookup
● Whois
● NSlookup
● Sam Spade
● In google to Gather information
UNDERSTANDING DNS ENUMERATIONS
● DNS enumeration is the process of locating all the DNS servers and their corresponding
● records for an organization. A company may have both internal and external DNS servers
that can yield information such as usernames, computer names, and IP addresses of
potential target systems.
● NSlookup, DNSstuff,
UNDERSTANDING DNS ENUMERATIONS
IDENTIFYING TYPES OF DNS RECORDS
USING TRACE ROOT IN FOOTPRINTING
● Traceroute is a packet-tracking tool that is available for most operating systems.
It operates by sending an Internet Control Message Protocol (ICMP) echo to
each hop (router or gateway) along the path, until the destination address is
reached.
● When ICMP messages are sent back from the router, the time to live (TTL) is
decremented by one for each router along the path. This allows a hacker to
determine how many hops a router is from the sender.
● One problem with using the traceroute tool is that it times out (indicated by an
asterisk) when it encounters a firewall or a packet-filtering router.
● Although a firewall stops the traceroute tool from discovering internal hosts on
the network, it can alert an ethical hacker to the presence of a firewall;
then, techniques for bypassing the firewall can be used.
USING TRACE ROOT IN FOOTPRINTING
● NeoTrace, VisualRoute, and VisualLookout are all packet-tracking tools with a
GUI or visual interface. They plot the path the packets travel on a map and can
visually identify the locations of routers and other internetworking devices.
● These tools operate similarly to traceroute and perform the same information
gathering; however, they provide a visual representation of the results.
UNDERSTANDING EMAIL TRACKING
● Email-tracking programs allow the sender of an email to know whether the
recipient reads, forwards, modifies, or deletes an email.
● Most email-tracking programs work by appending a domain name to the
email address, such as readnotify.com. A single-pixel graphic file that
isn’t noticeable to the recipient is attached to the email.
● Then, when an action is performed on the email, this graphic file connects
back to the server and notifies the sender of the action.
● Visualware’s eMailTrackerPro (www.emailtrackerpro.com/) and MailTracking
(http:// mailtracking.com/) are tools that allow an ethical hacker to track email
messages.
● When you use these tools to send an email, forward an email, reply to an
email, or modify an email, the resulting actions and tracks of the original email
are logged. The sender is notified of all actions performed on the tracked email
by an automatically generated email.
UNDERSTANDING WEB SPIDERS
● Spammers and anyone else interested in collecting email addresses from the
Internet can use web spiders.
● A web spider combs websites collecting certain information such as email
addresses.
● The web spider uses syntax such as the @ symbol to locate email addresses and
then copies them into a list. These addresses are then added to a database and
may be used later to send unsolicited emails.
● Web spiders can be used to locate all kinds of information on the Internet.
● A hacker can use a web spider to automate the information-gathering process.
● A method to prevent web spidering of your website is to put the robots.txt file in
the root of your website with a listing of directories that you want to protect
from crawling.