Chapter 8 CNS
Chapter 8 CNS
• Reflected attacks:
– involve attackers obtaining a victim's IP address and creating a packet that is
sent to servers, causing a flood of traffic that overwhelms the victim's server.
– This can be seen in smart cities with interconnected devices like streetlights,
where skilled attackers can manipulate DNS protocols to craft queries,
crippling operations and underscoring the need for comprehensive defense
strategies.
Domain Name System (DNS) attacks
• The key concepts related to DNS and attacks on the system are as follows:
• DNS name resolution: When someone types in the URL of a website, for example, www.packt.com,
the DNS server uses DNS resolution to convert the www.packt.com URL hostname into its IP
address.
• The name resolution process occurs in the following order:
1. DNS cache: The system first checks the DNS cache. This is stored on the local machine. To view the cache,
you can type ipconfig /displaydns into the command prompt. Because the DNS cache is the first place
visited for DNS resolution, it is a prime target for attackers.
2. HOSTS file: If the URL is not in the DNS cache, the system then checks the HOSTS file. This is a text file on
the local computer. It is located on Windows computers under C:\Windows\System32\drivers\etc.
3. Root hints: If the URL is not in the cache or the HOSTS file, the system then consults the root hints, which
most often forwards the resolution to other DNS servers on the internet
• DNS sinkhole: A DNS sinkhole identifies known malicious domains and ingeniously sends back false
information to potential attackers, preventing them from launching an attack. Or, the sinkhole
might redirect the malicious actors to a honeypot instead for further analysis.
• DNS cache poisoning: (aka DNS spoofing) occurs when an attacker manipulates DNS records to
redirect users to malicious websites. By poisoning the DNS cache with fake information, the
attacker tricks users into believing they are visiting legitimate sites, all the while exposing them to
fraudulent activities.
– In the DNS resolution process, the DNS cache is searched for the name of the website, but the attackers
have poisoned the cache with fake entries to redirect the victim to a fake website that looks like the
legitimate website being sought. The attackers could also place fake information in the HOSTS file, which is
the second place searched during the DNS resolution process.
Wireless Attacks
• Wireless networks offer convenience and connectivity, but also serve as an attack vector for malicious
actors.
• Understanding attacker tactics and techniques is crucial for identifying malicious activity using Wi-Fi
scanners.
• The following two methods can be used to launch a wireless attack:
– Rogue access points, disguised as legitimate Wireless Access Points (WAP), can trick users into
sharing sensitive information, leading to unauthorized access, data breaches, and malware spread.
Installing one on a Raspberry Pi can expose this vulnerability.
– An evil twin is a rogue access point that impersonates a real network and intercepts communications
between users and the legitimate network. It allows malicious actors to eavesdrop on online
activities and launch attacks. Attackers create a duplicate network with a name similar to a trusted
network, manipulating encryption settings and authentication procedures.
– Deauthentication and jamming attacks:Wireless attacks use deauthentication and jamming
techniques to disrupt legitimate network services. Jamming is illegal and blocks victims from
accessing the Wireless Access Point (WAP). Deauthentication attacks cause sudden disconnections,
slow network speeds, and increased reconnection attempts. Analyzing radio frequency interference
helps detect these indicators.
– MAC spoofing and device impersonation: Malicious actors often engage in MAC address spoofing to
impersonate authorized devices on the network. Unusual MAC address changes, multiple devices
with identical MAC addresses, or sudden shifts in device behavior can suggest attempted device
impersonation
– Wi-Fi analyzer: A Wi-Fi analyzer analyzes network signals, identifying nearby networks, signal
strength, and potential interference sources, providing a comprehensive view of the Wi-Fi landscape.
On Path Attacks
• On-path attacks, also known as "man-in-the-middle" or
interception attacks, involve adversaries intercepting
communication between parties, allowing cybercriminals to exploit
sensitive information, launch attacks, or manipulate transactions
undetected, including rogue access points and evil twins.
• Other types of on-path attacks are:
– Session Replay When a user connects to a web server, a session token
is created (this may be saved as a cookie). In a session-hijacking attack,
the attacker intercepts the token using Cross-Site Scripting (XSS), man-
in-the-browser, or man-in-the-middle attacks.
– A replay attack intercepts data and replays it at a later date. Kerberos
prevents this by assigning unique sequence numbers and timestamps
to each authentication request and response. For example, in
Windows networks, data transmitted with different sequence
numbers prevents replay attacks.
Credential Replay
• Among the most prevalent and damaging cyberattacks are
credential replay attacks, which involve malicious code, keyloggers,
packet sniffers such as Wireshark or tcpdump, or credential-
capturing malware.
• Two main types of credential attacks are as follows:
– Credential replay attacks involve attackers capturing valid credentials
during a legitimate login attempt and using them to gain unauthorized
access. Administrators should avoid Telnet for remote access due to its
non-encrypted credentials. Secure Shell (SSH) is recommended for
secure remote administration. The legacy NT LAN Manager (NTLM)
authentication protocol should be discouraged.
– Credential stuffing is an attack where attackers use the same
credentials for all accounts, compromising all matched accounts.
Organizations should monitor login spikes and failed attempts. To
prevent this, companies should conduct security awareness training,
encourage unique passwords, and use password managers.
Malicious Code
• Malicious code is a dark aspect of software development,
aiming to infiltrate systems, steal data, and cause digital
chaos.
• Early indicators include unusual network traffic patterns,
unexpected system behaviour, and unfamiliar files or
software.
• Detecting anomalies and monitoring for unusual behaviour
enhances cyber security.
• Examples of malicious code attacks include the following:
– Bash shell attacks
– Python
– Java Script
– XSS
• Bash Shell Attack: The Bash shell, a powerful tool in Unix-like operating systems,
can be exploited for malicious purposes, including unauthorized command
execution, system compromise, and file manipulation. (Example of bad script,
see from book)
• Python, a simple and versatile programming language, has gained popularity
among cybercriminals due to its ability to execute various actions, including
keylogging and data exfiltration, through phishing emails. (Example of bad script,
see from book)
• JavaScript, a crucial component of web development, is frequently exploited by
attackers for client-side attacks, allowing malicious code to steal user data,
redirect traffic, and execute unauthorized transactions. (Example of bad script,
see from book)
Indicators of Attack
• Indicators of Attack (IoAs) provide early warnings of potential threats by identifying suspicious activities or behaviors within
a network, thereby helping organizations proactively defend against cyberattacks.
• The following are some common indicators that will help you identify attacks:
– Account lockouts, particularly for privileged accounts, are a warning sign of potential malicious attempts to gain
unauthorized access, often triggered by brute-force attacks.
– Concurrent session usage: Monitoring the number of concurrent user sessions can reveal suspicious activity. Sudden
spikes or a significantly higher number of concurrent sessions than usual might indicate unauthorized access or a
breach in progress.
– Blocked content indicators reveal attempts to access valuable data, such as ACLs and DLP systems, which log access
denied messages and events if auditing is configured.
– Impossible travel refers to multiple logins from distant locations in an unrealistically short timeframe, potentially
indicating account compromise by an attacker.
– Resource consumption: Unusual spikes in resource consumption, such as excessive CPU or memory usage, might
suggest a malware infection or a DDoS attack targeting your systems.
– Resource inaccessibility: When critical resources become suddenly inaccessible, it could be a sign of a cyberattack,
either due to network issues or a deliberate effort to disrupt services. An example of this is a DDoS attack.
– Out-of-cycle logging: Logs that are generated at unusual or unexpected times can be indicative of suspicious
activities. Cyber attackers often manipulate logs to cover their tracks, so irregular log generation times warrant
investigation.
– Published/documented: Published or documented vulnerabilities and configuration settings can attract malicious
actors. Regularly checking your organization’s systems against such known issues can help prevent attacks.
– Missing logs: The absence of expected logs (especially during critical events or incidents) can be a clear sign of
tampering or an attempt to hide malicious activities.