Chapter 04: Vulnerability Scanning Flashcards

1
Q

Vulnerability Management Programs

A

Seek to identify, prioritize, and remediate vulnerabilities before an attacker exploits them to undermine the CIA of enterprise information assets

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

PCI-DSS Vulnerability Scans

A
  • Orgs must run both internal and external scans
  • Orgs must run scans on at least a quarterly basis and after any significant change in the network, like new system component installations, changes in network topology, firewall rule modifications, product upgrades
  • Internal scans must be conducted by qualified personnel
  • Orgs must remedaite any high-risk vulnerabilities and repeat scans to confirm that they’re resolved until they receive a clean scan report
  • External scans must be conducted by an ASV (approved scanning vendor) authorized by PCI-DSS
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

FISMA Vulnerability Scans

A

Federal Information Security Management Act of 2002

Requires government agencies and other orgs operating systems on behalf of government comply with a series of standards

  • Scans for vulnerabilities in the infomration system and hosted apps and when new vulnerabilities potentially affecting the system/application are identified and reported
  • Employs vulnerability scanning tools and techniques that facilitate interoperability among tools and automate parts of the vulnerability management process by using standards for:
    1. Enumerating platforms, software flaws, and improper configs
    2. Formatting checklists and test procuedures
    3. Measuring vulnerability impact
  • Analyzes vulnerability scan reports and results from security control assessments
  • Remediates legitimate vulnerabilities in accordance with an organizational assessment of risk
  • Shares information obtained from the vulnerability scanning process and security control assessments to help eliminate similar vulnerabilities in other information systems (EX: systemic weaknesses or deficiencies)

Page 114-115

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

NIST 800-53

A

Security and Privacy Controls for Federal Information Systems and Organizations

Describes eight control enhancements that may be required depending on their circumstances:
1. The org employes vulnerability scanning tools that include the capability to readily update the information system vulnerabilities to be scanned
2. The org updates the information system vulneabilities scanned prior to a new scan and/or when new vulnerabilities are identified and reported
3. The org employs vulnerability scanning procedures that can identify the breadth and depth of coverage (EX: information system components scanned and vulnerabilities checked)
4. The org determines what information about the information systems is discoverable by adversaries and subsequently takes org-defined corrective actions
5. The information system implements privileged access authorization to information system components for select vulnerability scanning activities
6. The org employs automated mechanisms to compare the results of vulnerability scans over time to determine trends in information system vunlerabilities
7. Withdrawn by NIST
8. The org reviews historic audit logs to determine if a vulnerability identified in the information system has been previously exploited
9. Withdrawn by NIST
10. The org correlates the output from vulnerability scanning tools to determine the presence of multi-vulnerability or multi-hop attack vectors

Page 115-116

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

Identifying Scan Targets

A

Some orgs choose to cover all systems in their scanning process while others select only certain ones depending on the answers to these questions like:
* What is the data classification of the information stored, processed, or transmitted by the system?
* Is the system exposed to the internet or other public or semipublic networks?
* What services are offered by the system?
* Is the system a production, test, or development system?

Scanning tools can automate the identification of systems to be scanned and build an asset inventory

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

Determining Scan Frequency

A

Factors that influence how an org decides this:
* Risk appetite
* Regulatory requirements
* Technical constraints
* Business constraints
* Licensing limitations
* Operational constraints

Pentesters need to know where the trade-offs are made for orgs in this decision process

These limitations can point to areas where pentesters should supplement the org’s existing scans with custom scans designed specifically for pentesting

Page119, but you know from CySA

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

Active vs Passive Scanning

A

Active Scans
Interact with the host to identify open services and check for possible vulnerabilities

Active provides high-quality results, but it comes with drawbacks:
* Noise and will likely be detected by admins of the scanned systems—not an issue in environments where admins have knowledge of the scan, but problematic for stealth
* Potential to accidentally exploit vulnerabilites and interfere with the functioning of production systems
* May miss some systems if they’re blocked by firewalls, IPS, segmentation, etc

Passive Scans
Take a different approach and supplement active scans

Instead of probing for vulnerabilities, passive scanners monitor the network similar to an IDS

Instead of watching for intrusion attempts though, they look for signatures of outdated systems and apps, reporting results to admins

Only capable of detecting vulnerabilities that are reflected in network traffic and aren’t a replacement for active scans

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

Scoping Vulnerability Scans

A

Figuring out the extent of the scan by answering questions like:
* What systems, networks, services, apps, and protocols will be included in the scan?
* What technical measures will be used to test whether systems are present on the network?
* What tests will be performed against systems discovered by a vulnerability scanner?
* When will you run the scans?

When scans are taking place for pentests, avoid business interruptions as much as is possible

But the invasiveness of the test and the degree of coordination with management should be guided by the agreed-upon SOW for the pentest

DION NOTES
* You need to know what you’re going to add to the scope of your vuln scan, because it will consume more resources
* But the more you add, the more likely you’ll be seen by network defenders and blocked
* This is why conducting recon upfront to determine what OS, services, and versions are being run on a given target—if you can scan for just the vulns associated with your findings, you drastically reduce your time and chances of being stopped
* If you’re doing web app scanning, those can take a long time too so know what you’re doing there with regard to the amount of code an app might be built on
* Know your protocols, because scanning all 65,535 ports is not ideal and will kill your timing, or will you just look at the web server on 80 and 443?
* This is all based on your initial scoping documentation

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

Scan Sensitivity Levels

A

Often it’s more productive to adjust the scan settings to the specific needs of an assessment vs conducting a full scan using all available vulnerability tests

Sensitivity settings determine the types of checks that the scanner will perform and should be customized to ensure that the scan meets its objectives while minimizing the possibility of disrutpion to the environment

Pentesters don’t want to cause issues in assets, especially ICS, IoT, and specialized medical equipment

The best way to avoid that is to maintain a test environment that contains copies of the same systems running on the production network, and then run scans against the test—if anything is found you can fix them in production and not worry about breaking them with a scan

Stealth Scans
The default for most scanners is TCP connect which is noisy and will attract immediate attention

Stealth scans are a good workaround for this, especially if you’re simulating how an attacker might actually approach a target

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

Scan Perspective

A

External Scans
Run from the perspective of the internet, giving admins a view of what an attacker located outside the org would see as potential vulnerabilities

Internal Scans
Might run from a scanner on the general corporate network, providing the view that a malicious insider might encounter

Data Center Scans
Scans located inside the data center and agents located on servers offer the most accurate view of the real state of the server by showing vulnerabilities that might be blocked by other security controls on the network

DION NOTES
* Important to understand the network topology here, because this will impact where you scan from

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

SCAP

A

Security Content Automation Protocol

An effort by the security community, led by NIST, to create a standardized approach for communicating security-related information

This standardization is important to the automation of interactions between security components

SCAP standards include the following:
* CCE: Common Configuration Enumeration—Discussing system config issues
* CPE: Common Platform Enumeration—Describing product names and versions
* CVE: Common Vulnerabilities and Exposures—Security-realted software flaws
* CVSS: Common Vulnerability Scoring System—Measuring and describing the severity of security-related software flaws
* XCCDF: Extensible Configuration Checklist Description Formats—Language for specifying checklists and reporting checklist results
* OVAL: Open Vulnerability and Assessment Language—Language for specifying low-level testing procedures used by checklists

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

Static Code Anlaysis

A

Conducted by reviewing the code for an application

Uses the source code for an app, which makes it white-box testing with full visibility to the testers

Allows testers to find problems other tests miss because the logic isn’t exposed to other testing methods or internal business logic problems

Static analysis doesn’t run the program being analyzed, but instead focuses on understanding how it’s written and what the code is intended to do

EXAM NOTE: BrakeMan is a static code analysis tool only used for Ruby on Rails

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

Dynamic Code Analysis

A

Relies on the execution of the code while providing it with input to test the software

Pentesters will likely find themselves conducting dynamic analysis rather than static because of RoE and SOW often restrict access to source code

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

Fuzzing

A

Sending invalid or random data to an app to test its ability to handle unexpeted data

App is monitored to determine if it crashes, failes, or responds in an incorrect manner when stressed

Can usually be performed externally without any privileged access to systems and is therefore a popular technique with pentesters

Very noisy and can attrack attention from cybersecurity teams

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

Vulnerability Lifecycle

A

Discover
* Identify the vulnerability
* Create an exploit, done first as POC to prove that this vuln can be exploited

Coordinate
* Report the vulnerability
* Generate a CVE

Mitigate
* Release the CVE
* Create a patch, release security config, etc

Manage
* Deploy a patch
* Test the system

Document
* Record the results
* Record the lessons learned

DION NOTES
* The exam lists Discover as the first stage
* But there really is a stage zero, and that’s with unknown vulns aka zero-days
* When a zero day comes out, this is a new tool or tactic in a pentesters arsenal for breaking into a system

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

Types of Vuln Scans

A

Discovery Scan
* Least intrusive, can be as simple as conducting a ping sweep

Stealth Scan
* Conducted by sending a SYN packet and then analyzing the response
* We send SYN –> Receive SYN/ACK –> We send RST
* Since we send RST and the TCP handshake is never completed, this usually doesn’t get logged by the target
* Terminus, because it’s less noise and more secretive than a full scan
* Some IDS and IPS will detect stealth scans regardless though
* To mask your scans: slow them down, break into individual scans, or mask true source over TOR or anonymization techniques

Compliance Scan
* Used to identify vulnerabilities that may affect compliance with regulations or policies

17
Q

Query Throttling

A

Reducing the number of queries launched by the scanner at a given time

EX: You can set number of queries launched by nmap with the -T options, which helps minimize network bandwidth and chances of being detected

You can limit queries to only send scans once per hour during the work day, but then send 25 scans per hour between 9 pm and 5 am

18
Q

nmap Discovery Scan

A

Used to footprint the network by figuring out what the network looks like from a topology standpoint

The basic syntax:
nmap 192.168.1.0/24
* This is going to scan all 256 IPs in this range

The Default behavior:
* To ping and send TCP ACK packet to ports 80 and 443
* If the host responds, nmap will perform a port scan against that host to determine which services it’s running across the 1,000 most common ports
* Not stealthy in default config—most IDS/IPS, fw will try to block

Host Discovery Scan
nmap -sn 192.168.1.0/24
* Only performs host discovery part and not the port scan

List Scan
-sL
* Think of it like a DNS lookup
* Lists the IPs from the supplied target range and performs a reverse-DNS query to discovery any host names associated with those IPs
* More stealth focused because you’re not actually probing the host
* You’re taking IP range and asking DNS server to do it for you

TCP SYN ping
-PS [PortList]
* Probes specific ports from the given list using a TCP SYN packet instead of ICMP to conduct the ping
* Helpful because most networks will block ICMP with ping
* When you send SYN, you usually get SYN-ACK back which tells you the host is alive
* Three way handshake is not finished so less information going back to host to tell it who you are

Sparse Scanning
–scan-delay [Time]
* Sends probes with significant delays to become stealthier and avoid detection by IDS / IPS

Scan Timing
-Tn
* Sends probes with using a timing pattern with n being the pattern to utilizes
* 0 slowest
* 5 fastest

TCP Idle Scan
-sI
* Another stealth method that makes it appear like another machine (zombie) started the scan to hide the true identity of the scanning machine

Fragmentation
-f or –mtu
* A technique that splits the TCP header of each probe between multiple IP datagrams to make it hard for an IDS/IPS to detect

Command Output
The default output for nmap is interactive and displays to the screen, but you have other options here:
* -oN = Normal to file
* -oX = XML to file
* -oG = Greppable file

19
Q

nmap Port Scans

A

Now that footprinting is over, it’s time to fingerprint the different hosts with service discovery
* We determine which network services and OS are in use by the target
* Can take several minutes or hours to complete depending on how many IPs you’re searching or ports you’re scanning

TCP SYN
-sS
* Conducts a half-open scan by sending a SYN packet to identify the port state without sending an ACK packet afterwards
* This gives a response we can analyze to figure out which ports are open

TCP Connect
-sT
* Conducts a three way handshake scan by sending a SYN packet to identify the port state and then sending an ACK packet once the SYN-ACK is received
* Sometimes network card doesn’t support sending a half-open scan, so you have to do this
* Additionally, depending on what perspective you’re conducting your scan from, you may not have the rights to do a TCP SYN because you also need root to do this on the system you’re scanning from

Null Scan
-sN
* Conducts a scan by sending a packet with the header bit set to zero
* This will flag IDS/IPS

FIN Scan
-sF
* Conducts a scan by sending an unexpected FIN packet
* This will flag IDS/IPS

Xmas Scan
-sX
* Conducts a scan by sending a packet with the FIN, PSH, and URG flags set to one
* Surefire way to get caught
* But this can be used as an easy way to see if people are doing their job and will catch you or not

UDP Scan
-sU
* Conducts a scan by sending a UDP packet to the target and waiting for a response or timeout
* We use the response, if there is one, to figure out if the port is open or closed
* This can be used to be more stealthy

Port Ranges
-p
* Conducts a scan by targeting the specified ports instead of the default 1,000 most commonly used ports

Port States
Open
* An application on the host is accepting connections

Closed
* The port responds to probes by sending a RST packet, meaning there is no application is available accept connections

Filtered
* nmap can’t probe the port, usually due to a firewall blocking the scans on the network or host

Unfiltered
* nmap can probe the port but can’t determine if it’s open or closed
* Not common to find this

Open|Filtered
* nmap can’t determine if the port is open or filtered when conducting a UDP or IP protocol scan

Closed|Filtered
* nmap can’t determine if the port is closed or filtered when conducting a TCP Idle scan

20
Q

nmap Fingerprinting

A

Fingerprinting is a technique to get a list of resources on the network, host, or system as a whole to identify potential targets for further attacks

Once you see there are ports open, you use nmap to scan them intensely:
nmap -sV 192.168.1.1
nmap -A 192.168.1.1
* These both do an intensive port scan
* -sV gives basic version information
* -A does it more intensely and discovers even more data
* Can provide information on protocol, app name and version, OS type and version, host name, device type

CPE
Common Platform Enumeration
* The scheme for identify hardware devices, OS, and applications developed by MITRE
* This is how nmap determines the software and versions after sending SYN packet and receiving the SYN-ACK back (each version responds a little differently)

NSE
nmap Scripting Engine, where the scripts are written in the Lua scripting language that can be used to carry out detailed probes like:
* OS detection and platform enumeration
* Windows user account discovery
* Identify logged-on Windows users
* Basic vulnerability detection
* Get HTTP data and identify applications
* Geolocation to traceroute probes