Starting from SQL Flashcards

1
Q

What is SQL?

A

It is a programming language with which we can create, maintain and request information from Databases.

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

What is a Database?

A

It is an organized collection of data or information.

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

what are relational databases?

A

A structured database containing tables that are related to each other.

Tables might be similar in one or more columns.

The columns that relate 2 tables to each other are called keys.

There are other kinds of databases as well.

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

What are 2 types of keys in relational databases?

A

Primary key - A column where every row has a unique key.

Foreign key - A column in a table that is a primary key in another tale.

Foreign keys unlike primary keys can have empty values or duplicates.

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

What is a Query?

A

A query is a request for data from a database table or a combination of tables.

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

How we can access SQLite version of SQL from Linux command line?

A

sqlite3

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

Give me an example of a scenario where we might Linux as compared to SQL.

A

Sometimes data format that we need to examine might not be compatible with SQL (for example - text files). For such cases, we need to use Linux.

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

What are the 2 basic keywords used in SQL queries?

A

SELECT - indicates which columns to return (* denotes to return all the columns of a table)

FROM - Indicates which tables to query

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

What keyword do we use to get an ordered result of a query to a database?

A

We can craft our query to order the query output based on any of the columns in the database.
SYNTAX - >

SELECT customer_ID, city
FROM customers
ORDER BY city;

In descending ->

ORDER BY city DESC;

Note - We can also sort based on multiple columns.

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

What are the basic filters in SQL queries?

A

WHERE -> acts as a clause that we use to create a filter
% -> Wildcard
- -> Wildcard
Like -> operator

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

Give me example of usage of WHERE in SQL.

A

WHERE country = ‘USA’
WHERE country LIKE “US_”
(In the above statement, underscore will substitute for only one another character )

WHERE name LIKE “man%”
(Above, percentage sign will substitute for any number of other characters)

WHERE NOT country = “USA”

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

What are the common datatypes in Databases?

A

Strings, Numbers, Data and Time

Note - Data and Time need to be enclosed within quotation marks like strings.

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

Give me an example of filtering use of comparison operator in SQL.

A

SELECT *
FROM employees
WHERE birthdate > ‘1970-01-01’;

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

What is inner join in SQL database tables?

A

It returns rows matching a specified column that exists in more than one table.

When we use INNER JOIN, all the columns in both tables are returned.

If the column exists in both of the tables, it is returned twice when SELECT * is used

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

What are different kinds of Joins in SQL?

A

Inner Join
Left Join
Right Join
Full join

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

Give me an example of Inner join syntax.

A

SELECT username, operating_system, employees.device_id

FROM employees

INNER JOIN machines ON employees.device_id = machines.device_id;

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

What are aggregate functions in SQL?

A

Count - returns a single number that represents the number of rows returned from your query.

AVG - for average

SUM - for sum

SELECT COUNT(firstname)
FROM customers
WHERE Country = ‘USA’;

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

How do we calculate risk to some asset?

A

Its formula is
Likelihood * impact = Risk

It depends on how often a risk can be exploited and what its impact on the organization if it is exploited.

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

What are the categories of a threat?

A

Intentional threat -
Unintentional threat -
Outsider threat -
Insider threat -

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

What are the 2 categories of vulnerabilities?

A

Technical vulnerability
Human vulnerability

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

What is Asset management?

A

It is the process of making an inventory of all the organization’s assets, tracking all the assets, and finding out all the associated risks to these assets.
It also includes asset classification.

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

What is asset classification?

A

Asset classification is the process of classifying assets based on how important an asset is to an organization and how sensitive it is.

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

How do we find out the sensitivity and importance of an asset to an organization?

A

To know the sensitivity and importance of an asset to an organization, we normally ask the following questions:

  1. What you have
  2. Where it is
  3. Who owns it
  4. How important it is
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
24
Q

What are the common asset classifications that an asset can be categorized into?

A
  1. Restricted
  2. Confidential
  3. Internal only
  4. Public
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
Q

What is information security?

A

Information Security is the practice of keeping information secured from unauthorized access in all its states :

Data-in-use
Data-at-rest
Data-in-transit

To protect data, we need to know what state our data is in.

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

What are the elements of a Security Plan?

A

Every Security Element has the following elements :

Policies - Policies are the set of rules that reduce risk and protect information.
Procedures -
Standards - these are the references based on what policies are created.

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

What are the components of the NIST Cyber security framework?

A

NIST CSF has 2 main components :

Core
Tiers
Profiles

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

What are the sub-components of the core component NIST CSF?

A

The core component has 5 sub-components :

  1. Identify
  2. Protect
  3. Detect
  4. Respond
  5. Recover
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
29
Q

What is the use of Tier component of NIST CSF?

A

This provides security teams with a way to measure performance across each of the 5 functions of the core.

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

What is the use of Profile component of NIST CSF framework?

A

It is like a snapshot of the security posture of an organization at different times.
It is used to see the improvements in the security posture of an organization.

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

What are the different types of security controls?

A

Technical
Managerial / Administrative
Operational - controls like user training or incident response.

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

What is information privacy?

A

It is the practice of protecting information from unauthorized access and giving the right to choose.

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

What is the best way or best control to protect the data privacy?

A

By implementing the principle of least privilege.

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

What are service accounts?

A

Service accounts are assigned to applications that need to interact with the other software on the network.

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

What are the 3 common approaches to auditing user accounts?

A

We can audit user accounts using 3 ways:

  • Usage audits
  • Privilege audits - These audits happen on the accounts of a user who is with the organization for a long time and they tend to accumulate more privileges as they are promoted or change their department.
  • Account change audits - in this one, security analysts look for unauthorized changes on user accounts.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
36
Q

What is Data governance?

A

It is a set of processes that defines how an organization manages information.

It defines policies that keep data secure throughout its lifecycle.

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

What are the different stages in Data life cycle?

A

Data life Cycle has 5 stages -

  1. Collect
  2. Store
  3. Use
  4. Archive
  5. Destroy
38
Q

What is cryptography?

A

It is the process of transforming information into a form that unintended readers can’t understand.

39
Q

What is PKI - Public Key Infrastructure?

A

It is an encryption framework that secures the exchange of information online.

40
Q

Give me some examples of symmetric encryption algorithms.

A

3DES -
AES - advanced encryption algorithm - it supports a key length of 128, 192 and 256 bits.

41
Q

Give me an example of asymmetric algorithms.

A

RSA - Rivest Shamir Adleman

DSA - Digital signature algorithm - It was generated by NIST and it generates a key length of 2048 bits. This algorithm is widely used PKI.

42
Q

What are some of the ways to protect information?

A

Using the principle of least privilege
Using cryptography
using Hashing functions

43
Q

What are different hashing functions?

A

MD5 - generates a hash of 128 bits
SHA1 - Secure Hashing - Produces a digest of 160 bits

SHA-224 - 224 bits digest
SHA-384
SHA-512

44
Q

What are the vulnerabilities in Hashing functions?

A

MD5 is vulnerable to Hashing collision.

Hashing collision - it happens when more than one input value gives that same digest value. An attacker might exploit this vulnerability.

Hashing functions are also vulnerable to Rainbow Table attacks.

Rainbow table - A rainbow table is a file of pre-generated hash values and their associated plaintext. These are like dictionaries of weak passwords. In some cases, if an attacker gets hold of the organization’s password database, he/she might use these rainbow tables to guess the password.

45
Q

How can we compute the hash of a file in Linux command line?

A

sha256sum

To compare the contents of 2 files and to see the number of the first character where it differ, we use cmp function.

46
Q

What is Access Control?

A

Security controls that manage access, authorization, and accountability of information.

47
Q

What is SSO?

A

SSO establishes a user’s identity once for a specified period of time.
It includes the concept of identity and service provider.
SSO should always adopt MFA.

48
Q

What are the 2 common authentication protocols that SSO implementation relies on?

A

LDAP - Light Weight Directory Access protocol

SAML - Security Assertion Mark Up Language

49
Q

What 2 factors influence authorization?

A

Principle of least privilege
Separation of duties

50
Q

What are 2 security controls that are used to secure data that travel over the internet?

A

Basic Auth
and OAuth

In OAuth, user authenticates to an OAuth server which provides a token to the service provider to authenitcate user. So user password and user name does not travel over the wire.
For example, when you log into Brainscape with google account, you are directed to the Google OAuth server that authenticates you and sends a authorization/ authentication token to Brainscape. Eventually, you are grated access to the service of service provider.

51
Q

What is Basic Auth?

A

HTTP uses basic auth. The technology is used to establish a user’s request to access a server.
It works by sending an identifier (username and password) every time the user communicates with a webpage.

It is not secure as it sends username and password in clear text.

52
Q

What is OAuth?

A

An open standard authorization protocol that shares designated access between applications.
For example - We can tell google that it is ok for other websites to access your profile to create a account.

Also, instead of sending and requesting sensitive username and password over the network, OAuth uses API tokens to authorize people to access webpages.

53
Q

What is API token?

A

It is a small block of encrypted code that contains information about a user.
Information like identity, site permissions, and more.

54
Q

What is a Session?

A

Any time a user accesses a system, they initiate what is called a session.

A session is a sequence of network HTTP basic auth requests and responses associated with the same user.

55
Q

What are the 2 things that happen when a session is initiated?

A
  1. Session ID is created - It is a unique token that identifies a user and their device while accessing the system.
  2. Second action that takes place during the start of session is the exchange of session cookies.
56
Q

What is a session cookie?

A

A token that websites use to validate a session and determine how long that session should last.

When cookies are exchanged between your computer and server, your session ID is read to determine what information should site show you. Cookies make web session more safer and efficient.

57
Q

What is session Hijacking attack?

A

Exchange of tokens means no sensitive data like usernames or passwords are shared.

Session cookies prevent attackers from obtaining sensitive data. However, there is other damage that they can do. With a stolen cookie, the attacker can impersonate a user using their session token.

Session hijacking is an event when an attacker obtains a legitimate user’s session ID.

58
Q

What are 3 main frameworks that organizations use to handle the steps of IAM?

A
  1. MAC - Mandatory Access Control
  2. DAC - Discretionary Access Control
  3. RBAC - Role Based Access Control
59
Q

What is MAC - Mandatory Access Control?

A

It is the strictest of the 3 frameworks. Authorization in this model is based on the need-to-know basis. Access to information must be granted manually by a central authority or system admin.

60
Q

What is an exposure?

A

It is a mistake that can be exploited by a threat.

61
Q

What is Vulnerability management?

A

It is the process of finding and patching vulnerabilities.

62
Q

What are the 4 steps of vulnerability management?

A
  1. Identify vulnerabilities
  2. Consider potential exploits
  3. Prepare defenses against threats
  4. Evaluate those defenses
63
Q

What is a zero day attack?

A

An exploit that was previously unknown.

64
Q

What are the 5 layers of defense in depth strategy?

A
  1. Perimeter layer
  2. Network layer
  3. Endpoint layer
  4. Application layer
  5. Data layer
65
Q

What is a CVE list?

A

An openly accessible dictionary of known vulnerabilities and exposures.

66
Q

What is CVE numbering authority (CNA)?

A

An organization that volunteers to analyze and distribute information on eligible CVEs

CVE list tests 4 criteria that a vulnerability must have before it is assigned an ID.

  1. Independent of other issues
  2. Recognized as a potential security risk
  3. It can only affect one codebase (only one programs source code)
67
Q

What is CVSS - Common Vulnerability Scoring System?

A

A measurement system that scores the severity of a vulnerability.

This vulnerability score is assigned by the National Vulnerability Database.

These are used as part of the vulnerability Management process.

68
Q

What is OWASP?

A

It is a not-for-profit organization that works to improve the security of web applications.

It stands for Open Web Application Security Project or Open Worldwide Application Security Project.

69
Q

What is OWASP 10?

A

It is one of the most valuable resources of OWASP that aware us about the web’s most targeted vulnerabilities.

70
Q

What are the first 3 OWASP top 10 vulnerabilities?

A
  1. Broken Access Control - if the web applications fail to keep Access Control in place, it might lead to unauthorized access to sensitive information, or escalated rights to the web database.
    Access control can be a technology or process that controls who has access to a particular service and what can they do with the resources.
  2. Cryptographic Failures - This might take place when application data is not encrypted or it is encrypted using a weak encryption algorithm. It might also involve the scenario where weak hashing functions are used like the user of MD5 that produces a digest of 128 bits.
  3. Injection - Injection is an attack in which an attacker inserts malicious code into an application through its vulnerability. Injection attacks can give back door into an organization information system.
71
Q

What are the 4th, 5th and 6th vulnerabilities mentioned by OWASP10?

A
  1. Insecure design - It is a vulnerability in which developers miss security controls or they use poorly implemented security controls while developing the application.
  2. Security Misconfiguration - Example of this using default settings while configuring a server.
  3. Vulnerable and outdated components - In this vulnerability, to complete their application design quickly, developers make use of pre-built libraries / open source libraries that are vulnerable to several kinds of attacks.
72
Q

What are 7th, 8th and 9th vulnerabilities stated by OWASP 10.

A
  1. Identification and authentication failures - This happens when an application fail to recognize who should have access and what they are authorized to.
  2. Software and Integrity failures - These are instances when updates or patches are inadequately reviewed before implementation. This can lead to supply chain attacks.
  3. Security logging and monitoring failures -
  4. Server-Side Request forgery - In this vulnerability, attackers manipulate the normal operations of a server to read or update other resources on that server.
73
Q

What is OSINT - Open Source Intelligence?

A

It refers to the analysis of information or data to produce insights or knowledge that supports decision making in a particular subject.

74
Q

What is vulnerability assessment?

A

It is the internal review process of organization systems to find any vulnerabilities in them.

Vulnerability assessment involves 4 steps -

  1. Identifying the vulnerabilities
  2. Analyzing the vulnerability to find you the root cause.
  3. Doing risk assessment which will find out how severe is this vulnerability and how likely it can be exploited.
  4. Remediation
75
Q

What is a Vulnerability scanner?

A

It is a software that automatically compares known vulnerabilities and exposures against the technologies used in the organization.
In general, these tools scan systems to find misconfigurations and programming flaws.

76
Q

What are the different kinds of vulnerability scans that we can perform with vulnerability scanners?

A

Authenticated / Unauthenticated scans

Limited / Comprehensive scans -

77
Q

What is penetration testing?

A

It is a simulated attack that helps identify vulnerabilities in systems, networks, applications and processes. We pen-test, security analysts find out that ways in which vulnerabilities can be exploited and what are the consequences if these vulnerabilities are exploited.

78
Q

What are the different types of penetration testing?

A
  1. Open box - Tester knows the system architecture, data flows, and network diagrams.
  2. Closed box - Black box
  3. Partial knowledge testing -
79
Q

What is one of the crucial steps that security analysts perform to secure organization assets?

A

They get to know the attack surface area of organization assets.

Attack Surface Area - It includes all the potential vulnerabilities that a threat actor could exploit.

There are 2 kinds of attack surface area -

Physical attack surface area
Digital Attack surface area

80
Q

What is Security Hardening?

A

It is the process of strengthening the system to reduce its vulnerability and attack surface.

81
Q

What are different types of threat actors?

A

A threat actor is any person or any group who resents a security risk.

These are divided into 5 categories -

  • competitors
  • Criminal Syndicates -> Refer to an organized group of people who make money from criminal activity.
  • state actors
  • Insider threats
  • Shadow IT
82
Q

What are attack vectors?

A

These are the pathways that attackers take to penetrate defenses.

83
Q

What is the list of common Attack vectors / Access Points?

A
  1. Direct access -
  2. Email -
  3. Removable drive/media -
  4. Social Media platforms -
  5. Wireless networks
  6. Cloud Services -
  7. Supply chains - Like 3rd part vendors that can present a backdoor into systems.
84
Q

How do we practice an attacker mindset?

A
  • Identify a target
  • Determine how the target can be accessed
  • Evaluate attack vectors that can be exploited
  • Find the tools and methods of attack.
85
Q

Give me examples of common rules for defending an attack vector.

A
  • Educating users
  • Applying the principle of least privilege
  • Using the right security controls and tools
  • Building a diverse security team.
85
Q

What is reverse brute force attack?

A

In reverse brute force attack, attacker gets hold of legit username/ password of some user and then he / she tries this password combination systems until a match is found.

86
Q

What is credentials stuffing attack?

A

In this attack, the attacker uses the stolen login credentials from previous data breaches.
A specialized type of credentials stuffing is pass the hash. These attacks reuse stolen, unsalted hashed credentials to trick an authentication systems into creating a new authenticated user session on the network.

87
Q

Give me some examples of tools of trade for brute force attacks.

A

Aircrack-ng
Hashcat
John The Ripper
Oph crack
THC Hydra

88
Q

What are the common preventative measures against brute force attacks?

A
  • Hashing and Salting
  • MFA
  • CAPTCHA
  • Password Policies

Salting is used to strengthen the length and complexity of hash values.

89
Q
A