Title: Ethical Hacking For Beginners (Tools, Enumeration and Exploitation) DISCLAIM..
Title: Ethical Hacking For Beginners (Tools, Enumeration and Exploitation) DISCLAIM..
net/publication/334173214
CITATIONS READS
0 565
2 authors, including:
Kharim Mchatta
Coventry University
5 PUBLICATIONS 0 CITATIONS
SEE PROFILE
Some of the authors of this publication are also working on these related projects:
All content following this page was uploaded by Kharim Mchatta on 02 July 2019.
Date: 6/24/2019
**********************************************************************************
* *
* *
* *
* DISCLAIMER: ANY MALICIOUS USE OF THE CONTENTS FROM THIS ARTICLE *
* *
* WILL NOT HOLD THE AUTHOR RESPONSIBLE, THE CONTENTS ARE SOLELY FOR *
* *
* EDUCATIONAL PURPOSE *
* *
* *
**********************************************************************************
1
Kharim Haji Mchatta
Table of Contents
Objective of the article…………………………………………………………………………………………………………………..3
Chapter 1: Introduction……………………………………………………………………………...6
Chapter 4: Network ports, services running and how they can be exploited………...…………20
Conclusion……………………………………………………………………………………………………………………………………30
2
Kharim Haji Mchatta
The main reasons for writing this article is to help the guys who are starting out in the
penetration testing field on ways on how to exploit or enumerate some of the common services
like ssh, ftp, dns, smb and many other more.
Most of articles online would show you the theoretical aspect of how a service could be
exploited but they don’t show practical examples on how the exploits or enumerations are done
based on the service.
There are numerous ways on which a system can be attacked, don’t be stuck with the methods
which are mentioned and shown in this article, do research and learn as many techniques as
possible simply because in one system the technique could work but on another system the
technique wouldn’t work depending on the complexity of the security systems that are put in
place by the targeted machine.
On the top you will see two tabs which all contains ISO’s based on the virtual environment
your using. Select one then download it.
3
Kharim Haji Mchatta
Once downloaded please follow these YouTube links created by Hackersploit to see how you
can setup the OS on the virtual environments
(a) how to install kali Linux on a virtual machine - https://youtu.be/od9jo8tvZUs
(b) how to install kali Linux on VMware - https://youtu.be/ShOb8bQ_h_I
NOTE: All the above distributions can be used depending on what you want to achieve, there
are many other more distributions apart from the ones listed above. On this article we will focus
more on kali Linux as the main and preferable distribution
4
Kharim Haji Mchatta
(b) YouTube channels – there are a lot of channels on which they teach penetration testing
concepts and show practical part of it where individuals could learn a lot from, these
channels include hackersploit, IppSec, Null byte, Hak5 and Demmsec, all these
channels contain good contents in penetration testing
(c) Mentor – find someone who is skilled and is already in the security world to help you
out learn and direct you while you are getting started in the field.
5
Kharim Haji Mchatta
CHAPTER 1: INTRODUCTION
1.1 understanding terminologies
cyber security is a field that is evolving every day, as technology keep’s on evolving the
more the digital crimes keep on get more popular and growing. As systems keep on getting
more sophisticated the more the cyber criminals keep on finding various ways to get to the
sensitive information. The motive of each hacker varies from one hacker to another some
are motivated by the money they get paid to hack a system, others are just motivated
because of the ego and others are motivated by the act of protecting the wellbeing of the
people.
Cyber security is the process of protecting organization’s assets from unauthorized access
but also from potential damages which might be caused by potential security breaches.
In cyber security there are terminologies that need to be understood by various individual’s
in-terms of careers in this field.
(a) Penetration testing – is the process of looking for weakness in the systems before they
are being exploited by hackers
(b) Ethical hacking – is the process of trying to exploit a network by covering all hacking
methodologies with other similar hacking techniques as a black hat hacker would do
according to EC-COUNCIL
(c) Cyber security – is the process of defending an organization’s network from various
threats. The cyber security is divided into two teams
(i) Blue team – they are the individuals who are responsible for implementing the
security of the organization and ensuring the security controls are put into place
(ii) Red team – they are the individuals who are responsible for testing the security
that have been implemented by the blue team by trying to hack there way
through the system
6
Kharim Haji Mchatta
1.2 Understanding the open system interconnection (OSI) model is an important part of
hacking, you need to know and understand how application and systems communicate and
function over the system.
OPEN SYSTEM INTERCONNECTION (OSI) LAYER
Is a reference model on how applications communicate on the network. There are 7 layers
of the 0SI model where layer 1 is has a far relationship with the user and layer 7 has a close
relation to the user.
Layer 7: Application layer
This is the layer which involves the user, this is the layer where the user interacts with the
systems example applications like the web browsers, email applications like outlook etc.
Layer 6: Presentation layer
This is the layer where you interact with the operating system example trying to boot your
system, or trying to change or add your drivers etc
Layer 5: Session layer
This is the layer where by when two computers interact with each other successfully they
create a session among each other
Layer 4: Transport Layer
This is all about the transfer of data from one point to, how much amount of data can be
sent and received from one point to another
Layer 3: Network Layer
This is the layer that involves how devices communicate with each other example TCP/IP
Layer 2: Data-link layer
This layer involves the physical addressing of network devices example mac address
Layer 1: Physical layer
It’s all about how devices are connected to each other physically
1.3 in penetration testing there are various areas of specialties that an individual could get into
and these include:
(a) web penetration testing
7
Kharim Haji Mchatta
The process of looking for systems vulnerabilities as well as presenting the evidence of theory
attacks to show the vulnerabilities are obvious. Good penetration usually provides suggestions
for directing and correcting the issue that was encountered during the analysis, in other terms
these techniques are applied to improve the security of the systems against attacks.
The main reason is to identify security issues by applying a methodology, tools and techniques
as an attacker. The following are phases of hacking
(a) RECONNAISSANCE
Is the most important phase of the hacking methodology. You can never win a war if you
haven't gathered enough information about your enemy. The importance of reconnaissance is
to gather information and facts about your target. At this phase each information that is obtained
is saved.
At this stage there are two ways of gathering information and this includes.
(i) Passive – this is where the attacker doesn’t actively engage the system, they gather
information based on online information which they might come across
(ii) Active – this is where the attacker actively engages the system in order to gather
information
(b) SCANNING
Is the process of identifying set of active machines, ports and services, discovering operating
system architecture of the target, identifying vulnerabilities and threats in the network.
Scanning is usually used by hackers to create a profile about the targeted organization.
(c) ENUMERATION
Is the process of extracting user names, machine names, network resources, shares and services
from the computer system. Here is where the hacker makes an active connection to the system
to perform direct queries to gain more information about the target.
(d) EXPLOITATION
Is the process of executing the attack based on the information that has been gathered in the
previous stage. In this stage is where the hacker performs that actual hacking itself using the
hacking the tools exposed to him.
8
Kharim Haji Mchatta
9
Kharim Haji Mchatta
(a) Netdiscover
Is a tool that is being used to help find and identify hosts on either a wireless or switched
network. It can be used in either active or passive mode. Netdiscover will also provide
the mac address of a host on the network
(b) Nmap
Is a port scanning tool. It sends ICMP packets to check whether the port is
open or closed. It also helps find the operating system running on a host
10
Kharim Haji Mchatta
(d) Nikto
This is a web server scanner that performs comprehensive tests against web servers for
multiple items, including over 6700 potentially dangerous files/programs, but also it
checks for outdated versions of over 1250 servers, and version specific problems on
over 270 servers
11
Kharim Haji Mchatta
(e) Exif
This is an information gathering tool that can be used for reading, writing and
manipulating image, audio and video metadata.
(f) Strings
This is a tool that makes it possible for the humans to be able to read characters with
any file. The purposed of this tool is to be able to know what type of file your looking
at and it can be used to extract text
(g) Nmblookup
Is a tool that can be used to get several meaningful information. It shows relevant
information about the workstation like what's the name of the workgroup and
sometimes who the users are
12
Kharim Haji Mchatta
(i) Enum4linux
Is a tool used for enumerating data from windows hosts which contain samba systems.
It could do user listing, listing of group membership information, share enumeration,
detecting if a host is in a workgroup or a domain, identifying the operating system and
password policy retrieval
13
Kharim Haji Mchatta
(j) Smbclient
It’s a samba client with an ftp-like interface. It is a tool that is used to test connectivity
with a window share machine. It can also be used for transferring files or it can be used
to look at share names
(k) Fcrackzip
This is a tool that can be used to crack zipped files encrypted with zipcrypto through
brute force and dictionary-based attacks
14
Kharim Haji Mchatta
(l) Pdfcrack
Is a tool that is being used for recovering passwords and content from a pdf file.
(m) Netcat
This is a tool that is also known as the swiss army. It’s a tool that is being used for
reading and writing from a network connection using TCP or UDP.
15
Kharim Haji Mchatta
(n) Wpscan
Is a vulnerability scanning tool that is used by the hacker to scan remote WordPress for
vulnerable plugins, usernames and passwords
(o) Curl
Is a tool that helps an attacker to view the source code of a web page and what contents
it entails
16
Kharim Haji Mchatta
17
Kharim Haji Mchatta
(r) Metasploit
Is a platform that provides exploits for a wide range of applications, services, operating
systems and platforms. it comes with modules like payloads, exploits, auxiliary,
encoders and posts which in combination can create a potential exploit
(s) crunch
Is a tool that generates wordlists where you could specify a standard ser of character or
a character set you specify. Crunch can generate all possible combinations and
permutations.
(t) sqlmap
Is a tool that automates the discovery and exploitation of vulnerabilities to SQL
injection attacks. It has many functions and included features such as detecting DBMS,
databases, tables, columns, retrieve data and even take control of a database
18
Kharim Haji Mchatta
(u) dnsenum
this is a tool that is being used to enumerate a dns server, it enumerates services on port
53
(v) dnsrecon
this is another tool that is being used to enumerate a dns server, it enumerates services
on port 53
NOTE: The commands used on the different tools shown above aren’t the only
commands to be used for that tool, to get more options and technique’s, type the
name of the tool with the word help at the end example
Don’t stick to the options only specified here in this article, go to google and do
some research about the tool’s and see how other techniques that could be used
with the tool.
19
Kharim Haji Mchatta
20
Kharim Haji Mchatta
21
Kharim Haji Mchatta
22
Kharim Haji Mchatta
23
Kharim Haji Mchatta
Nmblookup can be used to find out the name of the computers connected to the network
24
Kharim Haji Mchatta
Enum4linux is another tool that can be used to interrogate the machine and get possible
usernames, domains, passwords, NetBIOS information and other relevant information
Smbclient is used for creating the remote connection to the targeted computer that are
visible on the network, once access you can download a copy of the files from the
computer.
25
Kharim Haji Mchatta
Other tools that you could use to perform spidering is the wget command from the
terminal, you could use the -S or - -spider or - - server-response to perform spidering
using the wget command.
The purpose of spidering a host is to be able to get information about the target system
especially web page resources like index and folders
26
Kharim Haji Mchatta
The purpose of changing the file extension is to trick the content filet when trying to
upload the shell that the file your uploading isn’t malicious. Sometimes you may find
that when your trying to upload a shell on a webpage, the page will filter out anything
that has an extension of .php so to bypass this content filter you will be required to
change the file extension to successfully upload the shell.
(c) Port knocking
port knocking is a method of externally opening ports on a firewall by generating a
connection attempt on a set of prespecified closed ports (use nmap)
The primary advantage of this method is that the ports protected by Port Knocking will
be shown unavailable for a usual port scan. The main purpose of port knocking is to
create a connection with the port.
27
Kharim Haji Mchatta
Capture the flag is a cyber security game that involves challenging individual to try and hack
a vulnerable machine and try to get the flag’s that are stored in various places into the system.
The aim of these games is to teach an individual about security problems, how services could
be exploited and how to protect yourself against such attacks. You can play these games either
as a an individual or you could play in teams whereby teams would be playing attack and
defend.
(c) forensics – these types of challenge would usually require you to examine network
packets to look for evidence
(d) Exploitation - these types of challenges usually will require you to determine how to
exploit a provided running process on the target machine
(e) reverse engineering – for this type of challenge it would require you to reverse engineer
an executable that the server would have sent to you
28
Kharim Haji Mchatta
(b) cryptography challenges help an individual enhance their cryptography testing skills
for example. They will teach you on how to gain access to poorly configured
communication systems.
(c) forensics challenges help an individual enhance their forensics skills for example the
packets that you would examine could help you determine if a port scan has been done
on your system. This could be applicable on real systems to determine the activities tat
happened before getting hacked or to determine if someone was doing any malicious
activities with the network.
(d) exploitation challenges help an individual enhance their service enumeration and
hacking skills for example when port 21 is open here you will know how to access to
the remote system and how to exploit the service.
29
Kharim Haji Mchatta
CONCLUSION
This article is intended to help people who are getting into penetration testing, there are a lot
of topics which are not covered but it’s the authors belief that the individuals who are going to
read this article will do more research on other topics which haven’t been covered in this article
which they are going to meet along their career line while progressing their skills from beginner
to Intermediate and finally to advanced level hacking.
There is no easy way to success. The key to become a good penetration tester is to understand
what you’re doing, practice more and do more research, nothing comes easy.
Google is your best friend, there are a lot of information that can be found on google so make
use of google if you don’t understand a certain topic or don’t understand what a certain port
service is and how it could be exploited go to google and do research on the service.
30
Kharim Haji Mchatta
References
Akash. (n.d.). TechTric. Retrieved from TechTric: http://www.techtrick.in/description/4581-website-
hacking-sql-injections-sqlmap-introduction
ALex. (June, 6 2018). ethical hacking and penetration testing . Retrieved from ethical hacking and
penetration testing : https://miloserdov.org/?p=1254
Arms, C. (2015, January 22). Cybersecurity News and Business Computer Tips. Retrieved from
Cybersecurity News and Business Computer Tips:
https://cyberarms.wordpress.com/tag/metasploit/page/4/
Bjacharya. (2016, July 1). cybrary. Retrieved from cybrary: https://www.cybrary.it/0p3n/ethical-
hacking-kali-linux-part-6-nmap-network-mapper/
Brown, E. (2018, November 28). AT&T Business. Retrieved from AT&T Cybersecurity:
https://www.alienvault.com/blogs/security-essentials/capture-the-flag-ctf-what-is-it-for-a-
newbie
CISCO. (n.d.). CCNA Security COurse. Retrieved from Geek University : https://geek-
university.com/ccna-security/hacking-methodology/
Day, Z. (2017, April 15). Zero Day. Retrieved from Zero Day: https://zero-day.io/dns-zone-transfers/
Forge, S. (n.d.). Soure Forge.net. Retrieved from Soure Forge.net: http://pdfcrack.sourceforge.net/
Grotherus, J. ( 2016, January 5). Cybrary. Retrieved from Cybrary:
https://www.cybrary.it/0p3n/discover-network-hosts-with-netdiscover/
Haas, J. (2019, March 21). Life wire. Retrieved from Life wire: https://www.lifewire.com/strings-linux-
command-4093452
Hacking-Tutorials.com. (n.d.). Hacking-Tutorials.com. Retrieved from Hacking-Tutorials.com:
https://www.hacking-tutorial.com/tips-and-trick/information-gathering-using-theharvester-
in-kali-linux/#sthash.HSrdEL0T.V4x4MX0W.dpbs
Hofman, M. (2009, November 11). Internet Storm Center. Retrieved from Internet Storm Center:
https://isc.sans.edu/diary/Cyber+Security+Awareness+Month+-
+Day+12+Ports+161162+Simple+Network+Management+Protocol+%28SNMP%29/7327
Ismail, M. H. (2011, June 15). Mypapit GNU/Linux. Retrieved from Mypapit GNU/Linux:
https://blog.mypapit.net/2011/06/crack-zip-file-password-with-fcrackzip.html
Laureau, J. (2019, May 12). Secjuice. Retrieved from Secjuice: https://www.secjuice.com/hacking-
methodology-eli5/
linux, K. (n.d.). Kali Tools. Retrieved from Kali Tools: https://tools.kali.org/web-applications/burpsuite
Linux, K. (n.d.). Kali tools. Retrieved from Kali tools: https://tools.kali.org/password-attacks/crunch
Linux, K. (n.d.). Kali Tools. Retrieved from Kali Tools: https://tools.kali.org/web-applications/wpscan
Linux, K. (n.d.). Kali Tools. Retrieved from Kali Tools: https://tools.kali.org/information-
gathering/enum4linux
Margaret Rouse, A. L. (2006, August). Whatis.com. Retrieved from Whatis.com:
https://searchnetworking.techtarget.com/definition/Telnet
Margaret Rouse, P. L. (2018, October). Whatis.com. Retrieved from Whatis.com:
https://searchsecurity.techtarget.com/definition/Secure-Shell
OpenCampus. (n.d.). OpenCampus. Retrieved from Ethical Hacking:
https://www.greycampus.com/opencampus/ethical-hacking/what-is-scanning
OpenCampus. (n.d.). OpenCampus. Retrieved from Ethical Hacking:
https://www.greycampus.com/opencampus/ethical-hacking/enumeration-and-its-types
Rouse, M. (2007, March). Whatis.com. Retrieved from Whatis.com:
https://whatis.techtarget.com/definition/POP3-Post-Office-Protocol-3
Techopedia. (n.d.). Techopedia. Retrieved from Techopedia:
https://www.techopedia.com/definition/1710/simple-mail-transfer-protocol-smtp
Vlajin, B. (2018, October 18). cloudwards. Retrieved from cloudwards:
https://www.cloudwards.net/what-is-ftp/
31