02 - Planning and Reconnaissance
02 - Planning and Reconnaissance
Reconnaissance
ElMehdi BENDRISS
Bendriss+uir@gmail.com
http://ma.linkedin.com/in/bendriss/
Planning and Reconnaissance
example
example
Google Hacking DataBase (GHDB)
• The Google Hacking Database (GHDB) is an authoritative source for
querying the ever-widening scope of the Google search engine. In the
GHDB, you will find search terms for files containing usernames,
vulnerable servers, and even files containing passwords.
• Attackers use Google dorks in Google advanced search operators to
extract sensitive information about their target, such as vulnerable
servers, error messages, sensitive files, login pages, and websites
Google Hacking DataBase (GHDB)
• Google Hacking Database Categories:
• Footholds • Files Containing Juicy Info
• Files Containing Usernames • Files Containing Passwords
• Sensitive Directories • Sensitive Online Shopping Info
• Web Server Detection • Network or Vulnerability Data
• Vulnerable Files • Pages Containing Login Portals
• Vulnerable Servers • Various Online Devices
• Error Messages • Advisories and Vulnerabilities
VPN Footprinting through Google Hacking
Database
Other Techniques for Footprinting through
Search Engines
Gathering Information from IoT Search
Engines
• Internet of Things (IoT) search engines crawl the Internet for IoT
devices that are publicly accessible. Through a basic search on these
search engines, an attacker can gain control of Supervisory Control
and Data Acquisition (SCADA) systems, traffic control systems,
Internet-connected household appliances, industrial appliances, CCTV
cameras, etc. Many of these IoT devices are unsecured, i.e., they are
without passwords or they use the default credentials, which can be
exploited easily by attackers.
• With the help of IoT search engines such as Shodan, Censys, and
Thingful, attackers can obtain information such as the manufacturer
details, geographical location, IP address, hostname, and open ports
of the target IoT device.
Identifying Key Email Addresses through
Email Harvesting
• Email harvesting is a process which a large number of email addresses
are obtained through different methods. It is mainly used for bulk
emailing or for spamming. A penetration tester can use email
harvesting tools such as theHarvester to enumerate publicly available
email addresses of the target organization. These tools gather email
addresses from popular sites such as social networking sites, forums,
and blogs.
TheHarvester
• theHarvester is a tool for
gathering email accounts,
subdomain names, virtual hosts,
open ports/banners, and
employee names from different
public sources such as search
engines and Pretty Good Privacy
(PGP) key servers. It is effective
in the early stages of a
penetration test to know the
visibility of the company in the
Internet
Metagoofil
✓ Discover the network's live hosts, IP addresses, and open ports of the live hosts. Using the open
ports, the attacker will determine the best means of entering the system.
✓ Discover the OS and system architecture of the target. This is also known as fingerprinting. An
attacker can formulate an attack strategy based on the OS's vulnerabilities.
✓ Discover the services running/listening on the target system. Doing so gives the attacker an
indication of the vulnerabilities (based on the service) that can be exploited for gaining access to
the target system.
✓ Identify specific applications or versions of a particular service.
✓ Identify vulnerabilities in any of the network systems. This helps an attacker to compromise the
target system or network through various exploits
Types of Scanning
• Network Scanning — Lists the active hosts and IP addresses. Network
scanning is a procedure for identifying active hosts on a network, either to
attack them or assess the security of the network.
• Port Scanning — Lists the open ports and services. Port scanning is the
process of checking the services running on the target computer by
sending a sequence of messages in an attempt to break in. Port scanning
involves connecting to or probing TCP and UDP ports of the target system
to determine whether the services are running or are in a listening state.
• Vulnerability Scanning — Shows the presence of known weaknesses.
Vulnerability scanning is a method for checking whether a system is
exploitable by identifying its vulnerabilities. A vulnerability scanner consists
of a scanning engine and a catalog. The catalog includes a list of common
files with known vulnerabilities and common exploits for a range of servers.
What is Enumeration
• Enumeration is the process of extracting usernames, machine names,
network resources, shares, and services from a system or network.
• In the enumeration phase, an attacker creates active connections
with the system and sends directed queries to gain more information
about the target.
• The attacker uses the information collected using enumeration to
identify vulnerabilities in the system security, which help them exploit
the target system.
• In turn, enumeration allows the attacker to perform password attacks
to gain unauthorized access to information system resources.
Enumeration techniques in an intranet
environment
In particular, enumeration allows the attacker to collect the following
information:
• Network resources
• Network shares
• Routing tables
• Audit and service settings
• SNMP and fully qualified domain name (FQDN) details
• Machine names
• Users and groups
• Applications and banners
Techniques for Enumeration
• Extract usernames using email IDs
• Extract information using default passwords
• Brute force Active Directory
• Extract information using DNS Zone Transfer
• Extract user groups from Windows
• Extract usernames using SNMP
• Services and Ports
Services and Ports Enumeration
• TCP/UDP 53: DNS Zone Transfer
• TCP/UDP 135: Microsoft RPC Endpoint Mapper
• UDP 137: NetBIOS Name Service (NBNS)
• TCP 139: NetBIOS Session Service (SMB over NetBIOS)
• TCP/UDP 445: SMB over TCP (Direct Host)
• UDP 161: Simple Network Management Protocol (SNMP)
• TCP/UDP 162: SNMP Trap
• TCP/UDP 389: Lightweight Directory Access Protocol (LDAP)
• TCP 2049: Network File System (NFS)
• TCP 25: Simple Mail Transfer Protocol (SMTP)
• TCP 22: Secure Shell (SSH)
• TCP/UDP 3268: Global Catalog Service
• TCP 20/21: File Transfer Protocol
• TCP 23: Telnet
• UDP 69: Trivial File Transfer Protocol (TFTP)
Tools for enumeration
• Nmap / Zenmap
• Hping3
• Metasploit
• Net view
• Powerview
• Snmpwalk / snmpcheck
• Ldapsearch
• Smtpuserenum
Lab
• Lab file 03
• Nmap : https://tryhackme.com/r/room/furthernmap
• Nmap Live Host Discovery : https://tryhackme.com/r/room/nmap01
• Passive Reconnaissance :
https://tryhackme.com/r/room/passiverecon
• Active Reconnaissance : https://tryhackme.com/r/room/activerecon
Elmehdi
BENDRISS