Iman Awed Final
Iman Awed Final
Information Technology
2022
VAASAN AMMATTIKORKEAKOULU
UNIVERSITY OF APPLIED SCIENCES
Information Technology
1
ABBREVIATIONS
2
Contents
0
4.2.2. Operating System Identification .......................................................... 24
4.3 Enumeration ................................................................................................ 25
4.3.1. Port scan. ............................................................................................. 25
4.3.2. Services Enumeration .......................................................................... 26
4.3.3. Identified vulnerabilities ...................................................................... 26
4.4. Exploitation ................................................................................................ 27
4.4.1. Metasploit framework ......................................................................... 27
4.4.2. rlogin attack ......................................................................................... 28
4.4.3. Backdoor .............................................................................................. 29
4.4.4. Samba exploitation .............................................................................. 30
4.4.5. Discovery of directories on the web server and attack on Tikiwiki..... 32
5 CONCLUSIONS .................................................................................................... 35
6 RECOMMENDATIONS......................................................................................... 37
REFERENCES .......................................................................................................... 38
1
LIST OF FIGURES AND TABLES
Error! Bookmark not defined.Figure 1. PTES penetration testing (van den Hout, 2019) . 7
Figure 2. OSSTMM penetration testing (van den Hout, 2019) ......................................... 12
Figure 3. Applied penetration testing methodology ........................................................ 16
Figure 4. TCP communication ........................................................................................... 18
Figure 5. Penetration testing environment ...................................................................... 21
Figure 6. Identification of the IP address .......................................................................... 22
Figure 7. checking if the host is up ................................................................................... 22
Figure 8. Identification of open ports ............................................................................... 23
Figure 9. Syn Nmap scan ................................................................................................... 24
Figure 10. Identification of operating system .................................................................. 24
Figure 11: identification of open ports ............................................................................. 26
Figure 12: port 80 is open ................................................................................................. 27
Figure 13: weak telnet password...................................................................................... 28
Figure 14: rlogin attack ..................................................................................................... 29
Figure 15: backdoor exploitation...................................................................................... 29
Figure 16: successful backdoor exploitation .................................................................... 30
Figure 17: samba exploitation .......................................................................................... 31
Figure 18: tikiwiki exploitation ......................................................................................... 33
Figure 19: tikiwiki exploitation ......................................................................................... 34
2
1 INTRODUCTION
Over the years, the information has acquired a value relevant to social dynamics,
positioning the term “connectivity” as one of the most recurrent needs among
contemporary communities, especially when present in most social contexts in the
world. For this reason, computer security has acquired greater recognition, mainly
for companies that have information as one of their greatest assets. This reason
encourages them to allocate a significant percentage of their security budget,
whether physical, environmental, or logical; without, however, as the experts in-
dicate, it is impossible to ensure 100% of the system information, as there will
always be risks residuals that must be assumed as a result of various external fac-
tors. Companies are turning to a digital transformation to maintain their position
in the market and remain in force, especially when the digital ecosystem is greater,
representing a risk on the data they intend to safeguard. Cybercriminals can ex-
ploit any vulnerability that arises; therefore, organizations must continue to es-
tablish security policies to mitigate the impact that can have a seizure and make
its users aware of the use of their platforms (Bhardwaj et al., 2021).
3
test a web application, network, or computer system to find vulnerabilities that a
probable invader could explode.
• To describe the best methodologies and tools used for penetration testing
in Metasploitable machine.
• To identify existing vulnerabilities in the target machine
• To simulate an attack on the Metasploitable machine.
• To record the results and giving recommendations.
4
The answers to the research question answer the problem statement. Organiza-
tions experience the challenges of protecting their systems from attackers and
thus penetration testing. Two are supposed to be answered in this research work.
What are how cyber criminals attacking the system? Which tools do they use to
penetrate the system? The first research question helps the pen tester to under-
stand how attackers penetrate the system, including the information they collect
before and after penetrating the system. The second question helps the penetra-
tion tester know the tools used to attack the target system.
The scope of the project covers the penetration testing phases that the attacker
normally uses. The project covers the related work. The practical part covers the
five steps of penetration testing, including Planning and reconnaissance, scanning,
gaining system access, persistent access, and the final analysis/report.
The thesis contains six chapters. The background, aim, and scope of the project
are given in the introduction. Chapter 2 gives a literature review where related
work is explained. Chapter 3 presents the methodology of the project. Chapter 4
is the practical part where the environment setup and attack simulation are ex-
plained. Chapter 5 contains the findings and the discussions obtained from the
practical part. Chapter 6 concludes the thesis, and further recommendations are
provided.
5
2 LITERATURE REVIEW
The vulnerability analysis or Pen Testing will allow determining the level of security
on a computer, in a computer network LAN (Local Area Network) or WLAN (Wire-
less Local Area Network), Web applications, Information Servers, among others,
through simulated computer attacks identical to those that would be carried out
by a Cracker or Black Hat hacker but without putting at risk the information or the
availability of the services. This is done to find possible threats or vulnerabilities in
the systems before they are discovered by an attacker (external or internal).
Penetration Testing Execution Standard (PTES) is another of the standards that will
be addressed in this article; it provides the companies and security service provid-
ers common framework and scope for penetration testing, and is divided into
seven (7) large segments as shown in Figure 1 below.
6
Figure 1. PTES penetration testing (van den Hout, 2019)
The Pre-engagement Interactions stage aims to establish the rules about the work
to be carried out finished; it seeks to leave total clarity in the scope, which implies
defining the objective, the infrastructure that enters penetration tests, web appli-
cations, IP range domain, the time it will take to run the tests of penetration, the
rate of service, hourly rate, dates of start and end of penetration tests. In addition,
it is defined to what extent providers are going to be taken into account. Services,
lines of communication, emergency contact, and reporting frequency are also in-
cluded. Finally, the methodology poses a questionnaire that help to find aspects
of the company where the penetration tests will be conducted (Abu-Dabaseh &
Alshammari, 2018). This process is important when establishing customer expec-
tations and thus understanding the expected results.
The threat Modeling stage does not define a specific model; even so, the most
used should be consistent representations of threats and be applied repeatedly to
obtain the same results. The methodology focuses mainly on modeling threats by
the attacker and their capabilities. Of course, the value of the assets and acquisi-
tion cost; like a complementary model, there must be an impact model for the
organization to have a more objective vision of the possible scenarios in which a
threat. Consequently, the context of each identified asset and their net, intrinsic
value, and any costs directly or indirectly related to your loss. This phase is of great
importance within the process both for the organization and the pentesters
8
because it allows prioritizing the organization’s assets, giving the pentester a basis
for testing processes, procedures, and controls.
9
clarify with the client the roles and responsibilities established in the early stages,
and contractually; to protect the organization as a general rule, it must be shown
that every change in the configuration or the exploit used was intended to show
how an attacker could escalate privileges, gain access to data, or deny services. Of
course, this process is done without carrying out any unjustified activity that puts
in risk to the organization. Now the configuration modified as part of the penetra-
tion test should be reset, and sensitive data or information must be delivered to
the client. On the other hand, to carry out this type of test, the company must
have the customer’s consent and make it clear what and how it is going to be done,
to avoid legal problems when access a system without authorization.
Reporting does not provide a format for submitting a test report for penetration,
but it guides the points that should be exposed. The context in which they were
made must be presented. The tests show the guidelines on which it was done. The
objectives achieved, express the risks by classifying them due to their criticality,
present the findings found and the recommendations, which are the activities you
must perform to resolve the risks encountered.
Open Web Application Security Project (OWASP) and the foundation of the Pene-
tration Testing Execution Standard (PTES) emerged as a response to the evolution
of systems of information and the need to establish guidelines specific to carry out
audits to the systems of information. These focused on structuring and guiding the
detailed penetration testing process from collecting information until the presen-
tation of the findings found in a final report. OWASP also emphasizes and guides
security to web applications, giving greater relevance to each testing process’s
technical section.
Now, when penetration tests are done, various scenarios can be generated, which
depend on the information about the target to be audited. Assuring Security by
10
Penetration Testing (Ghanem & Chen ,2020) define three of them, which are the
Black box testing, The Grey box testing, and White box testing.
In black-box testing, the security auditor assesses the network infrastructure and
is not from any inside technology implemented by the target company. By using a
series of techniques, real-world hackers go through planned testing stages to re-
veal vulnerabilities and exploit them. A pen-tester must be capable of understand-
ing, classifying, and prioritizing these flaws depending on the risk level (either high,
medium, or low), which can be measured by the risk posed by the susceptibility at
large. A supreme pen-testing determines all paths of attack that can make the tar-
get look engaged. Once the test is done, a report is generated containing all nec-
essary information concerning the safety of the objectives evaluated, in addition
to the classification and its meaning in a business context.
In white box testing, the auditor involved has all inside technologies and funda-
mental assets the target environment uses. The door is opened for a pen-tester to
access and censoriously assess the security flaws with minimal effort and the high-
est precision (Alhassan et al., 2018). This process adds more value to the organi-
zation than the black box approach because it eliminates any inside security mat-
ters in the environment of the destination infrastructure, which makes it difficult
for a malicious adversary to infiltrate from the outside. Both white box testing and
black-box testing use a similar number of steps. Furthermore, the tester can easily
integrate the approach of the white box into a cycle of systematic progress life to
eliminate any probable security problem at the early stages before intruders re-
veal and exploit them (Ghanem & Chen, 2020). The time, cost, and level of
knowledge needed to discover and solve the security vulnerabilities are compara-
tively less than the tactic used in the black box testing.
11
2.1.3 Grey Box Testing
Grey box testing, also called translucent box testing, is a penetration testing type
that an attacker has limited information shared with them before the attack
(Ghanem & Chen, 2020). Normally, the attacker is given login credentials before
attacking the system. This type of pen testing is important as it helps to under-
stand the access level a privileged user has and the possible threat they pose. The
testing runs between efficiency and depth and can be utilized to simulate either
an attack from outside the network parameter or an insider threat within the or-
ganization. A persistent adversary in a real-world attack conducts surveillance on
the target system, gaining information similar to an insider. The customers act as
the best balance between authenticity and efficiency, uncovering surveillance that
might be time-consuming.
In this same sense, OSSTMM defines more nuances within the tests, making room
for six scenarios, as shown in Figure 2 below.
Blind refers to a situation when the analyst commits to the objective without pre-
ceding channels, assets, or defenses. The tester prepares the target for auditing,
having all the audit information in advance. This assessment mainly tests the ex-
aminer’s skills. The amplitude and complexity of a blind assessment can be so
12
broad as permitted by the appropriate information and competence of the exam-
iner.
In Gray Box audit the examiner commits to the objective having limited knowledge
of its defenses and assets, but if complete knowledge of the channels. The target
is prepared for the audit, knowing in advance all the details. A gray box audit tests
the analyst’s skill. The nature of the test is efficiency; The extent and complexity
depend on the analyst’s information quality and the target before the test. This
type of test is often called a susceptibility test, and the target often starts it as a
self-assessment.
In Double Gray Box audit the examiner commits to the target with incomplete
information of the defenses and resources and complete familiarity of the paths.
The target notifies the examiner in advance of the time frame and the scope of
the audit but not the tested paths of test vectors. A double gray box audit tests
analysts’ skills and the preparation of the objective for variables unknown agita-
tion. The extent and complexity depend on the analyst’s information quality, the
target before the test, and the appropriate Analyst capability.
The Tandem: process prepares both the target and the examiner for the audit, the
reason why both know in advance all the information needed. A tandem audit
proves the target protection and controls. However, one cannot test target readi-
ness against unfamiliar variables of distress. The true proof is meticulousness since
the analyst has a complete view of all the tests and their answers. The extent and
complexity depend on both the information quality the analyst is given before the
test (transparency) and his appropriate knowledge. This is often referred to as a
13
Crystal Box test or an internal audit, where the examiner is often part of the secu-
rity progression.
In the Reversal audit the examiner commits to the objective form of vast infor-
mation of the procedures and security functioning, although the target does not
know what, how, or when the examiner will perform the test. The true nature of
this test is to assess the target’s preparation to unknown variables and agitation
vectors. The extent and complexity depend on the information quality the analyst
is given as to his knowledge and creativity. Often this is a call to make a red team
exercise.
14
2.2.1 Internal Penetration Testing
This penetration testing helps the pen tester continue with the assessment initi-
ated from external pen-testing. It helps identify how far a cybercriminal can navi-
gate a network after successfully breaching an internet-facing asset. During the
process, the pen tester has to control the exploited box from the external pen
testing or use a computer inside the organization’s network to perform the assess-
ment. Performing with a computer or a testing box is preferred as it is a stable
testing path than executing tools via an exploited resource.
The tester launches internal attacks and reconnaissance from the initial beach-
head. A poorly secured domain control gives an attacker full network control;
however, there is a need to perform numerous attacks to achieve the testing ob-
jectives (Al Shebli & Beheshti, 2018). The attacker exploits less important systems
and later uses the information from the systems to attack the most important sys-
tem.
15
3 METHODOLOGY
The process of pen testing starts before even a simulation attack is launched. It
allows penetration testers to study the system they are attacking, understanding
its weaknesses and strengths, and identify the appropriate tactics and tools that
can be used to exploit the system. Similar to any other project, this project takes
five penetration testing phases to exploit the Metasploitable system. The five
phases include Planning and reconnaissance, scanning, gaining system access, per-
sistent access, and the final analysis/report (Alghamdi 2021), as shown in the fig-
ure below.
Planning and reconnaissance is the first step of penetration testing. The penetra-
tion tester plans ways to simulate malicious attacks where they try to collect in-
formation about the system and are planted to attack. The phase consumes a lot
of time compared to other phases of penetration testing since pen testers exam-
ine the system, noting down the available vulnerabilities and how the company’s
tech stack reacts to the available system breaches. Before information is collected,
16
the attackers always have the IP address or the domain name of the target ma-
chine. Generally, reconnaissance works in seven different steps. The pen tester
collects the information about the system they are supposed to attack. They then
determine the range of the network they will use. In the range of the networks,
the attacker identifies the active machines. Then the open ports and access points
are identified. The attacker fingerprints the OS (Sharma, 2020). The sixth step is to
discover services running on the open ports identified. The attack finishes the re-
connaissance phase by mapping the network.
3.2 Scanning
At the scanning phase, scanning tools are used in identifying how the target ma-
chine responds to an intrusion. There are two steps involved in the scanning
phase, including the static and dynamic analyses. The static analysis inspects the
application code and estimates its behavior when it runs. The tools used are capa-
ble of scanning the entire code in one pass. The dynamic analysis inspects the ap-
plication code when in the execution state. It is a practical scanning method since
it gives a real-time understanding of the performance of the application. The pa-
perwork contains two different events, the first being conducted is Port Scanning.
Port scanning will eventually provide the open ports lists and the possible services
on the ports. The enumeration of the Metasploitable is done on the virtual ma-
chine. Enumeration refers to the process used to retrieve computers on a network,
groups, web directories, services, shares, and usernames. Port scanning is used to
inquire the host or the server to display the open UDP and TCP ports.
Nmap is the tool used for fingerprinting and port scanning. Enum4linux is also used
to enumerate information from samba and windows hosts. For this purpose, TCP
SYN scan is used rather than UDP port scan. The type of SYN scan is a stealthy port
since it does not complete the full TCP handshake, which is always a three-way
handshake, as shown in Figure 4 below.
17
Figure 4. TCP communication
The SYN-ACK response from the TCP scan indicates that the port is open. If there
is no response, then it means that the firewall has filtered the port, or it is closed.
The host machine then has to reply to the SYN-ACK sending an ACK packet which
completes the three-way handshake of TCP. Scanning the port with SYN scan with-
out specifying the range of the port, then NMAP scans only the top one thousand
ports, which is usually taken as the ports with the most important services rather
than the entire 65,535 ports. The flag -p- helps to scan the entire ports (Sharma,
2020).
After port scanning, vulnerability scanning follows. This is the process to locate
and identify explicit weaknesses in the application and the service of the target.
Common Vulnerabilities and Exposures (CVE) and Open-Source Vulnerability Da-
tabase (OSVDB) are used to detect the vulnerabilities of the services. Lastly, using
OpenVAS on Kali Linux, a vulnerability scanner, the vulnerabilities of the target
machine are scanned. An open port does not imply that the application using it is
vulnerable. The OS version and running services have to be identified, which will
help determine the susceptibilities that can be exploited. The OS and service scan
results will offer the right details that can be used for further investigation during
a vulnerability assessment. The version of the service and the OS is needed thus -
sV flag and
18
-O is used in the scan of the target machine, respectively. Banner grabbing tech-
niques do not give a complete TCP handshake when retrieving the details of the
running services. Thus, the final scan to detect the OS and service version is Nmap
–sS –sV -O [target IP address] (Sharma, 2020).
After identifying the vulnerabilities of the target system, the pen tester infiltrates
the infrastructure by exploiting the identified weaknesses. More attempts are
made to exploit the target machine through privilege escalation to demonstrate
the depth they can reach in the system. Depending on the type of the system, the
attacker uses different tools. For this research work, the tool used is Metasploit.
This tool is powerful, and pen testers usually utilize it to evade detections, execute
attacks, enumerate networks, and test for security flaws. The tools contain a com-
plete environment used in penetration testing. Metasploit has a range of modules,
including payloads, the sets of the malicious codes; encoders for converting infor-
mation and codes; shellcode that activates once the attacker is inside the system;
Nops that makes sure the payload doesn’t crush and exploit for taking advantage
of the system weaknesses. The MFSconsole found in Metasploit provides a com-
mand-line interface utilized in accessing and working with the Metasploit frame-
work (Alghamdi 2021). To run the MFSconsole in Linux, the command $ ./msfcon-
sole is run on the Linux terminal.
Once inside the system, access must be maintained while holding the simulated
attacks for a longer duration to achieve the goals of the malicious hacker. There-
fore, a pentester needs to gain the maximum privilege levels, gathering the net-
work information and accessing as many applications as possible to identify the
data found in them. Persistent access demonstrates the impacts of the security
breach on the organization’s customers (Alghamdi 2021).
19
Since it is an ethical hacking process, destroying the evidence is not mandatory.
However, for a cybercriminal, destroying the evidence of the attack is mandatory
to ensure that no attack footprints are left. It helps to prevent from being tracked
down.
The analysis and reporting phase represents the results of penetration testing. A
detailed report is prepared by the pen tester explaining the whole process. In the
report, the seriousness of the risk originating from the exposures discovered is
recorded and explained. The tools used in penetrating the target machine are also
recorded. The ethical hacker also highlights the points that the security is well ap-
plied. The system’s weak point when security measures have to be corrected is
explained. Lastly, recommendations of the ways of preventing future attacks are
also provided. Since the report is read by both the non-technical managers and
the IT team, it is put in a general explanation for both parties to understand. There-
fore, two forms of the report are needed, the technical report and the executive
report.
20
4 PENETRATION TESTING TOOLS AND METHODS
Kali Linux was set up as the attacking machine and metasploitable2 as the target
machine.
4.1.1. Metasploitable 2
21
Figure 6. Identification of the IP address
A Ping command was used to identify if the attacking machine could communicate
to the target machine and as shown below it was communicating.
22
Figure 8. Identification of open ports
Nmap is a tool for system administrators and others interested in scanning of large
or small networks to determine which computers are active and which ones are
the services present in them. This tool is very useful when making penetration
tests, since it provides the attacker with all the necessary information that will
allow to identify the vulnerabilities and locate the most effective exploits to
achieve the remote access to the attacked system (Guirado Hernández, 2004). For
Nmap, a port can have three states:
Open implies that the target computer accepts requests to this port. Filtered when
a firewall or other network device masks it and prevents Nmap from determining
if it is open or not. Closed when the port does not allow connections, that is, it
responds with a TCP packet that has the RST flag enabled.
23
stealth scan, XMAS tree scan, FIN Scan, Null scan, IDLE Scan, UDP Scan, Ping Scan,
ACK Scan and Windows Scan.
It was identified that Metsaploitable2 was running on Linux 2.6.9 - 2.6.33 as shown
in Figure 10 below. Several ports and service were identified to be running.
The “-O” option allows the detection of the Operating System by sending a series
of TCP and UDP packets to the remote host, then examine virtually any bit in the
responses.
24
4.3 Enumeration
Enumeration is the procedure used to find and collect information from ports and
services available in the assessment target. Usually, this process is done after dis-
covering the environment by scanning to identify running hosts. Usually, this pro-
cess is done at the same time as the discovery process.
Having knowledge of the range of the network and the active machines in the
evaluation target, it is time to proceed with the port scan to obtain a list of TCP
and UDP ports in an open or attentive state. There are several techniques to per-
form port scanning, among the most common are listed the following:
The command nmap -n -Pn 192.168.139.129 was used in scanning the open ports
and the services. The following ports were identified to be open and the service
version running.
25
Figure 11: identification of open ports
Determining the services running on each specific port can ensure a Successful
penetration test on the target network. You can also remove any doubt generated
during the recognition process on the fingerprint of the operating system.
26
Figure 12: port 80 is open
4.4. Exploitation
After you have discovered the vulnerabilities on the target hosts or network, it is
time to try exploit them. The exploitation phase sometimes ends the Penetration
Testing process, but this depends on the contract, as there are situations where
you must enter deeper into the target network, this with the purpose of expanding
the attack throughout the network and winning all possible privileges.
Metasploit Framework, is one of the most used tools currently for the realization
Penetration testing of computer networks. This allows you to discover the differ-
ent security vulnerabilities present in them and enables the application of security
measures. security, so that an attacker cannot exploit these vulnerabilities in order
to compromise the system in question.
This tool was created by H. D. Moore, using the programming language of Perl
scripting, although it has now been fully upgraded to the scripting language. Ruby
programming (Cuadra Pacheco, 2012), and has versions for Windows and Linux
systems.
27
WEAK PASSWORDS: TELNET
It was identified that port 514, 513 and 512 were open and are known as the r
services which allows the attacker to gain remote access to the host. The rsh-client
was installed in the attacking machine and A "simple attack" through port 513,
performing a sudo rlogin -l root to the IP address of our attacked system, we will
enter it easily and we will be free to move.
28
Figure 14: rlogin attack
As shown above the remote login as root was successful.
4.4.3. Backdoor
It was identified that port 21 which was running vsftp an FTP server was open. The
version is vulnerable and it contains a backdoor that can allow an intruder gain
access into the system. The vulnerability was exploited using telnet as shown be-
low.
It was also identified that metasploitable2 was running on unreal IRCD IRC daemon
on port 6667 that was open the version is vulnerable since it contains a backdoor.
The vulnerability was exploited using Metasploit as shown below.
The backdoor was also exploited as shown below. a successful backdoor was cre-
ated through the exploitation of the FTP server service that was vulnerable.
29
Figure 16: successful backdoor exploitation
Samba allows us to connect between Windows, Linux, Unix and other operating
systems, allowing us to share folders.
31
4.4.5. Discovery of directories on the web server and attack on Tikiwiki.
Among the results obtained during the scanning of the Metasploitable machine,
there is the existence of the http service through an Apache server on port 80. To
verify its operation, the connection is made using a web browser, obtaining the
typical “It works” sign that appears when an installation of this type is carried out.
Since the directories that this server contains are not shown, it is necessary to use
the OWASP DirBuster tool, which is a java application that allows the discovery of
directories and filenames on Web servers using the method of brute force or from
a list of words (wordlist). Several hidden directories were identified as shown be-
low.
32
Figure 18: tikiwiki exploitation
In the Metasploit console, the command search tikiwiki is executed, where the
exploits available for this manager, and through the command use auxiliary/ad-
min./tikiwiki/tikidblib that auxiliary module is selected. With the info command
you can see all the information related to it, and with the show options command
all your options.
To run this module, it is necessary to correctly set all the necessary options. In this
case, you only need to set RHOST, an option that corresponds to the IP address of
the victim.
(Note: To set any option, use the command set [option] [option value]; for exam-
ple, in this case: set RHOST 192.168.1.128)
After having configured the options, the attack is carried out using the exploit
command; after which the results shown in figure 3.4 are obtained, where you can
see the type of database, its name, username and password, allowing the attacker
access to the same. This error occurred in the database that allows to obtain the
credentials of the itself, it can also be viewed by accessing the address
http://192.168.1.128/tikiwiki/tikilistpages.php?offset=0&sort_mode=.
33
Figure 19: tikiwiki exploitation
34
5 CONCLUSIONS
The machine was identified to be vulnerable; several ports were open that could
lead to the intruders gaining access to the system. The services that were running
are outdated and vulnerable. The operating system was identified to be outdated
and needed an update. Several ports such as port 512 allows the intruder to gain
remote access to the system. There are many vulnerabilities due to lack of update
services. To have a secure system, the necessary ports must be closed, as well as
the necessary updates of the services.
One of the purposes of this thesis was to collect and present a review of the state-
of- the- art tools related to the security of web applications. There are a huge num-
ber of vulnerabilities and security flaws in applications that communicate over the
internet. Developers and testers need to have a point of reference in order to re-
spectively create and certify that a web application is secure. Currently OWASP is
the best standard to refer to; with its guidelines, suggestions and tools it repre-
sents one of the best ways to keep a web application safe. The vulnerability listed
in OWASP Top 10 are the most common and dangerous; thus, a detailed descrip-
tion of them and how they can be exploited nowadays has been given. Unfortu-
nately, OWASP Top 10 is just the top of the iceberg: new vulnerabilities are dis-
covered every day and even the smallest security flaw, if properly exploited, can
create a lot of damage to a company. The penetration testing technique proposed
by OWASP is very valid methodology and covers a lot of vulnerabilities types. It
should be adopted by developers and security testers, with some customization
depending on the application that is being tested. In the case of study, it was no-
ticed that vulnerabilities related to authentication and session management were
the most widespread. Weak cryptography and a poor input validation mechanism
were also some important and dangerous security flaws. Furthermore, it was no-
ticed that even the slightest carelessness, such as a software version exposure in
an error message can lead to serious consequences indeed a chain is only as strong
as its weakest link. Unfortunately, for many companies’ software security is still
35
an aspect of the software life cycle that usually is neglected, cybersecurity is seen
as a cost rather that an investment
36
6 RECOMMENDATIONS
It is recommended to use strong passwords that combine both uppercase and spe-
cial characters and should be at least 8 characters long. Strong passwords are not
easily cracked by cyber attackers compared to default passwords.
The computer should be kept updated with the latest updates and patches, re-
membering that on many occasions, they not only improve functionality, they also
correct bugs and vulnerabilities so that they are not exploited.
Secure Shell should be used. The Telnet and rlogin protocols use plain text to send
information, on the other hand, Secure Shell is a secure protocol since it uses en-
cryption in all communications between computers.
Logging in directly as root is not recommended, unless absolutely necessary. It is
better to use the "sudo" command to run commands that require administrative
permissions.
If you have many users in the system, it is very important to collect information on
the activity and processes of each user, so that you can later analyze that infor-
mation in case of performance or security problems.
Make sure your system's firewall is active and properly configured. It blocks all
those ports and services that have no reason to be open. If you use IPTables, make
sure you have rules set for both IPv4 and IPv6. Always use HTTPS for your web
services Try to ensure that your websites or APIs always use HTTPS encrypted con-
nections.
37
REFERENCES
Al-Ahmad, A. S., Kahtan, H., Hujainah, F., & Jalab, H. A. 2019. Systematic literature
review on penetration testing for mobile cloud computing applications. IEEE Ac-
cess, 7, 173524-173540.
Bhardwaj, A., Shah, S. B. H., Shankar, A., Alazab, M., Kumar, M., & Gadekallu, T. R.
2021. Penetration testing framework for smart contract blockchain. Peer-to-Peer
Networking and Applications, 14(5), 2635-2650.
Mendhurwar, S., & Mishra, R. 2021. Integration of social and IoT technologies: ar-
chitectural framework for digital transformation and cyber security chal-
lenges. Enterprise Information Systems, 15(4), 565-584.
McKinnel, D. R., Dargahi, T., Dehghantanha, A., & Choo, K. K. R. 2019. A systematic
literature review and meta-analysis on artificial intelligence in penetration testing
and vulnerability assessment. Computers & Electrical Engineering, 75, 175-188.
Alhassan, J. K., Misra, S., Umar, A., Maskeliūnas, R., Damaševičius, R., & Adewumi,
A. 2018, January. A fuzzy classifier-based penetration testing for web applications.
In International Conference on Information Technology & Systems (pp. 95-104).
Springer, Cham.
Ghanem, M. C., & Chen, T. M. 2020. Reinforcement learning for efficient network
penetration testing. Information, 11(1), 6.
van den Hout, N. J. 2019. Standardised penetration testing? Examining the useful-
ness of current penetration testing methodologies.
38
Aires Berbigão, F. F. 2019. integration of intelligence techniques on the execution
of penetration tests (ipentest) (Doctoral dissertation).
Casola, V., Benedictis, A. D., Rak, M., & Villano, U. 2020. A methodology for auto-
mated penetration testing of cloud applications. International Journal of Grid and
Utility Computing, 11(2), 267-277.
39