Git Product home page Git Product logo

csew06labsqlinjection's Introduction

CSEW06LABSQLInjection

As a team, write a program to sanitize SQL input.

#Things to do writing a function that accepts two input parameters and returns a SQL string. We will then write a function to demonstrate the query generation function works as expected with a collection of test cases. Next, a collection of test cases will be generated that demonstrate that the function is vulnerable to a variety of command injection attacks: tautology, union query, comment attacks, and union queries. Code will be written to provide weak mitigation to each of these attacks. Finally, code will be written to provide strong mitigation.

Query Generation Write a function to accept two strings (username and a password) and return a single string (SQL) representing the query used to determine if a user is authenticated on a given system. The query will be similar to one presented in the textbook. Provide the code for the function in the report and a couple sentences justifying that it works the way one would expect.

Generate a set of cases (one for each member of your team) that represent valid input where the username and the password consist of letters, numbers, and underscores. Create a function that feeds these test cases through the query function and displays the resulting query. Provide the code in the report, a sample of the output from the function, and a couple sentences justifying why the test cases provide adequate coverage of the valid input.

Vulnerabilities Generate test cases (again, each team member should generate one test case) that demonstrate a tautology attack. Create a function that feeds these test cases through the query function and displays the output. Provide the code, output, and justification in the lab report.

Do the same thing for a union query attack, an additional statement attack, and a comment attack. As with tautology, each attack must be demonstrated with a separate set of test cases, a separate function feeding the test cases to the query function, and justification in the lab report.

Weak Mitigation Create a function to provide a weak mitigation against all four attacks. This function accepts the input as a parameter (or two!) and returns the sanitized input. In the lab report, provide the code, the output of the various test cases, and justification that the code represents a weak mitigation to the four attack types.

Strong Mitigation Create a function to provide a strong mitigation against all command injection attacks. Provide the code, output showing that the valid test cases still work, output showing that all four malicious inputs are mitigated, and a justification the approach works the way one would expect.

Lab Report As with last week the main deliverable for this lab will be the lab report. This concise, professionally written document will include the code fragments, test cases, the relevant output, a brief description of what is presented, and justification that the code matches the theoretical framework described in the class.

This lab report is the most important deliverable. This report should honor all of the guidelines presented in the Scholarly Writing document.

Assignment There will be one submission constituting all of the work of your team. This submission will include:

Lab Report: A lab report in PDF format. Source Code: All the source code generated for this assignment in a single source code file. By downloading the file and running it, it should be possible to execute any of the test cases in the report. A simple menu structure should be provided to facilitate this. Demo Video: A short video demonstrating your program. This should show the running of test cases. The video should be a link to stream it directly rather than a file to download. Assessment The assignment will be graded according to the following rubric:

csew06labsqlinjection's People

Contributors

awarbler avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.