Which of the following attacks was used to compromise the database server and what can the security administrator implement to detect such attacks in the future?

76.165.40 – – [08/Mar/2014:10:54:04) "GET index.php?user=<script>Create</script> HTIP/1.1" 200 5724

The security administrator also inspects the following file system locations on the database server using the command ‘Is -al /root’

drwxrwxrwx 11 root root 4096 Sep 28 22:45 .

drwxr-xr-x 25 root root 4096 Mar 8 09:30 ..

-rws—— 25 root root 4096 Mar 8 09:30 .bash_history

-rw——- 25 root root 4096 Mar 8 09:30 .bash_history

-rw——- 25 root root 4096 Mar 8 09:30 .profile

-rw——- 25 root root 4096 Mar 8 09:30 .ssh

Which of the following attacks was used to compromise the database server and what can the security administrator implement to detect such attacks in the future? (Select TWO).
A . Privilege escalation
B . Brute force attack
C . SQL injection
D . Cross-site scripting
E . Using input validation, ensure the following characters are sanitized:<>
F . Update crontab with: find/( -perm -4000 ) -type f-printO I xargs -0 Is -I I email.sh
G . Implement the following PHP directive: $clean_user_input = addslashes($user_input)
H . Set an account lockout policy

Answer: A, F

Explanation:

This is an example of privilege escalation.

Privilege escalation is the act of exploiting a bug, design flaw or configuration oversight in an operating system or software application to gain elevated access to resources that are normally protected from an application or user.

The question states that the web server communicates with the database server via an account with SELECT only privileges. However, the privileges listed include read, write and execute (rwx). This suggests the privileges have been ‘escalated’.

Now that we know the system has been attacked, we should investigate what was done to the system.

The command "Update crontab with: find / ( -perm -4000 ) -type f -printO I xargs -0 Is -I I email.sh" is used to find all the files that are setuid enabled. Setuid means set user ID upon execution. If the setuid bit is turned on for a file, the user executing that executable file gets the permissions of the individual or group that owns the file.

Incorrect Answers:

B: A brute force attack is used to guess passwords. This is not an example of a brute force attack.

C: SQL injection is a code injection technique, used to attack data-driven applications, in which malicious SQL statements are inserted into an entry field for execution (e.g. to dump the database contents to the attacker). This is not an example of a SQL Injection attack.

D: Cross-site scripting (XSS) is a type of computer security vulnerability typically found in Web applications. XSS enables attackers to inject client-side script into Web pages viewed by other users.

This is not an example of an XSS attack.

E: Sanitizing just the <> characters will not prevent such an attack. These characters should not be sanitized in a web application.

G: Adding slashes to the user input will not protect against the input; it will just add slashes to it.

H: An account lockout policy is useful to protect against password attacks. After a number of incorrect passwords, the account will lockout. However, the attack in this question is not a password attack so a lockout policy won’t help.

Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments