Barman EWS 057
Barman EWS 057
1. Introduction
Ethical hacking, also known as white hat hacking, is the utilization of hacking techniques to identify
vulnerabilities in computer systems, networks, and web applications to improve security. This proactive
approach helps to identify and fix security weaknesses before they can be exploited by malicious actors.
Furthermore, ethical hacking includes penetration testing, simulating an attack on a computer system, network,
or web application to identify vulnerabilities and assess the effectiveness of security measures. Ethical hackers
use the same tools, techniques, and tactics as malicious hackers, however, with the permission of the system or
network owner and the intention of making the system or network more secure (Kebande, Karie, and Ikuesan
2020). Historically, ethical hacking can be traced back to the 1970s when the US government began to employ
hackers to test the security of their systems. This practice was formalized in the 1980s with the creation of the
US Air Force's Computer Emergency Response Team (CERT). As the internet became more widely used in the
1990s, private companies also began to hire ethical hackers to test their systems. Today, many professional
organizations and certifications specialize in ethical hacking, such as the offensive security certified professional,
International Association of Computer Science and Information Technology (IACSIT) and the Certified Ethical
Hacker (CEH) certification, SANS GIAC web application penetration testing, as well as other non-prominent
organizations. A summary of organizations that provide certifications to ethical hacking, penetration testing as
well as other forms of offensive proactive security is further highlighted in word-cloud depicted in Figure 1.
54
Proceedings of the 22nd European Conference on Cyber Warfare and Security, ECCWS 2023
Fouz Barman et al
2. Background
Penetration testing and ethical hacking are essential in the information security lifecycle for several reasons.
Firstly, it helps to identify vulnerabilities in systems and networks before they can be exploited by malicious
hackers. By identifying and addressing these vulnerabilities, organizations can prevent cyber-attacks and protect
55
Proceedings of the 22nd European Conference on Cyber Warfare and Security, ECCWS 2023
Fouz Barman et al
sensitive information, such as financial data and personal information. Secondly, ethical hacking is also
important for compliance, as many industries are subject to regulations that require regular security testing.
Thirdly, it also helps organizations to improve their overall security posture and stay ahead of the ever-evolving
threat landscape. Furthermore, ethical hacking has been widely adopted by organizations as a key security
strategy. In today's digital age, organizations are constantly at risk of cyber-attacks, and they must have the
necessary security measures in place to protect their networks and data. Organizations that conduct regular
ethical hacking and penetration testing are better prepared to detect and respond to cyber threats and are less
likely to suffer data breaches and other security incidents. Fundamentally, the ethical hacking lifecycle contains
five phases which are reconnaissance, enumeration, exploitation, post-exploitation, and clearing of tracks. The
first two phases often play a critical success factor in any hacking exercise. However, this is often fraught with
inconsistencies and subjective processes.
Given that some ethical hackers often lack formal training, experience, and understanding, ethical hacking has
been susceptible to a diverse range of problems. The first problem relates to accessibility. Typically, ethical
hackers need both physical and logical access to the target organization to conduct an assessment. In essence,
the ability of ethical hackers to carry out their tried-and-true assaults depends on the access rights and privileges
provided by the organization. This could be within the black, white, or grey box principle. The ability to effectively
manage the first two phases of the hacking lifecycle is quintessential to the success of the process, especially
with the least privileges (Yaacoub et al. 2021). Secondly, the problems regarding security and privacy must be
taken thoughtfully, since organizations can be under simulated attacks, and their data, information, system
privacy, integrity, and confidentiality are being targeted as well. Consequently, ethical hackers are severely
required to explain, demonstrate, and document each phase performed. To provide a reliable baseline for
developing trust and ensuring compliance, this study developed a conceptually practicable framework for the
management of the first two phases of the ethical hacking cycle. The proposed framework is presented in the
next section.
3. Proposed Framework
As a step towards enhancing the penetration testing process, this study presents a process model that can be
used to reduce the daunting and confusing process of the first two stages in the penetration cycle. This is further
illustrated in Figure 2. The process model details the process of managing the reconnaissance (reconn) and the
enumeration (enum) phases in an agnostic alignment. The proposed management framework entails the
process of ensuring ethical compliance during the reconnaissance and enumeration phases. Given that most
ethical hacking process leverage diverse open-source tools and intelligence, the proposed framework further
specify the potential platforms such as the use of Parrot OS and Kali Linux as the hacking platform. Within this
platform, several off-the-shelf tools and open-source tools exist while others can be installed. To align with the
principle of ethics, and the need for transparency in the process, the proposed framework integrates
documentation and justification into every aspect of both phases. This includes the core process of curating the
attack surface on the target based on the extensive use of the hacking platform. An implementation of this
proposed framework is presented in the subsequent sections. Firstly, the methodology employed is discussed
and then followed by the result obtained.
4. Methodology
This section of the report covers the methodology and steps undertaken to ensure a successful ethical hacking
exercise. Additionally, this study highlights the two most important phases of the entire process, the
reconnaissance and enumeration phases. To implement this process, kali-linux 2022.4-amd64 1was installed on
a core i7 12GB RAM Windows 10 computing running using the virtual box as the virtualization technology. The
default configuration for the Kali Linux platform with username and password as ‘kali’ was used. Furthermore,
the victim machine was downloaded from Vulhub 2 open-source vulnerable machine repository. To demonstrate
the documentation process, each step followed was carefully recorded using a combination of notes, and saved
output (example, nmap –sP 192.168.170.0/24 >>output.txt). A synopsis of some common commands and their
corresponding interpretation is further presented in Tables 1 and 2 for Nmap and Netcat respectively.
1 https://www.kali.org/get-kali/#kali-virtual-machines
2 https://www.vulnhub.com/entry/napping-101,752/
56
Proceedings of the 22nd European Conference on Cyber Warfare and Security, ECCWS 2023
Fouz Barman et al
Start
Leverage reverse
Identify target
DNS where possible
Compliance Assurance
For each Phase, Do;
Platform Setup
Hacking platform Hacking Tools and
update and upgrade Kali/Parrot OS
Complete
Initialize
Set-up Hacking
Platform Continuous documentation and justification
No
traceroute NSE
Metasploit
Scripting
Auxiliary scanners
Banner detail Connectivity
Testing
Figure 3: Operational framework for the experimentation process
57
Proceedings of the 22nd European Conference on Cyber Warfare and Security, ECCWS 2023
Fouz Barman et al
Scanning IP Addresses: Linux, Windows, MAC OS X, Scans every port on the computer with this IP
Command: BSD, Solaris and AmigaOS. address.
nmap “ip address”
vulnerability scanning: scripts are in Linux, Windows, MAC OS X, An open-source tool for security auditing and
“/usr/share/nmap/scripts” BSD, Solaris and AmigaOS. related network discovery. It can be used to
then command: identify the current running devices on the
nmap –script= “chosen script” “target” systems, hosts, and services available.
Scan multiple targets: Linux, Windows, MAC OS X, One scan can be done including multiple targets
Nmap t1,t2,t3.. BSD, Solaris and AmigaOS. ips at once.
Scan range of hosts: Linux, Windows, MAC OS X, We can scan whole subnets, partial subnets, or
Nmap “range of ip addresses” BSD, Solaris and AmigaOS. file list targets. Nmap can generate possible new
Nmap 132.123.5.3-20 targets.
Performing fast scan: Linux, Windows, MAC OS X, -F will scan open services, domain names, and
nmap -F “target” BSD, Solaris and AmigaOS. ports fast and quickly.
Scan specific ports or entire port Linux, Windows, MAC OS X, Specifying port can filter the machine running a
ranges: BSD, Solaris and AmigaOS. service on this specific port,
Nmap -p x-xxx localhost
Scan specific ports:
Nmap -p x,xx x.x.x.x
Scan hosts and IP addresses reading Linux, Windows, MAC OS X, The “-iL” parameter lets you read from that file,
from a text file: BSD, Solaris and AmigaOS. and scan all those hosts for you:
Nmap -iL xx.txt
Scan using TCP or UDP protocols: Linux, Windows, MAC OS X, Sending a UDP packet to each specified port is
nmap -sT x.x.x.x BSD, Solaris and AmigaOS. how the UDP scan operates. Most ports will
nmap -sU localhost have an empty packet.
Fragment packets. Linux, Windows, MAC OS X, sending a probe to a network while fragmenting
nmap -f <target IP address> BSD, Solaris and AmigaOS. it into numerous smaller packets
-f split the ip address into tile fragment
packets.
Remote Networks: Linux, Windows, MAC OS X, Nmap also displays data about distant
BSD, Solaris and AmigaOS. networks. In reality, you may use Nmap to
analyze a website that you wish to look at, and
it will parse the website and find the IP address
for that web domain.
If host is vulnerable to DOS: Linux, Windows, MAC OS X, A script “NSE” is used to determine if the
Nmap –script dos -Pn x.x.x.x. BSD, Solaris and AmigaOS. targeted host is vulnerable to DOS or not.
Create a tunnel from one local port to Pre-installed in Linux and Using encrypted tunnels within the SSH protocol,
another: nc – xxx | nc x.x.x.x x MAC OS. Need to be tunneling is a method of port redirection. Using an
installed in Windows. SSH connection, two network devices can
communicate by tunneling.
Encrypt data before transferring over Pre-installed in Linux and sensitive data that is to be uploaded to the cloud
the network: MAC OS. Need to be should be encrypted on-premises, before upload.
openssl enc -des3 -pass installed in Windows.
pass:password | nc x.x.x.x x
58
Proceedings of the 22nd European Conference on Cyber Warfare and Security, ECCWS 2023
Fouz Barman et al
Pre-installed in Linux and Listen to the port & IP address after the connection
-k MAC OS. Need to be closes
Nc -k -l xx installed in Windows.
Displaying the IP routing table: Pre-installed in Linux and The -r displays the IP routing table. -s shows the
MAC OS. Need to be protocol statistics for the UDP, TCP, SCTP, ICMP,
Netstat -r installed in Windows. and IP protocols.
7. Result
Following the operational framework presented in Figure 3, this study explored the application of the proposed
framework for an enhanced hacking experience. The testing was carried out on the identified target. A synopsis
of the outcome is presented in this section.
a. The Reconnaisance Phase:
The reconnaissance phase is the initial and longest step of a hacking attack. This phase is essentially the
preparatory phase in which useful details about a target are gathered; information such as their network, their
open and active hosts, and the people involved. It is imperative to note that there are two types of
reconnaissance: Active: Directly interacting with the target to collect information (Nmap), and Passive:
Collecting and gathering information from the target indirectly. Common off-the-shelf tools include Nmap and
Netcat (the Swiss army knife for network communication). A description of the respective terms used in this
phase is provided in Tables 3 and 4. Whilst Table 3 addresses Nmap, Table 4 provides further clarity for Netcat.
Port Scanning This forms one of the core operations of the Nmap tool. An attacker can send probes (both
normal and carefully crafted probes) to determine if ports are open, closed, or filtered.
Version Detection If a port is open, Nmap helps determine what version each software/application is running.
OS Detection Allows attackers to determine and pinpoint the running OS which is extremely helpful as
different OSs implement different network standards.
NSE Script Scan Performs the tasks of detecting service vulnerabilities, gathering a greater amount of
information, advanced version detections, as well as malware discovery.
Test Connectivity Allows attacker to gain a shell or reverse connection to the target machine. Additionally, it
helps establish numerous connections or backdoors simultaneously.
Port Scanning Determines the range of ports as well as what ports are up and active.
Version Detection Helps determine target information such as their running service version.
Banner Details Detection Hunts down the target's banner details that can be used to exploit vulnerabilities.
59
Proceedings of the 22nd European Conference on Cyber Warfare and Security, ECCWS 2023
Fouz Barman et al
Search Exploits Websites and databases like “Exploit Database” allow attackers to search through any exploit
for the specific versions they are looking for.
Nmap –Pn –T4 192.168.170.16 Nmap command to perform regular or default scan to check top 100 ports, with
(-T4) flag specified to impact the time and speed.
Nmap –Pn –T4 –p- 192.168.170.16 Nmap command scans all 65535 ports with (-p-) flag. Additionally, the (-Pn) flag
will disable the host discovery and consider it active to improve scan speed.
Nmap –p80 –O 192.168.170.16 Nmap command to check the target machine's operating system with the (-O)
flag. Additionally, I have added (-p80) HTTP port because OS footprinting is
impossible without port scanning.
60
Proceedings of the 22nd European Conference on Cyber Warfare and Security, ECCWS 2023
Fouz Barman et al
Nmap –Pn –T4 -sV –sC –p 80,110,30109 Nmap command to scan to test NSE scripts for (80,110,30109) with (-sC) flag.
192.168.170.16
NETCAT
Netcat 192.168.170.16 22 Netcat command to connect to a host on port 22.
Netcat –zv 192.168.170.16 22 Netcat command with (-z) and (-v) flag performs port scanning and verbose
results. Additionally, the (-n) flag prevents DNS resolutions and improves the
Netcat –zv 192.168.170.16 80 scan speed.
Netcat –zvn 192.168.170.16 80
Netcat –zvn 192.168.170.16 1-100 Netcat command to perform a port scan for the top 100 ports.
Netcat –zvn 192.168.170.16 1-65535 Netcat command to perform a full port scan for all 65535 ports.
Netcat –vn 192.168.170.16 80 Netcat command to grab the banner or version details of the web server.
During the enumeration phase, the attacker establishes an active connection to the system and launches
directed queries to learn more about the target. The purpose of obtaining this information is to identify the
vulnerabilities of the system of the target to exploit it and perform password attacks to gain illegal access to
resources. Therefore, this type of enumeration could be a useful technique for attackers because the target
cannot completely avoid being screened by the DNS. By applying the steps provided in Figure 2, the authors
were able to extract a complete component of the target system. This includes the use of directory burster tools
(dirb), and enhanced enumeration tools (nikto and enum4linux).
7.1.3 Table 6: List of All Commands Used During the Enumeration Phase
Command Description
61
Proceedings of the 22nd European Conference on Cyber Warfare and Security, ECCWS 2023
Fouz Barman et al
8. Discussion
Penetration testing is a crucial aspect of ethical hacking that involves simulating a cyber-attack on a computer
system to identify any exploitable vulnerabilities. The testing process involves two key phases: reconnaissance
and enumeration. In reconnaissance, information about the target system is gathered passively to inform the
testing plan, while in enumeration, detailed information about the target's network resources, services, and
usernames is extracted (A. S. B. Singh, Yusof, and Nathan 2021). This study used Nmap for reconnaissance and
both Nmap and Netcat for enumeration. As part of the ethical hacking lifecycle, the goal of this report was to
highlight the techniques used in the reconnaissance and enumeration phases of penetration testing. In these
phases, access to sensitive information and common vulnerabilities can be gained. Netcat, as described,
establishes a connection between two computers to transmit data across TCP and UDP transport layer protocols.
It also enables banner grabbing to determine the operating system, service, and version on a specific port. On
the other hand, Nmap is a versatile tool for network scanning and auditing that can identify security
vulnerabilities, detect connected hosts, and determine open ports and running services on the target host and
operating system. As highlighted in Figure 3, the exploration of Metasploit auxiliary modules for enumeration is
a commonly misconstrued approach. This module can be leveraged like the Nmap, to conduct carefully crafted
enumeration.
The ethical hacking lifecycle framework presented in this report outlines the steps involved in the
reconnaissance and enumeration phases. It highlights the importance of identifying the target, documenting the
process, and utilizing tools such as Kali Linux and Parrot. The report is a valuable resource for beginner hackers,
students, and those looking to expand their knowledge in hacking and penetration testing, as it provides detailed
explanations of the commands used and how they work. By leveraging this framework, limitations, and
constraints often associated with the hacking processes can be easily remedied. This further supports the
assertion postulated by Bellaby (2023) which posits that the development of a methodical process could help
alleviate the frequent limitations associated with the hacking lifecycle. Ultimately, the goal of ethical hacking is
to evaluate the security measures of an organization and potentially gain access to sensitive information. To
achieve this, a certain level of trust must be established between the ethical hacker and the business hiring them
to perform the test. The framework in this report serves as a guide for conducting the reconnaissance and
enumeration phases of penetration testing in a compliant and ethical manner. Arguably, the use of other tools
and techniques is also encouraged in this wise. Several off-the-shelf tools and tailored tools have been developed
for this purpose. It is therefore worth mentioning that the process of conducting both active and passive
information gathering is not limited to the presented framework in Figure 2 and the methodology identified in
Figure 3. However, these steps provide a common baseline and a starting point for the same. This baseline aligns
with assertions from other related frameworks (Zawali et al. 2021; Ellison, Venter, and Ikuesan 2017; Ellison,
Ikuesan, and Venter 2019; Lagrasse et al. 2020; Patil et al. 2017).
9. Related works
Studies on existing ethical hacking frameworks are presented in this section, to highlight the contribution of this
current study within the common body of knowledge. Findings in Rafay Baloch's Ethical Hacking and Penetration
Testing Guide is a comprehensive book on ethical hacking and penetration testing. The book covers the
fundamentals of ethical hacking, such as the different types of attacks, methods, tools, and techniques used in
penetration testing. Furthermore, it provides readers with step-by-step instructions and examples to assist them
in conducting ethical hacking and penetration testing. The book also emphasizes the significance of adhering to
ethical guidelines and safeguarding user data (Baloch 2018). However, no specific detail is provided on the first
two phases of the hacking lifecycle. Also, the work failed to provide a relevant methodical framework for
conducting these phases. In a dissimilar approach, the study (Bellaby 2023) explored various penetration testing
services with a specific focus on penetration testing service limitations. The authors surveyed penetration testing
service providers and analyzed the results to determine these services' limitations. The identified limitations
include a lack of customization, a limited scope, and difficulty testing real-world scenarios. The study also
emphasizes the importance of taking these limitations into account when choosing a penetration testing service.
A study by Hawamleh et al. (2020) further highlights the Importance of Protecting User Data by applying the
ethical hacking lifecycle. In this regard, an overview of the different types of hacking attacks, the methods used
by hackers, and the consequences of these attacks. The paper also emphasizes the importance of protecting
user data and the role of ethical hacking in cyberattack prevention. This source provides an excellent overview
of the subject and emphasizes the importance of cybersecurity and ethical hacking. A similar work detailed by
62
Proceedings of the 22nd European Conference on Cyber Warfare and Security, ECCWS 2023
Fouz Barman et al
Bhawesh (2022) discusses the different types of hacking attacks, such as SQL injection, cross-site scripting, and
man-in-the-middle attacks, and describes the methods used to carry out these attacks. Mitigation strategies
against these attacks, such as implementing security software and following best practices for web development
are further provided. However, it fails to provide a directed method for conducting ethical hacking, particularly
on the modalities for the first two phases. In attempting to identify challenges associated with conducting ethical
hacking, a study conducted by Hartley (2015) discusses challenges, such as the increasing sophistication of
hacking techniques, the difficulty of detecting and preventing cyberattacks, and the importance of user data
protection. Whilst the study is good for information on cyber-attack, it fails to provide any direction or guide on
the actual process of ethical hacking. Similarly, a review of cybersecurity risk management models, methods,
and frameworks from a penetration testing perspective is presented by the study presented in Shah and Mehtre
(2015). The authors examined the existing literature on cybersecurity risk management and identified the key
components of effective risk management strategies. Based on the review of the extant studies, the authors
discuss risk assessment, risk mitigation, and risk communication, as well as the importance of taking
organizational culture and user behavior into account when implementing a risk management strategy.
These existing studies examined and discussed various methods and techniques that can be leveraged during
the reconnaissance and enumeration phases of the penetration testing cycle. This framework, on the other
hand, provides a more comprehensive and methodical approach to carrying out these phases, making it a
valuable resource for readers. The framework provides a systematic and structured approach to reconnaissance
and enumeration, lowering the possibility of missing information and increasing process efficiency. This
academic paper also emphasizes the significance of understanding the target system and its network
environment before proceeding to the next phase to ensure a thorough and complete penetration testing
process. Other sources, by contrast, focus on specific techniques or tools and do not provide a comprehensive
framework for conducting reconnaissance and enumeration. Overall, this framework is an important addition to
the field of penetration testing because it provides a step-by-step guide to conducting effective reconnaissance
and enumeration.
10. Conclusion
This study introduced a comprehensive methodology for conducting penetration testing, specifically focused on
the reconnaissance and enumeration phases. These initial stages of the ethical hacking process aim to gather
information about the target through passive reconnaissance methods and active enumeration techniques that
exploit weaknesses and vulnerabilities in direct client-server communication. The proposed framework
emphasizes compliance with ethical hacking principles and utilizes various hacking platforms. To assist new
learners, users, and hackers, detailed tables (Tables 1, 2, 5, and 6) of Nmap and Netcat usage, deployment, and
description are also provided as a clear and concise reference guide. As a future work, the authors intend to
further develop a holistic framework that can adapt to any perspective of the hacking lifecycle with clearly stated
detail and concepts. Furthermore, such a framework would provide a comprehensive view of the hacking
process on which any stakeholder can reliably formulate a penetration testing process. Having such a framework
can be a breakthrough for the ethical hacking community, as it would provide a reference model for ethical
hacking. To date, the hacking community lacks such.
References
Baloch, Rafay. 2018. “Ethical Hacking and Penetration Testing Guide.” International Journal of Advance Research in
Computer Science and Management 4 (4): 2253--2257.
Bellaby, Ross W. 2023. “An Ethical Framework for Hacking Operations.” In The Ethics of Hacking, 32–52. Bristol University
Press.
Bhawesh, Kumawat. 2022. “Ethical Hacking Attacks, Methods, Techniques and Their Protection Measures.” International
Journal of Advance Research in Computer Science and Management 4 (4): 2253–57.
https://madhavuniversity.edu.in/ethical-hacking.html.
Craigen, Dan, Nadia Diakun-Thibault, and Randy Purse. 2014. “Defining Cybersecurity.” Technology Innovation
Management Review 4 (10).
Ellison, Dagney, Richard Adeyemi Ikuesan, and Hein S. Venter. 2019. “Ontology for Reactive Techniques in Digital
Forensics.” 2019 IEEE Conference on Application, Information and Network Security, AINS 2019, 83–88.
https://doi.org/10.1109/AINS47559.2019.8968696.
Ellison, Dagney, Hein Venter, and Adeyemi Ikuesan. 2017. “An Improved Ontology for Knowledge Management in Security
and Digital Forensics.” In European Conference on Cyber Warfare and Security, 725--733. Academic Conferences
International Limited.
63
Proceedings of the 22nd European Conference on Cyber Warfare and Security, ECCWS 2023
Fouz Barman et al
64
Proceedings of the 22nd European Conference on Cyber Warfare and Security, ECCWS 2023