Ethical Hacking Secrets Exposed - A Beginner's Guide {free online e-book} - Technology
Ethical Hacking Secrets Exposed - A Beginner's Guide  {free online e-book}

Ethical Hacking Secrets Exposed - A Beginner's Guide {free online e-book}

Share This

Basic of ethical hacking from Alvi

Based on the attitude and skill level they possess, hackers are classified into the following
White Hat Hacker: A white hat hacker (also known as ethical hacker) is someone
who uses his skills only for defensive purposes such as penetration testing. These
type of hackers are often hired by many organizations in order to ensure the security
of their information systems.
Black Hat Hacker: A black hat hacker (also known as cracker) is someone who
always uses his skills for offensive purposes. The intention of black hat hackers is to
gain money or take personal revenge by causing damage to information systems.
Grey Hat Hacker: A grey hat hacker is someone who falls in between the white hat
and black hat category. This type of hacker may use his skills both for defensive and
offensive purposes.
Script Kiddie: A script kiddie is a wannabe hacker. These are the ones who lack the
knowledge of how a computer system really works but use ready-made programs,
tools and scripts to break into computers.
Before proceeding further, the following are some of the essential terminologies in the
field of hacking that one should be aware of:
Vulnerability: A vulnerability is an existing weakness that can allow the attacker to
compromise the security of the system.
Exploit: An exploit is a defined way (piece of software, set of commands etc.) that
takes advantage of an existing vulnerability to breach the security of an IT system.
Threat: A threat is a possible danger that can exploit an existing vulnerability to
cause possible harm.
Attack: An attack is any action that violates the security of the system. In other
words, it is an assault on the system security that is derived from an existing threat.
Here is a small list of some of the frequently asked questions about hacking:
How long does it take to become a hacker?
Hacking is not something that can be mastered overnight. It really takes quite some time
to understand and implement the skills that actually put you in the hacker’s shoes.
So, for anyone who is wanting to become a hacker, all it takes is some creativity,
willingness to learn and perseverance.
What skills do I need to become a hacker?
In order to become a hacker, it is essential to have a basic understanding of how a
computer system works. For example, you may start off with basics of operating system,
computer networks and some programming.
At this point in time, you need not worry much about this question as this book will take
you through all those necessary concepts to establish the skills that you need to possess as
a hacker.
What is the best way to learn hacking?
As said earlier, the best way to learn hacking is to start off with the basics. Once you have
established the basic skills, you can take it even further by going through the books that
discuss individual topics in a much detailed fashion. Do not forget the power of Internet
when it comes to acquiring and expanding your knowledge.

Now, let us begin to understand some of the basic concepts that are essential in laying the
groundwork for our journey of learning how to hack. Before actually jumping into the
hands-on approach, it is highly necessary for one to have a thorough understanding of the
basics of computer network and their working model. In this chapter you will find a brief
description of various concepts and terminologies related to computer networks,
encryption and security.
A computer network is a group of two or more computers linked together so that
communication between individual computers is made possible. Some of the common
types of computer network include:
Local Area Network (LAN)
This is a type of computer network where interconnected computers are situated very
close to each other say for example, inside the same building.
Wide Area Network (WAN)
This is a type of computer network where interconnected computers are separated by a
large distance (a few km to few hundreds of km) and are connected using telephone lines
or radio waves.
The Internet is the largest network which interconnects various LANs and WANs. It is a
global system of various interconnected computer networks belonging to government or
private organizations.
A network host (or simply referred to as a host) can be any computer or network device
connected to the computer network. This computer can be a terminal or a web server
offering services to its clients.
A network protocol (or just referred to as protocol) is a set of rules and conventions that
are necessary for the communication between two network devices. For example, two
computers on a network can communicate only if they agree to follow the protocols.
The following are some of the most widely referred network protocols:
Internet Protocol (IP Address)
An Internet Protocol address (IP address) is a unique number assigned to each computer
or device (such as printer) so that each of them can be uniquely identified on the network.
Types of IP Address:
Private IP Address: A private IP address is the one that is assigned to a computer on the
Local Area Network (LAN). A typical example of private IP address would be something
Public IP Address: A public IP address is the one that is assigned to a computer
connected to the Internet. An example public IP address would be something like:
In most cases a computer gets connected to the ISP network using a private IP. Once a
computer is on the ISP network it will be assigned a public IP address using which the
communication with the Internet is made possible.
How to Find the IP Address of a Computer?
Finding your public IP is extremely simple. Just type “what is my IP” on Google to see
your public IP address displayed in search results.
Hyper Text Transfer Protocol (HTTP)
The Hyper Text Transfer Protocol provides a standard for communication between web
browsers and the server. It is one of the most widely used protocol on the Internet for
requesting documents such as web pages and images.
File Transfer Protocol (FTP)
The File Transfer Protocol provides a standard for transferring files between two
computers on the network. FTP is most widely used in carrying out upload/download
operations between a server and a workstation.
Simple Main Transfer Protocol (SMTP)
The Simple Mail Transfer Protocol provides a standard for sending e-mails from one
server to another. Most e-mail systems that send mail over the Internet use SMTP to
exchange messages between the server.
Telnet is a network protocol that allows you to connect to remote hosts on the Internet or
on a local network. It requires a telnet client software to implement the protocol using
which the connection is established with the remote computer.
In most cases telnet requires you to have a username and a password to establish
connection with the remote host. Occasionally, some hosts also allow users to make
connection as a guest or public.
After the connection is made, one can use text based commands to communicate with the
remote host. The syntax for using the telnet command is as follows:
telnet port
Example:telnet 25
SSH (Secure Shell)
SSH is a protocol similar to telnet which also facilitates connection to remote hosts for
communication. However, SSH has an upper hand over telnet in terms of security. Telnet
was primarily designed to operate within the local network and hence does not take care of
security. On the other hand SSH manages to offer total security while connecting to
remote hosts on a remote network or Internet.
Akin to telnet SSH also uses a client software and requires a username and password to
establish connection with the remote host.
A computer may be running several services on it like HTTP (web server), SMTP, FTP
and so on. Each of these services are uniquely identified by a number called network port
(or simply referred to as port). If a computer wants to avail a specific service from another
computer, it has to establish a connection to it on the exact port number where the
intended service is running.
For example, if a terminal is to request a web document from a remote server using HTTP,
it has to first establish a connection with the remote server on port 80 (HTTP service runs
on port 80) before placing the request.
In simple words, port numbers can be compared to door numbers where each door grants
access to a specific service on a computer. The following table shows a list of popular
services and their default port numbers:
Name of Service/Protocol Port Number
FTP 21
SSH 22
Table 2. 1
A network packet (data packet, datagram or simply called as packet) is a basic unit of data
sent from one host to another over a network. When data (such as a mail, message or a
file) has to be transmitted between two hosts, it is fragmented into small structures called
packets and are reassembled at the destination to make the original data chunk.
Each packet consists of the fragmented data along with the necessary information that will
help it get to its destination such as the sender’s IP address, intended receiver’s IP address,
target port number, the total number of packets the original data chunk has been broken into and the sequence number of the particular packet.

A Domain Name System or Domain Name Service (DNS) is a network protocol whose job
is to map domain names such as “” to its corresponding IP address like
Since Internet is the mother of millions of computers each having a unique IP address, it
becomes impossible for people to remember the IP address of each and every computer
they want to access. So, in order to make this process simpler the concept of domain
names was introduced. As a result users can easily access any website just by typing their
domain names in the browser’s address bas such as “” or “” without
having to remember their actual IP addresses.
However, since the network protocol understands only the IP address and not the domain
names, it is necessary to translate the domain name back to its corresponding IP address
before establishing a connection with the target server. This is where DNS comes in
Your Internet Service Provider has a DNS server which maintains a huge record of
existing domain names and their corresponding IP addresses. Each time you type the URL
such as “” on your browser’s address bar, your computer will use
the DNS server from the ISP and translates the domain name “” to its
corresponding IP address to make a connection with the Google’s server. All this process
will happen in a split second behind the scenes and hence goes unnoticed.
How DNS Works?
Let us understand the working of Domain Name System using the following example:
Whenever you type a URL such as “” on your browser’s
address bar, your computer will send a request to the local name server (the ISP DNS
server) to resolve the domain name to its corresponding IP address. This request is often
referred to as a DNS query.
The local name server will receive the query to find out whether it contains the matching
name and IP address in its database. If found, the corresponding IP address (response) is
returned. If not, the query is automatically passed on to another DNS server that is in the
next higher level of DNS hierarchy. This process continues until the query reaches the
DNS server that contains the matching name and IP address. The IP address (response)
then flows back the chain in the reverse order to your computer. The following figure 2.4
illustrates the above process.

No comments: