(3) Expressions That Are Regular And Grep Flashcards

1
Q

What is a frequent task for security analysts?

A

A frequent task for security analysts is doing string (text) searches with grep.

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

Describe the -c, -i and -n flags in grep

A

-c Counts the number of occurrences

-i Matches both lower and upper case

-n Shows the matching line and line number

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

Describe the -v, -r, and -e flags in grep

A

-v shows all lines that do not match the string

-r reads all files under each directory recursively

-e When followed by a pattern, uses the pattern for a search (allows multiple patterns)

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

What are regular expressions (regex)?

A

Regex is commonly used in grep to match a flexible set of entries

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

When doing regular expressions (regex), what will using letters between the square brackets do? What will using an asterisk * do?

A

Using square brackets will match any of a set of characters, but using an asterisk * will match any number of occurrences of the previous character.

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

What is grep?

A

Grep is a powerful tool that is often combined with other command line functions to do complex searches or to prepare data to feed to other tools

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

How do you send data from one command line tool to another?

A

To send data from one command line tool to another, you use a pipe, which is the “|” symbol.

knowing how to use pipes to combine data from multiple commands is useful for security analysts if you want to combine multiple regular expressions

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

What is JSON?

A

JSON uses JavaScript notation and human-readable text for data interchange

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

What is XML?

A

XML is a markup language, it is machine and human readable, and has a broad application to multiple areas

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

To determine if a file is encoded with JSON, what do we need to look for?

A

To determine if a file is encoded in JSON, one needs to look for curly brackets opening and closing statements

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

How would one determine if a file was using XML?

A

An XML file would use angle brackets to open and close statements, similar to HTML

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