Chapter 01: Penetration Testing Flashcards

1
Q

Penetration Testing

A

Seeks to bridge the gap between the rote use of technical tools to test and organization’s security and the power of those tools when placed in the hands of a skilled and determined attacker

Pentests are authorized, legal attempts to defeat an org’s security controls and perform unauthorized activities

This is the most effective way for an org to gain a complete picture of its security vulnerabilities

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Hacker Mindset

A

Instead of trying to defend against all possible threats, pentesters only need to find a single vulnerability that they can exploit

To find these flaws, they must think like an attacker—hacker mindset

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Ethical Hacking

A

The art of using hacking tools and techniques within a code of ethics that regulat activity. Key components include:

  • Performing background checks on all members of pentesting team
  • Adhering to the defined scope of a pentesting engagement
  • Immediately reporting any active security breaches or criminal activity detected during a pentest
  • Limiting the use of pentesting tools to approved engagements
  • Limiting the invasiveness of a pentest based on the scope of the engagement
  • Protecting the confidentiality of data and information related to or uncovered during the pentest
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Benefits of Pentesting

A
  1. Provides us with knowledge we can’t obtain elsewhere—we learn whether an attacker with the same knowledge, skills, and info as our testers would be able to penetrate our defenses
  2. If attackers are successful, pentesting gives us important blueprints for remediation—we can trace the actions of the testers as they progressed through the different stages of the attack and close the doors they passed through
  3. Provide essential, focused information about specific attack targets—focused tests drill into the defenses around a specific target and provide actionable insight that can prevent a vulnerability from initial exposure
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Threat Hunting

A

Related to pentesting but has a separate purpose

Pentesting seeks to evaluate the org’s security controls by testing them in the same manner an attacker might

Threat hunters use the attacker mindset to search the org’s tech infrastructure for the artifacts of a successful attack

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Presumption of Compromise

A

Threat hunting mindset

Assumes attackers have already successfully breached an org and searches out the evidence of successful attacks

When threat hunters discover a potential compromise, they kick into incident-handling mode in order to contain, eradicate, and recover from the compromise

Threat hunters also conduct postmortem analysis of the factors that contributed to the compromise in order to remediate deficiencies

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Regulatory Requirements for Pentesting

A

The most common regulatory requirement for pentesting comes from PCI-DSS

Contractual obligations that govern all orgs in storage, processing, or transmission of credit card transactions

Section 11.3 of the cardholder data environments (CDEs) reads that pentesting methodology needs to include the following:

  • Based on indsutry accepted pentesting approaches (NIST SP800-115)
  • Includes coverage for the entire CDE permiter and critical systems
  • Includes testing from both inside and outside the network
  • Includes testing to validate any segmentation and scope-reduction controls
  • Defines application-layer pentests to include, at minimum, the vulnerabilities listed in Requirement 6.5
  • Defines network-layer pentests to include components that support network function as well as OS
  • Includes review and consideration of threats and vulnerabilities experienced in the last 12 months
  • Specifies retention of pentesting results and remediation activities results

NOTE: This is a helpful blueprint for anyone, not just PCI-DSS

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Requirements 6.5 Vulnerabilities

A

This includes common vulnerabilities like:
* SQL injection
* Buffer overflow
* Insecure cryptographic storage
* Insecure communications
* Improper error handling
* XSS
* Improper access controls
* CSRF
* Broken authentication
* Other “high risk” vulnerabilities

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Frequency and Scope of Pentests for PCI-DSS

A

11.3.x provides four additional requirements:

  • 11.3.1—Perform external pentesting at least annually and after any significant infrastructure or application upgrade or modification (like an OS upgrade, a sub-network added, or a web server added)
  • 11.3.2—Perform internal pentesting at least annually and after any significant infrastructure or application upgrade or modification (like an OS upgrade, a sub-network added, or a web server added)
  • 11.3.3—Exploitable vulnerabilities found during pentesting are corrected and the testing is repeated to verify corrections
  • 11.3.4—If segmentation is used to isolate the CDE from other networks, perform pentests at least annually and after any changes to segmentation controls/methods to verify that the segmentation methods are operational and effective, and isolate all out-of-scope systems from systems in the CDE
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Internal Pentesting Teams

A

Made up of cybersecurity pros from within an organization who conduct pentests on the org’s systems and applications

They might be dedicated to pentesting full time or convened periodically to conduct tests

Pros of using an internal team:
* Contextual knowledge about the org that can improve the effectiveness of testing by providing enhanced suject matter expertise
* Generally less expensive than hiring a pentesting firm

Cons of using an internal team:
* You’re using internal employees
* Internal employees may have helped to design and implement the security controls that they’re testing which can introduce bias toward demonstrating they’re secure
* The bias may make it more difficult to spot potential flaws that could provide a foothold for an attacker

NOTE: Internal teams should be organizationally separate from cybersecurity team that designs and operates controls if possible

NOTE: Internal can refer to internal teams at an org or the internal perspective of a pentest (internal network)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

External Pentesting Teams

A

Hired for the express purpose of performing a pentest, and can come from a general cybersecurity consulting firm or one that specializes in pentesting

Pros of using an external team:
* Tend to be highly skilled
* Generally bring a higher degree of independence than internal teams

NOTE: Always be aware of potential conflicts of interest pentesters may have—might not be a good idea to hire the consultants who helped you design and implement your security controls as negative reports they provide could reflect poorly on the overall quality of their implementation work (bias)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Repeating Pentests

A

Three reasons why you want to repeat tests:
1. Technology environments change—systems are reconfigured, patches applied, and regular tweaks are made. Periodic tests have a good chance of detecting security inssues introduced by those changes
2. Attack techniques evolve—updated pentests should reflect these attack evolutions. Systems developed today may receive a clean bill of health, but in two years they’re potentially vunerable
3. Each team member brings a unique set of skills, talents, and experiences—Rotate team members so you’re getting the perspective of individuals who have never tested your systems, environments, or applications

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

CompTIA Pentesting Process

A
  1. Planning and Scoping
  2. Information Gathering and Vulnerability Scanning
  3. Attacking and Exploiting
  4. Reporting and Communicating Results

NOTE: There’s a fifth domain titled “Tools and Code Analysis” that includes coverage of the man tools used during all stages of the pentesting process

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Planning and Scoping

A

Pentesters and their clients need to:

  • Have a clear understanding of what will occur during the test
  • Outline clear rules of engagement
  • Decide what systems, data, processes, and activities are within the scope of the test

NOTE: There’s a very fine line between hacking and testing. A written statement of work (SOW) that includes clear authorization for pentesting is crucial to staying on the right side of the law and meeting client expectations

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Information Gathering and Vulnerability Scanning

A

After clearly defining the scope and securing authorization to proceed, pentesters move to the reconiassance phase where they gather as much intel about the target environment as possible and perform testing to identify vulnerabilities in the environment

Vulnerabilities identified here provide the road map for the remainder of the test, highlighting all the weak links in an org’s security chain (potential points of entry for an attacker)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Attacks and Exploits

A

After developing a clear testing plan and conducting recon activities, pentesters move on to exploitation of discovered vulnerabilities and penetration of the network as deeply as possible (within the bounds of the testing scope)

17
Q

Reporting and Communication

A

A key requirement in any successful pentest is reporting on the useful information to the client about the security of their environment

This comes in the form of clear, actionable recommendations for impleenting new security controls and enhancing existing controls

18
Q

Tools and Code Analysis

A

Applying coding skills to automate aspects of a pentest (Perl, JavaScript, Ruby, Bash, Python, and PowerShell)

19
Q

The Cyber Kill Chain

A

Lockheed Martin developed process for how sophisticated attackers tend to organize their work:

  1. Reconaissance
  2. Weaponization
  3. Delivery
  4. Exploitation
  5. Installation
  6. C2
  7. Actions on Objectives

These can map to the pentesting process as follows:

  • Information Gathering and Vulnerability Scanning = Reconnaissance
  • Attacking and Exploiting = Weaponization, Delivery, Exploitation, Installation, C2, Actions on Objectives
20
Q

Cyber Kill Chain: Reconnaissnace

A

Attackers gather OSINT and conduct initial scans of the target environment to detect potential avenues of exploitation

21
Q

Cyber Kill Chain: Weaponization

A

Attackers develop a specific attack tool designed to exploit the vulnerabilities indentified during reconnaissance

They often use automated tools to develop a malware strain specifically tailored to infiltrate their target

22
Q

Cyber Kill Chain: Deliver

A

Attackers deliver the malware to their target

This can occur through a varity of means including exploitating a network or application vulnerability, conducting a social engineering attack, distributing malware on infected devices (USB), or sending email attachments (phishing)

23
Q

Cyber Kill Chain: Exploitation

A

The malware gains access to the targeted system, which can occur when the victim opens a malicious file or when the attacker exploits a vulnerability over the network, or otherwise gains a foothold on the target network

24
Q

Cyber Kill Chain: Installation

A

The attacker uses the initial access provided by the malware to establish persistent access to the target system (establishing persistence)

Attackers may create a back door that allows them to return to a system on a later date, create Registry entries that reopen access once an admin closes it, or install web shells that allow them access to the system over HTTPS connections

25
Q

Cyber Kill Chain: C2

A

The attacker will remotely control the compromised system, either manually with a web shell or by connecting it to an automated C2 network that provides it with instructions

26
Q

Cyber Kill Chain: Actions on Objectives

A

Attackers advance the original objectives of their attack

Could involve pivoting from the compromised system to other systems operated by the same organization, which restarts the Cyber Kill Chain

This could also include the theft of sensitive information, unauthorized use of computing resources to engage in DOS attacks, mine crypto, or modify or delete information

(CIA-DAD)

27
Q

Pentesting Tools

A

The exam requires you to understand the purposes of a wide varity of tools, but the intent is not to test on specific vendor feature sets

Know what each tool does and be able to describe the purpose of each tool in a coherent sentence

PAGE 18 Table 1.1

28
Q

Inherent Risk

A

When a risk is identified, but no mitigation factors are applied

29
Q

Residual Risk

A

When a risk is calculated after applying mitigations and security controls

30
Q

Risk Exception

A

Risk that exists due to an exemption being granted or failure to comply with corporate policy

31
Q

Risk Management

A

Risk Avoidance
* Stops a risky activity or chooses a less risky alternative
* Eliminating the hazards, activities, and exposures with potential negative effects

Risk Transference
* Passes the risk to a third party, like insurance provider

Risk Mitigation
* Minimizes the risk to an acceptable level which an org can accept

Risk Acceptance
* Accepts the current level of risk and the costs associated with it if the risk is realized

32
Q

Access Controls

A

Seven Types of AC Categories
* Compensative
* Corrective
* Detective
* Deterrent
* Directive
* Preventive
* Recovery

Three Types of Controls
* Administrative
* Logical
* Physical

READ ME: https://medium.com/novai-cissp-ciso/understanding-the-seven-main-categories-of-access-control-in-cissp-426226c09bc2

33
Q

Input Validation

A

Any technique used to ensure that the data entered into a field or variable in an application is handled appropriately by that application
* Can be conducted locally on the client or remotely on the server
* Client-side is very dangerous because it’s vulnerable to malware interference
* Server-side can be time and resource intensive
* All input should still undergo a server-side validation after passing client-side validation

Input Normalization
A string is stipped of illegal characters or substrings and converted to the accepted character set

Canonicalization Attack
Attack method where input characters are encoded in such a way as to evade vulnerable input validation measures
* This is the percent encoding shit

READ ME: https://cheatsheetseries.owasp.org/cheatsheets/Input_Validation_Cheat_Sheet.html

34
Q

Output Encoding

A

Coding methods to sanitize output by converting untrusted input into a safe form where the input is displayed as data to the user without executing as code in the browser
* Used to mitigate against code injection and XSS attacks that attempt to use input to run a script
* Takes special characters like < and says & lt;

READ ME: https://cheatsheetseries.owasp.org/cheatsheets/Cross_Site_Scripting_Prevention_Cheat_Sheet.html

35
Q

Parameterized Queries

A

A technique that defends against SQL injections and insecure object references by incorporating placeholders in a SQL query
* This is technically a form of output encoding

READ ME: https://cheatsheetseries.owasp.org/cheatsheets/Query_Parameterization_Cheat_Sheet.html