Security代写:CS4117 Common Vulnerabilities

这次需要代写的作业分为两个部分,第一部分是安全问答,涉及到C语言。第二部分是数据库安全,主要是SQL注入。

Marking

  • You are to work on this assignment in groups of 1 or 2. These groups do not have to be the same as those for your previous project.
  • Answer the questions below in no more than three pages - concise answers are good answers. Diagrams are welcome where appropriate.
  • Typed assignment and any relevant code is to be emailed to your tutor by the end of the tutorial. Late assignments will not be accepted.
  • You are expected to demo the practical component of Savegames (1,2) and SQL Exploits (1) during class to demonstrate your understanding.
  • Ensure any code and/or solutions employed are included in a legible and well documented fashion.

Low Level Exploits

Savegames

Jimmy is becoming increasingly frustrated at the computer game hes playing. He has a save right before the levels boss but he needs either more health or more gold in order to win. The game is loaded from a normal file on disk but the health and gold are encrypted in some complicated fashion. The characters name is not, however.

  1. Set the characters gold or health to a number greater than 9000 by utilising a buffer overflow. How did you achieve this? Explain using reference to bytes and ASCII as to what the exact value was that you achieved.
  2. How could this exploit be prevented?
  3. Could this exploit be useful for more than just the game? Could it be used to gain access to a system? If not, why not? If so, where might it be used?

General Questions

  1. Why is it necessary for us to provide the flag -fno-stack-protector to GCC? What is a canary in terms of a buffer overflow and how can a canary prevent a buffer overflow exploit?
  2. If the game above was written in Java instead of C, would the savegame still be exploitable?
  3. Imagine you were exploiting a program that was running with escalated privileges (i.e. could read sensitive files, modify other users settings and so on) is it possible to obtain a BASH shell using buffer overflows? Be sure to explain what shellcode is and how the shellcode is executed 1.

SQL Exploits

  1. Show how it is possible to log in as any user by performing an SQL injection attack on the username/password login page.
  2. The website has been clued in on their major security problem and prevented the previous attack. Is it possible to use the status query to work out the password of one of the administrators Bobby 2?
  3. How can these attacks be prevented? Is it a difficult security problem to fix? Why is it so common?