UNIT-2: Footprinting
UNIT-2: Footprinting
UNIT-2
Footprinting
Footprinting is the process of gathering information about a target system, network, or organization to identify security
vulnerabilities. It is the first step in ethical hacking and penetration testing.
Types of Footprinting
1. Passive Footprinting – Collecting publicly available information without direct interaction with the target.
Ex:
o WHOIS lookup
o DNS records analysis
o Social media and company websites
2. Active Footprinting – Directly engaging with the target to collect data.
Ex:
o Port scanning using Nmap
o Traceroute analysis
o Banner grabbing
Footprinting Tools
• Nmap – For scanning network ports.
• theHarvester – Gathers emails and subdomains.
• Maltego – Visualizes relationships between gathered data.
Key Objectives:
1. Identify the Target’s Infrastructure
o Gather details about IP addresses, domain names, subdomains, and network topology.
2. Collect Organizational Information
o Extract details about employees, job roles, partners, and technologies used from public sources like
websites, job postings, and social media.
3. Identify Security Weaknesses
o Discover outdated software, misconfigurations, or unpatched vulnerabilities that could be exploited.
4. Gather Network and System Information
o Obtain details about open ports, services running on servers, and operating system versions.
5. Understand Security Policies and Procedures
o Analyze the organization’s security posture, firewall rules, and access controls.
6. Assist in Penetration Testing
o Provide valuable insights for ethical hackers to simulate real-world cyber attacks and improve
defenses.
Footprinting Methodologies
1. Passive Footprinting
Collecting publicly available information without directly interacting with the target.
Ex: WHOIS lookup, analyzing job postings, and social media research.
2. Active Footprinting
Directly engaging with the target system to gather details.
Ex: Port scanning, traceroute, and banner grabbing using tools like Nmap and Netcat.
3. Search Engine Footprinting
Using search engines to discover sensitive data, hidden files, cached pages, and indexed directories.
Ex: Publically available data, Finding an exposed [Link] file.
Website Footprinting
Website footprinting is the process of gathering information about a target website, including its structure,
technologies, and vulnerabilities.
➢ Wappalyzer is a web extension technology profiler that shows you what websites are built with.
➢ Netcraft site reports can be used to generate a comprehensive analysis of a target website including
hosting information and history, DNS server information and site technology among others.
Email Footprinting
Email footprinting is the process of gathering information about a target's email addresses, such as their
associated domains, mail servers, metadata, and possible vulnerabilities.
DNS Footprinting
DNS footprinting is the process of gathering information about a target domain’s DNS records,
subdomains, IP addresses, and mail servers. Ethical hackers use this technique to assess security risks and
identify vulnerabilities in an organization's network.
Network Footprinting
Network footprinting is the process of gathering information about a target network, such as IP addresses,
subnets, devices, and security configurations. Ethical hackers use this technique to map the network
structure and identify vulnerabilities.
Purpose:
• Identifies network infrastructure.
• Detects security misconfigurations.
• Helps in penetration testing and reconnaissance.
Tools:
Ping
Ping is a network tool used to check if a host is reachable and measure response time using ICMP Echo
Requests.
Purpose:
• Checks if a host is online.
• Measures network latency.
• Detects packet loss.
Social Engineering
Social Engineering is the psychological manipulation of people to trick them into revealing confidential information,
such as passwords, financial details, or security credentials. Instead of exploiting technical vulnerabilities, attackers
exploit human behavior and trust to gain unauthorized access to systems, data, or physical locations.
It is commonly used in cybersecurity attacks, frauds, and scams, where attackers impersonate trusted entities
through emails, phone calls, or in-person interactions to deceive victims.
Ex: A hacker posing as IT support calls an employee, asking for their login credentials to "fix a system issue."
Techniques:
• Phishing – Fraudulent emails or websites mimic legitimate sources to steal credentials. Example: A user gets
an email from a "bank" asking to reset their password through a fake link.
• Spear Phishing – A targeted phishing attack customized for a specific individual or organization. Example: A
fake email from a "CEO" asks an employee to transfer funds urgently.
• Baiting – Attackers offer something tempting (like free software or USB devices) to spread malware.
Example: A hacker leaves a USB labeled “Salary Report” in an office, hoping someone plugs it in.
• Scareware – Fake virus alerts trick users into installing malicious software. Example: A pop-up claims "Your
computer is infected! Click here to remove the virus."
Scanning
Scanning is a set of procedures for identifying live hosts, ports, and services, discovering Operating system and
architecture of target system, Identifying vulnerabilities and threats in the network. Network scanning is used to create
a profile of the target organization.
Scanning refers to collecting more information using complex and aggressive reconnaissance techniques.
Types of Scanning
1. Network Scanning – Identifying active hosts and devices on a network.
2. Port Scanning – Finding open ports and services running on a target.
3. Vulnerability Scanning – Detecting security weaknesses in systems.
4. Web Application Scanning – Finding security flaws in web apps (e.g., SQL injection, XSS).
5. Malware Scanning – Checking for malicious software or backdoors.
6. Banner Grabbing (Service & Version Scanning) → Retrieves details about services running on those open
ports.
Scanning Methodology
Ethical hackers follow a structured scanning methodology to gather information about a target system and identify
vulnerabilities. The key steps involved are:
1. Check for Live Systems
o Identifies active hosts in a network.
o Techniques: Ping Sweep, ARP Scanning
o Tool: nmap -sn <IP-Range>
2. Check for Open Ports
o Finds open ports and running services.
o Technique: TCP/UDP Port Scanning
o Tool: nmap -p 1-65535 <IP>
3. Scan Beyond IDS (Intrusion Detection System)
o Avoids detection using stealthy scanning methods.
o Techniques: SYN Scan, Fragmented Packet Scan
o Tool: nmap -sS -f <IP>
4. Perform Banner Grabbing
o Retrieves service versions and OS details.
o Techniques: Telnet, Netcat, Nmap Service Scan
o Tool: nmap -sV <IP>
5. Scan for Vulnerabilities
o Detects security flaws in systems.
o Tools: Nessus, OpenVAS, Nmap Vuln Script
o Command: nmap --script=vuln <IP>
Network Scanning
Network scanning is the process of identifying active hosts, open ports, running services, and vulnerabilities in a
network.
Scan Types:
1) Stealth scan/syn scan:
The Stealth Scan, also known as a Half-open or SYN scan, is a network scanning technique employed
by Nmap.
These SYN packets are part of the TCP 3-way handshake process that's used to establish a connection.
The handshake is not completed, so the ACK packet is not sent.
3) UDP Scan
Sending UDP packets to target ports to determine whether they are open or closed.
UDP is connectionless.
No response from closed ports.
• We can also specify which UDP port we wish the scan to be performed on.
nmap -sU -p U:53, 123 <target>
• We can fire up both TCP and UDP scan with port specification:
nmap -sU -sS -p U:53,123 T:80,443 <target>
4) Ping Sweep
Scanning technique used to discover live hosts within a range of IP addresses.
A successful response (ICMP Echo Reply) indicates the presence of an active host, while no response suggests
an inactive or blocked host.
Evasion techniques
To evade IDS, sometimes we need to change the way we scan. Some of the different ways we can use nmap to evade
detection are
a) Fragmenting packets
Fragmenting packets can help in network evasion by breaking large packets into smaller fragments.
This fragmentation technique can be used to hide malicious content or reconnaissance activities
Command: nmap -sS -f <target>
There are two techniques through which packet fragmentation can be carried out
Active - sending crafted packets to the target
Passive - sniffing network traffic for things such as TTL windows, DF flags and ToS fields
b) Spoofing
Spoofing in the scanning process involves the manipulation of network packets' source addresses to hide
origin of packet.
d) Proxy
A proxy hides the true identity.
Proxy chains - is a technique used to enhance anonymity and security.
It involves routing network traffic through multiple proxy servers.
e) Tor
a specific type of proxy that uses multiple hops to a destination; endpoints are peer computers.
Enumeration
Enumeration is defined as the process of extracting usernames, machine names, network resources, shares and
services from a system. In this phase, the attacker creates an active connection to the system and performs directed
queries to gain more information about the target. The gathered information is used to identify the vulnerabilities or
weak points in system security and tries to exploit in the System gaining phase.
NetBIOS Enumeration
NetBIOS is an acronym that stands for Network Basic Input Output System. It enables computer communication over
a LAN and the sharing of files and printers. TCP/IP network devices are identified using NetBIOS names (Windows).
It must be network-unique and limited to 16 characters, with 15 reserved for the device name and the 16th reserved for
identifying the type of service running or name record type.
Uses of NetBIOS Enumeration
• Discover Shared Resources – Identify shared files, folders, and printers on a Windows system.
• Enumerate User & Machine Names – Obtain usernames, workgroups, and domain details.
• Privilege Escalation – Exploit misconfigured shares to gain unauthorized access to files.
• Lateral Movement – Use NetBIOS information to navigate and compromise other systems.
• Denial of Service (DoS) Attacks – Exploit NetBIOS vulnerabilities to disrupt services.
• Brute Force & Credential Attacks – List valid user accounts and attempt brute-force logins.
Netstat:
Netstat is a utility for obtaining protocol statistics, NetBIOS name table, name cache information and current TCP/IP
connections over NBT (NetBIOS over TCP/IP), assisting in the resolution of NetBIOS name resolution issues. Name
resolution is normally performed when NetBIOS over TCP/IP is operational.
Displays the NetBIOS name table of a remote computer, where RemoteName is the remote
-a RemoteName
computer’s NetBIOS computer name.
Displays the NetBIOS name table of a remote computer, as specified by the remote
-A IPAddress
computer’s IP address (in dotted decimal notation).
The contents of the NetBIOS name cache, as well as the table of NetBIOS names and their
-c
resolved IP addresses, are listed.
Displays the names that NetBIOS applications, such as the server and redirector, have
-n
registered locally.
-R Removes all #PRE entries from LMHOSTS and clears the name cache.
-RR All names are released and reregistered with the name server.
The NetBIOS sessions table is listed, with destination IP addresses converted to computer
-s
NetBIOS names.
-S Lists the current NetBIOS sessions, along with their status and IP addresses.
Displays selected statistics again, pausing for the amount of time specified in Interval
Interval
between each display.
Examples:
1. To display the NetBIOS name table of a remote computer
Netstat -a
SMB Enumeration
SMB( Server Message Block protocol) is a client-server communication protocol that is used for sharing access to
files, devices, serial ports, and other resources on a network. SMB enumeration is a multipart process in which we
enumerate the host or target system for different information like Hostnames, List shares, null sessions, checking
for vulnerabilities, etc.
2. Nbtscan:
$ nbtscan <target IP>
1. Smbmap: Smbmap allows the attacker to enumerate samba share drives on the IP address. It also lists drive
permissions and upload/download functionality.
$ smbmap -H <target IP>
Also, we can scan for specific user shares using the credentials by using the below command
$ smbmap -H <target IP> -u username -p password
3. Nmap: Nmap provides smb-enum-shares NSE script which can be used to enumerate the shares.
$ nmap --script smb-enum-shares -p 139,445 <Target IP>
4. Metasploit: In Metasploit, we are going to the smb_enumshares module that will enumerate any SMB share if
present on the server.
msf6> use auxiliary/scanner/smb/smb_enumshares
msf6> auxiliary(scanner/smb/smb_enumshares) > set rhosts <target IP>
msf6> auxiliary(scanner/smb/smb_enumshares) > set smbuser <username>
msf6> auxiliary(scanner/smb/smb_enumshares) > set smbpass <password>
msf6> auxiliary(scanner/smb/smb_enumshares) > exploit
Result here we scanned the target for the specific script, and we didn’t find any vulnerability as we can see in the
scan.
DNS Enumeration
DNS Enumeration is a technique used for Reconnaissance for better understanding of surface area of the Target
systems(i.e. IP addresses).
• The process of DNS Enumeration returns various important information about the target like DNS record
types, host names, IP addresses and much more depending upon the configuration of that target system.
• To perform DNS enumeration there are various open source tools, scripts available like Nmap, DNS recon etc.
Importance and Impacts:
Importance:
• It helps in discovering the various services and hosts that are running on the domain.
• It makes the target surface larger as we enumerate further.
• Furthermore, it exposes the critical information about the target.
Impact:
• The attacker can read about the system data and also can modify it.
• It can also lead to various other potential DNS attacks.
• It gives the Threat actor very critical details about the system that the attack can leverage to other attacks.
Command Usage:
nmap -sSU -p 53 --script dns-nsec-enum --script-args [Link]=[Link] <target>
DNS Hijacking Attackers take control of DNS settings. Traffic interception, credential theft.
Subdomain Takeover Unclaimed subdomains used by attackers. Data leaks, impersonation attacks.
Structure of DNS
It is very difficult to find out the IP address associated with a website because there are millions of websites and with
all those websites we should be able to generate the IP address immediately, there should not be a lot of delays for that
to happen organization of the database is very important.
• Non-Recursive Query: Non-Recursive Query is the query that occurs when a DNS Resolver queries a DNS
Server for some record that has access to it because of the record that exists in its cache.
BIND9 DNS
BIND9 (Berkeley Internet Name Domain) is the most widely used DNS server software, mainly for
Linux/Unix systems.
Key Features
Common Uses
Basic Commands
WHOIS
• WHOIS is a protocol used for querying domain name and IP address information.
• Example: whois [Link]
• Provides details such as registrar, contact information, and name servers.
Recon-ng
• Purpose: Enumerates hostnames and finds subdomains.
• Commands:
1. Open Recon-ng: recon-ng
2. Load module: modules load recon/domains-hosts/brute_hosts
3. Insert domain: db insert domains [Link]
4. Run module: run
Host
• Purpose: Provides a quick lookup compared to other tools.
• Commands:
o Find domain details: host [Link]
o Find hostname for an IP: host [Link]
Dig
• Purpose: Identifies name servers and other DNS records.
• Commands:
o Request SOA (Start of Authority): dig [Link] SOA
o Find name server’s IP: dig [Link]
Exploitation of Vulnerabilities
Metasploit
• Purpose: Used for searching, viewing, and running exploits via CLI.
• Commands:
1. Start Metasploit: msfconsole
2. Search DNS Amplification scanner: search dns_amp
3. Use the module: use auxiliary/scanner/dns/dns_amp
4. Set target details:
5. set DOMAINNAME pes.cs000
6. set RHOSTS [Link]
7. Confirm settings: show options
8. Execute: run
• Steps:
• wget --user=student --password=student [Link]
• gcc dnsdrdos.c -o dnsdrdos
• ./dnsdrdos -f dns_servers.txt -s -d pes.cs000 -l 20
• Monitor attack using Wireshark.
DNS Spoofing
• Manipulates DNS records to redirect users.
• Steps:
o Attacker intercepts DNS requests.
o Sends forged responses to victim.
o Requires knowledge of victim's transaction ID and UDP source port.
• Features:
o Reduces trust in responses, preventing forgery.
o Uses Public Key Infrastructure (PKI).
o Signs records with public keys but does not encrypt traffic.
Fuzzing
• Purpose: Identifies vulnerabilities by injecting random/malformed input.
• Method:
o Alters UDP packets to flood name servers.
o Causes unexpected behavior or service crashes.
o May expose information leaks.
• Tools:
o Metasploit
o Nmap (e.g., dns-fuzz script)
Vulnerability Research
Vulnerability research is the systematic process of identifying, analyzing, and assessing security weaknesses in
software, hardware, networks, or protocols.
Vulnerability Assessment
Vulnerability assessment is the process of identifying, analyzing, and prioritizing security weaknesses in a system,
network, or application. It helps organizations detect vulnerabilities before they can be exploited by attackers and
implement corrective measures to enhance security.
• Each metric generates a score from 1 to 10, with 10 being the most severe.
• A vector string combines these scores for an overall severity assessment.
• CVSS calculator helps rank vulnerabilities and assess their security risk.
Pre-Assessment Phase:
• Understand and identify business processes.
• Identify the applications, data, and services that support the business processes and perform code review.
• Identify approved software, drivers and configurations.
• Create inventory of all assets and rank critical ones.
• Deep dive into network architecture and infrastructure.
• Identify existing controls.
• Understand policy implementation and standards compliance.
• Define scope of assessment.
• Create information protection procedures.
• Evaluate Physical Security – Assessing physical access controls and security measures.
• Check for Misconfigurations and Human Error – Identifying weaknesses caused by misconfigurations or
human mistakes.
• Run Vulnerability Scans – Conducting automated scans to detect vulnerabilities.
• Select Appropriate Scan – Choosing the right type of scan for the environment.
• Prioritize Vulnerabilities – Ranking vulnerabilities based on risk and impact.
• Identify False Positives and Negatives – Verifying results to ensure accuracy.
• Apply Business and Tech Context to Scanners – Understanding vulnerabilities in the context of business
operations.
• Gather OSINT for Validation of Vulnerabilities – Using open-source intelligence to confirm risks.
• Create Vulnerability Scan Report – Documenting findings for further action.
Post-Assessment Phase
1. Risk Assessment
o Categorize risks.
o Assess severity of impact.
o Determine threat and risk levels.
2. Remediation
o Prioritize risks based on ranks.
o Devise an action plan for remediation.
o Perform root cause analysis.
o Apply patches and fixes.
o Document findings and conduct awareness training.
3. Verification
Vulnerability Classification
a. Misconfiguration:
• Caused by human error
• Unauthorized access risk
• Affects various system components
Ex: debug mode, open ports, outdated software, and more.
b. Default Installations:
User-friendly but insecure initially
Risks from unaltered defaults can lead to data breaches.
c. Buffer Overflows:
Results from coding errors, enabling system access.
Attackers exploit insufficient bounds checking.
d. Unpatched Servers:
Compromise security, attract hackers.
Serve as entry points into networks.
Updating and patching mitigates vulnerabilities.
e. Design Flaws:
Universal vulnerabilities in system design.
Exploited for bypassing security mechanisms and gaining access.
g. Application Flaws:
Vulnerabilities in apps exploited by attackers.
Secure apps with user validation and authorization.
h. Open Services:
Unnecessary or insecure ports risk data loss and DoS attacks.
Continuous checks reduce network risk.
i. Default Passwords:
Failure to change defaults allows attacks.
Protect password confidentiality to prevent system compromise.
Type Description
Active Assessment Uses network scanners to find hosts, services, and vulnerabilities.
Passive Assessment Monitors network traffic to detect active systems, services, and
vulnerabilities without directly interacting with them.
External Assessment Evaluates the network from an outsider’s perspective, identifying
vulnerabilities accessible from the internet.
Internal Assessment Scans the internal infrastructure for vulnerabilities that an insider
might exploit.
Host-based Assessment Checks configurations, directories, and system settings for
security flaws.
Network-based Assessment Identifies network security weaknesses that could be exploited in
attacks.
Application Assessment Tests websites and web apps for vulnerabilities like
misconfigurations, outdated content, or known exploits.
Database Assessment Evaluates databases (MySQL, MSSQL, Oracle, PostgreSQL) for
vulnerabilities, including data exposure and injection risks.
Wireless Network Assessment Identifies weaknesses in wireless infrastructure.
Distributed Assessment Evaluates vulnerabilities in distributed systems (e.g., client-server
applications).
Credentialed Assessment Conducted with valid user credentials to check deeper security
issues.
Non-Credentialed Assessment Performed without login credentials to identify publicly
accessible vulnerabilities.
Manual Assessment Conducted manually by ethical hackers to identify vulnerabilities,
assess risks, and rank security issues
Automated Assessment Uses tools like Nessus, Qualys, or GFI LanGuard to detect
vulnerabilities systematically.
This process ensures that security risks in a network are identified and addressed systematically.
1. Locate Nodes: Identify the devices, servers, or endpoints in the network that need to be assessed.
2. Perform Service and OS Discovery on Them: Scan the located nodes to determine the running services and
operating systems.
3. Test Services and OS for Known Vulnerabilities: Evaluate the discovered services and OS against known
vulnerability databases.
4. Findings and Recommendations: Generate a report with the vulnerabilities found and suggest mitigation
measures.
5. Term of References: Define the scope, objectives, and guidelines for the vulnerability scanning process.
Types of Vulnerability Assessments Tools
Host-Based Vulnerability Assessment Tools
• Identify the OS running on a host and detect vulnerabilities.
• Search for common applications and services.
Nessus-
• Arguably one of the best platforms for vulnerability scanning and for identifying configuration issues and
malwares.
GFI LanGuard-
• Scans, detects, assess and recitifies security vulnerabilities in a network and connected devices.
OpenVAS-
• A framework of several tools for performing vulnerability scanning and management.
Nikto-
• A web server assessment tool that discovers vulnerabilities and potential threats on a web server.
It helps organizations identify potential security risks and take action to mitigate them before attackers can exploit
them.
o Scan Information – Details about the scanning process, including tools, methodologies, and
configurations used.
o Target Information – Information about the systems, applications, or networks being assessed.
o Results – Findings from the assessment, including identified vulnerabilities, risk levels, and
remediation recommendations.