15.2 Exploitation and Mitigation Flashcards

1
Q

What is the top web vulnerability according to OWASP?

A

**injection**

According to OWASP, “injection flaws, such as SQL, NoSQL, OS, and LDAP injection, occur when untrusted data is sent to an interpreter as part of a command or query. The attacker’s hostile data can trick the interpreter into executing unintended commands or accessing data without proper authorization.”

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

What does SQL stand for?

A

SQL (Structured Query Language) is a language used for programming and managing databases.

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

What does SQLi refer to?

A

SQL injections

SQLi attacks inject malicious SQL code through a client-side application such as a browser, revealing private data within the database. This flaw is easily detectable and exploitable. Any website, no matter how many users it has, may experience these types of attacks.

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

Criminal adversaries use SQLi as a technique to perform the following:

A
  • Violate authentication by spoofing a user’s identity.
  • Cause repudiation issues.
  • Violate data integrity by modifying existing data.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

SQLi attacks mainly affects what part of the CIA? Explain how it affects each pillar:

A

SQLi attacks mainly affects the confidentiality pillar of the CIA triad by revealing private and sensitive data. However, loss of integrity and availability are also risks.

  • Confidentiality: SQLi leverages the leak of sensitive data in SQL databases, directly impacting confidentiality.
  • Authentication: SQL commands can be manipulated to scan, modify, and extract usernames and passwords, allowing an attacker to connect as an authorized user.
  • Integrity: Attackers can potentially read sensitive information, allowing them to modify or delete critical information.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Explain SQLMap:

A

SQLMap is an open-source command-line tool that automates the process of detecting and exploiting SQL injection flaws in order to take control of database servers.

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

What does SQLMap allow attackers to do?

A

SQLMap contains a powerful detection engine with many features that enable attackers to access an underlying database file system.

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

With SQLMap, attackers can execute commands on the database server using _______ connections, meaning that an attacker can remotely control a back-end database using a backdoor connection, such as an RAT (Remote Access Trojan).

A

With SQLMap, attackers can execute commands on the database server using **out-of-band** connections, meaning that an attacker can remotely control a back-end database using a backdoor connection, such as an RAT (Remote Access Trojan).

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

Explain this command:

sqlmap -u “http://172.16.203.141/owaspbricks/login-1/”

A
  • sqlmap: Detects SQL injection vulnerabilities.
  • -u: Indicates a URL for SQLMap to scan.
  • "http://172.16.203.141/owaspbricks/login-1/" is the website we are attacking.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Explain this command:

sqlmap -u http://172.16.203.141/owaspbricks/login-1/ –dbms=mysql –forms –users

A
  • sqlmap: Detects SQL injection vulnerabilities.
  • -u: Indicates a URL for SQLMap to scan.
  • --dbms=mysql: Specifies which database management system to exploit.
  • --forms: Parses and tests forms on the target URL.
  • --users: Enumerates database users.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Once we run the command, SQLmap will prompt us every time about:(3)

A
  1. Do we want to test additional forms that SQLmap detects?
  2. Do we want to fill blank fields with random values?
  3. Do we want to have SQLmap try to inject with random integer values?
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

After learning about SQLMap, what are the key takeaways?

A
  1. Back-end database systems are a valuable source of information for criminal hackers.
  2. Complacency can cause significant harm. We need to remember that just because back-end databases are buried deep within the web server architecture and protected by firewalls doesn’t mean they are safe from attackers.
  3. As proven in this demonstration, the URL can be manipulated in various ways to circumvent layered defense mechanisms contained within web infrastructure. This is accomplished by exploiting existing trust-based systems that are public-facing, such as HTTP port 80 and the URL.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What does BeEF stand for?

A

The **Browser Exploitation Framework** (BeEF) is a practical client-side attack tool that exploits vulnerabilities of web browsers to assess the security posture of a target.

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

Ture or False:

While BeEF was developed for lawful research and penetration testing, criminal hackers have started using it as an attack tool.

A

True

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

BeEF uses ______” to activate a simple but powerful API, which takes remote control of client-based web browsers.

A

BeEF uses “hooks” to activate a simple but powerful API, which takes remote control of client-based web browsers.

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

Once a browser has been “hooked,” it becomes ______ which awaits instructions from the BeEF control station.

A

Once a browser has been “hooked,” it becomes a zombie which awaits instructions from the BeEF control station.

Zombies that have been hooked by BeEF send out periodic **polls** to the BeEF control center. These are **keep alive** signals, and indicate that the zombie connection is running and awaiting further instructions from BeEF.

17
Q

The majority of BeEF exploits occur as the result of an ______, however, they can also be facilitated by______ campaigns and _______attacks.

A

The majority of BeEF exploits occur as the result of an XSS attack, however, they can also be facilitated by social engineering campaigns and man-in-the-middle attacks.

18
Q

True or False:

The BeEF framework also allows for the integration of custom scripts, which more experienced criminal hackers can use.

A

True

19
Q

BeEF exploits what pillar of the CIA?

A

BeEF exploits compromise the integrity of hooked machines.

A breach can also cause loss of confidentiality and availability, depending on the motives of the attackers.

20
Q

What was BeEF originally intended for?

A

BeEF was originally intended for pentesting. In addition to being an exploitation tool, BeEF acts as an information gathering tool by providing additional details about the victim’s computer, revealing other types of attacks that can be performed.

21
Q

BeEF uses an ____ through JavaScript to hook vulnerable web browsers of unsuspecting clients.

A

BeEF uses an API through JavaScript to hook vulnerable web browsers of unsuspecting clients.

22
Q

Mitigation strategies against BeEF hooks include: (3)

A
  • Use the Vegan Chrome browser extension. This extension detects BeEF hooks and blocks offending domains, preventing the attack.
  • Create a Snort rule. You can add an emerging threats Snort rule to the company’s IDS, such as:
  • alert tcp $HOME_NET any -\> $EXTERNAL_NET $HTTP_PORTS (flow:to_server,established; content:"Cookie|3a 20|BEEFSESSION=";)
  • Implement a Content Security Policy (CSP). A CSP is an added layer of network security that detects and mitigates specific types of attacks, such as XSS and injection attacks.
23
Q

Just as each piece of hardware and software becomes a possible attack surface, various parts of the web can also become targets. These include:(4)

A
  1. Environment variables
  2. Parameters
  3. Internal and external web services
  4. All types of users
24
Q

Injection flaws are most common in older code and modern code with weak ______ practices.

A

Injection flaws are most common in older code and modern code with weak SDLC practices.

25
Q

Injection flaws often reside within:

A
  1. SQL
  2. NoSQL
  3. LDAP
  4. SMTP headers
  5. XML parsers
  6. OS commands.
26
Q

Injection flaws are relatively easy to detect when examining code with _____ or _____, which are also used by hackers to discover injection flaws.

A

Injection flaws are relatively easy to detect when examining code with fuzzers or scanners, which are also used by hackers to discover injection flaws.

27
Q

What aspect of the CIA triad is most directly affected by command injections

A

Command injection exploits affect confidentiality:

  • Command injection attacks can result in data loss/corruption, unauthorized disclosure, loss of accountability, and/or loss of availability.
  • Command injection attacks can also lead to a complete takeover, where the degree of impact depends on the business needs of the data and the application it runs on.
28
Q

(Windows)

How to you search for a file located on the c:\ drive

A

dir c:\filename /s: Returns the location of a file called filename`

  • dir: Lists the directory.
  • c:\filename: The argument that the command is run against.
  • /s: Lists the file if included in a subdirectory.
29
Q

You can inject code into files by outputting strings of characters into an argument with commands like ______.

A

‘echo’

30
Q

Explain this command:

A

‘&& echo This_is_a_test > “c:\filename”

  • &&: Links this command to the previous dir c:\filename /s command.
  • echo: Directs content into an argument.
  • This_is_a_test: The string that will be injected.
  • \> "c:\filename": The file that will be injected with code (the argument).
31
Q

What is command injection chaining?

A

Similar to its use in bash scripting, chaining allows us to link a series of commands.

32
Q

True or False:

As a method of code injection, chaining limits the number of commands that can be run and the amount of work that can be done on the site

A
33
Q

Attackers can use a _________ to establish a reverse shell from the infected web server back to the attacker’s machine, where a listener waits to complete the connection.

A

attackers can use a command injection shell to establish a reverse shell from the infected web server back to the attacker’s machine, where a listener waits to complete the connection.