Course 276 Exercise 2
Course 276 Exercise 2
Documents provided to participants are strictly reserved for training purposes and are copyrighted by Parker
Solutions Group and Sysca Consulting. Unless otherwise specified, no part of this publication may be, without the
written permission of Parker Solutions Group and Sysca Consulting, reproduced or used in any way or format or
by any means whether it be electronic or mechanical including photocopy and microfilm.
Understanding some of the vulnerabilities across the DNS from a Pen Tester point of view
DNS Enumerations
DNS Hijacking
DNS Spoofing
dns-blacklist
Checks target IP addresses against multiple DNS anti-spam and open proxy blacklists and returns a list of
services for which an IP has been flagged. Checks may be limited by service category (eg: SPAM, PROXY) or to
a specific service name.
dns-brute
Attempts to enumerate DNS hostnames by brute force guessing of common subdomains. With the dns-brute.srv
argument, dns-brute will also try to enumerate common DNS SRV records.
Licensed to Synergy Innovation Group (contact@synergy-innov.com)
©Copyrighted material PECB®. Single user license only, copying and networking prohibited. Downloaded: 2020-05-24
10/70
dns-cache-snoop
Performs DNS cache snooping against a DNS server.
dns-check-zone
Checks DNS zone configuration against best practices, including RFC 1912. The configuration checks are
divided into categories which each have a number of different tests.
dns-client-subnet-scan
Performs a domain lookup using the edns-client-subnet option which allows clients to specify the subnet that
queries supposedly originate from. The script uses this option to supply a number of geographically distributed
locations in an attempt to enumerate as many different address records as possible. The script also supports
requests using a given subnet.
dns-fuzz
Launches a DNS fuzzing attack against DNS servers.
dns-ip6-arpa-scan
Performs a quick reverse DNS lookup of an IPv6 network using a technique which analyzes DNS server
response codes to dramatically reduce the number of queries needed to enumerate large networks.
dns-nsec-enum
Enumerates DNS names using the DNSSEC NSEC-walking technique.
dns-nsec3-enum
Tries to enumerate domain names from the DNS server that supports DNSSEC NSEC3 records.
dns-nsid
Retrieves information from a DNS nameserver by requesting its nameserver ID (nsid) and asking for its id.server
and version.bind values. This script performs the same queries as the following two dig commands: - dig CH
TXT bind.version @target - dig +nsid CH TXT id.server @target
dns-random-srcport
Checks a DNS server for the predictable-port recursion vulnerability. Predictable source ports can make a DNS
server vulnerable to cache poisoning attacks (see CVE-2008-1447).
dns-recursion
Checks if a DNS server allows queries for third-party names. It is expected that recursion will be enabled on your
own internal nameservers.
dns-service-discovery
Attempts to discover target hosts' services using the DNS Service Discovery protocol.
dns-srv-enum
Enumerates various common service (SRV) records for a given domain name. The service records contain the
hostname, port and priority of servers for a given service. The following services are enumerated by the script: -
Active Directory Global Catalog - Exchange Autodiscovery - Kerberos KDC Service - Kerberos Passwd Change
Service - LDAP Servers - SIP Servers - XMPP S2S - XMPP C2S
dns-update
Attempts to perform a dynamic DNS update without authentication.
dns-zeustracker
Checks if the target IP range is part of a Zeus botnet by querying ZTDNS @ abuse.ch. Please review the
following information before you start to scan:
https://zeustracker.abuse.ch/ztdns.php
dns-zone-transfer
Requests a zone transfer (AXFR) from a DNS server.
Retrieves information from a DNS nameserver by requesting its nameserver ID (nsid) and asking for its
id.server and version.bind values. This script performs the same queries as the following two dig commands: -
dig CH TXT bind.version @target - dig +nsid CH TXT id.server @target
Example
The Net Logon system service maintains a security channel between your computer and the domain controller to
authenticate users and services. It passes the user's credentials to a domain controller and returns the domain
security identifiers and the user rights for the user. This is typically known as pass-through authentication. Net
Logon is configured to start automatically only when a member computer or domain controller is joined to a
domain. In the Windows 2000 Server and Windows Server 2003 families, Net Logon publishes service resource
locator records in the DNS. When this service runs, it relies on the WORKSTATION service and on the Local
Security Authority service to listen for incoming requests. On domain member computers, Net Logon uses RPC
over named pipes. On domain controllers, it uses RPC over named pipes, RPC over TCP/IP, mail slots, and
Lightweight Directory Access Protocol (LDAP).
Note The Net Logon service uses RPC over named pipes for earlier versions of Windows clients. This service
has the same firewall requirements as the "File and Printer Sharing" feature.
Server Services
The Server system service provides RPC support and file sharing, print sharing, and named pipe sharing over
the network. The Server service lets users share local resources, such as disks and printers, so that other users
on the network can access them. It also enables named pipe communication between programs that are running
on the local computer and on other computers. Named pipe communication is memory that is reserved for the
output of one process to be used as input for another process. The input-accepting process does not have to be
local to the computer.
Note If a computer name resolves to multiple IP addresses by using WINS, or if WINS failed and the name is
resolved by using DNS, NetBIOS over TCP/IP (NetBT) tries to ping the IP address or addresses of the file server.
Port 139 communications depend on Internet Control Message Protocol (ICMP) echo messages. If IP version 6
(IPv6) is not installed, port 445 communications will also depend on ICMP for name resolution. Preloaded
Lmhosts entries will bypass the DNS resolver. If IPv6 is installed on computers that are running Windows Server
2003 or Windows XP operating systems, port 445 communications do not trigger ICMP requests.
The NetBIOS ports that are listed here are optional. Windows 2000 and newer clients can work over port 445.
Terminal Services
Terminal Services provides a multi-session environment that enables client devices to access a virtual Windows
desktop session and Windows-based programs that are running on the server. Terminal Services enables
multiple users to be connected interactively to a computer.
World Wide Web Publishing Service provides the infrastructure that you must have to register, manage, monitor,
and serve websites and programs that are registered with IIS. This system service contains a process manager
and a configuration manager. The process manager controls the processes where custom applications and
websites reside. The configuration manager reads the stored system configuration for World Wide Web
Publishing Service and makes sure that Http.sys is configured to route HTTP requests to the appropriate
application pools or operating system processes. You can use the Internet Information Services (IIS) Manager
snap-in to configure the ports that are used by this service. If the administrative website is enabled, a virtual
website is created that uses HTTP traffic on TCP port 8098.
Active Directory runs under the Lsass.exe process and includes the authentication and replication engines for
Windows domain controllers. Domain controllers, client computers and application servers require network
connectivity to Active Directory over specific hard-coded ports. Additionally, unless a tunneling protocol is used to
encapsulate traffic to Active Directory, a range of ephemeral TCP ports between 1024 to 5000 and 49152 to
65535 are required.
¹ This is the range in Windows Server 2012, Windows 8, Windows Server 2008 R2, Windows 7, Windows Server
2008, and Windows Vista.
SNMP Service
SNMP Service lets the local computer service incoming Simple Network Management Protocol (SNMP)
requests. SNMP Service includes agents that monitor activity in network devices and report to the network
console workstation. SNMP Service provides a method of managing network hosts (such as workstation or
server computers, routers, bridges, and hubs) from a centrally-located computer that is running network
management software. SNMP performs management services by using a distributed architecture of
management systems and agents.
The Remote Procedure Call (RPC) system service is an interprocess communication (IPC) mechanism that
enables data exchange and invocation of functionality that is located in a different process. The different process
can be on the same computer, on the LAN, or in a remote location, and it can be accessed over a WAN
connection or over a VPN connection. The RPC service serves as the RPC Endpoint Mapper and Component
Object Model (COM) Service Control Manager. Many services depend on the RPC service to start successfully.
Notes
Server Services
System service name: lanmanserver
Application protocol Protocol Ports
NetBIOS Datagram Service UDP 138
Terminal Services
SNMP Service
SNMP Service lets the local computer service incoming Simple Network Management Protocol (SNMP)
requests. SNMP Service includes agents that monitor activity in network devices and report to the network
console workstation. SNMP Service provides a method of managing network hosts (such as workstation or
server computers, routers, bridges, and hubs) from a centrally-located computer that is running network
management software. SNMP performs management services by using a distributed architecture of
management systems and agents.
The Remote Procedure Call (RPC) system service is an interprocess communication (IPC) mechanism that
enables data exchange and invocation of functionality that is located in a different process. The different process
can be on the same computer, on the LAN, or in a remote location, and it can be accessed over a WAN
connection or over a VPN connection. The RPC service serves as the RPC Endpoint Mapper and Component
Object Model (COM) Service Control Manager. Many services depend on the RPC service to start successfully.
Notes
RPC does not use only the hard-coded ports that are listed in the table. Ephemeral range ports that are used by
Active Directory and other components occur over RPC in the ephemeral port range. The ephemeral port range
depends on the server operating system that the client operating system is connected to.
Basically, similar approach to Windows Architecture would apply to these *nix flavours, though historically *nix
systems were more affected to network services, usually IP (Telnet, FTP, SSH, DNS, DHCP etc) than client
software as Windows seemed to always dominate the desktop / domain sphere.
Mac OSX are more Windows ‘like’ which started to change the focus ‘back’ to the end users affecting client
software applications such as Browsers like Safari and Firefox widely used and distributed with these OS.
Nevertheless, classic enumeration attacks to common Internet Services and out-of-date software still offer an
opportunity for Pen testers to access these OS, and extend the attack within DMZs or internal networks.
Although, most exploits have to circumvent OS Security mechanisms such as ASRL, DEP, SYSCALLS in
different ways to how Windows operate, the mechanics and logic (including the results) important for almost all
Penetration testing remain the same.
The principle of finding a vulnerable service or software, either locally or remote with the objective of taking
control of the host from a low privilege user to further escalate to a more privileged one such as Root or
Administrator and progressing by taking control of the other hosts in the network or ultimately the entire
infrastructure.
Ports and Services enumeration / Identification of services and preparing tools for Brute Forcing
accounts.
Let the students identify common vulnerabilities such as enumeration, information leakage, different attack
vectors etc.
msfpayload can be piped through msfencode tools to further encode the binaries created and attempt to avoid
antivirus detection.
msfpayload can be piped through msfencode tools to further encode the binaries created and attempt to avoid
antivirus detection.
msfpayload can be piped through msfencode tools to further encode the binaries created and attempt to avoid
antivirus detection.
meterpreter > ps
Process list
=================