Welcome to ExamTopics
ExamTopics Logo
- Expert Verified, Online, Free.
exam questions

Exam 312-50v12 All Questions

View all questions & answers for the 312-50v12 exam

Exam 312-50v12 topic 1 question 38 discussion

Actual exam question from ECCouncil's 312-50v12
Question #: 38
Topic #: 1
[All 312-50v12 Questions]

Suppose that you test an application for the SQL injection vulnerability. You know that the backend database is based on Microsoft SQL Server. In the login/password form, you enter the following credentials:

Based on the above credentials, which of the following SQL commands are you expecting to be executed by the server, if there is indeed an SQL injection vulnerability?

  • A. select * from Users where UserName = ‘attack’ ’ or 1=1 -- and UserPassword = ‘123456’
  • B. select * from Users where UserName = ‘attack’ or 1=1 -- and UserPassword = ‘123456’
  • C. select * from Users where UserName = ‘attack or 1=1 -- and UserPassword = ‘123456’
  • D. select * from Users where UserName = ‘attack’ or 1=1 --’ and UserPassword = ‘123456’
Show Suggested Answer Hide Answer
Suggested Answer: D 🗳️

Comments

Chosen Answer:
This is a voting comment (?) , you can switch to a simple comment.
Switch to a voting comment New
Stoa
Highly Voted 1 year, 3 months ago
Selected Answer: D
Well I confirm that it is the D, with the following The query is select * from Users where UserName = 'varName' and UserPassword = 'varPassword'. So if we change by the credentials that say would be the following result: select * from Users where UserName = 'attack' or 1=1 --' and UserPassword = '123456' An important consideration is that it is not asking for any correction of the command or if the command itself is correct, it is asking to be executed on the server.
upvoted 15 times
...
MKesenheimer
Highly Voted 1 year, 2 months ago
Selected Answer: A
Answer A. Look at the single quote.
upvoted 6 times
...
sshksank
Most Recent 6 months ago
Selected Answer: D
CEH BOOK V12 P.2205
upvoted 4 times
...
barey
9 months, 1 week ago
GPT 4.0 what you think in that way ? : Apologies for the confusion. In line with the credentials provided and typical SQL injection techniques, the correct SQL command that would be executed by the server, if there is indeed an SQL injection vulnerability, would indeed be: A. select * from Users where UserName = 'attack' or '1'='1' -- and UserPassword = '123456' In this scenario, the injection point is within the UserName parameter, and the rest of the SQL statement is commented out using the double dashes (--). This would cause the where condition to always be true, potentially allowing an attacker to bypass authentication mechanisms.
upvoted 1 times
Miracleam
1 month ago
The answer is D. Please refer to CEH V12 Module 15
upvoted 1 times
...
...
[Removed]
11 months, 1 week ago
Selected Answer: D
D. select * from Users where UserName = ‘attack’ or 1=1 --’ and UserPassword = ‘123456’. The point of the question is not whether the select statement will provide anything useful, but to show that you understand how the strings/parameters are passed from the login/password form to the SQL query. This was a question for me when I took the exam on 13 Dec 2023.
upvoted 2 times
...
insaniunt
11 months, 2 weeks ago
Selected Answer: D
D. select * from Users where UserName = ‘attack’ or 1=1 --’ and UserPassword = ‘123456’ pay attention: --’
upvoted 2 times
...
IPconfig
1 year ago
Selected Answer: D
Understanding an SQL Injection Query Attacker Launching SQL Injection SELECT Count(*) FROM Users WHERE UserName='Blah' or 1=1 --' AND Password='Springfield' SELECT Count(*) FROM Users WHERE UserName='Blah' or 1=1 --' AND Password='Springfield' CEH V12 Page 2204
upvoted 2 times
...
mattlai
1 year, 3 months ago
https://owasp.org/www-community/attacks/SQL_Injection_Bypassing_WAF
upvoted 1 times
...
kinok9438
1 year, 3 months ago
D is the Correct
upvoted 1 times
...
581777a
1 year, 3 months ago
Selected Answer: D
D. select * from Users where UserName = ‘attack’ or 1=1 --’ and UserPassword = ‘123456’
upvoted 1 times
...
Nst6310
1 year, 4 months ago
B. select * from Users where UserName = 'attack' or 1=1 -- and UserPassword = '123456' Option D is incorrect because the SQL injection payload is placed after the closing single quote for 'UserPassword', which would likely result in a syntax error. Option A is incorrect because the payload is missing the closing single quote after 'attack', which would likely result in a syntax error.
upvoted 2 times
...
Rijoe
1 year, 4 months ago
A is the correct answer look closely, the username = attack' so the actual query will have 'attack' '....the additional hyphen is for the username then 2 hyphen for the query.
upvoted 3 times
...
zhack405
1 year, 4 months ago
CEH BOOK V12 : P2204 SELECT Count(*) FROM Users WHERE UserName='Blah' or 1=1 --' AND Password='Springfield' ' ' --' ' '
upvoted 3 times
...
Vincent_Lu
1 year, 5 months ago
D. select * from Users where UserName = ‘attack’ or 1=1 --’ and UserPassword = ‘123456’
upvoted 2 times
...
predator67
1 year, 5 months ago
Selected Answer: D
The correct option is D.
upvoted 1 times
...
victorfs
1 year, 6 months ago
Selected Answer: D
The correct option is D. select * from Users where UserName = ‘attack’ or 1=1 --’ and UserPassword = ‘123456’
upvoted 1 times
...
jeremy13
1 year, 7 months ago
Selected Answer: D
D. select * from Users where UserName = ‘attack’ or 1=1 --’ and UserPassword = ‘123456’ CEH BOOK V12 : P2204 SELECT Count(*) FROM Users WHERE UserName='Blah' or 1=1 --' AND Password='Springfield' SQL Query Executed : SELECT Count(*) FROM Users WHERE UserName='Blah' or 1=1 Code after -- are now comments : --' AND Password='Springfield'
upvoted 3 times
ShuvroD
1 year, 7 months ago
I have my CEHv12 exam tomorrow. Can anyone please give me temporary contributor access ?
upvoted 4 times
...
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...