Web Hacker Handbook Flashcards

1
Q

What is the difference between a session and a session token?

A

A session is a set of data structures held on the server, which are used to track the state of the user’s interaction with the application. A session token is a unique string that the application maps to the session, and is submitted by the user to reidentify themselves across successive requests.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Why is it not always possible to use a whitelist-based approach to input validation?

A

Many people’s names contain characters that can be used in various attacks. If an application wishes to allow people to register under their real names, it needs to accept input that may be malicious, and ensure that this is handled and processed in a safe manner nevertheless.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

You are attacking an application that implements an administrative function. You do not have any valid credentials to use the function. Why should you nevertheless pay close attention to it?

A

Defects in the any of the core mechanisms for handling access may enable you to gain unauthorized access to the administrative functionality. Further, data that you submit as a low privileged user may ultimately be displayed to administrative users, enabling you to attack them by submitting malicious data designed to compromise their session when it is viewed.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

An input validation mechanism designed to block cross-site scripting attacks performs the following sequence of steps on an item of input:

1. Strip any expressions that appear. 
2. Truncate the input to 50 characters. 
3. Remove any quotation marks within the input. 
4. URL-decode the input. 
5. If any items were deleted, return to step 1. 

Can you bypass this validation mechanism to smuggle the following data past it?

“>alert(“foo”)

A

Yes. If it were not for Step 4, this mechanism would be robust in terms of filtering the specific items it is designed to block. However, because your input is decoded after the filtering steps have been performed, you can simply URL-encode selected characters in your payload to evade the filter:
%22>%3cscript>alert(%22foo%22)

If Step 4 were performed first (or even not at all) then this bypass would not be possible.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Why are an application’s mechanisms for handling user access only as strong as the weakest of these components?

A

In a typical application, access is handled using a trio of mechanisms relating to authentication, session management, and access control. These components are highly interdependent, and a weakness in any one of them will undermine the effectiveness of the overall access handling mechanism. For example, a defective authentication mechanism may enable an attacker to login as any user and so gain unauthorized access. If session tokens can be predicted, an attacker may be able to masquerade as any logged in user and gain access to their data. If access controls are broken, then any user may be able to directly use functionality that is supposed to be protected.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is the OPTIONS method used for?

A

The OPTIONS method asks the server to report the HTTP methods that are available for a particular resource.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What are the If-Modified-Since and If-None-Match headers used for?

A

The If-Modified-Since header is used to specify the time at which the browser last received the requested resource.

The If-None-Match header is used to specify the entity tag that the server issued with the requested resource when it was last received.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Why might you be interested in the If-Modified-Since and If-None-Match Headers when attacking an application?

A

In the two ways described, these headers are used to support caching of content within the browser, and they enable the server to instruct the browser to use a cached copy of a resource, rather than responding with the full contents of the resource if this is not necessary.

When you are attacking an application, your browser may already have cached copies of resources that you are interested in, such as JavaScript files. By removing these two headers, you can override the browser’s caching information and ensure that the server responds with a fresh copy of the resource you wish to view.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is the significance of the secure flag when a server sets a cookie?

A

The secure flag is used to instruct the browser that the cookie should only ever be resubmitted over HTTPS connections, and never unencrypted HTTP.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What is the difference between the common status codes 301 and 302?

A

The 301 status code tells the browser that the requested resource has moved permanently to a different location. For duration of the current browser session, if your browser needs to access the originally requested resource, it will use the location specified in the 301 response instead.

The 302 status code tells the browser that the requested resource has moved temporarily to a different location. On the next occasion that the browser needs to access the originally requested resource, it will request this from the originally requested location.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

How does a browser interoperate with a web proxy when SSL is being used?

A

The browser sends a CONNECT request to the proxy, specifying the destination hostname and port number as the URL within this request. If the proxy allows the request, it returns an HTTP response with a 200 status, keeps the TCP connection open, and from that point onwards acts as a pure TCP-level relay to the specified destination.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Which organization provides incident response support for the federal government?

A

US-CERT (Computer Emergency Readiness Team)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Which organizations investigate Internet crime?

A

IC3 (Internet Crime Compliance Center) and ECTFs (Electronic Crime Task Forces)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Which two security standards are governed by NIST?

A

Advanced Encryption Standard (AES) and the Federal Desktop Core Configuration (FDCC) Standard

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

List three (ISC)2 qualifications?

A

CISSP (Certified Information Systems Security Professional).

CISSP-ISSEP (Information Systems Security Engineering Professional)

CSSLP (Certified Secure Software Lifecycle Professional)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Which certification organization is not approved under DoD Directive 8750?

  1. CERT/CC
  2. ISACA
  3. SANS GIAC
  4. FLETC
A
  1. FLETC (Federal Law Enforcement Training Center)
17
Q

What is the purpose of open proxy honeypots in relation to Internet-based Web attacks?

A

Silently record for later analysis

18
Q

ISO 17024 is the international standard for ____________?

A

Certification programs for personal competence

19
Q

The National Institute of Standards and Technology (NIST) represents the United States in the International Standards Organization.

  1. True
  2. False
A

False: NIST does not play a significant role in U.S. representation to the International Standards Organization, responsible for the ISO 27000 series.

That is coordinated by American National Standards Institute (ANSI). ANSI is also the U.S. national representative body for the International Electrotechnical Commission (IEC).