exam questions

Exam PT0-002 All Questions

View all questions & answers for the PT0-002 exam

Exam PT0-002 topic 1 question 250 discussion

Actual exam question from CompTIA's PT0-002
Question #: 250
Topic #: 1
[All PT0-002 Questions]

For a penetration test engagement, a security engineer decides to impersonate the IT help desk. The security engineer sends a phishing email containing an urgent request for users to change their passwords and a link to https://example.com/index.html. The engineer has designed the attack so that once the users enter the credentials, the index.html page takes the credentials and then forwards them to another server that the security engineer is controlling. Given the following information:



Which of the following lines of code should the security engineer add to make the attack successful?

  • A. window.location.= 'https://evilcorp.com'
  • B. crossDomain: true
  • C. geturlparameter ('username')
  • D. redirectUrl = 'https://example.com'
Show Suggested Answer Hide Answer
Suggested Answer: B 🗳️

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
vazq77
Highly Voted 10 months, 2 weeks ago
Selected Answer: B
In the context of web development, especially when dealing with AJAX (Asynchronous JavaScript and XML) requests, the crossDomain: true parameter is often associated with the jQuery library or other similar frameworks. When making an AJAX request, a web page is restricted by the Same-Origin Policy, which means that it can only make requests to the same domain from which the web page originated. This policy is in place for security reasons to prevent potentially harmful actions, such as cross-site request forgery. However, there are scenarios where you might need to make requests to a different domain (cross-origin requests). To enable this, certain adjustments are needed. The crossDomain: true setting is one of these adjustments, and it tells the browser that the request is intended to be cross-origin.
upvoted 5 times
...
Sleezyglizzy
Most Recent 8 months, 1 week ago
Selected Answer: B
Only one that makes the most sense after doing your research.
upvoted 2 times
...
Alizade
12 months ago
Selected Answer: B
B is the correct answer
upvoted 1 times
...
matheusfmartins
1 year, 2 months ago
Selected Answer: A
A beacuse the code is not redirecting the user to the other server, so he need to add the "window.location= 'https://evilcorp.com'"
upvoted 3 times
...
biggydanny
1 year, 6 months ago
I will go with A here as this explanation is what makes sense Out of the options provided, the correct line of code to achieve this goal is A. window.location = 'https://evilcorp.com'. This line of code redirects the user's browser to the specified URL, which in this case is the legitimate website of the organization being impersonated. This will make the user believe that their password change was successful, while the attacker harvests their credentials for malicious purposes.
upvoted 3 times
...
KingIT_ENG
1 year, 7 months ago
B Cross Domim true
upvoted 2 times
...
[Removed]
1 year, 7 months ago
A answer is not correct B is the correct answer
upvoted 1 times
...
[Removed]
1 year, 7 months ago
B is the correct answer CrossDomain true
upvoted 2 times
...
nickwen007
1 year, 7 months ago
When setting up the attack, the security engineer would need to add a line of code that enables cross-domain requests. This is to ensure that the page can receive data from the remote server (in this case, evilcorp.com). Adding the line of code "crossDomain: true" enables the page to make cross-domain requests, allowing the attacker to receive the credentials provided by the users.
upvoted 4 times
[Removed]
1 year, 7 months ago
CrossDomain true is the correct answer?
upvoted 2 times
...
...
cy_analyst
1 year, 7 months ago
Selected Answer: A
ChatGPT says: The success function in the AJAX request is empty, so the code in that function is not doing anything with the user's entered credentials. By adding window.location.href = 'https://evilcorp.com' to the success function, the code will redirect the user to the specified URL after they submit their credentials, which allows the security engineer to capture the user's credentials on their controlled server.
upvoted 2 times
[Removed]
1 year, 7 months ago
B is the correct answer CrossDomain true
upvoted 2 times
...
cy_analyst
1 year, 7 months ago
Yes answer B is correct!
upvoted 2 times
...
KingIT_ENG
1 year, 7 months ago
Cross Domin ture B correct
upvoted 2 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 ...
exam
Someone Bought Contributor Access for:
SY0-701
London, 1 minute ago