CYB 405 main Material
CYB 405 main Material
Course Outline
Ethical hacking process, penetration testing, securing and protecting networks from
A vulnerability assessment intends to identify threats and the risks they pose. It typically
involves using automated testing tools, such as network security scanners, whose results are
listed in a vulnerability assessment report.
Organizations of any size, or even individuals who face an increased risk of cyberattacks, can
benefit from some form of vulnerability assessment, but large enterprises and organizations
subject to ongoing attacks will benefit most from vulnerability analysis.
Because security vulnerabilities enable hackers to access IT systems and applications, it is
essential for enterprises to identify and remediate weaknesses before they can be exploited. A
comprehensive vulnerability assessment, along with a vulnerability management program, can
help companies improve the security of their systems.
A vulnerability assessment uses automated network security scanning tools. The results are listed
in a vulnerability assessment report, which focuses on providing enterprises with a list of
vulnerabilities that need to be fixed. However, it does so without evaluating specific attack goals
or scenarios.
Organizations should conduct vulnerability testing on a regular basis to ensure the security of
their networks, particularly when changes are made. For example, test when services are added,
new equipment is installed or ports are opened.
In contrast, pen testing involves identifying vulnerabilities in a network and then attempting to
exploit those vulnerabilities to attack the system. Although sometimes carried out in concert with
vulnerability assessments, the primary aim of pen testing is to check whether a vulnerability
exists. In addition, pen testing tries to prove that exploiting a vulnerability can damage the
application or network.
While a vulnerability assessment is usually automated to cover a wide variety of unpatched
vulnerabilities, pen testing generally combines automated and manual techniques to help testers
delve further into the vulnerabilities and exploit them to gain access to the network in a
controlled environment.
The difference between Penetration Testing and Vulnerability Scanning
Confused by the terms penetration testing and vulnerability scanning?
IT security terminology and acronyms are bandied about at a furious rate – so much so that the
use of several terms throughout the course of a typical cybersecurity conversation could end up
sounding quite similar. The terms penetration testing and vulnerability scanning, in particular,
often end up confusing many, especially when it comes to their key differences and overall
purpose.
While both aim to detect weaknesses in a system, the methods used to conduct penetration tests and
vulnerability scans differ, as do their goals. In short, a pen test is an offensive technique that mimics
real-world attacks and their consequences, while a vulnerability scan is a higher-level technique that
identifies and reports on flaws.
Let's delve into penetration testing vs. vulnerability scanning - how they're different, how they're
related and why they're both important parts of an organization's IT security strategy.
Note that pen testing is a form of ethical hacking. Security professionals should always obtain
permission from the organization before performing any tests.
The goal of pen testing, which can be conducted in-house or outsourced to a third-party tester, isn't to
steal data or cause harm to assets, but to mimic the tactics, techniques and procedures threat actors
might use to identify exploitable flaws in a business's systems. Once identified during a pen test,
security teams can fix these vulnerabilities prior to a real-world attack.
A pen test is a relatively broad term for the following six underlying testing steps:
Security teams should follow up these steps with remediation efforts and retesting to ensure
vulnerabilities are fixed.
Follow
these six steps to perform a comprehensive pen test.
Security practitioners usually conduct pen tests with a particular focus. For example, a social
engineering penetration test determines how employees respond to phishing scams, a mobile
application pen test assesses the security of mobile apps and a cloud pen test discerns vulnerabilities
in cloud environments.
Ethical hackers use a variety of commercial and open source penetration testing tools.
Some options include Nmap to scan networks, Wireshark to capture and analyze protocols,
Checkmarx's Zed Attack Proxy to scan web applications and Aircrack-ng to test Wi-Fi security.
Pen test frequency varies by organization. Many experts suggest annual testing, but organizations in
high-risk industries, such as banking or healthcare, might need to test more often. Compliance
regulations can also dictate testing cadence. PCI DSS 4.0, for example, requires annual pen tests.
Teams should also perform pen tests after infrastructure changes, such as installing new appliances,
upgrading applications or equipment, opening new office locations or updating security policies.
Costs can be high, especially if pen testers don't have a specific attack or target.
Tests can be time-consuming.
Attacks don't always replicate real-world breaches, especially if employees know when
testing occurs.
Tests can result in false positives.
Narrow testing scopes can result in missed vulnerabilities or weaknesses.
Testing could require skills and resources organizations don't have in-house.
Executives might ignore test results and see pen testing as a box to check for compliance
reporting.
To counter high costs and the time-consuming nature of manual pen tests, many pen testing tools use
AI to automate some processes of the testing lifecycle. Automated tools enable teams to speed up
testing times and can counter staffing and skills gaps.
Vulnerability assessment reports use scan results to summarize the vulnerabilities, prioritize threats
and create a remediation plan.
Internal scans. These scans look for vulnerabilities within a network. They have access
to the internal network and look for vulnerabilities such as misconfigurations, missing
patches, weak passwords and coding errors.
External scans. These scans are performed outside the network being tested. They do
not have access to the internal network. External scans look for vulnerabilities that could
provide access to external attackers, such as open ports, insecure APIs and web
application flaws.
Unauthenticated scans. These scans mimic external attackers who do not have
legitimate access to a network.
Authenticated scans. These scans test a system as a valid, credentialed user. They search
for vulnerabilities attackers could exploit if they had access to a network.
Common targeted vulnerability scans include compliance scanning, network scanning, database
scanning and host-based scanning.
Security teams have a variety of commercial and open source vulnerability scanners to choose from.
Some open source options include Open Vulnerability Assessment Scanner to find known
vulnerabilities, Snyk Open Source to discover application dependencies with known vulnerabilities
and sqlmap to scan databases.
Vulnerability scanning benefits include the following:
Security teams conduct automated vulnerability scans at regularly scheduled intervals as part of
their vulnerability management program. These automated scans provide up-to-date reports of
potentially vulnerable systems and software so security administrators can prioritize and schedule
patching efforts to mitigate cyberthreats.
While both tools use varying levels of automation to find vulnerabilities, pen tests are generally more
manual and in-depth than vulnerability scans, which makes them more expensive. Pen tests also
attempt to exploit vulnerabilities to discover their effects on systems, while vulnerability scans only
report flaws and weaknesses but not their exploitability.
Intelligence gathering.
Gaining access to applications or systems.
Privilege escalation.
Payload inspection and analysis.
Vulnerability scanning is key to the intelligence gathering step. It detects and creates a report on
potential weaknesses. Security teams can use this report to inform their pen test efforts, as well as
validate the results of a scan.
Threats and Vulnerabilities
What Are Web Application Attacks?
Web application attacks are malicious activities that target web applications by exploiting
vulnerabilities in their design or implementation. These attacks can result in unauthorized access,
data theft, or other harmful consequences.
Common types of web application attacks include SQL injection, cross-site scripting (XSS),
cross-site request forgery (CSRF), and file inclusion attacks. Attackers may use automated tools
or manually craft their attacks to bypass security measures and gain access to sensitive
information or systems.
Organizations can prevent or mitigate web application attacks by implementing strong security
measures, such as input validation, user authentication, and regular vulnerability testing.
When another user views the page that contains the malicious script, the script is executed in
their browser, allowing the attacker to steal data or perform other malicious actions on the user’s
behalf. XSS attacks can be prevented by properly sanitizing user input, using content security
policy (CSP) headers, and escaping untrusted data.
For example, a CSRF attack could be used to make unauthorized purchases or change account
settings. CSRF attacks can be prevented by using anti-CSRF tokens, which are unique tokens
that are generated by the web application for each user session and must be included in every
request to the application.
XXE attacks typically involve injecting specially crafted XML payloads that exploit the XML
parser’s ability to read external entities. XXE attacks can be prevented by disabling external
entity parsing or using secure XML parsers that properly sanitize input data.
4. Injection Attacks
Injection attacks involve inserting malicious code into a web application, typically in the form of
input data such as SQL queries, commands, or scripts. Injection attacks are successful when an
application fails to properly validate and sanitize input data. These attacks can be prevented by
properly validating and sanitizing input data and using parameterized queries to access
databases.
Fuzz testing can be performed manually or with the help of automated tools. Fuzz testing can
uncover vulnerabilities that may not be detected by other security testing methods such as
penetration testing. To perform effective fuzz testing, a tester needs to understand the web
application’s input and output mechanisms and the types of data that the application processes.
DDoS attacks can be prevented by using network security devices, such as firewalls and
intrusion prevention systems, that can detect and block malicious traffic. Additionally, web
application developers can use content delivery networks (CDNs) and load balancers to
distribute traffic across multiple servers to help mitigate the effects of DDoS attacks.
8. Path Traversal
Path traversal is a type of web application attack that involves manipulating file paths in a web
application in order to access unauthorized files or directories on the server. Path traversal
attacks typically occur when a web application does not properly validate user input, allowing an
attacker to traverse up and down directory structures to access sensitive files.
Path traversal attacks can be prevented by properly validating user input and sanitizing file paths,
as well as using secure file access methods that restrict access to sensitive files and directories.
Secure coding practices: Adopt secure coding practices, such as the OWASP Top 10 guidelines,
to ensure that web applications are built with security in mind. This includes measures like input
validation, output encoding, and secure authentication mechanisms.
Regular security testing: Perform regular security testing, such as penetration testing and
vulnerability scanning, to identify and address security vulnerabilities in web applications.
Access control: Implement access controls to ensure that only authorized users can access
sensitive data or functionality within web applications. This includes measures like role-based
access control and multi-factor authentication.
Secure communication: Use secure communication protocols, such as HTTPS, to ensure that
data transmitted between web applications and users is encrypted and protected from
interception.
Server and network security: Implement server and network security measures, such as
firewalls and intrusion detection systems, to protect web applications from attacks like DDoS
and SQL injection.
Regular updates and patches: Keep web applications and supporting software up-to-date with
the latest security patches and updates to address known vulnerabilities.
User education: Educate users on best practices for safe web browsing, such as avoiding
clicking on suspicious links or downloading attachments from unknown sources.
Incident response planning: Develop and test incident response plans to ensure that web
application security incidents are identified and addressed in a timely and effective manner.
Port Scanning: Using tools like Nmap or Angry IP Scanner to find open ports
or services.
Vulnerability Scanning: Using tools like Nessus to detect known weaknesses
in systems and applications.
Network Mapping: Generating a visual map that shows the network topology
with applications like SolarWinds.
Banner Grabbing: This involves collecting software version information from
open services to help determine any weaknesses.
Ping Sweeps: This entails sending ICMP requests to identify active hosts on a
particular network.
3. Gaining Access
During this crucial stage, the intruder utilizes the weaknesses identified during
scanning for unauthorized entry into the target system. This may involve leveraging
applications, operating systems, or network flaws. The objective is establishing access
at different privilege levels, from user accounts to administrative control.
Exploitation Methods comprise buffer overflows, SQL injection, and cross-site
scripting (XSS).
Popular Tools Used:
Metasploit
SQLmap
Hydra
Commonly used techniques for Gaining Access:
Password Cracking: Using brute force and dictionary attacks or to crack
passwords, rainbow tables are used.
Exploration of Vulnerabilities: Unauthorized access can be obtained by
exploiting known vulnerabilities such as SQL Injection or buffer overflows.
Privilege Escalation: Higher-level privileges are acquired within a system
through exploitation or misconfiguration.
Session Hijacking: Taking over a valid session between a user and a system
gives entrance without permission.
Man-in-the-Middle (MITM) Attacks: By intercepting communication
between two parties, sensitive data can be accessed, violating confidentiality
principles.
4. Maintaining Access
Once inside, the intruder must maintain a presence on the target machine for further
actions such as gathering or monitoring sensitive data. Therefore, backdoors, rootkits,
or Trojan horses can be installed at this point to ensure continued access to the device
even after it has been rebooted or patched.
Persistence Techniques: Employing malicious programs, establishing concealed user
accounts, or exploiting cron jobs.
Tools Used:
Netcat
Ngrok
Empire
Standard Methods of Maintaining Access:
Installing Backdoors: Creating permanent ways of accessing the system later,
like backdoors or rootkits.
Creating Hidden User Accounts: Adding unauthorized users with
administrative privileges that are hard to discover.
Tunneling: Employing strategies such as SSH tunneling for secure
communication with an infected machine.
Keystroke Logging: Capturing user’s keystroke entries to acquire confidential
details such as passwords or private information.
Trojan Horses: Integrating applications that look real but permit unlawful
entry.
5. Clearing Track
The finale of ethical hacking revolves around ensuring the hacker remains under the
radar. This implies wiping logs, concealing files, and manipulating timestamps to
eliminate evidence or proof of any attack. The intention is to ensure that attackers can
never be detected or traced via their attack methodology.
Tools Used:
CCleaner
Stealth Rootkit
Timestamp
Standard Methods for Covering Tracks:
Log Tampering: Deleting or modifying logs to erase evidence of hacking
activities.
Steganography: Hiding malicious files or data within legitimate files to avoid
detection.
File Timestamp Alteration: Changing the timestamps of modified files to
mislead investigators.
Clearing Command Histories: Deleting or altering shell command histories to
prevent detection.
Encryption: Encrypting communication and files to obscure activities makes
forensic analysis more difficult.