Solutions
Which method is used for a SQL injection attack?
- exploiting query parameters
- passing safe query parameters
- using SQL composition
- utilizing literal parameters - ANSWER - exploiting query parameters
Consider the following assertion statement:
def authorizeAdmin(usr):
assert isinstance(usr, list) and usr != [], "No user found" assert 'admin'
in usr, "No admin found."
print("You are granted full access to the application.")
if __name__ == '__main__':
authorizeAdmin(['user'])
What should be the response after running the code?
- Authorized User
- You are granted full access to the application
- AssertionError: No admin found
- AssertionError: No user found - ANSWER - AssertionError: No admin
found
What does cross-origin resource sharing (CORS) allow users to
do?
- prevent the passing of credentials
- override same starting policy for specific resources
- protect the client header from exposure
, - connect web security models - ANSWER - Override same starting policy
for specific resources
Which protocol caches a token after it has been acquired?
- MSAL
- Auth0
- LDAP
- ACL - ANSWER - MSAL
Consider the following API code snippet:
import requests
url = 'https://website.com/'
# Get request
result = requests.get(url)
# Print request
print(result.content.decode())
Which status code will the server return?
- 200
- 400
- 401
- 403 - ANSWER - 200
The user submits the following request to an API endpoint that
requires a header:
import requests
url = 'https://api.github.com/invalid'