Questions
To prevent from Database Access Control attack
- access control should be handled by the application and database layers
- Always include current authenticated username as part of the query.
- Never rely on presentation layer to restrict values submitted by the user
- All the above
Sql injection occurs when
- Data is injected from application into query
- The data is used to dynamically construct a SQL query
- when sql query is executed injected application code from the database.
- None of these
A cross-site request forgery (CSRF) vulnerability occurs when
- If the request does not contain a nonce that proves its provenance
- The application acts on an HTTP request without verifying that the request was made with the user's consent
- A Web application uses session cookies
- All the above
Use of readLine() method in java may lead to
- Sql Injection attack
- Denial of Service attack
- CSRF attack
- None of these
What is session hijacking?
- Monitoring UDP session
- Monitoring TCP sessions
- Taking over UDP sessions
- Taking over TCP sessions
Which of the following is essential information to a hacker performing a session-hijacking attack?
- Session ID
- Session number
- Sequence number
- Source IP address
Which of the following is a countermeasure for a buffer overflow attack?
- Input field length validation
- Encryption
- Firewall
- Use of web forms
Which of the following is the best countermeasure to session hijacking?
- Port filtering firewall
- Encryption
- Session monitoring
- Strong passwords
What algorithm outputs a 128-bit message digest regardless of the length of the input?
- SHA
- MD5
- RC4
- RC6
What is the process of replacing some characters with others in an encryption key?
- Transposition
- Subtraction
- Substitution
- Transrelation
What Vulnerablity does JilWIN_32 exploit ?
- Blank Password
- IP Printing buffer overflow
- SQL Injection
- None of the choices
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
- Broken authentication and Sesion Management
- Cross Site Request Forgery (CSRF)
- SQL Injection
- Cross Site Scripting (XSS)
Security of application itself ensures absolute security of databases
- Yes
- No. Additional System Hardening is needed
- No.Additional Database hardening is needed.
- No. Additional Application hardening is needed.
Which of the following API's associates a Subject with the thread of execution?
- Subject.doAs ()
- AccessController.checkPermission()
- SecurityManager.checkAccess()
- None of the above
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);
- This is a double free vulnerability and must be fixed.
- The second call to free() will return an error.
- There might be compiler warnings, but the program will run fine.
- This is not a security issue.
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
- 2
- 1 & 2
- No vulnerability
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.
- Strncpy(dst,src,len(dst))
- Strncpy(dst,src,len(src)+1)
- Strncpy(dst,src,len(dst)+1)
- Strncpy(dst,src,len(dst)-1)
Which of the following is a secure way to use scanf?
- scanf("%.8s", name);
- scanf("%8s", name);
- scanf("%8c", name);
- scanf("%s", name);
How do you fix the unbounded string copy in the following code?
char fname[20]; /* 1 */
cout << “Enter First Name:”; /* 2 */
cin >> fname ; /* 3 */
- Replace cin call in line 3 with gets() function.
- The length of input from cin cannot be limited. Use a larger array for fname.
- Use cin.width[20] before line 3.
- Use cin.size[19] before line 3.
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 and 2
- 2 and 3
- 3 and 4
- only 2