CCT APP Written - Deck A Flashcards

1
Q

What DB type is MongoDB

A

Document Oriented

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

What language are the documents in MongoDB stored

A

BSON (Binary JSON)

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

What is the reserved primary key is MongoDB

A

_id

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

What does a JSON NoSQL Injection look like

A

{“username”: { “$regex”: “.*”} }

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

What is an In-Band NoSQL Injection

A

When the attacker can use the same channel of communication to exploit a NoSQL Injection and receive the result

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

What is a Blind NoSQL Injection

A

Where the attacker does not receive the results from the NoSQL Injection but they infer the results based on how the server responds

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

What are the two sub-types of Blind NoSQL Injection

A

Boolean and Time-Based

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

What is a Boolean based NoSQL Injection

A

Where the attacker forces the server to evaluate a query and return one result or the other if it is true or false

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

What is a Time-based NoSQL Injection

A

Where the attacker makes the server wait for a specific amount of time before responding, usually indicating if the query is true or false

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

What is the format we use if the query is using URL encoded or x-www-form-urlencoded

A

Instead of JSON we use param[$regex]=val

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

What are some of the common NoSQL query operators

A

ne (not equal). Regex. Gt/Gte/Lt/Lte (Greater/Less than(equal to))

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

What is a simple auth bypass using NoSQL injection

A

username[$regex]=.&password[$regex]=.

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

Example of an NoSQL injection if we know the username

A

username=admin@mail.com&password[$ne]=invalid

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

What is the character we can use for $lt and $lte and why

A

We can use the tilde (~) as it is the largest ASCII character

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

How can we perform Blind Data Extraction using NoSQL

A

username[$ne]=^.* will be true. username[$ne]=^z.* will be false. username[$ne]=^A.* will be true.

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

What is SSJI

A

SSJI occurs when a $where query is used on the backend

17
Q

What does SSJI stand for

A

Server Side JavaScript Injection

18
Q

How can we exploit SSJI in NoSQL injection

A

Query: $where: ‘this.username === “<username>". We can make the username " || sleep(5000) || ""=="</username>

19
Q

How can we check if the first char of the username is A using SSJI in NoSQL injection

A

Query: $where: ‘this.username === “<username>". We can make the username " || this.username.match('^A.*') || ""=="</username>

20
Q

How can we prevent NoSQL Injection

A

Sanitising user inputs. Use a white-list of acceptable values and avoud using JS expressions as much as possible