security Online Quiz - 11

security Online Quiz - 11

20 Questions Published

Questions

Question 1 Multiple Choice (Single Answer)

To prevent from Database Access Control attack

  1. access control should be handled by the application and database layers
  2. Always include current authenticated username as part of the query.
  3. Never rely on presentation layer to restrict values submitted by the user
  4. All the above
Question 2 Multiple Choice (Single Answer)

Sql injection occurs when

  1. Data is injected from application into query
  2. The data is used to dynamically construct a SQL query
  3. when sql query is executed injected application code from the database.
  4. None of these
Question 3 Multiple Choice (Single Answer)

A cross-site request forgery (CSRF) vulnerability occurs when

  1. If the request does not contain a nonce that proves its provenance
  2. The application acts on an HTTP request without verifying that the request was made with the user's consent
  3. A Web application uses session cookies
  4. All the above
Question 4 Multiple Choice (Single Answer)

Use of readLine() method in java may lead to

  1. Sql Injection attack
  2. Denial of Service attack
  3. CSRF attack
  4. None of these
Question 5 Multiple Choice (Single Answer)

What is session hijacking?

  1. Monitoring UDP session
  2. Monitoring TCP sessions
  3. Taking over UDP sessions
  4. Taking over TCP sessions
Question 6 Multiple Choice (Single Answer)

Which of the following is essential information to a hacker performing a session-hijacking attack?

  1. Session ID
  2. Session number
  3. Sequence number
  4. Source IP address
Question 7 Multiple Choice (Single Answer)

Which of the following is a countermeasure for a buffer overflow attack?

  1. Input field length validation
  2. Encryption
  3. Firewall
  4. Use of web forms
Question 8 Multiple Choice (Single Answer)

Which of the following is the best countermeasure to session hijacking?

  1. Port filtering firewall
  2. Encryption
  3. Session monitoring
  4. Strong passwords
Question 9 Multiple Choice (Single Answer)

What algorithm outputs a 128-bit message digest regardless of the length of the input?

  1. SHA
  2. MD5
  3. RC4
  4. RC6
Question 10 Multiple Choice (Single Answer)

What is the process of replacing some characters with others in an encryption key?

  1. Transposition
  2. Subtraction
  3. Substitution
  4. Transrelation
Question 11 Multiple Choice (Single Answer)

What Vulnerablity does JilWIN_32 exploit ?

  1. Blank Password
  2. IP Printing buffer overflow
  3. SQL Injection
  4. None of the choices
Question 12 Multiple Choice (Single Answer)

An attack technique where a programming flaw allows an attacker to execute script in the victims's browser which can hijack user sessions, deface websites, possibly introduce worms, etc

  1. Broken authentication and Sesion Management
  2. Cross Site Request Forgery (CSRF)
  3. SQL Injection
  4. Cross Site Scripting (XSS)
Question 13 Multiple Choice (Single Answer)

Security of application itself ensures absolute security of databases

  1. Yes
  2. No. Additional System Hardening is needed
  3. No.Additional Database hardening is needed.
  4. No. Additional Application hardening is needed.
Question 14 Multiple Choice (Single Answer)

Which of the following API's associates a Subject with the thread of execution?

  1. Subject.doAs ()
  2. AccessController.checkPermission()
  3. SecurityManager.checkAccess()
  4. None of the above
Question 15 Multiple Choice (Single Answer)

In this code, x is freed twice. What is the risk of this code?

x = malloc(200); 
/* do something with x */ 
free(x);  
/* do something else */ 
free(x);
  1. This is a double free vulnerability and must be fixed.
  2. The second call to free() will return an error.
  3. There might be compiler warnings, but the program will run fine.
  4. This is not a security issue.
Question 16 Multiple Choice (Single Answer)
int main (int argc, char *argv[]){
    char chararray[3];
    int intarray[3];
    int i;
    strncpy(chararray, argv[1], sizeof(chararray) - 1);
    for (i=0;i<=3; i++){ /*1*/   chararray[i]= getchar();
        intarray[i]=i*i;/*2*/
    }
}

Is there a vulnerability in this code? If yes, which line(s) (Line numbers are marked using comments /* */)?

  1. 1
  2. 2
  3. 1 & 2
  4. No vulnerability
Question 17 Multiple Choice (Single Answer)

The options show various uses of strncpy. Choose which use of strncpy is most secure while not wasting storage space at dst? Src is an untrusted input obtained from an external source.

  1. Strncpy(dst,src,len(dst))
  2. Strncpy(dst,src,len(src)+1)
  3. Strncpy(dst,src,len(dst)+1)
  4. Strncpy(dst,src,len(dst)-1)
Question 18 Multiple Choice (Single Answer)

Which of the following is a secure way to use scanf?

  1. scanf("%.8s", name);
  2. scanf("%8s", name);
  3. scanf("%8c", name);
  4. scanf("%s", name);
Question 19 Multiple Choice (Single Answer)

How do you fix the unbounded string copy in the following code?

char fname[20];   /* 1 */ 
cout << “Enter First Name:”; /* 2 */ 
cin >> fname ;   /* 3 */
  1. Replace cin call in line 3 with gets() function.
  2. The length of input from cin cannot be limited. Use a larger array for fname.
  3. Use cin.width[20] before line 3.
  4. Use cin.size[19] before line 3.
Question 20 Multiple Choice (Single Answer)

While trying to print an eight character long name, which of the following will introduce a security vulnerability ?

printf ("%.8s",name); /* 1 */
printf (name);  /* 2 */ 
printf ("%s",name);  /* 3 */ 
printf ("%8c", name);  /* 4 */
  1. 1 and 2
  2. 2 and 3
  3. 3 and 4
  4. only 2