Download Tyu 08 and more Essays (high school) Architecture in PDF only on Docsity!
Instructor’s Manual
Chapter 8
Application Security
Answer Key
General Application Security Issues
Executing Commands with the Privileges of a Compromised
Application
- a) What can hackers gain by taking over application programs? They get the privileges of the application program they take over. b) What is the most popular way for hackers to take over hosts? By taking over an application with root privileges
Buffer Overflow Attacks
- a) What is a buffer? A temporary storage area in memory b) What is a buffer overflow attack? An attack that writes data longer than the space allocated for it in the buffer. c) What impacts can buffer overflows have? The impact of a buffer overflow can range from nothing to the crashing of the server, or the ability to execute any command on the server. d) In a stack overflow, what is overwritten by the overflow? The return address in a stack is overwritten in a stack overflow. e) To where does the overwritten return address point? The overwritten address will point to data in the buffer, which will actually be program/ attack code that will be executed instead of legitimate code. f) In the IIS IPP buffer overflow attack, what buffer is overflowed?
Corporate Computer Security , 4 th^ Edition Randall J. Boyle and Raymond R. Panko
The host to which the request should go is overflowed. The host name is replaced with a 420-character string that causes a buffer overflow.
Few Operating Systems, Many Applications
- Why is patching applications more time consuming than patching operating systems? There are many more applications compared to only one OS, and finding information about application vulnerabilities takes a lot of time.
Hardening Applications
- a) Why must you know a server’s role to know how to protect it?
Knowing what a server is meant to do allows you to determine what services must be kept on, and all others can be disallowed. b) Why is it important to minimize both main applications and subsidiary applications? The few applications you have, the fewer security risks there will be. c) Why are security baselines needed for installing applications? A complex series of actions is needed for any major application. This requires the checklist of a security baseline. d) Why is it important to minimize permissions for application programs? Application permissions must be minimized because if a hacker takes over an application, he or she can take over the entire host if the permissions are too great. e) Why is application-level authentication superior to operating system authentication? Application-level authentication is superior because it requires the hacker to not only have an exploit, but also authenticated access to a server (versus just an exploit). f) Why should cryptographic protections be used? To prevent eavesdropping by unauthorized people
- a) How does a SQL injection attack work? A SQL injection attack works by manipulating the way database parameters are processed. Malformed parameters are passed via a web interface to be processed by a database. The malformed parameters allow an attacker to extract data, shut down a database, or perform a variety of database functions. b) What is SQL? SQL is a query language used to extract, insert, or delete data from a database. c) What is error-based inference? Error-based inference is used by attackers to manipulate a database based on the errors returned when commands are submitted. d) What is the difference between in-band and out-of-band SQL injection? In-band SQL injection extracts data directly from the database and displays it in a web browser. Out-of-band SQL injection uses malformed statements to extract data through a different application, such as e-mail. e) What is blind SQL injection?
Corporate Computer Security , 4 th^ Edition Randall J. Boyle and Raymond R. Panko
8–
An e-commerce server needs to have network access to a number of systems external to itself, including servers within firms (for order entry, accounting, shipping, and so forth) and servers outside the firm in merchant banks and companies that check credit card numbers for validity. The webmaster or e-commerce master often has no control over the security of other systems. c) Does the webmaster or e-commerce administrator have control over the security of other servers? Neither the webmaster nor e-commerce administrator have control over the security of other systems outside their purview. d) Why are custom programs especially vulnerable? Custom programs offer security through obscurity, but because they are often not programmed securely, hackers have automated tools that can find common exploits (such as buffer overflows) to allow them to attack the application.
Some Webserver Attacks
- a) What is website defacement? Changing the contents of a webpage b) Why is it damaging? It may be embarrassing to the company. c) In directory access commands and URLs, what does “..” represent? It means move to the parent of the current directory. d) What are directory traversal attacks? Attacks in which a user reaches a directory outside of the WWW root directory and its subdirectories e) Create a URL to retrieve the file aurigemma.htm under the rainbow directory on the host www.pukanui.com. The WWW root is three levels below the system’s true root directory and the rainbow directory, which is under the projects directory, which is directly under the root directory. (Hint: Draw a picture.) http://www.pukanui.com/../../projects/rainbow/aurigemma.htm f) In what two ways have attackers circumvented filtering designed to stop directory traversal attacks? Hackers have used hexadecimal and Unicode character sets to enter the value for the “..” characters to be executed.
Patching the Webserver and E-Commerce Software and Its
Components
Other Website Protections
- a) What software must be patched on an e-commerce server?
The webserver, the e-commerce server, and subsidiary programs must all be up-to-date on their patches.
Corporate Computer Security , 4 th^ Edition Randall J. Boyle and Raymond R. Panko
8–
b) What three other webserver protections were mentioned in the text? The three other webserver protections mentioned in the text were (1) website vulnerability assessment tools, like Whisker, (2) reading website error logs, and (3) using a webserver proxy in front of the webserver. c) Where is an application proxy firewall placed relative to the webserver? Application proxy firewalls would be placed in front of the webserver, between the webserver and the border router.
Controlling Deployment
- a) In staged development, what three servers do companies use? A development server, a testing server, and a production server b) What permissions does the developer have on the development server? Developers get extensive permissions on the development server. c) On the testing server? Developers get no permissions on the testing server. d) On the production server? Developers get no permissions on the production server. e) On what servers does the tester have access permissions? The tester should only have access to the test servers.
Browser Attacks
- a) Why do hackers attack browsers? Attackers might want to have data stored on the client, and attackers can use a compromised client to attack other systems for which the client has access credentials. b) What is mobile code? Mobile code consists of commands written into a webpage that are downloaded when the page is visited. c) Why is it called mobile code? It is called mobile code because the code travels from the webpage to the client to execute. d) What is a client-side script? A client-side script is code that is written to execute on the client PC, allowing the attacker access to the PC. e) What is a Java applet? A Java applet is a small program written in the Java language. The Java applet is downloaded into a webpage. f) Why is Active-X dangerous? Active-X is dangerous because it has significant permissions on the machine. If a hacker writes in Active-X, it could compromise the PC easily.
Corporate Computer Security , 4 th^ Edition Randall J. Boyle and Raymond R. Panko
8–
E-Mail Content Filtering
- a) Why are HTML bodies in e-mail messages dangerous? HTML can contain malicious scripts. b) What is spam? Spam is unsolicited commercial email. c) What three problems does spam create? Spam clogs mailboxes, slows user computers, and annoys users by requiring them to spend time deleting the unwanted messages. d) Why is spam filtering dangerous? Spam filtering is dangerous because valid email will eventually be affected. e) For what legal reason should companies filter sexually or racially harassing message content? Filtering explicit message content shows that the company does not tolerate this type of action and tries to stop it. (In case of lawsuits, this may help.) f) What is extrusion prevention? Preventing certain information from leaving the company g) Why is extrusion prevention needed for intellectual property? It prevents the loss of trade secrets. h) What is PII, and why must it be prevented from leaving the firm? PII is Personally Identifiable Information (such as SSN, date of birth, address, etc.) that must be prevented from leaving a firm in order to avoid lawsuits related to identify theft or credit card theft.
E-Mail Encryption
- a) Is encryption widely used in e-mail? Encryption is not widely used in email because of the difficulties of end-to-end encryption systems. b) What part of the e-mail process does SSL/TLS usually secure? SSL/TLS usually only secures the transmission of email from the client to the server. c) Is this end-to-end security? Explain. This is not end-to-end security because unless all other links in the path are encrypted (such as between mail servers, and the POP3/IMAP connection from mail server to end user client application), there is no end-to-end security. d) What standards provide end-to-end security? S/MIME and PGP provide end-to-end security. e) Compare PGP and S/MIME in terms of how applicants learn the true party’s public key. S/MIME uses the traditional PKI to share keys. In PGP, keys are shared via circles of trust. f) Describe the advantages and disadvantages of each approach.
Corporate Computer Security , 4 th^ Edition Randall J. Boyle and Raymond R. Panko
8–
Using PKI offers the strongest security, but it is labor-intensive and can be expensive to get key pairs issued to all participants. PGP is cheaper, but the possibility of misplacing trust and having bogus public key/name pairs is high. Thus, PKI has been used in corporate environments, while PGP is primarily used in person-to- person communications.
Voice over IP (VoIP) Security
Sending Voice between Phones
- a) What is VoIP? Voice over IP, or VoIP, is the digitization of voice and its transmission over a data network. b) Distinguish between IP telephones and soft phones. IP telephones are telephones that contain everything needed to attach to a VoIP network. A soft phone is a computer with hardware and software for VoIP. c) List in order of appearance at the receiver, the headers and message of a packet carrying voice between phones. IP header UDP header RTP header Codec byte stream d) What does RTP add to compensate for the limitations of UDP? RTP adds sequence numbers (for in-order delivery) and time stamps (to control jitter).
Transport and Signaling
- a) Distinguish between transport and signaling. In transport, data/voice is sent. In signaling, the parameters for the communication channel are determined, configured, and managed. b) In Figure 8-25, is the packet shown a transport packet or a signaling packet? The packet shown is a transport packet because it contains the Codec byte stream. c) What are the two main signaling standards in VoIP? SIP and H. d) What does the registrar server do? (Hint: Don’t say, “It registers things.”) The registrar server adds the user and his location to the registration database for proxy servers to use to route calls. e) What type of SIP message does a VoIP phone use when it wants to connect to another VoIP phone?
Corporate Computer Security , 4 th^ Edition Randall J. Boyle and Raymond R. Panko
8–
SIP Identity ensures that traffic is authenticated between two companies holding public/ private keys. c) How can eavesdropping be thwarted? Eavesdropping can be thwarted by encrypting both transport and signaling traffic. d) What sound quality problem may encryption create? Encryption adds a small delay, which may impact performance. e) Why do firewalls have problems with typical VoIP traffic? Firewalls don’t like VoIP traffic because the packets are small, there are lots of them, they cannot be appreciably delayed to minimize latency, and they use multiple ports for signaling and transport. f) For SIP signaling, what port has to be opened on firewalls? SIP signaling requires port 5060 to be open. g) Describe firewall port openings for VoIP transport. Firewall port openings are required for SIP/H.323 messages. Additionally, the firewall must read these messages in order to open the transport ports. h) Why is NAT traversal problematic? NAT adds latency to VoIP packets, and VoIP relies on IP addresses between participants; using NAT may break the VoIP protocol being used. i) How are VLANs useful in VoIP? Placing VoIP on a separate VLAN makes it difficult for attackers to come through the data side of the network to hack VoIP, and vice versa. It also helps to reduce traffic on the network for the data side.
The Skype VoIP Service
- a) What is Skype? Skype is a VoIP service that currently offers free calling among Skype customers over the Internet and reduced-cost calling to and from Public Switched Telephone Network customers. b) Why is Skype’s use of proprietary software problematic? Skype’s use of proprietary software is problematic because Skype uses proprietary software and protocols that have not been studied by security professionals. This causes security professionals to be concerned with the existence of vulnerabilities, backdoors, and other security threats. c) What problem is there with Skype’s encryption for confidentiality? The problem with Skype’s encryption for confidentiality is that its method is unknown. Worse yet, Skype controls the encryption keys so that it can read traffic if it wants. d) Does Skype control who can register a particular person’s name? No, an attacker can use another person’s name and impersonate him or her. Skype initial registration is open and uncontrolled. e) Why do firewalls have a difficult time controlling Skype?
Corporate Computer Security , 4 th^ Edition Randall J. Boyle and Raymond R. Panko
8–
Firewalls have a difficult time controlling Skype because Skype protocol is unknown and changes frequently to avoid analysis. Skype uses its structure to help users communicate through NAT firewalls. This is good for the user but bad for corporate security. f) Does Skype’s file transfer generally work with antivirus programs? No, Skype’s file transfer generally does not work with antivirus programs. g) Overall, what is the big problem with Skype? Although Skype concerns are theoretical, the fact that Skype cannot be well controlled by corporate security policies makes it unacceptable in many firms.
Other User Applications
Instant Messaging (IM)
- a) In IM, what does a presence server do? Presence servers allow two users to locate each other. b) What does a relay server do? Relay servers have all messages pass through them, allowing filtering and recording. c) For corporate IM, what are the advantages of using a relay server instead of only a presence server? Using a relay server allows the company to report IM messages to satisfy legal retention and other compliance regulations.
TCP/IP Supervisory Applications
- a) What is the Danvers Doctrine? The general thrust by the IETF to add strong security to all or nearly all of its standards b) Distinguish between security in SNMP V1 and security in SNMP V2. SNMP v1 had no security at all. SNMP v2 introduces community strings in which a shared secret between manager and managed devices was used to authenticate messages. However, the same secret was used on all devices, making it easy to crack and lose control of the secret. Also, the secret is sent in the clear, making it vulnerable to network sniffers. c) Distinguish between security in SNMP V2 and security in SNMP V3.
Corporate Computer Security , 4 th^ Edition Randall J. Boyle and Raymond R. Panko
8–
automatically stripped (such as Access database files) and could contain scripts/ malicious code, whether they are infected or not.
- A company is warned by its credit card companies that it will be classified as a high-risk firm unless it immediately reduces the number of fraudulent purchases made by its e- commerce clients. Come up with a plan to avoid this outcome. First and foremost, the company needs to inventory and patch all the WWW and e- commerce software (including third-party software components) running on their servers. It is easy to miss a single application or component that has a vulnerability that opens the site to fraudulent attacks. The company should use website vulnerability assessment tools after the patches have been applied to verify the baseline is adequate. Website logs should be reviewed regularly for error messages that indicate possible attacks. Finally, the company should seriously consider installing one or more application proxy firewalls. They may be costly, but not as costly as the damage to its reputation and the increased fees from the credit card companies.
Corporate Computer Security , 4 th^ Edition Randall J. Boyle and Raymond R. Panko
8–
Hands-on Projects
NOTE: Screenshots for individual students will vary.
Project 1
Buffer overflows are a fairly common vulnerability. They can crash an application, allow unauthorized people access, process unintended payloads, etc. Most students just learning about the field of IT security may hear about buffer overflows but don’t really understand how they work. The following online example is a great demonstration of how buffer overflows actually work. It really helps students understand how buffer overflows work if they can see a graphical representation. They can visualize the memory space and how the overflow may affect the underlying code. Let’s look at just one example of a buffer overflow written by Dr. Susan Gerhart.
- Open a Web browser and go to http://nsfsecurity.pr.erau.edu/bom/. (Additional buffer overflow examples are available for download at http://www.pearsonhighered.com/ boyle.)
- Scroll down and click on the link labeled “Spock.”
- Click Play.
- After it stops, enter the first eight characters (ONLY 8 characters) of your last name as the password. (If your last name has less than 8 characters, you can fill in the last characters with “X.” For example, “Boyle” would become BOYLEXXX.)
- Click Play.
- Take a screenshot.
- Click Reset.
- Click Play.
- After it stops, enter the first eight characters (ONLY 8 characters) of your last name as the password AND add the letter “ T ” at the end. (If your last name has less than 8 characters, you can fill in the last characters with “X.” In this case it would be BOYLEXXXT.)
- Click Play.
- Take a screenshot.
Project 2
Gaining practical experience related to testing and securing application weaknesses is difficult. Most applications have already patched known vulnerabilities. Websites are typically not willing to let users “test” their website or web applications for vulnerabilities. Testing for vulnerabilities can cause applications, web applications, and even whole websites to crash. Open Web Application Security Project®^ (OWASP) is a project that contains tools that focuses specifically on application security (www.OWASP.org). It has robust tools for testing the security of your existing Web applications, and impressive training tools that won’t harm any outside websites.
Corporate Computer Security , 4 th^ Edition Randall J. Boyle and Raymond R. Panko
8–
- On the left-hand side, click on Concurrency. (The links labeled Lesson Plan and Solution provide detailed explanations about why coding errors make this attack possible.)
- Click on Shopping Cart Concurrency Flaw.
- Right click on the link Shopping Cart Concurrency Flaw and select Open Link in New Window. (You should have two tabs open with the exact same content.)
- Align the windows so they are side-by-side.
- In the left window, change the quantity of Hitachi Hard Drives from 0 to 1.
- Click Purchase. (Do not click Confirm.)
- In the right window, change the quantity of Hitachi Hard Drives from 0 to 15.
- Click Update Cart.
- Take a screenshot of your entire desktop (Ctrl-PrintScreen) showing both windows.
- In the left window, click Confirm. (This confirms the charged amount of $169.00 while having updated the quantity to 15 in your cart! This will now process the transaction charging the original amount of one item and process the order for the updated quantity amount.)
- Take a screenshot of your entire desktop (Ctrl-PrintScreen) showing both windows.
- Close the right window.
- In the left window, click Restart this lesson in the top right-hand side of the page.
- Repeat the steps in this exercise to reproduce a similar concurrency flaw using a different product (not the Hitachi hard drive) and different quantities.
- Take a screenshot of your entire desktop (Ctrl-PrintScreen) showing both windows after you have reproduced the concurrency flaw.
Project Thought Questions
- In the buffer overflow project, why did the addition of the letter “T” allow you to bypass the login with a fake password? The letter “T” changed the value from an “F,” which subsequently was used to authenticate the user regardless of username and password.
- What would happen if you entered a 15-character password consisting of all Xs? You will get a segmentation fault and likely lock up the machine. You will overwrite the return pointer.
- Could the code behind this login be fixed to stop this buffer overflow? How? Yes, you could fix the code to prevent this buffer overflow. You will need to code the application to only allow a password of a specific length.
Corporate Computer Security , 4 th^ Edition Randall J. Boyle and Raymond R. Panko
8–
- Are there different overflow attacks? (Hint: Look at the other examples shown.)
Yes, there are many different types of buffer overflow attacks. There are several other examples of buffer overflow attacks you can download directly from the website for this book.
- What is a concurrency flaw? Concurrency flaws are errors in code that can allow an attacker to take advantage of “state” management errors. For example, concurrency flaws can allow an attacker to manipulate an online retailer’s internal systems in such a way that it allows the attacker to “steal” merchandise for a much lower price than would normally be charged.
- Have most real websites taken measures to secure their systems against concurrency flaws? There are some websites that are vulnerable to concurrency flaws. However, in general, most large websites will have written secure code to prevent concurrency flaws.
- What is cross-site scripting? Cross-site scripting is a vulnerability that allows users to inject code into the pages being viewed by other users.
- What are the advantages for IT security professionals having a training environment like the WebGoat platform? It provides a great training and testing platform. They don’t have to worry about bringing down a real website or losing real data. Users can also run it on their own machines for individualized training.
Case Discussion Questions
- After seeing the impact of the hacked Twitter account, would news organizations become even more attractive targets? Why or why not? Yes, possibly, many people would be interested in a way to push the stock market up or down. Artificially moving the market (either up or down) can provide stock manipulators the opportunity to make large sums of money. The ability to use a technological weakness to move the market would greatly benefit a trader.
- Could an insider use the fact that news feeds are scanned for trading decisions to manipulate the stock market? How? Yes, an insider could take a position in stocks (long or short), issue false news stories that would impact the price of the stocks, and then close the position to reap a large reward. The ability to manipulate information about a stock’s perceived future value can greatly affect its current market price.
- How could highly integrated information systems be a threat to corporations? Highly integrated information systems could be a threat to corporations if they create an inordinately large vulnerability. Any time systems are integrated, they become slightly more vulnerable due to their interrelated nature. For example, suppose an auto manufacturer shares its corporate database with a contracted tire manufacturer. The tire manufacturer may be able to gain access to other internal systems at the auto manufacturer that outsiders are blocked from. The tire
Corporate Computer Security , 4 th^ Edition Randall J. Boyle and Raymond R. Panko
8–