Sec plus Chapter 6- Secure Coding

¡Supera tus tareas y exámenes ahora con Quizwiz!

Joe is examining the logs for his web server and discovers that a user sent input to a web application that contained the string WAITFOR. What type of attack was the user likely attempting? a. timing-based SQL injection b. HTML injection c. cross-site scripting d. content-base SQL injection

a. the use of the SQL WAITFOR command is a signature characteristic of a timing-based SQL injection attack.

precompiled SQL statements that only require variables to be input are an example of what type of application security control? a. parameterized queries b. encoding data c. input validation d. appropriate access controls.

a. a parameterized query (sometimes called a prepared statement) uses a prebuilt SQL statement to prevent SQP-based attacks. variables from the application are fed to the query, rather than building a custom query the application needs data. encoding data helps to prevent cross-side scripting attacks, as does input validation. appropriate access controls can precent access to data that the account or application should not have access to, but they don't use precompiled SQL statements. stored procedures are an example of a parameterized query implementation.

Tom is a software developer who creates code for sale to the public. He would like to assure his users that the code they receive actually came from him. What technique can he use to best provide this assurance? A. Code signing B. Code endorsement C. Code encryption D. Code obfuscation

a. code signing provides developers with a way to confirm the authenticity of their code to end users. developers use a cryptographic function to digitally sign their code with their own private key, and then browsers can use the developer's public key to verify that signatures and ensure that the code is legitimate and was not modified by unauthorized individuals.

During a web application test, Ben discovers that the application shows SQL code as part of an error provided to application users. What should he note in his report? A. Improper error handling B. Code exposure C. SQL injection D. A default configuration issue

a. improper error handling often exposes data to users and possibly attackers that should not be exposed. in this case, knowing what SQL code is used inside the application can provide an attacker with details they can use to conduct further attacks. code exposure is not one of the vulnerabilities we discuss in this book, and SQL code being exposed does not necessarily mean that SQL injection is possible. while this could be caused by a default configuration issue, there is nothing in the question to point to that problem .

what type of attack places an attacker int he position to eavesdrop on communications between a user and a web server? a. man-in-the-middle b. session hijacking c. buffer overflow d. meet-in-the-middle

a. in a man-in-the-middle attack, the attacker fools the user into thinking that the attacker is actually the target website and presenting a fake authentication form. they may then authenticate to the website on the user's behalf and obtain the cookie. this is slightly different from a session hijacking attack, where the attacker steals the cookie associated with an active session.

Upon further inspection, joe finds a series of thousands of requests to the same URL coming from a single IP address. Here are a few examples: http://www.mycompany.com/servicestatus.php?serviceID=1 http://www.mycompany.com/servicestatus.php?serviceID=2 http://www.mycompany.com/servicestatus.php?serviceID=3 http://www.mycompany.com/servicestatus.php?serviceID=4 http://www.mycompany.com/servicestatus.php?serviceID=5 http://www.mycompany.com/servicestatus.php?serviceID=6 What type of vulnerability was the attack likely trying to eploit? a. insecure direct object reference b. file upload c. unvalidated redirect d. session hijacking

a. the series of thousands of requests incrementing a variable indicate that the attacker was most likely attempting to exploit an insecure direct object reference vulnerability

What data minimization technique replaces personal identifiers with unique identifiers that may be cross-referenced with a lookup table? a. tokenization b. hashing c. salting d. masking

a. tokenization replaces personal identifiers that might directly reveal an individual's identity with a unique identifier using a look up table. hashing uses a cryptographic hash function to replace sensitive identifiers with an irreversible alternative identifier. salting these values with a random number prior to hashing them makes these hashed values resistant to a type of attack known as a rainbow table attack.

Adam is conducting software testing by reviewing the source code of the application. What type of cost testing is Adam conducting? a. mutation testing b. static code analysis c. dynamic code analysis d. fuzzing

b. adam is conducting static code analysis by reviewing the source code. dynamic code analysis requires running the program, and both mutation testing and fuzzing are types of dynamic analysis.

Every time Susan checks code into her organization's code repository, it is tested, validated, then if accepted it is immediately put into production. What is the term for this? A. Continuous integration B. Continuous delivery C. A security nightmare D. Agile development

b. although this example includes continuous integration, the key thing to notice is that the code is then deployed into production. this means that susan is operating in a continuous deployment environment, where code is both continually integrated and deployed. agile is a development methodology and often uses CI?CD, but we cannot determine if susan is using Agile.

Which one of the following is not an advantage of database normalization? a. preventing data inconsistencies b. preventing injection attacks c. reducing the need for database restructuring d. making the database schema more informative

b. database normalization has four main benefits. normalized designs prevent data inconsistencies, prevent update anomalies, reduce the need for restructuring existing databases, and make the database schema more informative. they do not prevent web application attacks, such as SQL injection.

Tim is working on a change to a web application used by his organization to fix a known bug. what environment should he be working in? a. test b. development c. staging d. production

b. developers working on active changes to code should always work in the development environment. the test environment is where the software or systems can be tested without impacting the production environment. the staging environment is a transition environment for code that has successfully cleared testing and is waiting to be deployed into production. the production environment is the live system. software, patches, and other changes that have been tested and approved move to production

which one of the following software development models focuses on the early and continuous delivery of software? a. waterfall b. agile c. spiral d. butterfly

b. one of the core principles of the Agile approach to software development is to ensure customer satisfaction via early and continuous delivery of software.

The application that scott is writing has a flaw that occurs when two operations are attempted at the same time, resulting in unexpected results when the two actions do not occur in the expected order. What type of flaw does the application have? a. de-referencing b. a race condition c. an insecure function d. improper error handling

b. the application has a race condition, which occurs when multiple operations cause undesirable results due to their order of completion. de=referencing would occur if a memory location was incorrect, an insecure function would have security issues in the function itself, and improper error handling would involve an error and how it was displayed or what data it provided.

kevin would like to ensure that his software runs on a platform that is able to expand and contract as needs change. which one of the following terms best describes his goal? a. scalability b. elasticity c. cost effectiveness d. agility

b. the situation described in the scenario, expanding capacity when demand spikes and then reducing that capacity when demand falls again, is the definition of elasticity.

Wendy is a penetration tester who wishes to engage in a session hijacking attack. What information is crucial for Wendy to obtain if her attack will be successful? a. session ticket b. session cookie c. username d. user password

b. websites use HTTP cookies to maintain sessions over time. if wendy is able to obtain a copy of the user's session cookie, she can use that cookie to impersonate the user's browser and hijack the authenticated session

Charles is worried about users conducting SQL injections attacks. Which of the following solutions will best address his concerns? a. using secure sessions management b. enabling logging on the database c. performing user input validation d. implementing TLS

c. charles should perform user input validation to strip out any SQL code or other unwanted input. secure session management can help prevent session hijacking, logging may provide useful information for incident investigation, and implementing TLS can help protect network traffic, but only input validation helps with the issue described.

Joe's adventures in web server log analysis are not yet complete. As he continues to review the logs, he finds the request http://www.mycompany.com/../../../etc/passwd What type of attack was most likely attempted? A. SQL injection B. Session hijacking C. Directory traversal D. File upload

c. in this case, the... operators are the tell-tale giveaway that the attacker was attempting to conduct a directory traversal attack. this particular attack sought to break out of the web server's root directory and access the /etc/passwd file on he server.

Joe checks his web server logs and sees that someone sent the following query string to an application running on the server: http://www.mycompany.com/servicestatus.php?serviceID=892&serviceID=892' ; DROP TABLE Services;-- What type of attack was most likely attempted? A. Cross-site scripting B. Session hijacking C. Parameter pollution D. Man-in-the-middle

c. this query string is indicative of a parameter pollution attack. in this case, it appears that the attacker was waging a SQL injection attack and tried to use parameter pollution to slip the attack past content filtering technology. the two instances of the serviceID parameter in the query string indicate a parameter pollution attempt.

what type of cross-site scripting attack would not be visible to a security professional inspecting the HTML source code in a browser? a. reflected XXS b. stored XSS c. persistent XSS d. DOM-based XSS

d Dom-based XSS attacks hide the attack code within the Document Object Model. This code would not be visible to someone viewing the HTML source of the page. other XSS attacks would leave visible traces in the browser.

Frank is investigating a security incident where the attacker entered a very long string into an input field, which was followed by a system command. What type of attack likely took place? a. cross-site request forgery b. server-side request forgery c. command injection d. buffer overflow

d. buffer overflow attacks occur when an attacker manipulates a program into placing more data into an area of memory than is allocated for the program's use. the goal is to overwrite other information in memory with instructions that may be executed by a different process running on the system.


Conjuntos de estudio relacionados

Intro to Supply Chain Management Chapter 11: Customer Relationship Management

View Set

Nutrition chapter 12 study questions

View Set

Growth and Development: Toddlers and Preschoolers

View Set

A&P 2 - Cardiovascular System (heart, veins, & arteries)

View Set

AP government Federalism test review guid

View Set

pediatric Neurological and sensory disorders

View Set

RN Targeted Medical Surgical Neurosensory and Musculoskeletal

View Set