Footprinting and Reconnaissance + Scanning Networks - Part 1

Footprinting & Reconnaissance

Brief

The footprinting phase enables attackers to gather information about a target's internal and external security architecture, helping identify vulnerabilities for exploitation. Detailed reconnaissance narrows the attack focus, bringing the attacker closer to the target by analyzing IP ranges, domain details, and other critical data.

Objective

The major objectives of Footprinting are:

  1. To know security posture

  2. To reduce focus area

  3. Identify vulnerabilities

  4. Draw network map

Methodology

Chapter 2: CEH v10

Footprinting through Search Engines

  • Finding Company’s Public and Restricted Websites

Gathers information from an organization's official website, including public and restricted URLs.

  • Collect Location Information

Obtains local details such as the headquarters' physical location, nearby surroundings, branch office locations, and other relevant data from online maps and location services.

  • People Search Online Services

Several online services are commonly used to find phone numbers, addresses, and personal details.

  • Gather Information from Financial Services

Various financial services, powered by search engines, provide financial data on internationally recognized organizations.

  • Footprinting through Job Sites

Job sites feature company profiles, including location, industry details, contact information, employee count, job postings, and insights into required hardware and software.

  • Monitoring Target Using Alerts

Alert services provide Content monitoring with notifications, keeping subscribers updated on their chosen topics.

  • Information Gathering Using Groups, Forums, and Blogs

Groups, forums, blogs, and communities can be valuable sources of sensitive information, as both official and unofficial groups may unintentionally leak data.

Footprinting using Advanced Google Hacking Techniques

  • Google Advanced Search Operators

Advanced search operators help refine searches, making them more precise and focused on specific topics using search engines.

Advanced Search Operators
Description

site :

Search for the result in the given domain

related :

Search for Similar web pages

cache :

Display the web pages stored in Cache

link :

List the websites having a link to a specific web page

allintext :

Search for websites containing a specific keyword

intext :

Search for documents containing a specific keyword

allintitle :

Search for websites containing a specific keyword in the title

intitle :

Search for documents containing a specific keyword in the title

allinurl :

Search for websites containing a specific keyword in URL

inurl :

Search for documents containing a specific keyword in URL

  • Google Hacking Database (GHDB)

  • Google Hacking, or Google Dorking, uses advanced search techniques to identify security vulnerabilities in an organization's network and systems through Google and related applications, enhancing search efficiency.

  • Queries are organized in the Google Hacking Database (GHDB), a categorized collection designed to uncover potentially sensitive or non-public information.

Footprinting through Social Networking Sites

  • Social Engineering

Social engineering in information security involves psychological manipulation to extract information from social networks and other platforms, often for fraud, hacking, or gaining proximity to a target.

  • Footprinting using Social Engineering on Social Networking Sites

Social networking sites are among the most effective sources of information, making it easy to find individuals and access both basic personal details and potentially sensitive data. Advanced features further provide real-time updates.

Chapter 2: CEH v10
Mind map

Website Footprinting

This information can be collected using online services like Netcraft or tools such as Burp Suite, ZAP Proxy, Website Informer, and Firebug

  • Determining the Operating System

Identifying the operating systems used by a target organization helps gather insights into potential vulnerabilities and attack vectors.

  • Web Spiders or Web Crawlers

Web spiders or crawlers are internet bots that systematically browse the web to collect targeted information, such as names and email addresses from websites.

  • Mirroring Entire Website

Website mirroring is the process of downloading and replicating an entire website on a local system for analysis or offline access.

Chapter 2: CEH v10
  • Extract Website Information

Wayback Machine - Internet Archive is an online service that provides archived versions of websites, offering summaries on MIME-type Count, Summary for TLD/HOST/Domain, a sitemap of website and dates, Calendar view, and other historical data.

  • Monitoring Web Updates

Monitoring websites for updates and changes, automatically detecting modifications to target websites.

Chapter 2: CEH v10

Email Footprinting

  • Tracking Email from Email Header

Tracing an email through its header provides a hop-by-hop analysis, revealing IP addresses, server names, and locations along its route.

Competitive Intelligence

Resources
  • Official Websites

  • Job Advertisements

  • Press releases

  • Annual reports

  • Product catalogs

  • Analysis reports

  • Regulatory reports

  • Agents, distributors & Suppliers

  • Competitive Intelligence Gathering

These websites collect and provide company reports, including legal news, press releases, financial data, analysis reports, and details on upcoming projects and plans.

Chapter 2: CEH v10

Gathering information from these resources, Penetration testers and attacker can identify:

1

When did the company begin?

2

Evolution of the company

3

Authority of the company

4

Background of an organization

5

Strategies and planning

6

Financial Statistics

7

Other information

  • Monitoring Website Traffic of Target Company

Website monitoring tools provide insights into a target website's ranking, global user distribution, visitor statistics, page views, time spent on the site, total backlinks, and other analytical data.

Chapter 2: CEH v10
  • Tracking Online Reputation of the Target

These tools help track an organization's reputation, ranking, and online presence while enabling notifications for updates and other relevant insights.

Chapter 2: CEH v10

WHOIS Footprinting

  • WHOIS Lookup

WHOIS provides domain-related information, including ownership details, IP addresses, netblock data, and name servers. A WHOIS lookup helps identify the entity behind a target domain.

  • DNS Footprinting

DNS lookup information helps identify hosts within a target network, revealing domain-to-IP mappings and other relevant details.

Chapter 2: CEH v10
Tools
  • Domain Dossier

  • http://www.dnsstuff.com

  • http://network-tools.com

  • http://www.kloth.net

  • http://www.mydnstools.info

  • http://www.nirsoft.net

  • http://www.dnswatch.info

  • http://www.domaintools.com

  • http://www.dnsqueries.com

  • http://www.ultratools.com

  • http://www.webmaster-toolkit.com

Feature
WHOIS Lookup
DNS Lookup

Focus

Domain ownership & registration

Domain-to-IP resolution & DNS records

Data Source

WHOIS databases (registrars)

DNS servers

Common Use

Checking domain availability, ownership

Resolving domain names, debugging DNS issues

Privacy Issues

WHOIS info may be hidden (GDPR, privacy services)

DNS info is generally public

Network Footprinting

Network footprinting is a crucial technique for gathering information about a target network. Various tools are available to help map the network, revealing its structure and potential vulnerabilities.

  • Traceroute

An illustration of hops in a wired network (assuming a 0-origin hop count). The hop count between the computers in this case is 2
Chapter 2: CEH v10

Footprinting through Social Engineering

  • Social Engineering

Social engineering is the art of extracting sensitive information by manipulating people. Social engineers operate discreetly, exploiting human trust and carelessness to obtain valuable data.

  • Eavesdropping

Eavesdropping is a social engineering technique where an attacker covertly listens to conversations, reads messages, or accesses information sources without detection.

  • Phishing

Phishing is a social engineering attack that uses digital means, such as emails, messages, or fake websites, to trick individuals into revealing sensitive information.

  • Shoulder Surfing

Shoulder surfing is a social engineering technique where an attacker observes a target’s screen or keyboard to steal sensitive information like passwords or account numbers.

  • Dumpster Diving

Dumpster diving is an old but effective technique where attackers search through discarded materials like printer trash, desk waste, or company garbage to find valuable information such as phone bills, contacts, financial records, and source codes.

  • Vishing

Vishing (voice phishing) is a social engineering attack where scammers use phone calls to trick individuals into revealing sensitive information, such as passwords, credit card details, or personal data.

  • Smishing

Smishing (SMS phishing) is a social engineering attack where attackers use text messages to deceive individuals into revealing sensitive information, clicking malicious links, or downloading malware.

  • Spear Phishing

Spear Phishing is a targeted phishing attack aimed at specific individuals or organizations. Attackers craft personalized emails or messages to trick victims into revealing sensitive information or downloading malware.

Footprinting Tools

  • Maltego

  • Recon-ng

  • FOCA

  • Metasploit

Chapter 2: CEH v10

Countermeasures of Footprinting

Mind Map

Scanning Networks

Brief

After the footprinting phase, you may have gathered sufficient information about the target. The next step, network scanning, uses this data to identify hosts, open ports, and running services by systematically scanning networks and ports.

Objective

  • To identify live hosts on a network

  • To identify open & closed ports

  • To identify operating system information

  • To identify services running on a network

  • To identify running processes on a network

  • To identify the presence of Security Devices like firewalls

  • To identify System architecture

  • To identify running services

  • To identify vulnerabilities

Chapter 3: CEH v10

Overview of Network Scanning

The Network Scanning phase involves probing the target network to gather critical information. By analyzing responses, an attacker can identify network details, open ports, and running services. This helps map the network architecture, providing a clearer picture of the target.

TCP Communication

Internet Protocol (IP) traffic is categorized into two types: TCP (Transmission Control Protocol) and UDP (User Datagram Protocol).

  • TCP is a connection-oriented protocol, meaning a reliable connection must be established before data transfer. It enables bidirectional communication, ensuring data is sent and received in an organized manner.

  • UDP is a connectionless and lightweight Internet protocol. It transmits multiple messages as independent packets, sending data in chunks without requiring a stable connection.

Due to its simplicity, UDP headers are smaller and require less network overhead compared to TCP, making data transmission more efficient.

Chapter 3: CEH v10
UDP Header

Flag filed in the TCP header is of 9 bits. Which includes the following 6 TCP flags:

Chapter 3: CEH v10

A TCP connection is established using a three-way handshake between hosts. This process ensures a reliable, connection-oriented session. The handshake consists of three essential steps to initiate communication.

Chapter 3: CEH v10

When Host A wants to communicate with Host B, a TCP connection is established through a three-way handshake:

  1. Host A sends a Sync packet to host B.

  2. Host B upon receipt of Sync packet from Host A, reply to Host A with Sync+Ack packet.

  3. Host A reply with Ack packet when it receives Sync+Ack packet from host B.

Once this process is successfully completed, the TCP connection is established.

The U.S. Department of Defense (DoD) developed the TCP/IP model by integrating the OSI Layer Model with the DoD model. Transmission Control Protocol (TCP) and Internet Protocol (IP) are the core networking standards that define the Internet.

  • IP defines how computers can get data to each other over a routed, interconnected set of networks. TCP defines how applications can create reliable channels of communication across such a network.

  • IP defines addressing and routing, while TCP defines how to have a conversation across the link without garbling or losing data.

The layers in the TCP/IP model function similarly to those in the OSI model, following similar specifications. The key difference is that the TCP/IP model merges the top three OSI layers (Application, Presentation, and Session) into a single Application Layer.

Creating Custom Packet Using TCP Flags

Colasoft Packet Builder allows users to create customized network packets, which can be used for testing, troubleshooting, or even penetrating networks for attacks. It also supports the creation of fragmented packets for advanced network analysis.

Methodology

The Scanning Methodology consists of the following steps:

1

Checking for live systems (Host discovery)

2

Port Scanning

3

Scanning beyond IDS

4

Banner grabbing

5

Scanning Vulnerabilities

6

Network Diagram

7

Proxies

Chapter 3: CEH v10

Checking for Live Systems

  • ICMP Scanning

ICMP scanning is a technique used to identify active hosts by sending ICMP Echo Requests. If a host responds with an ICMP Echo Reply, it confirms that the host is live and reachable on the network.

Chapter 3: CEH v10
  • Ping Sweep

Ping Sweep is a technique used to identify live hosts across a large network. Instead of sending ICMP Echo Requests to individual IP addresses one by one, it sends requests to an entire range of addresses. Active hosts respond with ICMP Echo Reply packets, confirming their presence.

Check for Open Ports

  • SSDP Scanning

The Simple Service Discovery Protocol (SSDP) enables the discovery of network services without relying on server-based configurations like DHCP, DNS, or static host settings.

It is commonly used for discovering Plug & Play devices through Universal Plug and Play (UPnP). SSDP supports both IPv4 and IPv6, making it versatile for modern networks.

  • Scanning Tool

    • Nmap

    Nmap provides host discovery, port scanning, and service enumeration. It can also detect operating system versions, retrieve hardware (MAC) addresses, identify service versions, and uncover vulnerabilities or exploits using Nmap Scripting Engine (NSE).

    • Hping2 & Hping3

Hping is a command-line TCP/IP packet assembler and analyzer tool. It allows users to send customized packets and view target responses, similar to how the ping command displays ICMP Echo Replies.

Hping supports packet fragmentation, custom payloads, adjustable packet sizes, and file transfers. It works with multiple protocols, including TCP, UDP, ICMP, and RAW IP.

  • Scanning Techniques

Chapter 3: CEH v10

Scanning Beyond IDS

OS Fingerprinting & Banner Grabbing

The two types of OS Fingerprinting:

  • Active OS Fingerprinting

  • Passive OS Fingerprinting

  • Active OS Fingerprinting or Banner Grabbing

Nmap can efficiently perform active banner grabbing to identify running services. Its OS detection capability works by sending specially crafted TCP and UDP packets and analyzing the target's response. A detailed assessment of these responses provides valuable clues, helping to determine the operating system type.

  • Passive OS Fingerprinting or Banner Grabbing

Passive OS Fingerprinting involves analyzing network traffic without directly interacting with the target. This method relies on inspecting packet attributes such as Time to Live (TTL) values and Window Size to infer the operating system, making detection stealthier compared to active scanning.

Chapter 3: CEH v10
Mind map

Draw Network Diagrams

A network diagram visually represents the network environment, offering a clear and structured view of its components. Network mappers are specialized tools that utilize scanning techniques and other network analysis methods to create a detailed map of the network, aiding in both security assessments and attack planning.

  • Network Discovery Tool

OpManager is a powerful network monitoring tool that provides fault management and supports various network components, including WAN links, routers, switches, VoIP systems, and servers. It also offers performance management, ensuring optimal network efficiency.

  • Drawing Network Diagrams

SolarWinds Network Topology Mapper is a powerful tool for network discovery and topology visualization. It automatically maps networks and provides features like manual node editing, multi-level discovery, and Visio diagram export. The generated topology includes key details such as node names, IP addresses, hostnames, system names, machine types, vendors, system locations, and more.

Prepare Proxies

Chapter 3: CEH v10
  • Proxy Servers

Proxy server anonymizes web traffic by acting as an intermediary between the user and publicly available servers. When a user requests a resource, the proxy forwards the request on their behalf, helping to conceal their identity and enhance privacy.

When a user makes a request, it is first sent to the proxy server, which processes and forwards it to the destination. The proxy can handle various requests, such as web page access, file downloads, and connections to other servers, while masking the user's identity.

Summary
  • Hiding Source IP address for bypassing IP address blocking.

  • Impersonating.

  • Remote Access to Intranet.

  • Redirecting all requests to the proxy server to hide identity.

  • Proxy Chaining to avoid detection.

  • Proxy Chaining

Proxy Chaining is a technique that involves routing traffic through multiple proxy servers for enhanced anonymity. In this process, one proxy server forwards the request to another, creating a chain that makes it more difficult to trace the original source.

Chapter 3: CEH v10
  • Proxy Tool

  • Proxy Switcher

  • Proxy Workbench

  • TOR

  • CyberGhost

  • Introduction to Anonymizers

Anonymizer is a tool designed to completely hide or remove identity-related information, ensuring online activities remain untraceable and private.

  • Censorship Circumvention Tool

    • Tails

    Tails (The Amnesic Incognito Live System) is a widely used censorship circumvention tool based on Debian GNU/Linux. It functions as a live operating system, running directly from a USB or DVD on almost any computer. Designed for privacy and anonymity, Tails enables users to browse the internet securely without leaving traces on the system.

Anonymizers for Mobile
  • Orbot

  • Psiphon

  • Open door

Spoofing IP Address

Spoofing process involves modification of header with a spoofed source IP address, a checksum, and the order values. Packet-switched networking causes the packets arriving at the destination in different order. When these out of order packets are received at the destination, these packets are resembled to extract the message.

IP spoofing can be detected using techniques such as Direct TTL probing and IP Identification Number analysis.

  • Direct TTL probing

In Direct TTL Probing, packets are sent to a host suspected of spoofing, and the responses are analyzed. By comparing the TTL value in the reply with the TTL in the suspected spoofed packet, IP spoofing can be identified. If the TTL values do not match, the packet is likely spoofed.

Chapter 3: CEH v10
  • IPID

Additional probes are sent to check the IP Identification (IPID) of the host. If the IPID values are not sequential or closely related, the traffic is likely spoofed. This technique is particularly useful when the attacker is within the same subnet.

Chapter 3: CEH v10

Last updated

Was this helpful?